From 76bea7d8b78fb6ef96cfc088f1f7e44106288339 Mon Sep 17 00:00:00 2001 From: jimturner-adfa Date: Tue, 6 Oct 2026 12:32:42 -0700 Subject: [PATCH 01/10] ADFA-174: supersede ADR 0008 with ADR 0017 (rename to org.appdevforall.codeonthego) Phase 1 of the rename plan: record the decision to reverse ADR 0008 and rename the application id / namespace, instead of silently editing the original decision. Co-Authored-By: Claude Sonnet 5 --- docs/adr/0008-retain-androidide-namespace.md | 3 +- ...e-to-appdevforall-codeonthego-namespace.md | 75 +++++++++++++++++++ docs/adr/README.md | 3 +- 3 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 docs/adr/0017-rename-to-appdevforall-codeonthego-namespace.md diff --git a/docs/adr/0008-retain-androidide-namespace.md b/docs/adr/0008-retain-androidide-namespace.md index 0880d76900..b2cc408d78 100644 --- a/docs/adr/0008-retain-androidide-namespace.md +++ b/docs/adr/0008-retain-androidide-namespace.md @@ -1,6 +1,6 @@ # 0008. Retain the `com.itsaky.androidide` namespace after rebrand -- **Status:** Proposed +- **Status:** Superseded by [ADR 0017](0017-rename-to-appdevforall-codeonthego-namespace.md) - **Date:** 2026-06-18 - **Deciders:** Code On The Go team @@ -35,3 +35,4 @@ The decisive constraint, though, is the **terminal bootstrap packages** (built s - [ARCHITECTURE.md](../../ARCHITECTURE.md) — overview note on the namespace/product-name mismatch. - [ADR 0003](0003-vendored-forked-desktop-toolchain.md) — vendored coordinates that a rename would disrupt. +- [ADR 0017](0017-rename-to-appdevforall-codeonthego-namespace.md) — supersedes this decision. diff --git a/docs/adr/0017-rename-to-appdevforall-codeonthego-namespace.md b/docs/adr/0017-rename-to-appdevforall-codeonthego-namespace.md new file mode 100644 index 0000000000..e840a3e5eb --- /dev/null +++ b/docs/adr/0017-rename-to-appdevforall-codeonthego-namespace.md @@ -0,0 +1,75 @@ +# 0017. Rename the application id / namespace to `org.appdevforall.codeonthego` + +- **Status:** Proposed +- **Date:** 2026-10-06 +- **Deciders:** Code On The Go team +- **Supersedes:** [ADR 0008](0008-retain-androidide-namespace.md) + +## Context + +[ADR 0008](0008-retain-androidide-namespace.md) kept the inherited `com.itsaky.androidide` +application id / Gradle namespace after the AndroidIDE -> Code On The Go rebrand, applying the new +identity only at the presentation layer. That decision's reasoning stands on its own: an +application id change breaks the update path for existing installs, and the terminal bootstrap +packages (built separately in `appdevforall/terminal-packages`) have the package name baked in, so +the app and those packages must flip atomically across both repos. + +The team has since decided the namespace mismatch (tracked as +[ADFA-174](https://appdevforall.atlassian.net/browse/ADFA-174)) is worth resolving despite that +cost. This ADR records that reversal and the sequencing it requires, rather than silently +reopening or editing ADR 0008. + +Scope, per a `git grep` audit of the tree at decision time: ~2,606 files / ~11,088 occurrences of +`com.itsaky.androidide` across 67 modules, ~697 directories under a `com/itsaky/androidide` path, +one source-of-truth build constant (`BuildConfig.PACKAGE_NAME`), several hardcoded manifest +strings (permissions, actions, provider authorities, a cross-app `logsender` package reference), +and external wiring keyed to the current identity (Firebase app registrations, the +`well-known-worker`'s `assetlinks.json` for Android App Links, two CI workflows, Play Store/F-Droid +listings). + +## Decision + +**Rename** the application id / Gradle namespace and the Kotlin/Java package declarations from +`com.itsaky.androidide` to `org.appdevforall.codeonthego`, sequenced as: + +1. Cross-repo unblock with `appdevforall/terminal-packages` — must complete first; the terminal + bootstrap packages and this app's application id change together, atomically, not + incrementally. +2. Mechanical rename of source packages, directories, imports, and vendored build-logic + coordinates ([ADR 0003](0003-vendored-forked-desktop-toolchain.md)) — reversible, done as a + stacked PR series, landed independently of the identity flip below. +3. The application id / namespace flip itself — irreversible for existing installs, sequenced + last and only once step 1 is confirmed ready. +4. External re-wiring (Firebase, `assetlinks.json`, CI, store listings) and an explicit decision on + the migration story for users on the old application id. + +## Consequences + +**Positive** +- Codebase namespace matches the product name and the rebrand is complete, not just + presentation-layer. +- Removes the standing confusion ADR 0008 itself flagged as a known cost. + +**Negative / costs** +- Repeats, in reverse, the disruption ADR 0008 avoided: existing installs under + `com.itsaky.androidide` do not receive this as an update; a migration story (ADFA-174) must be + decided before the identity flip ships. +- Requires coordinated, atomic work in a second repository (`appdevforall/terminal-packages`) + outside this team's sole control. +- Large mechanical diff (~2,600 files) carries real risk of missed references; needs a thorough + sweep and build/test verification per module rather than a single trust-the-script pass. + +## Alternatives considered + +- **Keep ADR 0008's decision** — rejected: the team decided the namespace/product-name mismatch is + worth resolving now. +- **Partial rename (code packages only, keep `applicationId`)** — rejected for this decision: the + goal is to resolve the mismatch end-to-end, including the published identity, not just the + source tree. + +## Related + +- [ADR 0008](0008-retain-androidide-namespace.md) — the decision this supersedes. +- [ADR 0003](0003-vendored-forked-desktop-toolchain.md) — vendored coordinates affected by the + rename. +- [ADFA-174](https://appdevforall.atlassian.net/browse/ADFA-174) — tracking ticket. diff --git a/docs/adr/README.md b/docs/adr/README.md index 5ac4721593..e5844acf76 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -21,7 +21,7 @@ Format is lightweight **MADR / Nygard**: Context → Decision → Consequences | [0005](0005-per-abi-product-flavors.md) | Ship per-ABI product flavors (v7/v8), not a universal APK | Proposed | | [0006](0006-koin-dependency-injection.md) | Use Koin for dependency injection, not Hilt/Dagger | Proposed | | [0007](0007-strictmode-whitelist-engine.md) | Enforce StrictMode via a custom whitelist engine | Proposed | -| [0008](0008-retain-androidide-namespace.md) | Retain the `com.itsaky.androidide` namespace after rebrand | Proposed | +| [0008](0008-retain-androidide-namespace.md) | Retain the `com.itsaky.androidide` namespace after rebrand | Superseded by 0017 | | [0009](0009-jetpack-compose-for-new-ui.md) | Build new UI in Jetpack Compose, not XML Views | Proposed | | [0010](0010-navigation-resolves-via-analysis-api.md) | Kotlin navigation resolves via the Analysis API, not the symbol index | Proposed | | [0011](0011-command-analysis-priority.md) | User-invoked commands get their own analysis priority | Proposed | @@ -30,3 +30,4 @@ Format is lightweight **MADR / Nygard**: Context → Decision → Consequences | [0014](0014-refactorings-decline-rather-than-rewrite.md) | Interactive refactorings decline rather than rewrite unselected code | Proposed | | [0015](0015-one-pinned-ktfile-per-analysis.md) | One pinned live KtFile per analysis, enforced by the type system | Proposed | | [0016](0016-quick-build-compiles-outside-gradle.md) | Quick Build's per-save path compiles incrementally outside Gradle | Proposed | +| [0017](0017-rename-to-appdevforall-codeonthego-namespace.md) | Rename the application id / namespace to `org.appdevforall.codeonthego` | Proposed | From 6ecf001ac82887e7915b3f91767c365dde25bf09 Mon Sep 17 00:00:00 2001 From: jimturner-adfa Date: Tue, 6 Oct 2026 12:42:19 -0700 Subject: [PATCH 02/10] ADFA-174: rename com.itsaky.androidide.annotations -> org.appdevforall.codeonthego.annotations Phase 2 pilot slice: the `annotations` module and every file that references it (annotation-processors, annotation-processors-ksp, uidesigner, xml-inflater). Package declarations, imports, KDoc links, the FQN annotation usage, and the KSP service-provider descriptor all moved together. Does not touch BuildConfig.PACKAGE_NAME, applicationId, or AGP namespace - those stay com.itsaky.androidide until Phase 3 (ADR 0017), which is gated on the terminal-packages cross-repo coordination. Verified: :annotations, :annotation-processors, :annotation-processors-ksp, :uidesigner, :xml-inflater compile, and xml-inflater/uidesigner unit tests (which exercise the ViewAdapter/ IncludeInDesigner path end-to-end through KSP) pass. Co-Authored-By: Claude Sonnet 5 --- .../annotations/ksp/inflater/ViewAdapterIndexGenerator.kt | 6 +++--- .../annotations/ksp/inflater/ViewAdapterSymbolProcessor.kt | 4 ++-- .../ksp/inflater/ViewAdapterSymbolProcessorProvider.kt | 4 ++-- .../codeonthego}/annotations/ksp/inflater/kspUtils.kt | 2 +- .../codeonthego}/annotations/ksp/inflater/utils.kt | 2 +- ...m.google.devtools.ksp.processing.SymbolProcessorProvider | 2 +- .../annotations/EventBusAnnotationProcessor.java | 2 +- .../codeonthego}/annotations/inflater/ViewAdapter.kt | 2 +- .../annotations/uidesigner/IncludeInDesigner.kt | 4 ++-- .../java/com/itsaky/androidide/uidesigner/utils/Widgets.kt | 4 ++-- .../java/com/itsaky/androidide/inflater/IViewAdapter.kt | 6 +++--- .../com/itsaky/androidide/inflater/IViewAdapterIndex.kt | 2 +- .../inflater/internal/adapters/AbsoluteLayoutAdapter.kt | 2 +- .../inflater/internal/adapters/AnalogClockAdapter.kt | 6 +++--- .../internal/adapters/AutoCompleteTextViewAdapter.kt | 6 +++--- .../androidide/inflater/internal/adapters/ButtonAdapter.kt | 6 +++--- .../inflater/internal/adapters/CalendarViewAdapter.kt | 6 +++--- .../inflater/internal/adapters/CheckBoxAdapter.kt | 6 +++--- .../inflater/internal/adapters/CheckedTextViewAdapter.kt | 6 +++--- .../inflater/internal/adapters/ChronometerAdapter.kt | 6 +++--- .../inflater/internal/adapters/DigitalClockAdapter.kt | 6 +++--- .../inflater/internal/adapters/EditTextAdapter.kt | 6 +++--- .../inflater/internal/adapters/FrameLayoutAdapter.kt | 6 +++--- .../inflater/internal/adapters/GestureOverlayViewAdapter.kt | 2 +- .../inflater/internal/adapters/GridLayoutAdapter.kt | 6 +++--- .../inflater/internal/adapters/GridViewAdapter.kt | 6 +++--- .../internal/adapters/HorizontalScrollViewAdapter.kt | 6 +++--- .../inflater/internal/adapters/ImageButtonAdapter.kt | 6 +++--- .../inflater/internal/adapters/ImageSwitcherAdapter.kt | 6 +++--- .../inflater/internal/adapters/ImageViewAdapter.kt | 6 +++--- .../inflater/internal/adapters/LinearLayoutAdapter.kt | 6 +++--- .../inflater/internal/adapters/ListViewAdapter.kt | 6 +++--- .../internal/adapters/MultiAutoCompleteTextViewAdapter.kt | 6 +++--- .../inflater/internal/adapters/NumberPickerAdapter.kt | 6 +++--- .../inflater/internal/adapters/ProgressBarAdapter.kt | 2 +- .../inflater/internal/adapters/QuickContactBadgeAdapter.kt | 6 +++--- .../inflater/internal/adapters/RadioButtonAdapter.kt | 6 +++--- .../inflater/internal/adapters/RadioGroupAdapter.kt | 6 +++--- .../inflater/internal/adapters/RatingBarAdapter.kt | 6 +++--- .../inflater/internal/adapters/RelativeLayoutAdapter.kt | 6 +++--- .../inflater/internal/adapters/ScrollViewAdapter.kt | 6 +++--- .../androidide/inflater/internal/adapters/SeekBarAdapter.kt | 6 +++--- .../androidide/inflater/internal/adapters/SpaceAdapter.kt | 6 +++--- .../androidide/inflater/internal/adapters/SpinnerAdapter.kt | 6 +++--- .../inflater/internal/adapters/SurfaceViewAdapter.kt | 6 +++--- .../androidide/inflater/internal/adapters/SwitchAdapter.kt | 6 +++--- .../inflater/internal/adapters/TextClockAdapter.kt | 6 +++--- .../inflater/internal/adapters/TextSwitcherAdapter.kt | 6 +++--- .../inflater/internal/adapters/TextViewAdapter.kt | 6 +++--- .../inflater/internal/adapters/TextureViewAdapter.kt | 6 +++--- .../inflater/internal/adapters/ToggleButtonAdapter.kt | 2 +- .../inflater/internal/adapters/VideoViewAdapter.kt | 6 +++--- .../androidide/inflater/internal/adapters/ViewAdapter.kt | 6 +++--- .../inflater/internal/adapters/ViewAnimatorAdapter.kt | 6 +++--- .../inflater/internal/adapters/ViewFlipperAdapter.kt | 6 +++--- .../inflater/internal/adapters/ViewSwitcherAdapter.kt | 6 +++--- .../androidide/inflater/internal/adapters/WebViewAdapter.kt | 6 +++--- 57 files changed, 147 insertions(+), 147 deletions(-) rename annotation-processors-ksp/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/annotations/ksp/inflater/ViewAdapterIndexGenerator.kt (97%) rename annotation-processors-ksp/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/annotations/ksp/inflater/ViewAdapterSymbolProcessor.kt (95%) rename annotation-processors-ksp/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/annotations/ksp/inflater/ViewAdapterSymbolProcessorProvider.kt (88%) rename annotation-processors-ksp/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/annotations/ksp/inflater/kspUtils.kt (94%) rename annotation-processors-ksp/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/annotations/ksp/inflater/utils.kt (96%) rename annotation-processors/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/annotations/EventBusAnnotationProcessor.java (99%) rename annotations/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/annotations/inflater/ViewAdapter.kt (95%) rename annotations/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/annotations/uidesigner/IncludeInDesigner.kt (87%) diff --git a/annotation-processors-ksp/src/main/kotlin/com/itsaky/androidide/annotations/ksp/inflater/ViewAdapterIndexGenerator.kt b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterIndexGenerator.kt similarity index 97% rename from annotation-processors-ksp/src/main/kotlin/com/itsaky/androidide/annotations/ksp/inflater/ViewAdapterIndexGenerator.kt rename to annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterIndexGenerator.kt index 261a8b9084..f94f9738fa 100644 --- a/annotation-processors-ksp/src/main/kotlin/com/itsaky/androidide/annotations/ksp/inflater/ViewAdapterIndexGenerator.kt +++ b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterIndexGenerator.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.annotations.ksp.inflater +package org.appdevforall.codeonthego.annotations.ksp.inflater import androidx.annotation.RequiresApi import com.google.devtools.ksp.KspExperimental @@ -26,8 +26,8 @@ import com.google.devtools.ksp.symbol.KSAnnotation import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFunctionDeclaration import com.google.devtools.ksp.symbol.KSType -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import com.squareup.javapoet.ClassName import com.squareup.javapoet.CodeBlock import com.squareup.javapoet.FieldSpec diff --git a/annotation-processors-ksp/src/main/kotlin/com/itsaky/androidide/annotations/ksp/inflater/ViewAdapterSymbolProcessor.kt b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterSymbolProcessor.kt similarity index 95% rename from annotation-processors-ksp/src/main/kotlin/com/itsaky/androidide/annotations/ksp/inflater/ViewAdapterSymbolProcessor.kt rename to annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterSymbolProcessor.kt index 18cd3676e3..ee8a4be638 100644 --- a/annotation-processors-ksp/src/main/kotlin/com/itsaky/androidide/annotations/ksp/inflater/ViewAdapterSymbolProcessor.kt +++ b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterSymbolProcessor.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.annotations.ksp.inflater +package org.appdevforall.codeonthego.annotations.ksp.inflater import com.google.devtools.ksp.containingFile import com.google.devtools.ksp.isOpen @@ -27,7 +27,7 @@ import com.google.devtools.ksp.processing.SymbolProcessor import com.google.devtools.ksp.symbol.KSAnnotated import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFile -import com.itsaky.androidide.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter /** * [SymbolProcessor] for [ViewAdapter] annotations. diff --git a/annotation-processors-ksp/src/main/kotlin/com/itsaky/androidide/annotations/ksp/inflater/ViewAdapterSymbolProcessorProvider.kt b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterSymbolProcessorProvider.kt similarity index 88% rename from annotation-processors-ksp/src/main/kotlin/com/itsaky/androidide/annotations/ksp/inflater/ViewAdapterSymbolProcessorProvider.kt rename to annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterSymbolProcessorProvider.kt index c29c00c057..d960512b40 100644 --- a/annotation-processors-ksp/src/main/kotlin/com/itsaky/androidide/annotations/ksp/inflater/ViewAdapterSymbolProcessorProvider.kt +++ b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterSymbolProcessorProvider.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.annotations.ksp.inflater +package org.appdevforall.codeonthego.annotations.ksp.inflater import com.google.devtools.ksp.processing.SymbolProcessor import com.google.devtools.ksp.processing.SymbolProcessorEnvironment @@ -23,7 +23,7 @@ import com.google.devtools.ksp.processing.SymbolProcessorProvider /** * [SymbolProcessorProvider] implementation for - * [ViewAdapter][com.itsaky.androidide.annotations.inflater.ViewAdapter] annotation. + * [ViewAdapter][org.appdevforall.codeonthego.annotations.inflater.ViewAdapter] annotation. * * @author Akash Yadav */ diff --git a/annotation-processors-ksp/src/main/kotlin/com/itsaky/androidide/annotations/ksp/inflater/kspUtils.kt b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/kspUtils.kt similarity index 94% rename from annotation-processors-ksp/src/main/kotlin/com/itsaky/androidide/annotations/ksp/inflater/kspUtils.kt rename to annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/kspUtils.kt index 7d5100273d..4672e6ddb7 100644 --- a/annotation-processors-ksp/src/main/kotlin/com/itsaky/androidide/annotations/ksp/inflater/kspUtils.kt +++ b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/kspUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.annotations.ksp.inflater +package org.appdevforall.codeonthego.annotations.ksp.inflater import com.google.devtools.ksp.symbol.KSAnnotated import com.google.devtools.ksp.symbol.KSAnnotation diff --git a/annotation-processors-ksp/src/main/kotlin/com/itsaky/androidide/annotations/ksp/inflater/utils.kt b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/utils.kt similarity index 96% rename from annotation-processors-ksp/src/main/kotlin/com/itsaky/androidide/annotations/ksp/inflater/utils.kt rename to annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/utils.kt index bfe69e595d..7dc521638a 100644 --- a/annotation-processors-ksp/src/main/kotlin/com/itsaky/androidide/annotations/ksp/inflater/utils.kt +++ b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/utils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.annotations.ksp.inflater +package org.appdevforall.codeonthego.annotations.ksp.inflater import com.squareup.javapoet.ClassName diff --git a/annotation-processors-ksp/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider b/annotation-processors-ksp/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider index 004759fc87..678dbaf660 100644 --- a/annotation-processors-ksp/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider +++ b/annotation-processors-ksp/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider @@ -15,4 +15,4 @@ # along with AndroidIDE. If not, see . # -com.itsaky.androidide.annotations.ksp.inflater.ViewAdapterSymbolProcessorProvider \ No newline at end of file +org.appdevforall.codeonthego.annotations.ksp.inflater.ViewAdapterSymbolProcessorProvider \ No newline at end of file diff --git a/annotation-processors/src/main/java/com/itsaky/androidide/annotations/EventBusAnnotationProcessor.java b/annotation-processors/src/main/java/org/appdevforall/codeonthego/annotations/EventBusAnnotationProcessor.java similarity index 99% rename from annotation-processors/src/main/java/com/itsaky/androidide/annotations/EventBusAnnotationProcessor.java rename to annotation-processors/src/main/java/org/appdevforall/codeonthego/annotations/EventBusAnnotationProcessor.java index 7504108bbe..1e42a75867 100644 --- a/annotation-processors/src/main/java/com/itsaky/androidide/annotations/EventBusAnnotationProcessor.java +++ b/annotation-processors/src/main/java/org/appdevforall/codeonthego/annotations/EventBusAnnotationProcessor.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.itsaky.androidide.annotations; +package org.appdevforall.codeonthego.annotations; import com.google.auto.service.AutoService; import javax.annotation.processing.Processor; diff --git a/annotations/src/main/java/com/itsaky/androidide/annotations/inflater/ViewAdapter.kt b/annotations/src/main/java/org/appdevforall/codeonthego/annotations/inflater/ViewAdapter.kt similarity index 95% rename from annotations/src/main/java/com/itsaky/androidide/annotations/inflater/ViewAdapter.kt rename to annotations/src/main/java/org/appdevforall/codeonthego/annotations/inflater/ViewAdapter.kt index f1fefa36e0..6c28886b14 100644 --- a/annotations/src/main/java/com/itsaky/androidide/annotations/inflater/ViewAdapter.kt +++ b/annotations/src/main/java/org/appdevforall/codeonthego/annotations/inflater/ViewAdapter.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.annotations.inflater +package org.appdevforall.codeonthego.annotations.inflater import android.view.View import kotlin.annotation.AnnotationTarget.CLASS diff --git a/annotations/src/main/java/com/itsaky/androidide/annotations/uidesigner/IncludeInDesigner.kt b/annotations/src/main/java/org/appdevforall/codeonthego/annotations/uidesigner/IncludeInDesigner.kt similarity index 87% rename from annotations/src/main/java/com/itsaky/androidide/annotations/uidesigner/IncludeInDesigner.kt rename to annotations/src/main/java/org/appdevforall/codeonthego/annotations/uidesigner/IncludeInDesigner.kt index e5299e3b2d..622308b4ec 100644 --- a/annotations/src/main/java/com/itsaky/androidide/annotations/uidesigner/IncludeInDesigner.kt +++ b/annotations/src/main/java/org/appdevforall/codeonthego/annotations/uidesigner/IncludeInDesigner.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.annotations.uidesigner +package org.appdevforall.codeonthego.annotations.uidesigner /** * Indicates that the view (whose view adapter is annotated with [ViewAdapter] - * [com.itsaky.androidide.annotations.inflater.ViewAdapter] and [IncludeInDesigner]) should be + * [org.appdevforall.codeonthego.annotations.inflater.ViewAdapter] and [IncludeInDesigner]) should be * included in the UI Designer and made accessible to the user. * * @author Akash Yadav diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/Widgets.kt b/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/Widgets.kt index fb11f85ff7..b79eb8d27e 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/Widgets.kt +++ b/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/Widgets.kt @@ -17,8 +17,8 @@ package com.itsaky.androidide.uidesigner.utils -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.IViewAdapterIndex import com.itsaky.androidide.inflater.internal.utils.simpleName import com.itsaky.androidide.uidesigner.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewAdapter.kt index c98a437fa2..73eadef383 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewAdapter.kt @@ -34,9 +34,9 @@ import com.itsaky.androidide.inflater.models.UiWidget * - Provides list of supported attributes for the view. * * The following annotations are used to provide metadata about the view adapter implementation : - * - [ViewAdapter][com.itsaky.androidide.annotations.inflater.ViewAdapter] is used to specify the + * - [ViewAdapter][org.appdevforall.codeonthego.annotations.inflater.ViewAdapter] is used to specify the * view whose attributes are handled by the view adapter implementation. - * - [IncludeInDesigner][com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner] is used to + * - [IncludeInDesigner][org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner] is used to * indicate that the view adapter provides [UiWidget] models to the UI designer. * - [RequiresApi][androidx.annotation.RequiresApi] is used to indicate that the view adapter * implementation provides support for views that can be used only for the given API version (or @@ -49,7 +49,7 @@ abstract class IViewAdapter : AbstractParser() { /** * The package name or namespace of the module/artifact in which the view that this adapter * handles is defined. The value is set to "android" by default unless explicitly specified in the - * [ViewAdapter][com.itsaky.androidide.annotations.inflater.ViewAdapter] annotation. + * [ViewAdapter][org.appdevforall.codeonthego.annotations.inflater.ViewAdapter] annotation. * * This is used by the UI designer to quickly look for attributes of an inflated view from the * resource tables. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewAdapterIndex.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewAdapterIndex.kt index 54ea89cc1a..510be5ab35 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewAdapterIndex.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewAdapterIndex.kt @@ -18,7 +18,7 @@ package com.itsaky.androidide.inflater import android.view.View -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import com.itsaky.androidide.inflater.internal.ViewAdapterIndexImpl /** diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AbsoluteLayoutAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AbsoluteLayoutAdapter.kt index d93c287f33..67b3ddfba9 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AbsoluteLayoutAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AbsoluteLayoutAdapter.kt @@ -20,7 +20,7 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.AbsoluteLayout -import com.itsaky.androidide.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter /** * Attribute adapter for [AbsoluteLayout]. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AnalogClockAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AnalogClockAdapter.kt index df9084feca..06bb486bcd 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AnalogClockAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AnalogClockAdapter.kt @@ -23,8 +23,8 @@ import android.graphics.BlendMode import android.os.Build.VERSION_CODES import android.widget.AnalogClock import androidx.annotation.RequiresApi -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable @@ -35,7 +35,7 @@ import com.itsaky.androidide.resources.R.string * * @author Deep Kr. Ghosh */ -@com.itsaky.androidide.annotations.inflater.ViewAdapter(AnalogClock::class) +@org.appdevforall.codeonthego.annotations.inflater.ViewAdapter(AnalogClock::class) @IncludeInDesigner(group = WIDGETS) @RequiresApi(VERSION_CODES.S) open class AnalogClockAdapter : ViewAdapter() { diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AutoCompleteTextViewAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AutoCompleteTextViewAdapter.kt index d5b68d1200..0304d81de4 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AutoCompleteTextViewAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AutoCompleteTextViewAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.AutoCompleteTextView -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ButtonAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ButtonAdapter.kt index 26d3e40b10..1b2cdd28de 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ButtonAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ButtonAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.Button -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CalendarViewAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CalendarViewAdapter.kt index 628ad2261a..c41005bfca 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CalendarViewAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CalendarViewAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.CalendarView -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CheckBoxAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CheckBoxAdapter.kt index f5c58275aa..fc51262166 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CheckBoxAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CheckBoxAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.CheckBox -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CheckedTextViewAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CheckedTextViewAdapter.kt index 02faabbd2e..992b4cd7d1 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CheckedTextViewAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CheckedTextViewAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.CheckedTextView -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ChronometerAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ChronometerAdapter.kt index f0b56d7d5f..548909c432 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ChronometerAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ChronometerAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.Chronometer -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/DigitalClockAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/DigitalClockAdapter.kt index 112e4f65ae..fe6b49b32d 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/DigitalClockAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/DigitalClockAdapter.kt @@ -20,9 +20,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.DigitalClock -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/EditTextAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/EditTextAdapter.kt index ff5b4c47f0..2fa625ae3c 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/EditTextAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/EditTextAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.EditText -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/FrameLayoutAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/FrameLayoutAdapter.kt index b5665c23d1..5061ae7aba 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/FrameLayoutAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/FrameLayoutAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.FrameLayout -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GestureOverlayViewAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GestureOverlayViewAdapter.kt index 4b1ef69884..5da139813f 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GestureOverlayViewAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GestureOverlayViewAdapter.kt @@ -18,7 +18,7 @@ package com.itsaky.androidide.inflater.internal.adapters import android.gesture.GestureOverlayView -import com.itsaky.androidide.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.utils.ReflectUtils diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GridLayoutAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GridLayoutAdapter.kt index cc25018bb0..21b39a3e7f 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GridLayoutAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GridLayoutAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.GridLayout -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.IView import com.itsaky.androidide.inflater.IViewGroup diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GridViewAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GridViewAdapter.kt index 8df9492b3e..f47ba46093 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GridViewAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GridViewAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.GridView -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/HorizontalScrollViewAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/HorizontalScrollViewAdapter.kt index 7d764c93e4..d83756f9de 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/HorizontalScrollViewAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/HorizontalScrollViewAdapter.kt @@ -18,8 +18,8 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.HorizontalScrollView -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.IView import com.itsaky.androidide.inflater.IViewGroup @@ -31,7 +31,7 @@ import com.itsaky.androidide.resources.R * * @author Akash Yadav */ -@com.itsaky.androidide.annotations.inflater.ViewAdapter( +@org.appdevforall.codeonthego.annotations.inflater.ViewAdapter( HorizontalScrollView::class) @IncludeInDesigner(group = LAYOUTS) open class HorizontalScrollViewAdapter : diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageButtonAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageButtonAdapter.kt index e7670383a8..b83aa83260 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageButtonAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageButtonAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.ImageButton -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageSwitcherAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageSwitcherAdapter.kt index 28a55e2108..e636b471a3 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageSwitcherAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageSwitcherAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.ImageSwitcher -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageViewAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageViewAdapter.kt index 0bc93c52ef..a49f43be78 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageViewAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageViewAdapter.kt @@ -27,8 +27,8 @@ import android.widget.ImageView.ScaleType.FIT_END import android.widget.ImageView.ScaleType.FIT_START import android.widget.ImageView.ScaleType.FIT_XY import android.widget.ImageView.ScaleType.MATRIX -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.IView import com.itsaky.androidide.inflater.models.UiWidget @@ -41,7 +41,7 @@ import com.itsaky.androidide.resources.R.string * * @author Akash Yadav */ -@com.itsaky.androidide.annotations.inflater.ViewAdapter(ImageView::class) +@org.appdevforall.codeonthego.annotations.inflater.ViewAdapter(ImageView::class) @IncludeInDesigner(group = WIDGETS) open class ImageViewAdapter : ViewAdapter() { diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/LinearLayoutAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/LinearLayoutAdapter.kt index 86db59b099..0db86b4a24 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/LinearLayoutAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/LinearLayoutAdapter.kt @@ -22,9 +22,9 @@ import android.view.ViewGroup import android.widget.LinearLayout import androidx.annotation.DrawableRes import androidx.annotation.StringRes -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.INamespace import com.itsaky.androidide.inflater.IView diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ListViewAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ListViewAdapter.kt index 0c090ef2f3..631d136712 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ListViewAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ListViewAdapter.kt @@ -20,9 +20,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.R.layout import android.widget.ArrayAdapter import android.widget.ListView -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/MultiAutoCompleteTextViewAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/MultiAutoCompleteTextViewAdapter.kt index c8bdd2ae48..ce030dc51c 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/MultiAutoCompleteTextViewAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/MultiAutoCompleteTextViewAdapter.kt @@ -18,8 +18,8 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.MultiAutoCompleteTextView -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R @@ -28,7 +28,7 @@ import com.itsaky.androidide.resources.R * * @author Akash Yadav */ -@com.itsaky.androidide.annotations.inflater.ViewAdapter(forView = MultiAutoCompleteTextView::class) +@org.appdevforall.codeonthego.annotations.inflater.ViewAdapter(forView = MultiAutoCompleteTextView::class) @IncludeInDesigner(group = WIDGETS) open class MultiAutoCompleteTextViewAdapter : AutoCompleteTextViewAdapter() { diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/NumberPickerAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/NumberPickerAdapter.kt index c04240f1d6..1568be7cdc 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/NumberPickerAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/NumberPickerAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.NumberPicker -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ProgressBarAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ProgressBarAdapter.kt index 96451b7668..f6707267a4 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ProgressBarAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ProgressBarAdapter.kt @@ -28,7 +28,7 @@ import com.itsaky.androidide.resources.R.string * * @author Akash Yadav */ -@com.itsaky.androidide.annotations.inflater.ViewAdapter(ProgressBar::class) +@org.appdevforall.codeonthego.annotations.inflater.ViewAdapter(ProgressBar::class) open class ProgressBarAdapter : ViewAdapter() { override fun createAttrHandlers(create: (String, AttributeHandlerScope.() -> Unit) -> Unit) { diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/QuickContactBadgeAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/QuickContactBadgeAdapter.kt index d0c02fa4e6..1e8a35490a 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/QuickContactBadgeAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/QuickContactBadgeAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.QuickContactBadge -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RadioButtonAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RadioButtonAdapter.kt index 522bf7b603..4971724ed9 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RadioButtonAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RadioButtonAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.RadioButton -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RadioGroupAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RadioGroupAdapter.kt index b9b50fb43b..acfbcb51ed 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RadioGroupAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RadioGroupAdapter.kt @@ -19,8 +19,8 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.RadioButton import android.widget.RadioGroup -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.IView import com.itsaky.androidide.inflater.IViewGroup @@ -33,7 +33,7 @@ import com.itsaky.androidide.resources.R.string * * @author Akash Yadav */ -@com.itsaky.androidide.annotations.inflater.ViewAdapter( +@org.appdevforall.codeonthego.annotations.inflater.ViewAdapter( forView = RadioGroup::class) @IncludeInDesigner(group = LAYOUTS) open class RadioGroupAdapter : LinearLayoutAdapter() { diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RatingBarAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RatingBarAdapter.kt index 35266ef664..3152bd6f99 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RatingBarAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RatingBarAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.RatingBar -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RelativeLayoutAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RelativeLayoutAdapter.kt index 09102d71cb..a17a7d1772 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RelativeLayoutAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RelativeLayoutAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.RelativeLayout -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ScrollViewAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ScrollViewAdapter.kt index b07ae6a092..3facdc1c77 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ScrollViewAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ScrollViewAdapter.kt @@ -18,8 +18,8 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.ScrollView -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.IView import com.itsaky.androidide.inflater.IViewGroup @@ -31,7 +31,7 @@ import com.itsaky.androidide.resources.R * * @author Akash Yadav */ -@com.itsaky.androidide.annotations.inflater.ViewAdapter( +@org.appdevforall.codeonthego.annotations.inflater.ViewAdapter( forView = ScrollView::class) @IncludeInDesigner(group = LAYOUTS) open class ScrollViewAdapter : FrameLayoutAdapter() { diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SeekBarAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SeekBarAdapter.kt index 1c867ca9a1..d417b762d2 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SeekBarAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SeekBarAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.SeekBar -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SpaceAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SpaceAdapter.kt index 305ef4f2fa..4e379ef7e0 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SpaceAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SpaceAdapter.kt @@ -18,8 +18,8 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.Space -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string @@ -29,7 +29,7 @@ import com.itsaky.androidide.resources.R.string * * @author Deep Kr. Ghosh */ -@com.itsaky.androidide.annotations.inflater.ViewAdapter(Space::class) +@org.appdevforall.codeonthego.annotations.inflater.ViewAdapter(Space::class) @IncludeInDesigner(group = WIDGETS) open class SpaceAdapter<@Suppress("FINAL_UPPER_BOUND") T : Space> : ViewAdapter() { override fun createUiWidgets(): List { diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SpinnerAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SpinnerAdapter.kt index 341b6f6ab4..58a6ff53f0 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SpinnerAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SpinnerAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.Spinner -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SurfaceViewAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SurfaceViewAdapter.kt index 83557ebaf9..19e2d87118 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SurfaceViewAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SurfaceViewAdapter.kt @@ -18,8 +18,8 @@ package com.itsaky.androidide.inflater.internal.adapters import android.view.SurfaceView -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string @@ -29,7 +29,7 @@ import com.itsaky.androidide.resources.R.string * * @author Akash Yadav */ -@com.itsaky.androidide.annotations.inflater.ViewAdapter(SurfaceView::class) +@org.appdevforall.codeonthego.annotations.inflater.ViewAdapter(SurfaceView::class) @IncludeInDesigner(group = WIDGETS) open class SurfaceViewAdapter : ViewAdapter() { override fun createUiWidgets(): List { diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SwitchAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SwitchAdapter.kt index 2b3c852696..d7c2187274 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SwitchAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SwitchAdapter.kt @@ -19,9 +19,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.graphics.Typeface.DEFAULT import android.widget.Switch -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextClockAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextClockAdapter.kt index 490ff77501..a71c5e60d9 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextClockAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextClockAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.TextClock -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextSwitcherAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextSwitcherAdapter.kt index 9af6ce264f..8130f95f49 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextSwitcherAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextSwitcherAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.TextSwitcher -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextViewAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextViewAdapter.kt index 3532da035c..1fd668d816 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextViewAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextViewAdapter.kt @@ -23,8 +23,8 @@ import android.text.TextUtils import android.text.util.Linkify import android.util.TypedValue import android.widget.TextView -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.IView import com.itsaky.androidide.inflater.models.UiWidget @@ -37,7 +37,7 @@ import java.util.regex.Pattern * * @author Akash Yadav */ -@com.itsaky.androidide.annotations.inflater.ViewAdapter(TextView::class) +@org.appdevforall.codeonthego.annotations.inflater.ViewAdapter(TextView::class) @IncludeInDesigner(group = WIDGETS) open class TextViewAdapter : ViewAdapter() { override fun createAttrHandlers(create: (String, AttributeHandlerScope.() -> Unit) -> Unit) { diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextureViewAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextureViewAdapter.kt index 89f3995932..4d261c260a 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextureViewAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextureViewAdapter.kt @@ -20,8 +20,8 @@ package com.itsaky.androidide.inflater.internal.adapters import android.content.Context import android.view.TextureView import android.view.View -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.internal.ui.DesignerTextureView import com.itsaky.androidide.inflater.models.UiWidget @@ -33,7 +33,7 @@ import com.itsaky.androidide.resources.R.string * * @author Akash Yadav */ -@com.itsaky.androidide.annotations.inflater.ViewAdapter(TextureView::class) +@org.appdevforall.codeonthego.annotations.inflater.ViewAdapter(TextureView::class) @IncludeInDesigner(group = WIDGETS) open class TextureViewAdapter : ViewAdapter() { diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ToggleButtonAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ToggleButtonAdapter.kt index 21b0cc5b70..6c0f71f4ff 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ToggleButtonAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ToggleButtonAdapter.kt @@ -18,7 +18,7 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.ToggleButton -import com.itsaky.androidide.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/VideoViewAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/VideoViewAdapter.kt index bc43e8c19f..6972e3e4ee 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/VideoViewAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/VideoViewAdapter.kt @@ -18,8 +18,8 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.VideoView -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string @@ -29,7 +29,7 @@ import com.itsaky.androidide.resources.R.string * * @author Deep Kr. Ghosh */ -@com.itsaky.androidide.annotations.inflater.ViewAdapter(VideoView::class) +@org.appdevforall.codeonthego.annotations.inflater.ViewAdapter(VideoView::class) @IncludeInDesigner(group = WIDGETS) open class VideoViewAdapter : SurfaceViewAdapter() { override fun createUiWidgets(): List { diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewAdapter.kt index 65ffd659dd..84b72aa269 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewAdapter.kt @@ -51,9 +51,9 @@ import android.widget.RelativeLayout.START_OF import androidx.annotation.ChecksSdkIntAtLeast import androidx.core.view.updatePadding import androidx.core.view.updatePaddingRelative -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.IAttribute import com.itsaky.androidide.inflater.INamespace diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewAnimatorAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewAnimatorAdapter.kt index 9769694437..ad2ee57bfd 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewAnimatorAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewAnimatorAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.ViewAnimator -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewFlipperAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewFlipperAdapter.kt index 321ca1d325..8ddee8d0dc 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewFlipperAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewFlipperAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.ViewFlipper -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS import com.itsaky.androidide.inflater.AttributeHandlerScope import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewSwitcherAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewSwitcherAdapter.kt index 0990f3df61..a0432b32a6 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewSwitcherAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewSwitcherAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.widget.ViewSwitcher -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/WebViewAdapter.kt b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/WebViewAdapter.kt index a3ad62a21e..1110a7b45a 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/WebViewAdapter.kt +++ b/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/WebViewAdapter.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.inflater.internal.adapters import android.webkit.WebView -import com.itsaky.androidide.annotations.inflater.ViewAdapter -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS import com.itsaky.androidide.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string From f6c38277063af79fb9d814540a15ff5c79c5c4c1 Mon Sep 17 00:00:00 2001 From: jimturner-adfa Date: Tue, 6 Oct 2026 15:18:27 -0700 Subject: [PATCH 03/10] ADFA-174: Phase 2 mechanical rename, com.itsaky.androidide -> org.appdevforall.codeonthego Renames Kotlin/Java package declarations, directory layout, manifest strings, and build-script references across the tree. Does not touch BuildConfig.PACKAGE_NAME, applicationId, or AGP namespace - those stay com.itsaky.androidide until Phase 3 (ADR 0017), which is gated on the terminal-packages cross-repo coordination tracked in ADFA-6386. Deliberately left at the old namespace, since each is tied to that same deferred constant or an external identity: - Generated classes (R, BuildConfig, the per-module eventbus index classes, data-binding Binding classes) - these live wherever AGP's namespace currently points, which hasn't moved. - composite-builds/ (vendored build-logic, ADR 0003) and the :gradle-plugin module (its generated init-script string is a literal FQN baked in by composite-builds). - The vendored fork packages inside composite-builds/build-deps (desugaring, diffutils, fuzzysearch, javac.config, layoutlib, zipfs2) and the external android-tree-sitter library (com.itsaky.androidide.treesitter). - Cross-app identity checks: Firebase's google-services.json, logsender's and termux's manifest references, and the literal applicationId strings in tests/docs that describe the currently-running app. - testing/resources/sample-project and gradle-plugin/src/test/resources (fixtures simulating an external project, not our own identity). :plugin-api/:plugin-manager (com.itsaky.androidide.plugins.*) are included in this pass per team decision, despite being a published surface for third-party IDE plugins - plugin-builder's own group was already migrated to org.appdevforall.codeonthego.plugins before this branch existed. One real bug fixed along the way: common's FileProviderUtilsTest had a test fixture whose expected-output literal was swept along with production code, even though the test's whole point is exercising today's real (unflipped) package name as input. Verified: a full-tree compile (every module, every flavor/build-type, including a sweep for bare R/BuildConfig/databinding usage in files sitting at a module's namespace root) is clean, and the full unit test suite is green except a pre-existing lsp:java `refactor` test family (ExtractMethodPlanTest, ExtractMethodEditTest, ExtractVariableSoundnessTest, RegionAnalysisPrimitivesTest, ExtractMethodSignatureTest, ExtractionRegionSoundnessTest) - confirmed by stashing this entire change and re-running against the untouched baseline: identical failures, unrelated to this rename. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/instrumentation-test.yml | 4 +- REVIEW.md | 2 +- .../codeonthego}/actions/ActionData.java | 142 +- .../codeonthego}/actions/ActionItem.kt | 10 +- .../codeonthego}/actions/ActionMenu.kt | 2 +- .../codeonthego}/actions/ActionsRegistry.kt | 246 +- .../codeonthego}/actions/EditTextAdapter.kt | 2 +- .../codeonthego}/actions/EditorActionItem.kt | 2 +- .../codeonthego}/actions/FillMenuParams.kt | 4 +- .../actions/OnActionClickListener.kt | 2 +- .../codeonthego}/actions/SidebarActionItem.kt | 2 +- .../actions/SidebarSlotManager.kt | 2 +- .../codeonthego}/actions/TextTarget.kt | 2 +- .../codeonthego}/actions/actionUtils.kt | 4 +- .../internal/DefaultActionsRegistry.kt | 570 ++--- .../actions/locations/CodeActionsMenu.kt | 102 +- .../actions/ActionTooltipResolutionTest.kt | 2 +- .../actions/SidebarSlotManagerTest.kt | 2 +- .../annotations/ksp/inflater/utils.kt | 6 +- apk-viewer-plugin/build.gradle.kts | 2 +- apk-viewer-plugin/proguard-rules.pro | 4 +- .../com/example/sampleplugin/ApkViewer.kt | 22 +- .../fragments/ApkAnalyzerFragment.kt | 2 +- app/build.gradle.kts | 18 +- app/proguard-rules.pro | 38 +- .../codeonthego}/AutomationEndToEndTest.kt | 38 +- .../codeonthego}/AutomationTestSuite.kt | 2 +- .../appdevforall/codeonthego}/CleanupTest.kt | 2 +- .../appdevforall/codeonthego}/EndToEndTest.kt | 36 +- .../codeonthego}/ExportCacheDirectoryTest.kt | 2 +- .../codeonthego}/OrderedTestSuite.kt | 2 +- .../ProjectBuildTestWithGroovyGradle.kt | 20 +- .../ProjectBuildTestWithKtsGradle.kt | 18 +- .../codeonthego}/QuickBuildFlagOffTest.kt | 22 +- .../codeonthego}/QuickBuildPipelineTest.kt | 40 +- .../codeonthego}/QuickBuildSmokeTest.kt | 66 +- .../app/strictmode/FrameMatcherTest.kt | 2 +- .../app/strictmode/StackMatcherTest.kt | 2 +- .../codeonthego}/app/strictmode/Utils.kt | 2 +- .../app/strictmode/WhitelistEngineTest.kt | 2 +- .../app/strictmode/WhitelistRulesTest.kt | 8 +- .../codeonthego}/editor/ui/IDEEditorTest.kt | 2 +- .../helper/AdvancePastWelcomeScreenHelper.kt | 2 +- ...nfigureAutomationBuildPreferencesHelper.kt | 4 +- .../helper/DevicePermissionGrantUiHelper.kt | 2 +- .../helper/EnsureHomeScreenHelper.kt | 14 +- .../helper/ExperimentsFlagHelper.kt | 6 +- .../helper/FakeInstalledPackages.kt | 2 +- .../GrantRequiredPermissionsUiHelper.kt | 6 +- .../helper/HandlePrivacyDisclosureHelper.kt | 6 +- .../codeonthego}/helper/ProjectBuildHelper.kt | 10 +- ...izationProjectAndCancelingBuildScenario.kt | 6 +- .../scenarios/NavigateToMainScreenScenario.kt | 16 +- .../scenarios/RunAssembleTasksScenario.kt | 6 +- .../codeonthego}/screens/EditorScreen.kt | 2 +- .../codeonthego}/screens/ErrorBannerScreen.kt | 2 +- .../codeonthego}/screens/HomeScreen.kt | 4 +- .../screens/InstallToolsScreen.kt | 2 +- .../codeonthego}/screens/OnboardingScreen.kt | 2 +- .../codeonthego}/screens/PermissionScreen.kt | 2 +- .../screens/ProjectSettingsScreen.kt | 6 +- .../codeonthego}/screens/QuickBuildScreen.kt | 4 +- .../screens/SystemPermissionsScreen.kt | 2 +- .../codeonthego}/screens/TemplateScreen.kt | 4 +- app/src/debug/AndroidManifest.xml | 2 +- .../codeonthego}/app/LeakCanaryConfig.kt | 4 +- .../quickbuild/BenchEventsFile.kt | 2 +- .../quickbuild/BenchQuickBuildMetricsSink.kt | 2 +- .../quickbuild/BenchStateRecorder.kt | 2 +- .../quickbuild/QuickBuildBenchActivity.kt | 22 +- .../quickbuild/QuickBuildBenchAutostart.kt | 4 +- .../quickbuild/QuickBuildBenchHooks.kt | 6 +- app/src/main/AndroidManifest.xml | 18 +- .../events/PluginLanguagesChangedEvent.kt | 5 - .../fragments/debug/DisplayableUtils.kt | 8 - .../shortcuts/ShortcutGroupProvider.kt | 19 - .../codeonthego}/actions/BaseBuildAction.kt | 8 +- .../codeonthego}/actions/BaseEditorAction.kt | 194 +- .../actions/EditorActivityAction.kt | 128 +- .../actions/EditorRelatedAction.kt | 98 +- .../codeonthego}/actions/FileActionManager.kt | 8 +- .../codeonthego}/actions/PluginActionItem.kt | 12 +- .../actions/PluginSidebarActionItem.kt | 10 +- .../actions/PluginToolbarActionItem.kt | 12 +- .../appdevforall/codeonthego}/actions/Util.kt | 18 +- .../build/AbstractCancellableRunAction.kt | 18 +- .../build/AbstractModuleAssemblerAction.kt | 22 +- .../actions/build/AbstractRunAction.kt | 2 +- .../codeonthego}/actions/build/DebugAction.kt | 32 +- .../actions/build/PluginBuildActionItem.kt | 28 +- .../actions/build/ProjectSyncAction.kt | 8 +- .../actions/build/QuickBuildAction.kt | 22 +- .../actions/build/QuickRunAction.kt | 140 +- .../actions/build/RunTasksAction.kt | 10 +- .../build/StandardRunClobberDecision.kt | 2 +- .../actions/debug/AbstractDebuggerAction.kt | 10 +- .../actions/debug/AbstractStepAction.kt | 6 +- .../actions/debug/KillVmAction.kt | 6 +- .../actions/debug/RestartVmAction.kt | 12 +- .../actions/debug/StepIntoAction.kt | 6 +- .../actions/debug/StepOutAction.kt | 6 +- .../actions/debug/StepOverAction.kt | 6 +- .../actions/debug/SuspendResumeVmAction.kt | 8 +- .../codeonthego}/actions/editor/CopyAction.kt | 140 +- .../codeonthego}/actions/editor/CutAction.kt | 120 +- .../actions/editor/ExpandSelectionAction.kt | 96 +- .../actions/editor/LongSelectAction.kt | 12 +- .../actions/editor/PasteAction.kt | 124 +- .../actions/editor/SelectAllAction.kt | 134 +- .../actions/etc/DisconnectLogSendersAction.kt | 12 +- .../codeonthego}/actions/etc/FindAction.kt | 118 +- .../actions/etc/FindInFileAction.kt | 104 +- .../actions/etc/FindInProjectAction.kt | 14 +- .../actions/etc/LaunchAppAction.kt | 18 +- .../actions/etc/ReplaceInProjectAction.kt | 14 +- .../actions/file/CloseAllFilesAction.kt | 6 +- .../actions/file/CloseFileAction.kt | 6 +- .../actions/file/CloseOtherFilesAction.kt | 6 +- .../actions/file/CreateLinkAction.kt | 26 +- .../actions/file/FileTabAction.kt | 16 +- .../actions/file/FormatCodeAction.kt | 110 +- .../actions/file/InstallFileAction.kt | 16 +- .../actions/file/SaveFileAction.kt | 16 +- .../codeonthego}/actions/file/SaveFollowUp.kt | 4 +- .../actions/file/ShowTooltipAction.kt | 20 +- .../actions/filetree/BaseDirNodeAction.kt | 8 +- .../actions/filetree/BaseFileTreeAction.kt | 20 +- .../actions/filetree/CopyPathAction.kt | 14 +- .../actions/filetree/DeleteAction.kt | 24 +- .../actions/filetree/HelpAction.kt | 10 +- .../actions/filetree/NewFileAction.kt | 38 +- .../actions/filetree/NewFolderAction.kt | 18 +- .../actions/filetree/OpenWithAction.kt | 12 +- .../actions/filetree/RenameAction.kt | 16 +- .../actions/internalActionUtils.kt | 12 +- .../actions/main/CloneRepositoryAction.kt | 14 +- .../actions/main/CreateProjectAction.kt | 12 +- .../actions/main/DeleteProjectAction.kt | 12 +- .../codeonthego}/actions/main/DocsAction.kt | 12 +- .../codeonthego}/actions/main/DonateAction.kt | 12 +- .../actions/main/OpenProjectAction.kt | 12 +- .../actions/main/OpenTerminalAction.kt | 14 +- .../actions/main/PreferencesAction.kt | 12 +- .../actions/observers/FileActionObserver.kt | 2 +- .../actions/profiler/ProfilerAction.kt | 28 +- .../actions/profiler/ReleaseVariant.kt | 2 +- .../actions/sidebar/AbstractSidebarAction.kt | 8 +- .../sidebar/BuildVariantsSidebarAction.kt | 8 +- .../sidebar/CloseProjectSidebarAction.kt | 10 +- .../actions/sidebar/FileTreeSidebarAction.kt | 6 +- .../actions/sidebar/HelpSideBarAction.kt | 10 +- .../actions/sidebar/OutlineSidebarAction.kt | 6 +- .../sidebar/PreferencesSidebarAction.kt | 10 +- .../actions/sidebar/TerminalSidebarAction.kt | 14 +- .../codeonthego}/actions/text/RedoAction.kt | 12 +- .../codeonthego}/actions/text/UndoAction.kt | 126 +- .../codeonthego}/activities/AboutActivity.kt | 28 +- .../activities/CrashHandlerActivity.java | 8 +- .../activities/DeepLinkActivity.kt | 20 +- .../activities/ExternalFileInstallActivity.kt | 6 +- .../activities/ExternalFileInstallScreen.kt | 20 +- .../codeonthego}/activities/MainActivity.kt | 100 +- .../activities/OnboardingActivity.kt | 34 +- .../activities/PluginManagerActivity.kt | 18 +- .../activities/PluginScreenActivity.kt | 10 +- .../activities/PluginScreenNavigator.kt | 2 +- .../activities/PreferencesActivity.kt | 22 +- .../codeonthego}/activities/SetupState.kt | 8 +- .../codeonthego}/activities/SplashActivity.kt | 12 +- .../activities/editor/BaseEditorActivity.kt | 172 +- .../activities/editor/EditorActivityKt.kt | 2 +- .../editor/EditorHandlerActivity.kt | 190 +- .../activities/editor/FAQActivity.kt | 6 +- .../activities/editor/FileSaveOutcome.kt | 2 +- .../activities/editor/FullscreenManager.kt | 4 +- .../activities/editor/IDELogcatReader.kt | 6 +- .../editor/PeerCursorOverlayManager.kt | 2 +- .../editor/ProjectHandlerActivity.kt | 200 +- .../editor/QuickBuildClobberConfirmation.kt | 2 +- .../activities/editor/SaveResultFlags.kt | 4 +- .../adapters/BuildVariantsAdapter.kt | 10 +- .../adapters/DeleteProjectListAdapter.kt | 6 +- .../adapters/DiagnosticItemAdapter.java | 8 +- .../adapters/DiagnosticsAdapter.java | 6 +- .../adapters/EditorBottomSheetTabAdapter.java | 0 .../adapters/EditorBottomSheetTabAdapter.kt | 34 +- .../adapters/FilterableRecyclerViewAdapter.kt | 2 +- .../adapters/MainActionsListAdapter.kt | 4 +- .../adapters/OptionsSheetAdapter.java | 4 +- .../adapters/RecentProjectsAdapter.kt | 30 +- .../adapters/RunTasksListAdapter.kt | 14 +- .../adapters/SearchListAdapter.kt | 20 +- .../adapters/SymbolInputAdapter.kt | 12 +- .../adapters/TemplateListAdapter.kt | 8 +- .../adapters/TemplateWidgetsListAdapter.kt | 10 +- .../DefaultOnboardingItemAdapter.kt | 4 +- .../OnboardingPermissionsAdapter.kt | 6 +- .../viewholders/FileTreeViewHolder.java | 6 +- .../MultiSelectFileTreeViewHolder.java | 4 +- .../agent/model/ModelLoadResult.kt | 2 +- .../analytics/AnalyticsManager.kt | 8 +- .../analytics/AttachedDevicesCollector.kt | 2 +- .../analytics/AttachedDevicesMetric.kt | 2 +- .../codeonthego}/analytics/DeepLinkMetric.kt | 4 +- .../codeonthego}/analytics/Metric.kt | 2 +- .../analytics/gradle/BuildCompletedMetric.kt | 6 +- .../analytics/gradle/BuildMetric.kt | 6 +- .../analytics/gradle/BuildStartedMetric.kt | 12 +- .../gradle/StrategySelectedMetric.kt | 8 +- .../AnalyticsQuickBuildMetricsSink.kt | 4 +- .../analytics/quickbuild/QuickBuildMetrics.kt | 8 +- .../codeonthego}/api/ActionContextProvider.kt | 8 +- .../codeonthego}/api/BuildOutputProvider.kt | 10 +- .../codeonthego}/api/IDEApiFacade.kt | 12 +- .../codeonthego}/api/LogsProvider.kt | 22 +- .../app/ActivityLifecycleCallbacksDelegate.kt | 2 +- .../codeonthego}/app/ApplicationLoader.kt | 2 +- .../CredentialProtectedApplicationLoader.kt | 56 +- .../app/DeviceProtectedApplicationLoader.kt | 34 +- .../codeonthego}/app/EdgeToEdgeIDEActivity.kt | 6 +- .../codeonthego}/app/EditorEvents.kt | 2 +- .../codeonthego}/app/EditorProviderImpl.kt | 24 +- .../codeonthego}/app/IDEActivity.kt | 2 +- .../codeonthego}/app/IDEActivityDelegate.kt | 2 +- .../codeonthego}/app/IDEApplication.kt | 22 +- .../app/PluginRunAppCoordinator.kt | 16 +- .../app/TermuxApplicationLoader.kt | 2 +- .../IDEBuildConfigProviderImpl.kt | 4 +- .../JdkDistributionProviderImpl.kt | 10 +- .../app/strictmode/FrameMatcher.kt | 2 +- .../app/strictmode/StackMatcher.kt | 2 +- .../app/strictmode/StrictModeConfig.kt | 4 +- .../app/strictmode/StrictModeManager.kt | 2 +- .../app/strictmode/ViolationDispatcher.kt | 2 +- .../app/strictmode/ViolationHandler.kt | 4 +- .../app/strictmode/ViolationListener.kt | 2 +- .../app/strictmode/WhitelistBuilder.kt | 2 +- .../app/strictmode/WhitelistEngine.kt | 12 +- .../assets/AssetsInstallExceptions.kt | 2 +- .../assets/AssetsInstallationHelper.kt | 12 +- .../codeonthego}/assets/AssetsInstaller.kt | 4 +- .../assets/BaseAssetsInstaller.kt | 6 +- .../assets/BundledAssetsInstaller.kt | 18 +- .../assets/SplitAssetsInstaller.kt | 14 +- .../codeonthego}/deeplink/ConsumedRequests.kt | 6 +- .../deeplink/PendingDeepLinkOpen.kt | 6 +- .../appdevforall/codeonthego}/di/AppModule.kt | 30 +- .../codeonthego}/di/PluginModule.kt | 16 +- .../codeonthego}/di/QuickBuildModule.kt | 34 +- .../codeonthego}/di/TemplateModule.kt | 10 +- .../codeonthego}/dnd/DragAndDropExtensions.kt | 4 +- .../codeonthego}/dnd/DragEventRouter.kt | 2 +- .../codeonthego}/dnd/DropTargetCallback.kt | 2 +- .../codeonthego}/dnd/FileDragStarter.kt | 4 +- .../codeonthego}/dnd/GitUrlDropExtensions.kt | 2 +- .../codeonthego}/dnd/GitUrlDropTarget.kt | 6 +- .../editor/floating/ChromeControlTooltips.kt | 10 +- .../floating/EditorPanelDockableContent.kt | 32 +- .../floating/IdeFloatingTabController.kt | 16 +- .../MetricsCarouselDockableContent.kt | 10 +- .../floating/PluginTabDockableContent.kt | 20 +- .../codeonthego}/events/FileTree.kt | 6 +- .../events/InstallationResultEvent.kt | 4 +- .../events/PluginLanguagesChangedEvent.kt | 5 + .../fragments/BasePreferenceFragment.kt | 2 +- .../fragments/CloneRepositoryFragment.kt | 22 +- .../fragments/CrashReportFragment.kt | 6 +- .../fragments/DeleteProjectFragment.kt | 32 +- .../fragments/DiagnosticsListFragment.kt | 10 +- .../fragments/EmptyStateFragment.kt | 10 +- .../fragments/FindActionDialog.kt | 8 +- .../fragments/IDEPreferencesFragment.kt | 16 +- .../fragments/IDETooltipWebViewFragment.kt | 4 +- .../codeonthego}/fragments/MainFragment.kt | 24 +- .../fragments/RecentProjectsFragment.kt | 46 +- .../fragments/RecyclerViewFragment.kt | 4 +- .../fragments/RunTasksDialogFragment.kt | 38 +- .../fragments/SearchFieldToolbar.kt | 30 +- .../fragments/SearchResultFragment.kt | 16 +- .../fragments/TemplateDetailsFragment.kt | 28 +- .../fragments/TemplateListFragment.kt | 20 +- .../fragments/debug/CallStackFragment.kt | 14 +- .../fragments/debug/DebuggerFragment.kt | 28 +- .../fragments/debug/DisplayableUtils.kt | 8 + .../fragments/debug/Resolvable.kt | 24 +- .../fragments/debug/VariableIcon.kt | 2 +- .../fragments/debug/VariableListBinder.kt | 18 +- .../fragments/debug/VariableListFragment.kt | 8 +- .../debug/VariableTreeNodeGenerator.kt | 2 +- .../fragments/debug/WADBPermissionFragment.kt | 8 +- .../fragments/git/GitBottomSheetFragment.kt | 44 +- .../fragments/git/GitBranchPopupWindow.kt | 24 +- .../fragments/git/GitCommitHistoryDialog.kt | 22 +- .../fragments/git/GitDialogUtils.kt | 4 +- .../fragments/git/GitDiffViewerDialog.kt | 4 +- .../fragments/git/adapter/GitBranchAdapter.kt | 4 +- .../git/adapter/GitCommitHistoryAdapter.kt | 4 +- .../git/adapter/GitFileChangeAdapter.kt | 6 +- .../fragments/onboarding/GreetingFragment.kt | 6 +- .../IdeSetupConfigurationFragment.kt | 14 +- .../onboarding/OnboardingFragment.kt | 4 +- .../onboarding/OnboardingInfoFragment.kt | 4 +- .../OnboardingMultiActionFragment.kt | 8 +- .../onboarding/PermissionsFragment.kt | 40 +- .../fragments/onboarding/ideSetupConfig.kt | 4 +- .../fragments/output/AppLogFragment.kt | 8 +- .../fragments/output/BuildOutputFragment.kt | 22 +- .../fragments/output/FilterNoMatchTracker.kt | 2 +- .../fragments/output/IDELogFragment.kt | 6 +- .../output/LogFilterBarController.kt | 6 +- .../fragments/output/LogViewFragment.kt | 52 +- .../output/NonEditableEditorFragment.java | 16 +- .../output/SearchableOutputFragment.kt | 2 +- .../output/ShareableOutputFragment.kt | 2 +- .../output/ViewOptionsOutputFragment.kt | 2 +- .../output/WrappableOutputFragment.kt | 2 +- .../sheets/BaseBottomSheetFragment.java | 2 +- .../fragments/sheets/OptionsListFragment.java | 12 +- .../fragments/sheets/ProgressSheet.java | 2 +- .../sidebar/BuildVariantsFragment.kt | 14 +- .../sidebar/EditorSidebarFragment.kt | 12 +- .../sidebar/FileTreeDropController.kt | 14 +- .../fragments/sidebar/FileTreeFragment.kt | 42 +- .../sidebar/FileTreeSelectionFragment.kt | 6 +- .../fragments/sidebar/OutlineFragment.kt | 22 +- .../codeonthego}/handlers/BaseEventHandler.kt | 8 +- .../handlers/CrashEventSubscriber.kt | 8 +- .../EditorActivityLifecyclerObserver.kt | 30 +- .../handlers/EditorBuildEventListener.kt | 36 +- .../handlers/FileTreeActionHandler.kt | 38 +- .../handlers/GlitchTipDiagnosticsContext.kt | 16 +- .../codeonthego}/handlers/LspHandler.kt | 18 +- .../handlers/MetricsCrashAttachment.kt | 10 +- .../codeonthego}/handlers/SnippetHandler.kt | 22 +- .../interfaces/DiagnosticClickListener.java | 6 +- .../codeonthego}/interfaces/IEditorHandler.kt | 8 +- .../codeonthego}/localWebServer/WebServer.kt | 16 +- .../codeonthego}/logs/LogBuffer.kt | 6 +- .../codeonthego}/lsp/BreakpointHandler.kt | 22 +- .../codeonthego}/lsp/IDEDebugClientImpl.kt | 40 +- .../lsp/IDELanguageClientImpl.java | 50 +- .../codeonthego}/lsp/PluginLanguageSupport.kt | 28 +- .../codeonthego}/lsp/SearchResultGrouping.kt | 8 +- .../codeonthego}/models/ApkMetadata.kt | 6 +- .../codeonthego}/models/ArtifactType.kt | 2 +- .../codeonthego}/models/Checkable.kt | 2 +- .../codeonthego}/models/ContextListItem.kt | 2 +- .../codeonthego}/models/DeepLinkRequest.kt | 20 +- .../models/DefaultOnboardingItem.kt | 2 +- .../codeonthego}/models/DiagnosticGroup.java | 4 +- .../codeonthego}/models/EditorIntentExtras.kt | 4 +- .../codeonthego}/models/FileExtension.kt | 2 +- .../models/HyperlinkedOnboardingItem.kt | 2 +- .../codeonthego}/models/IdeSetupArguments.kt | 2 +- .../codeonthego}/models/InstallTaskRequest.kt | 2 +- .../codeonthego}/models/LogFilter.kt | 4 +- .../codeonthego}/models/MetadataElement.kt | 2 +- .../models/NewProjectDetails.java | 2 +- .../codeonthego}/models/OnboardingItem.kt | 2 +- .../models/OnboardingPermissionItem.kt | 2 +- .../codeonthego}/models/OpenedFile.kt | 2 +- .../codeonthego}/models/OpenedFilesCache.kt | 2 +- .../codeonthego}/models/ProjectFile.kt | 4 +- .../codeonthego}/models/ProjectTemplate.java | 2 +- .../codeonthego}/models/RunTasksCategory.kt | 4 +- .../codeonthego}/models/SearchResult.java | 2 +- .../codeonthego}/models/StepResult.kt | 2 +- .../codeonthego}/models/StorageInfo.kt | 2 +- .../codeonthego}/models/Symbol.kt | 4 +- .../codeonthego}/preferences/aboutPrefExts.kt | 6 +- .../preferences/buildAndRunPrefExts.kt | 42 +- .../preferences/commonPrefExts.kt | 4 +- .../preferences/developerOptionsPrefExts.kt | 10 +- .../preferences/editorPrefExts.kt | 30 +- .../preferences/generalPrefExts.kt | 16 +- .../codeonthego}/preferences/gitPrefExts.kt | 12 +- .../codeonthego}/preferences/javaPrefExts.kt | 6 +- .../preferences/pluginPrefExts.kt | 18 +- .../codeonthego}/preferences/rootPrefExts.kt | 4 +- .../preferences/termuxPrefsExt.kt | 18 +- .../codeonthego}/preferences/xmlPrefExts.kt | 6 +- .../projects/builder/BuildResult.kt | 2 +- .../projects/builder/LaunchResult.kt | 2 +- .../provider/IDEDocumentsProvider.java | 660 ++--- .../codeonthego}/provider/IDEFileProvider.kt | 2 +- .../quickbuild/AndroidProxyAppLauncher.kt | 2 +- .../codeonthego}/quickbuild/AutostartBuild.kt | 2 +- .../CompositeQuickBuildMetricsSink.kt | 2 +- .../quickbuild/EnvironmentQuickBuildPaths.kt | 4 +- .../quickbuild/GenerateSourcesDeferral.kt | 6 +- .../quickbuild/GradleQuickBuildProvisioner.kt | 24 +- .../PreferencesQuickBuildHistoryStore.kt | 2 +- .../quickbuild/QuickBuildArtifactStager.kt | 4 +- .../quickbuild/QuickBuildFlashes.kt | 2 +- .../quickbuild/QuickBuildGraphWarmUp.kt | 4 +- .../quickbuild/QuickBuildInstallAdapters.kt | 6 +- .../quickbuild/QuickBuildMessages.kt | 2 +- .../quickbuild/QuickBuildOutputLines.kt | 4 +- .../quickbuild/QuickBuildOutputMetricsSink.kt | 2 +- .../quickbuild/QuickBuildOutputNarrator.kt | 2 +- .../quickbuild/QuickBuildPrebuildStagger.kt | 2 +- .../quickbuild/QuickBuildProjectSupport.kt | 2 +- .../quickbuild/QuickBuildStatusBar.kt | 2 +- .../quickbuild/QuickBuildTaskPaths.kt | 2 +- .../quickbuild/QuickBuildTransitions.kt | 2 +- .../quickbuild/QuickBuildWontStayUpRestart.kt | 4 +- .../repositories/BreakpointRepository.kt | 12 +- .../repositories/PluginRepository.kt | 6 +- .../repositories/PluginRepositoryImpl.kt | 10 +- .../repositories/RecentProjectRepository.kt | 4 +- .../RecentProjectRepositoryImpl.kt | 6 +- .../TemplateCollectionRepository.kt | 2 +- .../TemplateCollectionRepositoryImpl.kt | 12 +- .../repositories/TemplateRepository.kt | 4 +- .../repositories/TemplateRepositoryImpl.kt | 10 +- .../roomData/recentproject/RecentProject.kt | 2 +- .../recentproject/RecentProjectDao.kt | 2 +- .../recentproject/RecentProjectMaintenance.kt | 2 +- .../RecentProjectMaintenanceDao.kt | 2 +- .../RecentProjectRoomDatabase.kt | 2 +- .../search/replace/OpenTabUndo.kt | 2 +- .../search/replace/ProjectReplacer.kt | 4 +- .../search/replace/ReplaceCoordinator.kt | 8 +- .../search/replace/ReplaceSession.kt | 6 +- .../search/replace/TextReplacement.kt | 4 +- .../services/InstallationResultReceiver.kt | 4 +- .../ToolingServerAlreadyStartedException.java | 2 +- .../ToolingServerNotStartedException.java | 2 +- .../services/builder/BalancedStrategy.kt | 2 +- .../builder/BuildInProgressException.java | 2 +- .../services/builder/BuildProfile.kt | 2 +- .../codeonthego}/services/builder/CpuInfo.kt | 2 +- .../services/builder/DeviceInfo.kt | 4 +- .../services/builder/DeviceProfile.kt | 2 +- .../services/builder/GradleBuildService.kt | 88 +- .../builder/GradleBuildServiceConnnection.kt | 2 +- .../services/builder/GradleBuildTuner.kt | 16 +- .../services/builder/GradleServiceBinder.kt | 2 +- .../services/builder/GradleTuningConfig.kt | 2 +- .../services/builder/GradleTuningStrategy.kt | 2 +- .../builder/HighPerformanceStrategy.kt | 2 +- .../services/builder/InternalBuildBracket.kt | 2 +- .../builder/InternalBuildOutputCapture.kt | 2 +- .../services/builder/LowMemoryStrategy.kt | 2 +- .../services/builder/ThermalInfo.kt | 2 +- .../services/builder/ThermalSafeStrategy.kt | 2 +- .../services/builder/ToolingServerRunner.kt | 22 +- .../codeonthego}/services/builder/util.kt | 6 +- .../services/debug/DebugOverlayManager.kt | 14 +- .../debug/DebuggerActionsOverlayAdapter.kt | 12 +- .../services/debug/DebuggerService.kt | 26 +- .../services/debug/ForegroundAppReceiver.kt | 2 +- .../services/log/CachingLogSender.kt | 4 +- .../services/log/ConnectionObserverParams.kt | 6 +- .../services/log/LogReceiverImpl.kt | 10 +- .../services/log/LogReceiverService.kt | 14 +- .../log/LogReceiverServiceConnection.kt | 2 +- .../services/log/LogSenderHandler.kt | 6 +- .../services/log/LogSendersRegistry.kt | 2 +- .../services/log/MultiLogSenderHandler.kt | 10 +- .../codeonthego}/services/log/utils.kt | 4 +- .../shortcuts/IdeShortcutActions.kt | 10 +- .../codeonthego}/shortcuts/KeyShortcut.kt | 2 +- .../codeonthego}/shortcuts/ShortcutCatalog.kt | 2 +- .../shortcuts/ShortcutCategory.kt | 2 +- .../codeonthego}/shortcuts/ShortcutContext.kt | 2 +- .../shortcuts/ShortcutDefinition.kt | 2 +- .../shortcuts/ShortcutExecutionContext.kt | 2 +- .../shortcuts/ShortcutGroupProvider.kt | 19 + .../codeonthego}/shortcuts/ShortcutManager.kt | 2 +- .../shortcuts/groups/FileManagementGroup.kt | 14 +- .../groups/ProjectsAndSolutionsGroup.kt | 16 +- .../shortcuts/groups/SearchAndReplaceGroup.kt | 16 +- .../shortcuts/groups/ShortcutDefinitionIds.kt | 2 +- .../shortcuts/groups/ShortcutGroup.kt | 4 +- .../groups/WindowsAndDisplayGroup.kt | 18 +- .../tasks/callables/FileTreeCallable.java | 4 +- .../callables/ListDirectoryCallable.java | 4 +- .../tasks/callables/UnzipCallable.java | 4 +- .../templates/manager/models/CgtFileItem.kt | 4 +- .../manager/parsing/CgtTemplateReader.kt | 4 +- .../codeonthego}/ui/CodeEditorView.kt | 56 +- .../ui/CustomDividerItemDecoration.kt | 2 +- .../codeonthego}/ui/CustomSnackbar.kt | 2 +- .../codeonthego}/ui/EditorBottomSheet.kt | 56 +- .../codeonthego}/ui/EmptyView.java | 4 +- .../codeonthego}/ui/IdeNavigationRailView.kt | 2 +- .../codeonthego}/ui/InfoRowView.kt | 2 +- .../ui/MemoryUsageChartRenderer.kt | 12 +- .../codeonthego}/ui/MetricsCarouselAdapter.kt | 2 +- .../ui/MetricsCarouselController.kt | 36 +- .../codeonthego}/ui/MetricsCarouselLayout.kt | 2 +- .../codeonthego}/ui/MetricsChartRenderer.kt | 12 +- .../ui/NetworkUsageChartRenderer.kt | 10 +- .../ui/PowerUsageChartRenderer.kt | 10 +- .../codeonthego}/ui/ProjectInfoBottomSheet.kt | 18 +- .../codeonthego}/ui/SafeLineChart.kt | 2 +- .../codeonthego}/ui/ScalableTabLayout.kt | 2 +- .../codeonthego}/ui/StorageDialog.kt | 4 +- .../codeonthego}/ui/SwipeRevealLayout.kt | 2 +- .../codeonthego}/ui/SymbolInputView.java | 10 +- .../codeonthego}/ui/compose/ManagerScreen.kt | 28 +- .../codeonthego}/ui/compose/TooltipInterop.kt | 4 +- .../ui/compose/common/FileImage.kt | 2 +- .../ui/compose/plugins/PluginListItem.kt | 10 +- .../compose/plugins/PluginManagerContent.kt | 36 +- .../compose/plugins/PluginManagerDialogs.kt | 6 +- .../ui/compose/templates/TemplateListItem.kt | 14 +- .../templates/TemplateManagerDialogs.kt | 12 +- .../templates/TemplateManagerScreen.kt | 26 +- .../ui/compose/theme/ManagerTheme.kt | 2 +- .../ui/models/ExternalFileInstallUiModels.kt | 4 +- .../codeonthego}/ui/models/OutlineUiState.kt | 6 +- .../ui/models/PluginManagerUiState.kt | 10 +- .../ui/models/TemplateManagerUiState.kt | 4 +- .../codeonthego}/ui/outline/OutlinePanel.kt | 10 +- .../codeonthego}/ui/outline/OutlineRows.kt | 4 +- .../codeonthego}/ui/themes/ThemeManager.kt | 6 +- .../ui/transition/ArcMotionPlus.java | 2 +- .../ui/transition/CubicBezierArc.java | 2 +- .../ui/transition/ProgressTransition.java | 4 +- .../codeonthego}/utils/ActionMenuUtils.kt | 16 +- .../codeonthego}/utils/ApkInstaller.kt | 6 +- .../codeonthego}/utils/BuildCancellation.kt | 6 +- .../codeonthego}/utils/BuildInfoUtils.kt | 6 +- .../codeonthego}/utils/ClassBuilder.kt | 8 +- .../utils/DeepLinkProjectResolution.kt | 2 +- .../codeonthego}/utils/DevicePowerSource.kt | 10 +- .../utils/DiagnosticsFormatter.kt | 6 +- .../codeonthego}/utils/DropHighlighter.kt | 2 +- .../utils/EditorActivityActions.kt | 96 +- .../utils/EditorDecorationBridge.kt | 10 +- .../utils/EditorRightSidebarActions.kt | 0 .../utils/EditorSidebarActions.kt | 44 +- .../codeonthego}/utils/FileDeleteUtils.kt | 2 +- .../codeonthego}/utils/FileImporter.kt | 4 +- .../codeonthego}/utils/FlexboxUtils.kt | 2 +- .../codeonthego}/utils/FragmentUtils.kt | 2 +- .../codeonthego}/utils/HtmlTextUtils.kt | 2 +- .../codeonthego}/utils/InstallTempFiles.kt | 2 +- .../utils/InstallationResultHandler.kt | 4 +- .../codeonthego}/utils/InstallerIoUtils.kt | 2 +- .../codeonthego}/utils/IntentUtils.kt | 4 +- .../codeonthego}/utils/JSONUtility.java | 68 +- .../codeonthego}/utils/JdkUtils.kt | 8 +- .../codeonthego}/utils/LastValueGate.kt | 2 +- .../codeonthego}/utils/ListingFileRedirect.kt | 2 +- .../codeonthego}/utils/MainScreenActions.kt | 22 +- .../codeonthego}/utils/MemoryUsageWatcher.kt | 4 +- .../utils/MetricsAnnotationStore.kt | 2 +- .../codeonthego}/utils/MetricsCsv.kt | 2 +- .../codeonthego}/utils/MetricsCsvFile.kt | 2 +- .../codeonthego}/utils/MetricsFileName.kt | 2 +- .../utils/MetricsSamplingRates.kt | 6 +- .../codeonthego}/utils/MetricsScratch.kt | 2 +- .../codeonthego}/utils/MetricsSnapshot.kt | 2 +- .../utils/MetricsSnapshotAssembler.kt | 2 +- .../codeonthego}/utils/MetricsSource.kt | 2 +- .../utils/MutableShiftedLongArray.kt | 2 +- .../codeonthego}/utils/NetworkUsageWatcher.kt | 4 +- .../utils/NoOpServiceConnection.kt | 2 +- .../utils/OverlayPermissionGuide.kt | 2 +- .../codeonthego}/utils/PermissionsHelper.kt | 4 +- .../codeonthego}/utils/PowerUsageWatcher.kt | 4 +- .../codeonthego}/utils/PrivilegedActions.kt | 4 +- .../codeonthego}/utils/ProcessMemoryReader.kt | 2 +- .../utils/ProjectCreationManager.kt | 16 +- .../codeonthego}/utils/ProjectLocation.kt | 2 +- .../utils/ProjectOpenBookkeeping.kt | 22 +- .../utils/ProjectSearchOptions.kt | 2 +- .../utils/ProjectStringsXmlResolver.kt | 2 +- .../codeonthego}/utils/ProjectValidations.kt | 2 +- .../codeonthego}/utils/ProjectWriter.java | 4 +- .../utils/RecentProjectLocationReconciler.kt | 6 +- .../utils/RecursiveFileSearcher.java | 10 +- .../codeonthego}/utils/ShiftedLongArray.kt | 2 +- .../utils/SingleBottomSheetCallback.kt | 2 +- .../codeonthego}/utils/StorageSizeUtils.kt | 2 +- .../codeonthego}/utils/StorageUtils.kt | 2 +- .../codeonthego}/utils/StringsXmlInjector.kt | 4 +- .../codeonthego}/utils/Symbols.kt | 4 +- .../utils/TemplateRecipeExecutor.kt | 8 +- .../utils/TerminalInstallResultExtensions.kt | 2 +- .../codeonthego}/utils/TerminalInstaller.kt | 2 +- .../utils/TextWatcherAdapter.java | 2 +- .../codeonthego}/utils/UriFileImporter.kt | 2 +- .../utils/WindowInsetsExtensions.kt | 2 +- .../codeonthego}/utils/WordBoundary.kt | 2 +- .../codeonthego}/utils/ZipExts.kt | 2 +- .../utils/ui/TemplateScrollGateKeeper.kt | 2 +- .../viewmodel/ApkInstallationViewModel.kt | 6 +- .../viewmodel/AppLogsCoordinator.kt | 14 +- .../viewmodel/AppLogsViewModel.kt | 2 +- .../viewmodel/BottomSheetViewModel.kt | 4 +- .../viewmodel/BuildOutputViewModel.kt | 8 +- .../codeonthego}/viewmodel/BuildState.kt | 2 +- .../viewmodel/BuildVariantsViewModel.kt | 4 +- .../codeonthego}/viewmodel/BuildViewModel.kt | 32 +- .../viewmodel/CloneRepositoryViewModel.kt | 12 +- .../viewmodel/DebuggerViewModel.kt | 22 +- .../codeonthego}/viewmodel/EditorViewModel.kt | 22 +- .../viewmodel/EmptyStateFragmentViewModel.kt | 2 +- .../viewmodel/FileManagerViewModel.kt | 8 +- .../viewmodel/FileTreeViewModel.kt | 6 +- .../viewmodel/GitBottomSheetViewModel.kt | 32 +- .../viewmodel/IDELogsViewModel.kt | 8 +- .../viewmodel/InstallationState.kt | 2 +- .../viewmodel/InstallationViewModel.kt | 30 +- .../codeonthego}/viewmodel/LogViewModel.kt | 18 +- .../codeonthego}/viewmodel/MainViewModel.kt | 6 +- .../viewmodel/MetricsViewModel.kt | 14 +- .../viewmodel/OutlineViewModel.kt | 10 +- .../viewmodel/RecentProjectsViewModel.kt | 26 +- .../viewmodel/RunTasksViewModel.kt | 6 +- .../codeonthego}/viewmodel/TaskState.kt | 6 +- .../viewmodel/WADBConnectionViewModel.kt | 4 +- .../ExternalFileInstallViewModel.kt | 18 +- .../viewmodels/PluginManagerViewModel.kt | 28 +- .../viewmodels/TemplateManagerViewModel.kt | 14 +- .../main/res/layout-land/activity_about.xml | 2 +- .../main/res/layout-land/content_editor.xml | 4 +- .../layout-land/fragment_editor_sidebar.xml | 2 +- .../res/layout-sw600dp/activity_about.xml | 2 +- .../fragment_editor_sidebar.xml | 2 +- .../main/res/layout-v30/fragment_debugger.xml | 2 +- app/src/main/res/layout/activity_about.xml | 2 +- app/src/main/res/layout/activity_editor.xml | 10 +- app/src/main/res/layout/activity_main.xml | 14 +- .../main/res/layout/activity_preferences.xml | 2 +- app/src/main/res/layout/content_editor.xml | 4 +- .../res/layout/fragment_editor_sidebar.xml | 2 +- .../main/res/layout/fragment_empty_state.xml | 2 +- app/src/main/res/layout/fragment_log.xml | 2 +- .../layout/fragment_non_editable_editor.xml | 2 +- .../main/res/layout/item_metrics_chart.xml | 2 +- .../res/layout/layout_editor_bottom_sheet.xml | 2 +- app/src/main/res/layout/layout_mem_usage.xml | 4 +- .../res/layout/layout_project_info_sheet.xml | 22 +- .../codeonthego}/app/LeakCanaryConfig.kt | 2 +- .../quickbuild/QuickBuildBenchHooks.kt | 4 +- .../build/QuickBuildActionPresentationTest.kt | 2 +- .../build/QuickBuildActionSaveOrderTest.kt | 2 +- .../actions/build/SlotBusyBuildActionsTest.kt | 18 +- .../build/StandardRunClobberDecisionTest.kt | 2 +- .../actions/file/CreateLinkActionTest.kt | 4 +- .../actions/file/SaveFollowUpTest.kt | 4 +- .../actions/profiler/ReleaseVariantTest.kt | 2 +- .../activities/DeepLinkSetupGateTest.kt | 10 +- .../DeepLinkTargetsNotExportedTest.kt | 4 +- .../editor/DebuggerServiceUnbindTest.kt | 6 +- .../editor/EditorHandlerActivityTest.kt | 4 +- .../editor/MemUsageLineColorTest.kt | 6 +- .../editor/OverlappingSaveFlagTest.kt | 4 +- .../QuickBuildClobberConfirmationTest.kt | 2 +- .../editor/RestorePluginTabsThreadTest.kt | 6 +- .../editor/SameProjectDeepLinkMidSyncTest.kt | 10 +- .../activities/editor/SaveFileResultTest.kt | 6 +- .../activities/editor/SaveResultFlagsTest.kt | 4 +- .../analytics/AnalyticsManagerConsentTest.kt | 2 +- .../analytics/AttachedDevicesCollectorTest.kt | 2 +- .../analytics/AttachedDevicesMetricTest.kt | 2 +- .../analytics/BuildCompletedMetricTest.kt | 10 +- .../analytics/DeepLinkMetricTest.kt | 6 +- .../AnalyticsQuickBuildMetricsSinkTest.kt | 6 +- .../api/BuildOutputProviderMainThreadTest.kt | 4 +- .../api/BuildOutputProviderTest.kt | 10 +- .../codeonthego}/api/LogsProviderTest.kt | 18 +- .../app/ForegroundActivityTrackingTest.kt | 2 +- .../app/PluginRunAppCoordinatorTest.kt | 6 +- .../app/TelemetryConsentMigrationTest.kt | 4 +- .../IDEBuildConfigProviderImplTest.kt | 2 +- .../assets/AssetsInstallationHelperTest.kt | 8 +- .../assets/ExtractZipToDirMergeTest.kt | 2 +- .../deeplink/ConsumedRequestsTest.kt | 4 +- .../FloatingWindowProjectCloseTest.kt | 12 +- .../fragments/IDEPreferencesFragmentTest.kt | 10 +- .../fragments/ScrollIndicatorBlinkTest.kt | 4 +- .../TemplateDetailsBlinkLifecycleTest.kt | 6 +- .../fragments/git/GitCommitWatermarkTest.kt | 2 +- .../output/BuildOutputFragmentDetachedTest.kt | 2 +- .../output/FilterNoMatchTrackerTest.kt | 2 +- .../sheets/ProgressSheetDismissTest.kt | 4 +- .../EditorBuildEventListenerAnnotationTest.kt | 26 +- .../GlitchTipDiagnosticsContextTest.kt | 8 +- .../MetricsCrashAttachmentEnvelopeTest.kt | 14 +- .../handlers/MetricsCrashAttachmentTest.kt | 16 +- .../handlers/SnippetHandlerTest.kt | 14 +- .../localWebServer/AcceptFailureTest.kt | 2 +- .../localWebServer/BookshelfPayloadTest.kt | 2 +- .../localWebServer/BookshelfQueryTest.kt | 2 +- .../BrotliDictionaryDecodeTest.kt | 10 +- .../localWebServer/TestServerConfig.kt | 2 +- .../localWebServer/WebServerTest.kt | 4 +- .../codeonthego}/logs/LogBufferTest.kt | 6 +- .../lsp/ComputeNewBreakpointPositionTest.kt | 6 +- .../lsp/SearchResultGroupingTest.kt | 8 +- .../models/DeepLinkBuildUrlTest.kt | 2 +- .../models/DeepLinkManifestPrefixTest.kt | 4 +- .../models/DeepLinkRequestTest.kt | 2 +- .../models/InstallTaskRequestTest.kt | 2 +- .../codeonthego}/models/LogFilterTest.kt | 4 +- .../preferences/GitPreferencesTest.kt | 4 +- .../IDEPreferencesTooltipTagsTest.kt | 4 +- .../preferences/PluginPrefExtsTest.kt | 6 +- .../PluginSettingsEntryPreferenceTest.kt | 2 +- .../preferences/StatPreferencesTest.kt | 8 +- .../quickbuild/AndroidProxyAppLauncherTest.kt | 2 +- .../quickbuild/ApkSigningCertTest.kt | 2 +- .../CompositeQuickBuildMetricsSinkTest.kt | 2 +- .../EnvironmentQuickBuildPathsD8Test.kt | 4 +- .../GenerateSourcesDeferralEntryPointTest.kt | 2 +- .../quickbuild/GenerateSourcesDeferralTest.kt | 2 +- .../GradleQuickBuildProvisionerAwaitTest.kt | 2 +- ...GradleQuickBuildProvisionerBaselineTest.kt | 4 +- .../GradleQuickBuildProvisionerCancelTest.kt | 18 +- ...dleQuickBuildProvisionerFailureArmsTest.kt | 8 +- .../GradleQuickBuildProvisionerFakes.kt | 30 +- ...GradleQuickBuildProvisionerMessagesTest.kt | 2 +- .../GradleQuickBuildProvisionerSigningTest.kt | 2 +- .../GradleQuickBuildProvisionerSlotTest.kt | 18 +- .../GradleQuickBuildProvisionerStampTest.kt | 2 +- .../quickbuild/InstallationEventFlowTest.kt | 4 +- .../PreferencesQuickBuildHistoryStoreTest.kt | 2 +- .../QuickBuildArtifactStagerTest.kt | 2 +- .../quickbuild/QuickBuildFlashesTest.kt | 4 +- .../quickbuild/QuickBuildGraphWarmUpTest.kt | 2 +- .../quickbuild/QuickBuildMessagesTest.kt | 2 +- .../quickbuild/QuickBuildOutputLinesTest.kt | 2 +- .../QuickBuildOutputMetricsSinkTest.kt | 2 +- .../QuickBuildOutputNarratorTest.kt | 2 +- .../QuickBuildPrebuildDecisionTest.kt | 2 +- .../QuickBuildPrebuildStaggerTest.kt | 2 +- .../QuickBuildProjectSupportTest.kt | 2 +- .../quickbuild/QuickBuildStatusBarTest.kt | 2 +- .../quickbuild/QuickBuildStatusStringsTest.kt | 2 +- .../quickbuild/QuickBuildTaskPathsTest.kt | 2 +- .../QuickBuildWontStayUpRestartTest.kt | 2 +- .../TemplateCollectionRepositoryImplTest.kt | 6 +- .../TemplateRepositoryImplTest.kt | 10 +- .../RecentProjectRoomDatabaseTest.kt | 2 +- .../search/replace/OpenTabUndoTest.kt | 2 +- .../search/replace/ProjectReplacerTest.kt | 6 +- .../search/replace/ReplaceSessionTest.kt | 6 +- .../search/replace/TextReplacementTest.kt | 8 +- .../services/builder/GradleBuildParamsTest.kt | 4 +- .../GradleBuildServiceListenerWrapperTest.kt | 6 +- ...radleBuildServiceNotificationStatusTest.kt | 4 +- .../GradleBuildServiceServerExitTest.kt | 10 +- .../services/builder/GradleBuildTunerTest.kt | 2 +- .../builder/InternalBuildBracketTest.kt | 2 +- .../builder/InternalBuildOutputCaptureTest.kt | 2 +- .../builder/ToolingServerRunnerTest.kt | 22 +- .../debug/DebuggerServiceDestroyTest.kt | 4 +- .../manager/models/CgtFileItemTest.kt | 2 +- .../manager/parsing/CgtTemplateReaderTest.kt | 2 +- .../codeonthego}/ui/ChartGestureHarness.kt | 6 +- .../codeonthego}/ui/ChartLayout.kt | 2 +- .../ui/CollapsedHeaderHeightTest.kt | 2 +- .../ui/IdeNavigationRailViewTest.kt | 2 +- .../ui/LongPressHelpTimingTest.kt | 10 +- .../ui/MemoryUsageChartRendererTest.kt | 8 +- .../ui/MetricsAnnotationRenderingTest.kt | 8 +- .../ui/MetricsAnnotationSpanTest.kt | 6 +- .../ui/MetricsCarouselAdapterTest.kt | 4 +- .../ui/MetricsCarouselHelpTest.kt | 12 +- .../ui/MetricsCarouselLayoutTest.kt | 2 +- .../ui/MetricsCarouselRebindTest.kt | 8 +- .../ui/MetricsChartAxisTapTest.kt | 4 +- .../ui/MetricsChartGestureTeardownTest.kt | 2 +- .../ui/MetricsChartHoldHelpTest.kt | 4 +- .../ui/MetricsChartLargeTextTest.kt | 4 +- .../ui/MetricsChartLegendFormTest.kt | 10 +- .../ui/MetricsChartNewestWindowTest.kt | 4 +- .../ui/MetricsChartTextScaleTest.kt | 6 +- .../ui/NetworkUsageChartRendererTest.kt | 4 +- .../ui/PowerUsageChartRendererTest.kt | 6 +- .../codeonthego}/ui/SafeLineChartTest.kt | 2 +- .../ui/outline/OutlineRowsTest.kt | 10 +- .../codeonthego}/utils/ClassBuilderTest.kt | 6 +- .../utils/DevicePowerEnvelopeTest.kt | 2 +- .../codeonthego}/utils/FeatureFlagsTest.kt | 6 +- .../utils/FileActionPopupLayoutTest.kt | 2 +- .../codeonthego}/utils/FileDeleteUtilsTest.kt | 4 +- ...allationResultHandlerSuppressLaunchTest.kt | 4 +- .../utils/IntentUtilsShareTest.kt | 2 +- .../codeonthego}/utils/JdkUtilsTest.kt | 2 +- .../utils/MemoryUsageWatcherIntervalTest.kt | 2 +- .../utils/MemoryUsageWatcherLivenessTest.kt | 2 +- .../MemoryUsageWatcherReaderFallbackTest.kt | 2 +- .../MemoryUsageWatcherSampleAlignmentTest.kt | 2 +- .../utils/MetricsAnnotationStoreTest.kt | 2 +- .../codeonthego}/utils/MetricsCsvFileTest.kt | 2 +- .../codeonthego}/utils/MetricsCsvTest.kt | 2 +- .../codeonthego}/utils/MetricsFileNameTest.kt | 2 +- .../utils/MetricsSamplingRatesTest.kt | 4 +- .../codeonthego}/utils/MetricsScratchTest.kt | 2 +- .../codeonthego}/utils/MetricsSnapshotTest.kt | 2 +- .../utils/NetworkUsageWatcherTest.kt | 2 +- .../utils/NetworkWatcherLifecycleTest.kt | 2 +- .../utils/PowerUsageWatcherTest.kt | 6 +- .../utils/ProcessMemoryReaderTest.kt | 2 +- .../codeonthego}/utils/ProjectLocationTest.kt | 2 +- .../utils/ProjectValidationsTest.kt | 2 +- .../RecentProjectLocationReconcilerTest.kt | 4 +- .../utils/RecursiveFileSearcherTest.kt | 2 +- .../codeonthego}/utils/ShiftedArrayTest.kt | 2 +- .../utils/ShiftedLongArrayCopyIntoTest.kt | 2 +- .../utils/WatcherIntervalChangeTest.kt | 2 +- .../utils/WatcherLifecycleTest.kt | 2 +- .../codeonthego}/utils/WordBoundaryTest.kt | 2 +- .../ApkInstallationViewModelDestroyTest.kt | 4 +- ...pkInstallationViewModelReloadStatusTest.kt | 4 +- .../viewmodel/BuildOutputFilterTest.kt | 2 +- .../viewmodel/BuildOutputSessionSinkTest.kt | 2 +- .../BuildViewModelInstallReArmTest.kt | 2 +- .../viewmodel/BuildViewModelTest.kt | 16 +- .../viewmodel/CloneRepositoryViewModelTest.kt | 10 +- .../viewmodel/EditorViewModelSaveFlagTest.kt | 2 +- .../viewmodel/EditorViewModelTest.kt | 2 +- .../EmptyStateFragmentViewModelTest.kt | 2 +- .../viewmodel/GitBottomSheetViewModelTest.kt | 22 +- .../viewmodel/LogViewModelTest.kt | 8 +- .../viewmodel/MainDispatcherRule.kt | 2 +- .../viewmodel/MetricsViewModelTest.kt | 2 +- .../viewmodel/OutlineViewModelTest.kt | 18 +- .../ExternalFileInstallViewModelTest.kt | 12 +- .../TemplateManagerViewModelTest.kt | 16 +- .../quickbuild/BenchEventsFileTest.kt | 2 +- .../BenchQuickBuildMetricsSinkTest.kt | 2 +- .../quickbuild/BenchStateRecorderTest.kt | 2 +- .../QuickBuildBenchActivityGateTest.kt | 2 +- .../QuickBuildBenchHooksInertTest.kt | 4 +- assets/core.cgt | Bin 1626091 -> 1626190 bytes .../common/compose/IdeColorScheme.kt | 2 +- .../codeonthego}/common/compose/IdeTheme.kt | 2 +- .../common/compose/IdeColorSchemeTest.kt | 2 +- .../codeonthego}/DraggableTouchListener.kt | 2 +- .../codeonthego}/FabPositionCalculator.kt | 4 +- .../codeonthego}/FabPositionRepository.kt | 2 +- .../codeonthego}/FeedbackButtonManager.kt | 8 +- .../utils/DatabaseVersionResolverTest.kt | 2 +- .../utils/FlashActivityUtilsKtTest.kt | 4 +- .../activities/editor/HelpActivity.kt | 14 +- .../adapters/IconTextAdapter.java | 2 +- .../adapters/IconTitleDescriptionAdapter.kt | 4 +- .../adapters/SimpleIconTextAdapter.java | 116 +- .../SimpleIconTitleDescriptionAdapter.kt | 4 +- .../codeonthego}/app/BaseApplication.kt | 8 +- .../codeonthego}/app/BaseIDEActivity.kt | 10 +- .../codeonthego}/app/configuration/CpuArch.kt | 2 +- .../configuration/IDEBuildConfigProvider.kt | 4 +- .../configuration/IJdkDistributionProvider.kt | 6 +- .../colorpicker/ColorPickerView.java | 456 ++-- .../documentation/DatabaseTemplateLoader.kt | 2 +- .../DocumentationContentSource.kt | 6 +- .../DocumentationRequestInterceptor.kt | 6 +- .../codeonthego}/fragments/BaseFragment.kt | 10 +- .../fragments/FragmentWithBinding.kt | 2 +- .../codeonthego}/interfaces/Filter.java | 2 +- .../interfaces/ProjectWriterCallback.java | 2 +- .../managers/NoopSharedPreferencesImpl.kt | 2 +- .../managers/PreferenceManager.kt | 6 +- .../codeonthego}/managers/ToolsManager.java | 20 +- .../codeonthego}/models/Constants.java | 98 +- .../codeonthego}/models/IconTextListItem.java | 82 +- .../models/IconTitleDescriptionItem.kt | 4 +- .../codeonthego}/models/JdkDistribution.kt | 2 +- .../codeonthego}/models/SaveResult.java | 2 +- .../codeonthego}/models/SheetOption.java | 2 +- .../models/SimpleIconTitleDescriptionItem.kt | 2 +- .../codeonthego}/shell/IProcessBuilder.kt | 4 +- .../codeonthego}/shell/ProcessBuilderImpl.kt | 4 +- .../codeonthego}/shell/shellUtils.kt | 2 +- .../syntax/colorschemes/DynamicColorScheme.kt | 6 +- .../syntax/colorschemes/SchemeAndroidIDE.java | 2 +- .../decoration/EditorDecorationRegistry.kt | 4 +- .../syntax/highlighters/Highlighter.java | 4 +- .../syntax/highlighters/JavaHighlighter.java | 4 +- .../codeonthego}/tasks/TaskExecutor.kt | 2 +- .../codeonthego}/tasks/coroutineUtils.kt | 8 +- .../codeonthego}/templates/Language.kt | 2 +- .../ui/BottomInsetHeightDistributor.kt | 4 +- .../ui/ContentTranslatingDrawerLayout.kt | 2 +- .../ui/InterceptableDrawerLayout.kt | 2 +- .../codeonthego}/ui/ProjectActionsToolbar.kt | 2 +- .../codeonthego}/ui/themes/IDETheme.kt | 2 +- .../codeonthego}/ui/themes/IThemeManager.kt | 4 +- .../codeonthego}/utils/AndroidUtils.java | 4 +- .../codeonthego}/utils/BuildInfoUtils.kt | 2 +- .../utils/CharSequenceInputStream.java | 2 +- .../utils/CharSequenceReader.java | 2 +- .../codeonthego}/utils/CollectionExts.kt | 2 +- .../codeonthego}/utils/ColorUtil.kt | 2 +- .../codeonthego}/utils/ContentTypeHeaders.kt | 2 +- .../codeonthego}/utils/ContextUtils.kt | 2 +- .../utils/DatabaseVersionResolver.kt | 2 +- .../codeonthego}/utils/DateFormatter.kt | 2 +- .../codeonthego}/utils/DeviceFormFactor.kt | 2 +- .../codeonthego}/utils/DeviceUtils.kt | 2 +- .../codeonthego}/utils/DialogUtils.kt | 364 +-- .../utils/DocumentationCompression.kt | 2 +- .../codeonthego}/utils/EdgeToEdgeUtils.java | 2 +- .../codeonthego}/utils/Environment.java | 4 +- .../codeonthego}/utils/FeatureFlags.kt | 2 +- .../utils/FeedbackEmailHandler.kt | 2 +- .../codeonthego}/utils/FeedbackManager.kt | 4 +- .../codeonthego}/utils/FileProviderUtils.kt | 2 +- .../codeonthego}/utils/FileUtil.java | 2 +- .../codeonthego}/utils/FileUtils.kt | 2 +- .../utils/FlashbarActivityUtils.kt | 14 +- .../codeonthego}/utils/FlashbarDismissGate.kt | 2 +- .../codeonthego}/utils/FlashbarUtils.kt | 6 +- .../codeonthego}/utils/FragmentExts.kt | 2 +- .../utils/GetProjectBuildVersions.kt | 4 +- .../codeonthego}/utils/GetProjectDetails.kt | 2 +- .../codeonthego}/utils/ImageUtils.kt | 2 +- .../codeonthego}/utils/InsetUtils.kt | 2 +- .../codeonthego}/utils/IntProperty.java | 2 +- .../codeonthego}/utils/IntentExtensions.kt | 2 +- .../codeonthego}/utils/JavaCharacter.java | 2 +- .../codeonthego}/utils/KeyboardUtils.kt | 2 +- .../utils/KeyedDebouncingAction.kt | 6 +- .../codeonthego}/utils/LSPUtils.java | 6 +- .../utils/LegacyIdeDataDirMigration.java | 2 +- .../codeonthego}/utils/ManufacturerUtils.kt | 2 +- .../codeonthego}/utils/NavigationBar.kt | 2 +- .../utils/OrientationUtilities.kt | 2 +- .../codeonthego}/utils/PathTraversal.kt | 2 +- .../codeonthego}/utils/ProjectAttrs.kt | 2 +- .../codeonthego}/utils/ReflectUtils.kt | 2 +- .../codeonthego}/utils/ResourceUtils.kt | 4 +- .../codeonthego}/utils/SelfSignedCert.kt | 2 +- .../utils/SingleSessionCallback.kt | 2 +- .../codeonthego}/utils/SingleTextWatcher.java | 2 +- .../codeonthego}/utils/SparseArrayUtils.kt | 2 +- .../codeonthego}/utils/StrictModeExts.kt | 2 +- .../utils/TermuxProcessEnvironment.kt | 2 +- .../codeonthego}/utils/TestModeUtils.kt | 2 +- .../codeonthego}/utils/TypefaceUtils.kt | 4 +- .../codeonthego}/utils/UriExtensions.kt | 2 +- .../codeonthego}/utils/ViewExtensions.kt | 2 +- .../utils/WindowInsetExtensions.kt | 2 +- .../codeonthego}/utils/WindowUtils.kt | 2 +- .../codeonthego}/utils/ZipUtils.kt | 4 +- .../codeonthego}/utils/buildVersionExt.kt | 2 +- .../codeonthego}/utils/connectionUtilExt.kt | 2 +- .../codeonthego}/utils/ioUtils.kt | 2 +- .../codeonthego}/utils/urlManager.kt | 4 +- .../window/ActivityCompatHelper.kt | 2 +- .../codeonthego}/window/Bounds.kt | 2 +- .../window/DisplayCompatHelper.kt | 2 +- .../codeonthego}/window/WindowManager.kt | 6 +- .../codeonthego}/window/WindowMetrics.kt | 2 +- .../window/WindowMetricsCalculator.kt | 2 +- .../window/WindowMetricsCalculatorCompat.kt | 18 +- .../DatabaseTemplateLoaderTest.kt | 2 +- .../DocumentationContentSourceTest.kt | 2 +- .../DocumentationRequestInterceptorTest.kt | 2 +- .../managers/ToolsManagerToolingJarTest.kt | 2 +- .../codeonthego}/utils/BasicBuildInfoTest.kt | 2 +- .../utils/ContentTypeHeadersTest.kt | 2 +- .../DatabaseVersionResolverBranchTest.kt | 2 +- .../codeonthego}/utils/FeatureFlagsTest.kt | 2 +- .../utils/FeedbackMetricsAttachmentTest.kt | 2 +- .../utils/FileProviderUtilsTest.kt | 2 +- .../codeonthego}/utils/FileUtilsTest.kt | 2 +- .../utils/FlashbarDismissGateTest.kt | 2 +- .../utils/GetProjectBuildVersionsTest.kt | 2 +- .../codeonthego}/utils/ImageUtilsTest.kt | 2 +- .../utils/KeyedDebouncingActionCancelTest.kt | 2 +- .../KeyedDebouncingActionSelfScheduleTest.kt | 2 +- .../codeonthego}/utils/PathTraversalTest.kt | 4 +- .../codeonthego}/utils/ReflectUtilsTest.kt | 2 +- .../codeonthego}/utils/ResourceUtilsTest.kt | 4 +- .../codeonthego}/utils/SelfSignedCertTest.kt | 2 +- .../codeonthego}/utils/SymlinkTestSupport.kt | 2 +- .../codeonthego}/utils/ZipUtilsTest.kt | 2 +- docs/PLUGIN_API_CHANGELOG.md | 12 +- docs/PLUGIN_AUTHORING.md | 8 +- docs/features/java-extract-method.md | 6 +- docs/features/kotlin-goto-definition.md | 2 +- docs/plugin-api.md | 4 +- .../codeonthego}/editor/api/IEditor.java | 6 +- .../codeonthego}/editor/api/ILspEditor.kt | 10 +- .../treesitter/api/TreeSitterInputEdit.kt | 4 +- .../api/TreeSitterLookaheadIterator.kt | 4 +- .../api/TreeSitterNativeLanguage.kt | 4 +- .../treesitter/api/TreeSitterNode.kt | 4 +- .../treesitter/api/TreeSitterObjectFactory.kt | 0 .../api/TreeSitterObjectPoolProvider.kt | 10 +- .../treesitter/api/TreeSitterParser.kt | 4 +- .../treesitter/api/TreeSitterPoint.kt | 4 +- .../treesitter/api/TreeSitterQuery.kt | 4 +- .../treesitter/api/TreeSitterQueryCapture.kt | 4 +- .../treesitter/api/TreeSitterQueryCursor.kt | 4 +- .../treesitter/api/TreeSitterQueryMatch.kt | 4 +- .../api/TreeSitterQueryPredicateStep.kt | 4 +- .../treesitter/api/TreeSitterRange.kt | 4 +- .../treesitter/api/TreeSitterTree.kt | 4 +- .../treesitter/api/TreeSitterTreeCursor.kt | 4 +- .../api/TreeSitterTreeCursorNode.kt | 4 +- .../treesitter/api/tsRecyclableUtils.kt | 2 +- .../codeonthego}/treesitter/api/tsUtils.kt | 0 .../sora/editor/ts/LineSpansGenerator.kt | 4 +- .../rosemoe/sora/editor/ts/TsAnalyzeWorker.kt | 2 +- .../codeonthego}/treesitter/nodeExt.kt | 0 .../codeonthego}/treesitter/pointExt.kt | 0 .../outline/TreeSitterOutlineProviderTest.kt | 2 +- .../outline/TreeSitterOutlineQueryTest.kt | 2 +- .../treesitter/LineSpansSnapshotTest.kt | 4 +- .../treesitter/TsAnalyzeWorkerStopTest.kt | 6 +- .../rosemoe/sora/widget/IDEEditorSearcher.kt | 2 +- .../editor/adapters/CompletionListAdapter.kt | 46 +- .../editor/adapters/IdeEditorAdapter.kt | 6 +- .../editor/events/FileUpdateEvent.kt | 2 +- .../editor/events/LanguageUpdateEvent.kt | 2 +- .../language/CommonCompletionProvider.kt | 198 +- .../language/CompletionCancelChecker.kt | 4 +- .../editor/language/IDELanguage.kt | 20 +- .../editor/language/LSPFormatter.kt | 18 +- .../editor/language/cpp/CppAnalyzer.java | 22 +- .../editor/language/cpp/CppLanguage.java | 8 +- .../editor/language/groovy/GroovyAnalyzer.kt | 10 +- .../language/groovy/GroovyAutoComplete.java | 8 +- .../language/groovy/GroovyLanguage.java | 10 +- .../BaseIncrementalAnalyzeManager.java | 12 +- .../language/incremental/IncrementalToken.kt | 2 +- .../editor/language/incremental/LineState.kt | 2 +- .../language/newline/BaseNewlineHandler.kt | 2 +- .../newline/BracketsNewlineHandler.kt | 2 +- .../language/newline/CStyleBracketsHandler.kt | 2 +- .../language/newline/TSBracketsHandler.kt | 4 +- .../newline/TSCStyleBracketsHandler.kt | 4 +- .../language/outline/OutlineProvider.kt | 2 +- .../editor/language/outline/OutlineSymbol.kt | 4 +- .../language/outline/OutlineTreeBuilder.kt | 4 +- .../outline/TreeSitterOutlineProvider.kt | 16 +- .../language/treesitter/JavaLanguage.kt | 16 +- .../language/treesitter/JsonLanguage.kt | 4 +- .../language/treesitter/KotlinLanguage.kt | 14 +- .../editor/language/treesitter/LogLanguage.kt | 4 +- .../treesitter/PluginTreeSitterLanguage.kt | 14 +- .../language/treesitter/TSLanguageRegistry.kt | 4 +- .../treesitter/TreeSitterAnalyzeManager.kt | 4 +- .../treesitter/TreeSitterIndentProvider.kt | 10 +- .../language/treesitter/TreeSitterLanguage.kt | 18 +- .../treesitter/TreeSitterLanguageProvider.kt | 2 +- .../treesitter/TreeSitterLanguageSpec.kt | 2 +- .../treesitter/TreeSitterSpanFactory.kt | 8 +- .../editor/language/treesitter/XMLLanguage.kt | 10 +- .../editor/language/treesitter/common.kt | 4 +- .../internal/TSLanguageRegistryImpl.kt | 6 +- .../treesitter/predicates/AnyOfPredicate.kt | 2 +- .../treesitter/predicates/EqualPredicate.kt | 2 +- .../predicates/InvertingPredicate.kt | 2 +- .../treesitter/predicates/MatchPredicate.kt | 2 +- .../predicates/NotEqualPredicate.kt | 2 +- .../predicates/NotMatchPredicate.kt | 2 +- .../predicates/TreeSitterPredicate.kt | 2 +- .../language/utils/CommonSymbolPairs.kt | 2 +- .../editor/language/utils/CompletionHelper.kt | 2 +- .../editor/processing/SimpleMacroProcessor.kt | 2 +- .../editor/processing/TextProcessor.kt | 2 +- .../editor/processing/TextProcessorEngine.kt | 2 +- .../editor/schemes/IDEColorScheme.kt | 8 +- .../editor/schemes/IDEColorSchemeProvider.kt | 12 +- .../editor/schemes/LanguageSpecProvider.kt | 14 +- .../schemes/LocalCaptureSpecProvider.kt | 2 +- .../internal/parser/EditorSchemeParser.kt | 6 +- .../schemes/internal/parser/LanguageParser.kt | 8 +- .../schemes/internal/parser/ParseException.kt | 2 +- .../schemes/internal/parser/SchemeParser.kt | 6 +- .../editor/schemes/internal/parser/common.kt | 10 +- .../AbstractSnippetVariableResolver.kt | 2 +- .../editor/snippets/FileVariableResolver.kt | 6 +- .../snippets/WorkspaceVariableResolver.kt | 4 +- .../editor/ui/AbstractPopupWindow.kt | 2 +- .../editor/ui/BaseEditorWindow.java | 4 +- .../editor/ui/DiagnosticWindow.kt | 4 +- .../editor/ui/EditorActionsMenu.kt | 48 +- .../editor/ui/EditorCompletionLayout.kt | 2 +- .../editor/ui/EditorCompletionWindow.kt | 14 +- .../editor/ui/EditorEventDispatcher.kt | 22 +- .../codeonthego}/editor/ui/EditorFeatures.kt | 12 +- .../editor/ui/EditorSearchLayout.kt | 16 +- .../editor/ui/GhostTextRenderer.kt | 2 +- .../editor/ui/IDECompletionPublisher.kt | 2 +- .../codeonthego}/editor/ui/IDEEditor.kt | 106 +- .../codeonthego}/editor/ui/ReplaceAction.kt | 8 +- .../editor/ui/SignatureHelpWindow.java | 8 +- .../editor/ui/TracingEditorRenderer.kt | 2 +- .../codeonthego}/editor/utils/ContentExt.kt | 4 +- .../editor/utils/ContentReadWrite.kt | 2 +- .../editor/utils/OperatorSelection.kt | 2 +- .../main/res/layout/layout_code_editor.xml | 2 +- .../res/layout/layout_completion_item.xml | 2 +- .../editor/language/LSPFormatterTest.kt | 4 +- .../outline/OutlineQueryCapturesTest.kt | 4 +- .../outline/OutlineTreeBuilderTest.kt | 6 +- .../internal/parser/SchemeParserTest.kt | 4 +- .../editor/ui/SignatureHelpWindowTest.kt | 8 +- .../eventbus/events/BuildEvent.kt | 8 +- .../codeonthego}/eventbus/events/Event.java | 2 +- .../eventbus/events/EventReceiver.kt | 2 +- .../events/editor/ActivityLifecycleEvents.kt | 4 +- .../eventbus/events/editor/DocumentEvents.kt | 4 +- .../eventbus/events/editor/EditorEvents.kt | 4 +- .../events/editor/LayoutEditorEvents.kt | 2 +- .../eventbus/events/file/FileEvents.kt | 4 +- .../events/filetree/FileTreeEvents.kt | 4 +- .../events/plugin/PluginCrashedEvent.kt | 4 +- .../events/preferences/PreferenceEvents.kt | 4 +- .../eventbus/events/project/ProjectEvents.kt | 4 +- .../floating/fragment/OverlayFragmentHost.kt | 4 +- .../floating/model/ChromeControl.kt | 2 +- .../codeonthego}/floating/model/DockAction.kt | 2 +- .../floating/model/DockableContent.kt | 4 +- .../floating/model/DockingEvent.kt | 2 +- .../floating/model/DockingManager.kt | 8 +- .../floating/model/FloatingTab.kt | 4 +- .../floating/permission/OverlayPermission.kt | 2 +- .../floating/service/FloatingTabService.kt | 8 +- .../codeonthego}/floating/ui/FloatingTheme.kt | 4 +- .../floating/ui/FloatingWindowChrome.kt | 6 +- .../floating/window/FloatingWindow.kt | 12 +- .../floating/window/FloatingWindowHost.kt | 2 +- .../floating/window/FloatingWindowState.kt | 4 +- .../floating/window/InitialBounds.kt | 2 +- .../floating/window/OverlayDialogs.kt | 6 +- .../floating/window/OverlayLayoutParams.kt | 2 +- git-core/build.gradle.kts | 2 +- .../codeonthego}/git/core/CryptoManager.kt | 2 +- .../git/core/GitCredentialsManager.kt | 2 +- .../codeonthego}/git/core/GitRepository.kt | 8 +- .../git/core/GitRepositoryManager.kt | 2 +- .../git/core/GitRepositoryUrls.kt | 2 +- .../codeonthego}/git/core/JGitRepository.kt | 12 +- .../git/core/models/CloneRepoUiState.kt | 2 +- .../git/core/models/CommitHistoryUiState.kt | 2 +- .../git/core/models/FileChange.kt | 2 +- .../codeonthego}/git/core/models/GitBranch.kt | 2 +- .../codeonthego}/git/core/models/GitCommit.kt | 2 +- .../codeonthego}/git/core/models/GitStatus.kt | 2 +- .../codeonthego}/git/core/GitModelsTest.kt | 4 +- .../git/core/GitRepositoryManagerTest.kt | 2 +- .../git/core/JGitRepositoryTest.kt | 2 +- .../tooling/api/GradlePluginConfig.java | 2 +- .../tooling/api/ToolingConfig.java | 2 +- .../gradle/AndroidIDEGradlePlugin.kt | 8 +- .../gradle/AndroidIDEInitScriptPlugin.kt | 0 .../codeonthego}/gradle/COTGSettingsPlugin.kt | 4 +- .../codeonthego}/gradle/JdwpPlugin.kt | 0 .../codeonthego}/gradle/LogSenderPlugin.kt | 2 +- .../codeonthego}/gradle/ProfilerPlugin.kt | 2 +- .../codeonthego}/gradle/QuickBuildPlugin.kt | 8 +- .../codeonthego}/gradle/common.kt | 2 +- .../quickbuild/BaselineGenerationAsset.kt | 0 .../gradle/quickbuild/ClassOpener.kt | 0 .../ComponentProxiabilityResolver.kt | 2 +- .../gradle/quickbuild/ProxySourceGenerator.kt | 2 +- .../gradle/quickbuild/QuickBuildJson.kt | 0 .../QuickBuildManifestTransformer.kt | 0 .../gradle/quickbuild/QuickBuildTasks.kt | 2 +- .../quickbuild/RuntimeClassesExtractor.kt | 0 .../gradle/quickbuild/SupertypeResolver.kt | 0 .../gradle/AndroidIDEInitScriptPluginTest.kt | 0 .../gradle/AndroidIDEPluginTest.kt | 2 +- .../gradle/InitScriptClasspathTest.kt | 0 .../gradle/InstallTaskReplacementTest.kt | 2 +- .../gradle/QuickBuildPluginTest.kt | 0 .../gradle/QuickBuildProxyAppBuildTest.kt | 6 +- .../quickbuild/BaselineGenerationAssetTest.kt | 0 .../gradle/quickbuild/ClassOpenerTest.kt | 0 .../ComponentProxiabilityResolverTest.kt | 0 .../quickbuild/ProxySourceGeneratorTest.kt | 2 +- .../gradle/quickbuild/QuickBuildJsonTest.kt | 0 .../QuickBuildManifestTransformerTest.kt | 8 +- .../QuickBuildPayloadTransformTaskTest.kt | 0 .../QuickBuildProxyAppReportTaskTest.kt | 0 .../quickbuild/RuntimeClassesExtractorTest.kt | 0 .../quickbuild/SupertypeResolverTest.kt | 0 .../appdevforall/codeonthego}/gradle/utils.kt | 6 +- .../DatabaseCorruptionException.kt | 2 +- .../idetooltips/DialogExtensions.kt | 6 +- .../idetooltips/IDETooltipItem.kt | 2 +- .../idetooltips/NoTooltipFoundException.kt | 2 +- .../idetooltips/ToolTipManager.kt | 20 +- .../idetooltips/TooltipCategory.kt | 2 +- .../codeonthego}/idetooltips/TooltipTag.kt | 2 +- .../codeonthego}/utils/ViewUtils.kt | 6 +- .../idetooltips/GradleTaskTooltipTagTest.kt | 2 +- .../codeonthego}/lexers/BaseLexerTest.kt | 2 +- .../codeonthego}/lexers/xml/XMLLexerTest.kt | 2 +- .../logging/provider/IdeGlobalLogBuffer.kt | 2 +- .../logging/provider/IdeLogFormatter.kt | 2 +- .../logging/provider/IdeLogSink.kt | 6 +- .../logging/provider/IdeLogger.kt | 2 +- .../logging/provider/IdeLoggerFactory.kt | 2 +- .../provider/IdeSlf4jServiceProvider.kt | 2 +- .../codeonthego}/logging/utils/LogUtils.java | 4 +- .../codeonthego}/utils/ILogger.java | 210 +- .../codeonthego}/utils/LogTagUtils.java | 2 +- .../codeonthego}/utils/StacktraceUtils.java | 202 +- .../provider/IdeGlobalLogBufferTest.kt | 2 +- .../logging/provider/IdeLogFormatterTest.kt | 8 +- .../logging/provider/IdeLogRouterTest.kt | 6 +- .../logging/utils/LogUtilsTest.kt | 2 +- .../logsender/sample/MainActivity.java | 4 +- logsender/src/main/AndroidManifest.xml | 2 +- .../codeonthego}/logsender/ILogReceiver.aidl | 4 +- .../codeonthego}/logsender/ILogSender.aidl | 2 +- .../codeonthego}/logsender/LogSender.java | 8 +- .../logsender/LogSenderService.java | 6 +- .../socket/AbstractSocketCommand.java | 2 +- .../logsender/socket/ISocketCommand.java | 2 +- .../logsender/socket/SenderInfoCommand.java | 2 +- .../logsender/socket/SignalCommand.java | 2 +- .../logsender/socket/SocketCommandParser.java | 2 +- .../logsender/utils/LogReader.java | 6 +- .../logsender/utils/LogSenderInstaller.java | 8 +- .../codeonthego}/logsender/utils/Logger.java | 2 +- .../codeonthego}/lookup/ForwardingLookup.kt | 2 +- .../codeonthego}/lookup/Lookup.java | 2 +- .../codeonthego}/lookup/LookupProvider.java | 8 +- .../lookup/ServiceRegisteredException.java | 2 +- .../lookup/internal/DefaultLookup.java | 6 +- .../codeonthego}/lookup/LookupTest.kt | 6 +- .../lookup/internal/DefaultLookupTest.kt | 8 +- lsp/api/consumer-rules.pro | 2 +- .../lsp/debug/events/BreakpointHitEvent.kt | 18 - .../lsp/actions/CommentLineAction.kt | 18 +- .../lsp/actions/IActionsMenuProvider.kt | 4 +- .../lsp/actions/SurroundWithTryCatch.kt | 8 +- .../lsp/actions/SurroundWithTryCatchAction.kt | 30 +- .../lsp/actions/UncommentLineAction.kt | 18 +- .../lsp/api/AbstractServiceProvider.java | 4 +- .../lsp/api/ConfigurableServiceProvider.java | 4 +- .../lsp/api/DefaultLanguageServerRegistry.kt | 10 +- .../lsp/api/ICompletionProvider.java | 172 +- .../codeonthego}/lsp/api/ILanguageClient.java | 20 +- .../codeonthego}/lsp/api/ILanguageServer.kt | 42 +- .../lsp/api/ILanguageServerRegistry.kt | 6 +- .../codeonthego}/lsp/api/IServerSettings.java | 6 +- .../codeonthego}/lsp/api/helpers.kt | 4 +- .../lsp/debug/DebugClientConnectionResult.kt | 2 +- .../codeonthego}/lsp/debug/IDebugAdapter.kt | 18 +- .../codeonthego}/lsp/debug/IDebugClient.kt | 2 +- .../lsp/debug/IDebugEventHandler.kt | 8 +- .../codeonthego}/lsp/debug/RemoteClient.kt | 2 +- .../lsp/debug/events/BreakpointHitEvent.kt | 18 + .../lsp/debug/events/EventOrResponse.kt | 4 +- .../lsp/debug/events/StepEvent.kt | 10 +- .../lsp/debug/events/StoppedEvent.kt | 4 +- .../lsp/debug/model/BreakpointRequest.kt | 4 +- .../lsp/debug/model/BreakpointResponse.kt | 2 +- .../lsp/debug/model/DapRequest.kt | 4 +- .../lsp/debug/model/DapResponse.kt | 2 +- .../codeonthego}/lsp/debug/model/Location.kt | 2 +- .../codeonthego}/lsp/debug/model/Source.kt | 2 +- .../lsp/debug/model/StepRequest.kt | 4 +- .../lsp/debug/model/StepResponse.kt | 2 +- .../lsp/debug/model/ThreadInfo.kt | 2 +- .../lsp/debug/model/ThreadInfoRequest.kt | 4 +- .../codeonthego}/lsp/debug/model/Variables.kt | 2 +- .../utils/BreakpointNotFoundException.kt | 2 +- .../lsp/internal/model/CachedCompletion.kt | 228 +- .../lsp/snippets/DefaultSnippet.kt | 2 +- .../codeonthego}/lsp/snippets/ISnippet.kt | 2 +- .../lsp/snippets/ISnippetScope.kt | 2 +- .../lsp/snippets/SnippetLanguage.kt | 2 +- .../lsp/snippets/SnippetParser.kt | 8 +- .../lsp/snippets/SnippetRegistry.kt | 2 +- .../lsp/snippets/UserSnippetLoader.kt | 4 +- .../lsp/util/DefaultServerSettings.kt | 4 +- .../codeonthego}/lsp/util/DiagnosticUtil.java | 8 +- .../util/DocumentationReferenceProvider.kt | 10 +- .../lsp/util/LSPEditorActions.java | 100 +- .../lsp/util/NoCompletionsProvider.kt | 50 +- .../lsp/util/PrefBasedServerSettings.java | 110 +- .../codeonthego}/lsp/util/StringUtils.java | 220 +- .../lsp/util/commonCompletionUtils.kt | 16 +- .../lsp/actions/SurroundWithTryCatchTest.kt | 6 +- .../api/DefaultLanguageServerRegistryTest.kt | 36 +- .../lsp/util/DiagnosticUtilTest.kt | 10 +- .../lsp/external/ExternalLanguageServer.kt | 54 +- .../lsp/external/Lsp4jConversions.kt | 32 +- .../external/ExternalLanguageServerTest.kt | 36 +- .../lsp/java/actions/JavaCodeActionsMenu.kt | 99 - .../java/CompilationCancellationException.kt | 2 +- .../lsp/java/JavaCompilerProvider.java | 6 +- .../lsp/java/JavaLanguageServer.kt | 110 +- .../lsp/java/actions/BaseJavaCodeAction.kt | 234 +- .../lsp/java/actions/ExtractMethodAction.kt | 50 +- .../lsp/java/actions/ExtractVariableAction.kt | 50 +- .../lsp/java/actions/FieldBasedAction.kt | 44 +- .../lsp/java/actions/JavaCodeActionsMenu.kt | 99 + .../actions/common/FindReferencesAction.kt | 110 +- .../actions/common/GoToDefinitionAction.kt | 112 +- .../actions/common/OrganizeImportsAction.kt | 160 +- .../common/RemoveUnusedImportsAction.kt | 124 +- .../actions/diagnostics/AddImportAction.kt | 42 +- .../actions/diagnostics/AddThrowsAction.kt | 178 +- .../diagnostics/AutoFixImportsAction.kt | 36 +- .../diagnostics/CreateMissingMethodAction.kt | 168 +- .../actions/diagnostics/FieldToBlockAction.kt | 26 +- .../ImplementAbstractMethodsAction.kt | 188 +- .../actions/diagnostics/RemoveClassAction.kt | 168 +- .../actions/diagnostics/RemoveMethodAction.kt | 178 +- .../diagnostics/RemoveUnusedThrowsAction.kt | 184 +- .../SuppressUncheckedWarningAction.kt | 176 +- .../diagnostics/VariableToStatementAction.kt | 30 +- .../generators/GenerateConstructorAction.kt | 32 +- .../GenerateMissingConstructorAction.kt | 174 +- .../GenerateSettersAndGettersAction.kt | 34 +- .../GenerateToStringMethodAction.kt | 30 +- .../OverrideSuperclassMethodsAction.kt | 58 +- .../java/compiler/CompilationTaskProcessor.kt | 2 +- .../lsp/java/compiler/CompileBatch.java | 24 +- .../lsp/java/compiler/CompileTask.java | 4 +- .../lsp/java/compiler/CompilerProvider.java | 6 +- .../DefaultCompilationTaskProcessor.kt | 4 +- .../lsp/java/compiler/JCReusableCompiler.kt | 6 +- .../lsp/java/compiler/JavaCompilerConfig.kt | 4 +- .../lsp/java/compiler/JavaCompilerImpl.kt | 16 +- .../java/compiler/JavaCompilerService.java | 46 +- .../lsp/java/compiler/SourceFileManager.java | 18 +- .../lsp/java/compiler/SourceFileObject.java | 6 +- .../lsp/java/compiler/SynchronizedTask.kt | 6 +- .../lsp/java/debug/EventConsumer.kt | 2 +- .../lsp/java/debug/EventHandler.kt | 4 +- .../lsp/java/debug/JavaDebugAdapter.kt | 66 +- .../lsp/java/debug/JdwpOptions.kt | 2 +- .../lsp/java/debug/ListenerState.kt | 4 +- .../lsp/java/debug/LspThreadInfo.kt | 40 +- .../lsp/java/debug/ThreadState.kt | 4 +- .../codeonthego}/lsp/java/debug/Variables.kt | 26 +- .../lsp/java/debug/VmConnection.kt | 8 +- .../lsp/java/debug/spec/BreakpointSpec.kt | 12 +- .../spec/ClassPatternReferenceTypeSpec.kt | 4 +- .../lsp/java/debug/spec/DebugEnv.kt | 2 +- .../lsp/java/debug/spec/EventRequestSpec.kt | 2 +- .../java/debug/spec/EventRequestSpecList.kt | 4 +- .../lsp/java/debug/spec/Exceptions.kt | 2 +- .../debug/spec/PatternReferenceTypeSpec.kt | 2 +- .../lsp/java/debug/spec/ReferenceTypeSpec.kt | 2 +- .../debug/spec/SourceReferenceTypeSpec.kt | 8 +- .../lsp/java/debug/utils/EvaluationContext.kt | 2 +- .../lsp/java/debug/utils/JdiTypes.kt | 4 +- .../lsp/java/debug/utils/KotlinClassNames.kt | 4 +- .../lsp/java/debug/utils/KotlinLocals.kt | 2 +- .../lsp/java/debug/utils/MirrorExts.kt | 2 +- .../lsp/java/debug/utils/MiscExts.kt | 6 +- .../lsp/java/debug/utils/ModelUtils.kt | 14 +- .../lsp/java/debug/utils/Strata.kt | 2 +- .../lsp/java/debug/utils/StringUtils.kt | 2 +- .../lsp/java/debug/utils/VariableValues.kt | 4 +- .../lsp/java/debug/utils/VmUtils.kt | 2 +- .../lsp/java/edits/AdvancedJavaEditHandler.kt | 10 +- .../lsp/java/edits/BaseJavaEditHandler.kt | 8 +- .../lsp/java/edits/ClassImportEditHandler.kt | 12 +- .../edits/MultipleClassImportEditHandler.kt | 12 +- .../lsp/java/models/CompilationRequest.kt | 6 +- .../lsp/java/models/DiagnosticCode.kt | 132 +- .../lsp/java/models/JavaCompletionItem.kt | 20 +- .../java/models/JavaServerConfiguration.java | 162 +- .../lsp/java/models/JavaServerSettings.java | 150 +- .../lsp/java/models/PartialReparseRequest.kt | 2 +- .../lsp/java/parser/IJavaParser.kt | 2 +- .../lsp/java/parser/ParseTask.java | 2 +- .../codeonthego}/lsp/java/parser/Parser.java | 478 ++-- .../lsp/java/parser/ts/TSJavaParser.kt | 10 +- .../lsp/java/parser/ts/TSMethodPruner.kt | 2 +- .../lsp/java/parser/ts/TSParseCache.kt | 2 +- .../lsp/java/parser/ts/TSParseResult.kt | 2 +- .../java/providers/BaseJavaServiceProvider.kt | 12 +- .../providers/CancelableServiceProvider.kt | 4 +- .../java/providers/CodeFormatProvider.java | 226 +- .../java/providers/CompletionProvider.java | 54 +- .../java/providers/DefinitionProvider.java | 30 +- .../lsp/java/providers/DiagnosticsProvider.kt | 636 ++--- .../java/providers/JavaDiagnosticProvider.kt | 22 +- .../java/providers/JavaSelectionProvider.java | 10 +- .../lsp/java/providers/ReferenceProvider.java | 24 +- .../lsp/java/providers/SignatureProvider.java | 28 +- .../ClassNamesCompletionProvider.kt | 222 +- .../completion/IJavaCompletionProvider.kt | 806 +++--- .../IdentifierCompletionProvider.kt | 162 +- .../completion/ImportCompletionProvider.kt | 892 +++---- .../completion/KeywordCompletionProvider.kt | 324 +-- .../MemberReferenceCompletionProvider.kt | 348 +-- .../MemberSelectCompletionProvider.kt | 454 ++-- .../completion/ScopeCompletionProvider.kt | 376 +-- .../completion/SnippetCompletionProvider.kt | 22 +- .../StaticImportCompletionProvider.kt | 252 +- .../SwitchConstantCompletionProvider.kt | 210 +- .../definition/ErroneousDefinitionProvider.kt | 20 +- .../definition/IJavaDefinitionProvider.kt | 16 +- .../definition/LocalDefinitionProvider.kt | 14 +- .../definition/RemoteDefinitionProvider.kt | 12 +- .../snippet/JavaSnippetRepository.kt | 8 +- .../providers/snippet/JavaSnippetScope.kt | 4 +- .../lsp/java/refactor/AnchorMember.kt | 4 +- .../lsp/java/refactor/CandidateExpressions.kt | 6 +- .../lsp/java/refactor/ExtractMethodEdit.kt | 12 +- .../lsp/java/refactor/ExtractMethodPlan.kt | 4 +- .../lsp/java/refactor/ExtractMethodPlanner.kt | 4 +- .../lsp/java/refactor/ExtractVariableEdit.kt | 14 +- .../java/refactor/ExtractVariablePlanner.kt | 22 +- .../lsp/java/refactor/ExtractionPlan.kt | 8 +- .../lsp/java/refactor/ExtractionRegion.kt | 4 +- .../lsp/java/refactor/JavaExtractMethodUi.kt | 6 +- .../java/refactor/JavaExtractVariableUi.kt | 12 +- .../lsp/java/refactor/MethodSignature.kt | 8 +- .../lsp/java/refactor/NameSuggestion.kt | 14 +- .../lsp/java/refactor/Occurrences.kt | 4 +- .../lsp/java/refactor/RegionReferences.kt | 4 +- .../lsp/java/refactor/RegionTypes.kt | 4 +- .../lsp/java/refactor/ScopeChain.kt | 10 +- .../lsp/java/refactor/SourceNormalizer.kt | 2 +- .../lsp/java/refactor/ThrownTypes.kt | 4 +- .../lsp/java/refactor/TypeText.kt | 2 +- .../lsp/java/rewrite/AddException.java | 14 +- .../lsp/java/rewrite/AddImport.java | 14 +- .../rewrite/AddSuppressWarningAnnotation.java | 16 +- .../lsp/java/rewrite/ConvertFieldToBlock.java | 16 +- .../rewrite/ConvertVariableToStatement.java | 14 +- .../lsp/java/rewrite/CreateMissingMethod.java | 28 +- .../rewrite/GenerateRecordConstructor.java | 20 +- .../rewrite/ImplementAbstractMethods.java | 360 +-- .../lsp/java/rewrite/RemoveClass.java | 12 +- .../lsp/java/rewrite/RemoveException.java | 14 +- .../lsp/java/rewrite/RemoveMethod.java | 10 +- .../codeonthego}/lsp/java/rewrite/Rewrite.kt | 168 +- .../codeonthego}/lsp/java/utils/ASTFixer.java | 2 +- .../lsp/java/utils/AnalyzeTimer.java | 186 +- .../lsp/java/utils/CancelChecker.kt | 4 +- .../lsp/java/utils/CodeActionUtils.java | 416 ++-- .../lsp/java/utils/CompletableDeferredExts.kt | 2 +- .../lsp/java/utils/EditHelper.java | 416 ++-- .../lsp/java/utils/Extractors.java | 2 +- .../lsp/java/utils/FindHelper.java | 14 +- .../lsp/java/utils/JavaParserUtils.kt | 1578 ++++++------ .../lsp/java/utils/JavaPoetUtils.kt | 218 +- .../lsp/java/utils/MarkdownHelper.java | 6 +- .../lsp/java/utils/MethodPtr.java | 210 +- .../lsp/java/utils/NavigationHelper.java | 8 +- .../lsp/java/utils/ScopeHelper.java | 4 +- .../lsp/java/utils/ShortTypePrinter.java | 2 +- .../codeonthego}/lsp/java/utils/TestUtils.kt | 74 +- .../codeonthego}/lsp/java/utils/TreeUtils.kt | 2 +- .../lsp/java/utils/TypeUtils.java | 576 ++--- .../lsp/java/utils/insertUtils.kt | 8 +- .../lsp/java/visitors/DiagnosticVisitor.kt | 800 +++--- .../FindAnonymousTypeDeclaration.java | 146 +- .../lsp/java/visitors/FindBiggerRange.java | 6 +- .../lsp/java/visitors/FindCompletionsAt.java | 2 +- .../lsp/java/visitors/FindInvocationAt.java | 4 +- .../lsp/java/visitors/FindMethodAt.kt | 2 +- .../lsp/java/visitors/FindMethodCallAt.java | 2 +- .../visitors/FindMethodDeclarationAt.java | 2 +- .../lsp/java/visitors/FindNameAt.java | 6 +- .../lsp/java/visitors/FindReferences.java | 2 +- .../java/visitors/FindTypeDeclarationAt.java | 2 +- .../visitors/FindTypeDeclarationNamed.java | 2 +- .../java/visitors/FindTypeDeclarations.java | 2 +- .../java/visitors/FindVariableAtCursor.java | 2 +- .../java/visitors/FindVariablesBetween.java | 152 +- .../lsp/java/visitors/MethodRangeScanner.kt | 6 +- .../java/visitors/PrettyPrintingVisitor.java | 290 +-- .../lsp/java/visitors/PrintingVisitor.kt | 2 +- .../lsp/java/visitors/PruneMethodBodies.java | 2 +- .../lsp/java/JavaCompilerProviderTest.kt | 8 +- .../codeonthego}/lsp/java/JavaLSPTest.kt | 10 +- .../lsp/java/actions/AddImportTest.kt | 138 +- .../actions/JavaCodeActionTooltipTagTest.kt | 4 +- .../lsp/java/compiler/CompilerTest.kt | 4 +- .../lsp/java/debug/KotlinClassNamesTest.kt | 10 +- .../lsp/java/debug/KotlinLocalsTest.kt | 8 +- .../java/debug/SourceReferenceTypeSpecTest.kt | 4 +- .../codeonthego}/lsp/java/debug/StrataTest.kt | 4 +- .../java/partial/PartialReparserImplTest.kt | 18 +- .../providers/JavaCompletionProviderTest.kt | 188 +- .../providers/JavaSelectionProviderTest.kt | 216 +- .../java/refactor/ExtractMethodEditTest.kt | 2 +- .../java/refactor/ExtractMethodPlanTest.kt | 2 +- .../java/refactor/ExtractMethodRegionTest.kt | 2 +- .../refactor/ExtractMethodSignatureTest.kt | 2 +- .../refactor/ExtractVariablePrimitivesTest.kt | 10 +- .../refactor/ExtractVariableSoundnessTest.kt | 8 +- .../refactor/ExtractionRegionSoundnessTest.kt | 2 +- .../lsp/java/refactor/JavacFixture.kt | 4 +- .../refactor/RegionAnalysisPrimitivesTest.kt | 4 +- .../lsp/java/refactor/SourceNormalizerTest.kt | 4 +- .../lsp/java/utils/FindHelperTest.kt | 10 +- .../src/test/resources/robolectric.properties | 2 +- .../jvm/JvmGeneratedIndexingService.kt | 6 +- .../indexing/jvm/JvmLibraryIndexingService.kt | 10 +- .../lsp/kotlin/KotlinCodeActionsMenu.kt | 58 - .../lsp/kotlin/FileEventConsumer.kt | 2 +- .../lsp/kotlin/KotlinCodeActionsMenu.kt | 58 + .../lsp/kotlin/KotlinLanguageServer.kt | 94 +- .../lsp/kotlin/KotlinServerSettings.kt | 4 +- .../lsp/kotlin/actions/AddImportAction.kt | 44 +- .../kotlin/actions/BaseKotlinCodeAction.kt | 34 +- .../lsp/kotlin/actions/ExtractMethodAction.kt | 60 +- .../kotlin/actions/ExtractVariableAction.kt | 58 +- .../kotlin/actions/FindReferencesAction.kt | 12 +- .../kotlin/actions/GoToDefinitionAction.kt | 12 +- .../kotlin/actions/ImplementMembersAction.kt | 44 +- .../kotlin/actions/InlineVariableAction.kt | 54 +- .../lsp/kotlin/actions/NullSafetyAction.kt | 40 +- .../kotlin/actions/OrganizeImportsAction.kt | 42 +- .../AbstractCompilationEnvironment.kt | 24 +- .../kotlin/compiler/CompilationEnvironment.kt | 38 +- .../lsp/kotlin/compiler/CompilationKind.kt | 2 +- .../lsp/kotlin/compiler/Compiler.kt | 8 +- .../lsp/kotlin/compiler/CompilerExts.kt | 2 +- .../IncrementalModificationTracker.kt | 2 +- .../KotlinApplicationEnvironmentPin.kt | 2 +- .../lsp/kotlin/compiler/KotlinProjectModel.kt | 6 +- .../lsp/kotlin/compiler/ReadWriteLock.kt | 2 +- .../lsp/kotlin/compiler/WorkspaceExts.kt | 22 +- .../lsp/kotlin/compiler/index/IndexCommand.kt | 2 +- .../lsp/kotlin/compiler/index/IndexWorker.kt | 16 +- .../kotlin/compiler/index/KtSymbolIndex.kt | 28 +- .../lsp/kotlin/compiler/index/LiveKtFile.kt | 8 +- .../kotlin/compiler/index/ScanningWorker.kt | 12 +- .../compiler/index/SourceFileIndexer.kt | 24 +- .../lsp/kotlin/compiler/index/WorkerQueue.kt | 2 +- .../compiler/modules/AbstractKtModule.kt | 2 +- .../compiler/modules/AbstractSourceModule.kt | 6 +- .../compiler/modules/AnalysisScheduler.kt | 4 +- .../modules/AnalysisThreadContext.java | 2 +- .../modules/CancelCheckerProgressIndicator.kt | 4 +- .../lsp/kotlin/compiler/modules/KtFileExts.kt | 6 +- .../compiler/modules/KtLibraryModule.kt | 6 +- .../lsp/kotlin/compiler/modules/KtModule.kt | 2 +- .../kotlin/compiler/modules/KtSourceModule.kt | 8 +- .../modules/NotUnderContentRootModule.kt | 2 +- .../registrar/AnalysisApiServiceProvider.kt | 2 +- .../registrar/AnalysisApiServiceProviders.kt | 26 +- .../LspAnalysisApiServiceRegistrar.kt | 2 +- .../services/AnalysisPermissionOptions.kt | 2 +- .../compiler/services/AnnotationsResolver.kt | 8 +- .../compiler/services/DeclarationsProvider.kt | 12 +- .../services/DirectInheritorsProvider.kt | 12 +- .../JavaModuleAccessibilityChecker.kt | 2 +- .../services/JavaModuleAnnotationsProvider.kt | 2 +- .../kotlin/compiler/services/KtLspService.kt | 6 +- .../compiler/services/LanguageSettings.kt | 2 +- .../services/ModificationTrackerFactory.kt | 2 +- .../services/ModuleDependentsProvider.kt | 6 +- .../services/NoOpAsyncExecutionService.kt | 2 +- .../compiler/services/PackageProvider.kt | 10 +- .../compiler/services/PlatformSettings.kt | 2 +- .../services/ProjectStructureProvider.kt | 10 +- .../services/ResolutionScopeProvider.kt | 2 +- .../compiler/services/WriteAccessGuard.kt | 2 +- .../lsp/kotlin/compiler/util/SLF4JLogger.kt | 2 +- .../completion/AdvancedKotlinEditHandler.kt | 8 +- .../completion/BaseKotlinEditHandler.kt | 8 +- .../kotlin/completion/CompletionContext.kt | 2 +- .../lsp/kotlin/completion/ContextKeywords.kt | 2 +- .../lsp/kotlin/completion/ContextResolver.kt | 2 +- .../kotlin/completion/DeclarationContext.kt | 2 +- .../completion/KotlinAutoImportEditHandler.kt | 12 +- .../kotlin/completion/KotlinCompletionItem.kt | 18 +- .../kotlin/completion/KotlinCompletions.kt | 54 +- .../completion/KotlinSnippetRepository.kt | 8 +- .../kotlin/completion/KotlinSnippetScope.kt | 4 +- .../lsp/kotlin/completion/ModifierFilter.kt | 2 +- .../diagnostic/KotlinDiagnosticProvider.kt | 20 +- .../lsp/kotlin/format/KotlinCodeFormatter.kt | 6 +- .../lsp/kotlin/navigation/FindUsages.kt | 40 +- .../lsp/kotlin/navigation/GoToDefinition.kt | 30 +- .../lsp/kotlin/navigation/ReferenceAtCaret.kt | 2 +- .../lsp/kotlin/navigation/TargetAtCaret.kt | 2 +- .../kotlin/refactor/KotlinExtractMethodUi.kt | 14 +- .../refactor/KotlinExtractVariableUi.kt | 16 +- .../kotlin/refactor/ui/InlineVariableSheet.kt | 8 +- .../refactor/ui/InlineVariableSheetContent.kt | 14 +- .../signaturehelp/ActiveParameterResolver.kt | 2 +- .../signaturehelp/CallAtCursorFinder.kt | 2 +- .../signaturehelp/KotlinSignatureHelp.kt | 18 +- .../signaturehelp/SignatureInfoBuilder.kt | 10 +- .../lsp/kotlin/utils/AbstractMemberStubs.kt | 2 +- .../lsp/kotlin/utils/ContextKeywords.kt | 4 +- .../lsp/kotlin/utils/ContextResolver.kt | 10 +- .../codeonthego}/lsp/kotlin/utils/EditExts.kt | 8 +- .../lsp/kotlin/utils/ImportOrganizer.kt | 2 +- .../lsp/kotlin/utils/ImportUsageCollector.kt | 2 +- .../lsp/kotlin/utils/ModifierFilter.kt | 6 +- .../lsp/kotlin/utils/NullSafetyFix.kt | 4 +- .../lsp/kotlin/utils/SymbolExts.kt | 2 +- .../kotlin/utils/SymbolVisibilityChecker.kt | 4 +- .../lsp/kotlin/utils/TypeRendering.kt | 2 +- .../lsp/kotlin/utils/VirtualFileExts.kt | 2 +- .../utils/refactor/CandidateExpressions.kt | 4 +- .../utils/refactor/ExtractMethodEdit.kt | 12 +- .../utils/refactor/ExtractMethodPlan.kt | 6 +- .../utils/refactor/ExtractMethodPlanner.kt | 8 +- .../utils/refactor/ExtractVariableEdit.kt | 16 +- .../utils/refactor/ExtractVariablePlanner.kt | 26 +- .../kotlin/utils/refactor/ExtractionPlan.kt | 10 +- .../kotlin/utils/refactor/ExtractionRegion.kt | 4 +- .../utils/refactor/InlineVariableEdit.kt | 12 +- .../utils/refactor/InlineVariablePlan.kt | 4 +- .../utils/refactor/InlineVariablePlanner.kt | 10 +- .../kotlin/utils/refactor/MethodSignature.kt | 8 +- .../kotlin/utils/refactor/NameSuggestion.kt | 12 +- .../lsp/kotlin/utils/refactor/Occurrences.kt | 4 +- .../kotlin/utils/refactor/RefactoringPlan.kt | 2 +- .../lsp/kotlin/utils/refactor/ScopeChain.kt | 12 +- .../lsp/kotlin/utils/refactor/TypeText.kt | 4 +- .../main/resources/META-INF/kt-lsp/kt-lsp.xml | 4 +- .../kotlin/KotlinCodeActionTooltipTagTest.kt | 30 +- .../actions/AddImportActionPinScopeTest.kt | 12 +- .../lsp/kotlin/actions/AddImportActionTest.kt | 8 +- .../index/BufferMovedWhileComputingTest.kt | 22 +- .../compiler/index/CurrentKtFileCacheTest.kt | 20 +- .../compiler/index/DiskCopyEvictionTest.kt | 6 +- .../index/IndexWorkerBatchRemovalTest.kt | 2 +- .../compiler/index/IndexWorkerDisposalTest.kt | 4 +- .../compiler/index/LiveKtFilePinTest.kt | 16 +- .../compiler/index/SourceFileIndexerTest.kt | 6 +- .../StaleKtFileInstanceDiagnosticsTest.kt | 18 +- .../compiler/index/StalePinEditRefusalTest.kt | 36 +- .../modules/AnalysisSerializationTest.kt | 8 +- .../modules/ContentScopeStalenessTest.kt | 4 +- .../kotlin/compiler/util/SLF4JLoggerTest.kt | 4 +- .../completion/CompletionRequestBufferTest.kt | 24 +- .../kotlin/completion/MatchLevelMemoTest.kt | 4 +- .../fixtures/InterModuleResolutionTest.kt | 2 +- .../lsp/kotlin/fixtures/KtLspTest.kt | 16 +- .../kotlin/fixtures/KtLspTestEnvironment.kt | 24 +- .../fixtures/KtLspTestEnvironmentTest.kt | 2 +- .../lsp/kotlin/fixtures/KtLspTestRule.kt | 2 +- .../lsp/kotlin/fixtures/TestKtSourceModule.kt | 10 +- .../kotlin/fixtures/TestSourceModuleSpec.kt | 2 +- .../kotlin/format/KotlinCodeFormatterTest.kt | 4 +- .../navigation/FindDefinitionRequestTest.kt | 16 +- .../navigation/FindUsagesLiveDocumentTest.kt | 16 +- .../lsp/kotlin/navigation/FindUsagesTest.kt | 12 +- .../kotlin/navigation/GoToDefinitionTest.kt | 10 +- .../kotlin/navigation/ReferenceAtCaretTest.kt | 6 +- .../kotlin/navigation/TargetAtCaretTest.kt | 6 +- .../refactor/KotlinExtractMethodUiTest.kt | 20 +- .../ActiveParameterResolverTest.kt | 6 +- .../signaturehelp/CallAtCursorFinderTest.kt | 6 +- .../signaturehelp/KotlinSignatureHelpTest.kt | 6 +- .../signaturehelp/SignatureInfoBuilderTest.kt | 4 +- .../kotlin/utils/AbstractMemberStubsTest.kt | 4 +- .../lsp/kotlin/utils/ContextKeywordsTest.kt | 4 +- .../lsp/kotlin/utils/EditExtsTest.kt | 8 +- .../utils/ImplementMembersEndToEndTest.kt | 10 +- .../lsp/kotlin/utils/ImportOrganizerTest.kt | 6 +- .../kotlin/utils/ImportUsageCollectorTest.kt | 4 +- .../lsp/kotlin/utils/NullSafetyFixTest.kt | 8 +- .../utils/OrganizeImportsEndToEndTest.kt | 12 +- .../utils/SymbolVisibilityCheckerTest.kt | 4 +- .../utils/refactor/ExtractMethodEditTest.kt | 6 +- .../refactor/ExtractMethodPlanEndToEndTest.kt | 10 +- .../utils/refactor/ExtractMethodRegionTest.kt | 6 +- .../utils/refactor/ExtractVariableEditTest.kt | 18 +- .../ExtractVariablePlanEndToEndTest.kt | 16 +- .../utils/refactor/InlineVariableEditTest.kt | 6 +- .../InlineVariablePlanEndToEndTest.kt | 10 +- .../utils/refactor/InlineVariablePlanTest.kt | 4 +- .../utils/refactor/RefactorPrimitivesTest.kt | 20 +- .../lsp/CancellableRequestParams.kt | 4 +- .../codeonthego}/lsp/LspParams.kt | 2 +- .../lsp/edits/DefaultEditHandler.kt | 12 +- .../codeonthego}/lsp/edits/IEditHandler.kt | 4 +- .../codeonthego}/lsp/models/CodeActions.kt | 4 +- .../lsp/models/CodeFormatException.kt | 2 +- .../codeonthego}/lsp/models/CodeFormatting.kt | 4 +- .../codeonthego}/lsp/models/CompletionData.kt | 2 +- .../lsp/models/CompletionItemComparator.java | 64 +- .../codeonthego}/lsp/models/Completions.kt | 652 ++--- .../codeonthego}/lsp/models/Definitions.kt | 10 +- .../codeonthego}/lsp/models/Diagnostics.kt | 12 +- .../codeonthego}/lsp/models/Edits.kt | 4 +- .../lsp/models/ExpandSelectionParams.kt | 4 +- .../codeonthego}/lsp/models/HighlightToken.kt | 4 +- .../codeonthego}/lsp/models/Initialization.kt | 2 +- .../codeonthego}/lsp/models/LSPFailure.kt | 2 +- .../codeonthego}/lsp/models/Markups.kt | 4 +- .../codeonthego}/lsp/models/References.kt | 10 +- .../codeonthego}/lsp/models/Signatures.kt | 8 +- .../codeonthego}/lsp/models/TextDocument.kt | 4 +- .../codeonthego}/lsp/util/RewriteHelper.kt | 4 +- .../codeonthego}/lsp/refactor/BlockRewrite.kt | 2 +- .../lsp/refactor/NamePrimitives.kt | 2 +- .../codeonthego}/lsp/refactor/RewriteSpan.kt | 8 +- .../codeonthego}/lsp/refactor/SourceText.kt | 2 +- .../codeonthego}/lsp/refactor/TextSpan.kt | 2 +- .../lsp/refactor/RefactorCoreTest.kt | 2 +- .../lsp/ui/ExtractMethodContract.kt | 2 +- .../codeonthego}/lsp/ui/ExtractMethodSheet.kt | 4 +- .../lsp/ui/ExtractMethodSheetContent.kt | 2 +- .../lsp/ui/ExtractMethodUiState.kt | 2 +- .../lsp/ui/ExtractMethodViewModel.kt | 2 +- .../lsp/ui/ExtractVariableContract.kt | 2 +- .../lsp/ui/ExtractVariableSheet.kt | 4 +- .../lsp/ui/ExtractVariableSheetContent.kt | 2 +- .../lsp/ui/ExtractVariableUiState.kt | 2 +- .../lsp/ui/ExtractVariableViewModel.kt | 2 +- .../codeonthego}/lsp/ui/SheetComponents.kt | 2 +- .../codeonthego}/lsp/ui/VariableName.kt | 2 +- .../lsp/ui/ExtractMethodViewModelTest.kt | 2 +- .../lsp/ui/ExtractVariableViewModelTest.kt | 2 +- .../codeonthego}/lsp/xml/XMLLanguageServer.kt | 54 +- .../lsp/xml/edits/AttrValueEditHandler.kt | 2 +- .../xml/edits/QualifiedValueEditHandler.kt | 6 +- .../lsp/xml/edits/TagEditHandler.kt | 2 +- .../lsp/xml/models/XMLFormattingOptions.kt | 8 +- .../lsp/xml/models/XMLServerSettings.kt | 4 +- .../lsp/xml/providers/AdvancedEditProvider.kt | 26 +- .../lsp/xml/providers/CodeFormatProvider.java | 64 +- .../xml/providers/XmlCompletionProvider.kt | 426 ++-- .../completion/AttrCompletionProvider.kt | 24 +- .../completion/AttrValueCompletionProvider.kt | 36 +- .../completion/IXmlCompletionProvider.kt | 46 +- .../common/CommonAttrCompletionProvider.kt | 8 +- .../etc/InheritingAttrCompletionProvider.kt | 8 +- .../layout/LayoutAttrCompletionProvider.kt | 10 +- .../layout/LayoutTagCompletionProvider.kt | 16 +- .../layout/QualifiedTagCompleter.kt | 26 +- .../completion/layout/SimpleTagCompleter.kt | 20 +- .../completion/layoutFileCompletions.kt | 4 +- .../ManifestAttrCompletionProvider.kt | 16 +- .../ManifestAttrValueCompletionProvider.kt | 40 +- .../manifest/ManifestTagCompletionProvider.kt | 32 +- .../completion/manifestFileCompletions.kt | 10 +- .../providers/completion/xmlCompletions.kt | 12 +- .../format/DOMAttributeFormatter.java | 338 +-- .../providers/format/DOMCDATAFormatter.java | 6 +- .../providers/format/DOMCommentFormatter.java | 6 +- .../providers/format/DOMDocTypeFormatter.java | 548 ++--- .../providers/format/DOMElementFormatter.java | 1094 ++++----- .../DOMProcessingInstructionFormatter.java | 176 +- .../providers/format/DOMTextFormatter.java | 268 +- .../format/FormatElementCategory.java | 148 +- .../xml/providers/format/TextEditUtils.java | 404 ++-- .../xml/providers/format/XMLFormatter.java | 6 +- .../format/XMLFormatterDocument.java | 1620 ++++++------- .../format/XMLFormatterDocumentNew.java | 1442 +++++------ .../format/XMLFormattingConstraints.java | 154 +- .../providers/snippet/XmlSnippetRepository.kt | 8 +- .../xml/providers/snippet/XmlSnippetScope.kt | 4 +- .../lsp/xml/utils/StringUtils.java | 2 +- .../lsp/xml/utils/XMLBuilder.java | 4 +- .../codeonthego}/lsp/xml/utils/XmlUtils.kt | 264 +- .../lsp/xml/utils/inheritingAttrs.kt | 2 +- .../lsp/xml/utils/tagTransforms.kt | 4 +- .../lsp/xml/utils/xmlCompletionUtils.kt | 2 +- .../codeonthego}/lsp/xml/CompletionHelper.kt | 4 +- .../lsp/xml/CompletionHelperImpl.kt | 8 +- .../codeonthego}/lsp/xml/XMLLSPTest.kt | 18 +- .../AttributeValueCompletionTest.kt | 10 +- .../CommonAttrCompletionProviderTest.kt | 8 +- .../CommonAttrValueCompletionTest.kt | 8 +- .../LayoutAttributeCompletionProviderTest.kt | 8 +- .../ManifestAttrCompletionProviderTest.kt | 8 +- ...ManifestAttrValueCompletionProviderTest.kt | 8 +- .../ManifestTagCompletionProviderTest.kt | 8 +- .../completion/XMLCompletionProviderTest.kt | 186 +- .../lsp/xml/utils/TagTransformsTest.kt | 2 +- markdown-preview-plugin/build.gradle.kts | 2 +- .../MarkdownPreviewerPlugin.kt | 20 +- .../fragments/MarkdownPreviewFragment.kt | 6 +- plugin-api/build.gradle.kts | 4 +- plugin-api/plugin-builder/build.gradle.kts | 6 +- .../build/GenerateCgpBuildProperties.kt | 2 +- .../plugins/build/PluginBuilder.kt | 2 +- .../plugins/build/PluginBuilderExtension.kt | 2 +- .../plugins/build/PluginProvenance.kt | 2 +- .../plugins/build/ProvenanceResolver.kt | 2 +- .../plugins/build/CgpBuildPropertiesTest.kt | 2 +- .../plugins/build/GitDirectoryReaderTest.kt | 2 +- .../plugins/build/PluginProvenanceTest.kt | 2 +- .../plugins/build/ProvenanceResolverTest.kt | 2 +- .../plugins/services/CapabilityStatus.java | 2 +- .../plugins/services/LlmInferenceService.java | 2 +- .../plugins/services/ToolSourceRegistry.java | 2 +- .../codeonthego}/plugins/IPlugin.kt | 2 +- .../codeonthego}/plugins/PluginContext.kt | 2 +- .../plugins/ai/LlmBackendRegistration.kt | 12 +- .../plugins/ai/prompt/PromptConfigDocument.kt | 2 +- .../ai/prompt/PromptConfigException.kt | 2 +- .../plugins/ai/prompt/PromptConfigLoader.kt | 2 +- .../plugins/ai/prompt/PromptConfigObject.kt | 2 +- .../plugins/ai/prompt/PromptConfigSource.kt | 2 +- .../plugins/ai/prompt/PromptConfigStore.kt | 2 +- .../plugins/ai/prompt/PromptTemplateEngine.kt | 2 +- .../plugins/ai/prompt/PromptText.kt | 2 +- .../codeonthego}/plugins/ai/ui/PaneStyling.kt | 2 +- .../plugins/ai/ui/SecretRevealController.kt | 2 +- .../plugins/base/InternalPluginApi.kt | 2 +- .../plugins/base/PluginFragment.kt | 4 +- .../plugins/base/PluginWindows.kt | 2 +- .../plugins/base/SafePluginLayoutInflater.kt | 2 +- .../extensions/BuildActionExtension.kt | 4 +- .../extensions/DocumentationExtension.kt | 4 +- .../extensions/EditorDecorationProvider.kt | 4 +- .../plugins/extensions/EditorExtension.kt | 4 +- .../plugins/extensions/EditorTabExtension.kt | 4 +- .../plugins/extensions/FileOpenExtension.kt | 4 +- .../plugins/extensions/LanguageExtension.kt | 4 +- .../plugins/extensions/ProjectExtension.kt | 4 +- .../extensions/ProjectSearchExtension.kt | 4 +- .../plugins/extensions/SettingsExtension.kt | 4 +- .../plugins/extensions/SnippetExtension.kt | 4 +- .../plugins/extensions/UIExtension.kt | 6 +- .../plugins/security/KeystoreSecretStore.kt | 2 +- .../plugins/security/SecretKeySource.kt | 2 +- .../plugins/services/IdeArchiveService.kt | 2 +- .../plugins/services/IdeCommandService.kt | 8 +- .../plugins/services/IdeEditorTabService.kt | 2 +- .../plugins/services/IdeEnvironmentService.kt | 4 +- .../plugins/services/IdeFeatureFlagService.kt | 2 +- .../plugins/services/IdeLogService.kt | 2 +- .../plugins/services/IdeServices.kt | 18 +- .../plugins/services/IdeSidebarService.kt | 2 +- .../plugins/services/IdeSnippetService.kt | 2 +- .../plugins/services/IdeTemplateService.kt | 4 +- .../plugins/services/IdeThemeService.kt | 2 +- .../plugins/services/IdeTooltipService.kt | 2 +- .../plugins/services/SharedServices.kt | 2 +- .../plugins/templates/CgtTemplateBuilder.kt | 4 +- .../services/LlmInferenceServiceTest.java | 2 +- .../services/ToolSourceRegistryTest.java | 2 +- .../codeonthego}/plugins/PluginContextTest.kt | 2 +- .../plugins/ai/LlmBackendRegistrationTest.kt | 12 +- .../plugins/ai/prompt/PromptConfigFixture.kt | 2 +- .../ai/prompt/PromptConfigLoaderTest.kt | 10 +- .../ai/prompt/PromptConfigObjectTest.kt | 6 +- .../ai/prompt/PromptConfigStoreTest.kt | 6 +- .../ai/prompt/PromptTemplateEngineTest.kt | 2 +- .../security/KeystoreSecretStoreTest.kt | 2 +- .../plugins/services/LogQueryTest.kt | 2 +- plugin-manager/build.gradle.kts | 2 +- .../services/IdeFeatureFlagServiceImpl.kt | 9 - .../plugins/manager/PluginTooltipNaming.kt | 2 +- .../manager/build/PluginBuildActionManager.kt | 24 +- .../manager/context/PluginContextImpl.kt | 6 +- .../manager/core/PluginCrashTracker.kt | 4 +- .../plugins/manager/core/PluginManager.kt | 158 +- .../manager/core/PluginSettingsEntries.kt | 6 +- .../ExtensionToContentTypeResolver.kt | 2 +- .../PluginDocumentationManager.kt | 14 +- .../manager/documentation/Tier3AssetWalker.kt | 2 +- .../manager/fragment/PluginFragmentFactory.kt | 2 +- .../language/PluginLanguageContribution.kt | 4 +- .../plugins/manager/loaders/PluginLoader.kt | 2 +- .../plugins/manager/loaders/PluginManifest.kt | 4 +- .../manager/loaders/PluginResourceContext.kt | 6 +- .../manager/project/PluginProjectManager.kt | 4 +- .../manager/security/PluginSecurityManager.kt | 6 +- .../manager/services/CogoProjectProvider.kt | 14 +- .../manager/services/IdeArchiveServiceImpl.kt | 10 +- .../manager/services/IdeBuildServiceImpl.kt | 16 +- .../manager/services/IdeCommandServiceImpl.kt | 18 +- .../manager/services/IdeEditorServiceImpl.kt | 18 +- .../services/IdeEditorTabServiceImpl.kt | 8 +- .../services/IdeEnvironmentServiceImpl.kt | 6 +- .../services/IdeFeatureFlagServiceImpl.kt | 9 + .../manager/services/IdeFileServiceImpl.kt | 8 +- .../manager/services/IdeLogServiceImpl.kt | 10 +- .../IdeProjectManipulationServiceImpl.kt | 4 +- .../manager/services/IdeProjectServiceImpl.kt | 20 +- .../manager/services/IdeSidebarServiceImpl.kt | 6 +- .../manager/services/IdeSnippetServiceImpl.kt | 4 +- .../services/IdeTemplateServiceImpl.kt | 10 +- .../manager/services/IdeThemeServiceImpl.kt | 8 +- .../manager/services/IdeTooltipServiceImpl.kt | 10 +- .../manager/services/IdeUIServiceImpl.kt | 8 +- .../manager/services/ModuleContextResolver.kt | 8 +- .../manager/services/PluginPathAllowlist.kt | 6 +- .../manager/snippets/PluginSnippetManager.kt | 6 +- .../manager/ui/PluginDrawableResolver.kt | 4 +- .../manager/ui/PluginEditorTabManager.kt | 14 +- .../plugins/manager/ui/PluginToolbarHost.kt | 2 +- .../manager/ui/PluginUiActionManager.kt | 4 +- .../plugins/manager/E2EIntegrationTest.kt | 10 +- .../core/PluginManagerIntegrationTest.kt | 20 +- .../manager/core/PluginSettingsEntriesTest.kt | 8 +- .../loaders/PluginProvenanceMappingTest.kt | 2 +- .../IdeBuildServiceImplExecuteTasksTest.kt | 18 +- .../IdeEditorServiceImplSaveFileTest.kt | 4 +- .../services/IdeFileServiceImplTest.kt | 4 +- .../manager/services/IdeLogServiceImplTest.kt | 12 +- .../IdeProjectServiceImplModuleContextTest.kt | 6 +- .../services/IdeSidebarServiceImplTest.kt | 4 +- .../preferences/BaseIDEPreferences.kt | 2 +- .../preferences/BasePreference.kt | 6 +- .../ChoiceBasedDialogPreference.kt | 2 +- .../preferences/DialogPreference.kt | 8 +- .../preferences/EditTextPreference.kt | 2 +- .../preferences/IDEPreferences.kt | 4 +- .../codeonthego}/preferences/IPreference.kt | 2 +- .../preferences/IPreferenceGroup.kt | 2 +- .../preferences/IPreferenceInflater.kt | 2 +- .../preferences/IPreferenceScreen.kt | 2 +- .../preferences/MultiChoicePreference.kt | 2 +- .../NumberInputEditTextPreference.kt | 2 +- .../preferences/PreferenceChoices.kt | 2 +- .../preferences/PreferenceValueType.kt | 2 +- .../preferences/SimpleClickablePreference.kt | 2 +- .../preferences/SimplePreference.kt | 2 +- .../preferences/SingleChoicePreference.kt | 2 +- .../preferences/SwitchPreference.kt | 2 +- .../preferences/internal/BuildPreferences.kt | 2 +- .../preferences/internal/DevOpsPreferences.kt | 2 +- .../preferences/internal/EditorPreferences.kt | 2 +- .../internal/GeneralPreferences.kt | 4 +- .../preferences/internal/GitPreferences.kt | 2 +- .../preferences/internal/JavaPreferences.kt | 2 +- .../preferences/internal/StatPreferences.kt | 4 +- .../preferences/internal/XmlPreferences.kt | 2 +- .../preferences/internal/preferences.kt | 6 +- .../preferences/utils/editorUtil.kt | 4 +- .../cotg/profiler/ui/theme/ProfilerTheme.kt | 2 +- quickbuild/core/src/main/AndroidManifest.xml | 2 +- .../quickbuild/domain/reload/ComponentInfo.kt | 4 +- .../quickbuild/domain/reload/RealIdInstall.kt | 2 +- .../service/deploy/DeployChannel.kt | 2 +- .../service/deploy/ProxyAppConnections.kt | 2 +- .../service/deploy/ProxyAppPriorityHold.kt | 2 +- .../service/deploy/QuickBuildHostService.kt | 6 +- .../domain/reload/DeployPolicyTest.kt | 16 +- .../service/deploy/DeployChannelDeployTest.kt | 2 +- .../service/deploy/DeployChannelWaitsTest.kt | 2 +- .../ProxyAppConnectionsFreezerHoldTest.kt | 2 +- .../deploy/QuickBuildHostBinderTest.kt | 2 +- .../session/QuickBuildSessionManagerTest.kt | 6 +- quickbuild/docs/debugging.md | 8 +- quickbuild/docs/live-reload-alternatives.md | 4 +- quickbuild/runtime/build.gradle.kts | 16 +- .../runtime/src/main/AndroidManifest.xml | 2 +- .../quickbuild/IQuickBuildHost.aidl | 4 +- .../quickbuild/IQuickBuildTarget.aidl | 2 +- .../quickbuild/runtime/ActivityTracker.java | 2 +- .../quickbuild/runtime/AssetExtractor.java | 2 +- .../runtime/BaselineGeneration.java | 2 +- .../quickbuild/runtime/BootProbation.java | 2 +- .../quickbuild/runtime/BuildStatus.java | 2 +- .../quickbuild/runtime/CrashSummary.java | 2 +- .../quickbuild/runtime/DeployMetadata.java | 2 +- .../runtime/DirectoryAssetsProvider.java | 2 +- .../quickbuild/runtime/FirstFrameGate.java | 2 +- .../quickbuild/runtime/Generations.java | 2 +- .../runtime/LegacyResourceSwap.java | 2 +- .../quickbuild/runtime/LoaderRouter.java | 2 +- .../quickbuild/runtime/MiniJson.java | 2 +- .../quickbuild/runtime/OverlayState.java | 2 +- .../runtime/PayloadPersistence.java | 2 +- .../quickbuild/runtime/PayloadStore.java | 2 +- .../runtime/PersistedSelection.java | 2 +- .../QuickBuildAppComponentFactory.java | 2 +- .../runtime/QuickBuildClassLoaders.java | 2 +- .../quickbuild/runtime/QuickBuildClient.java | 8 +- .../runtime/QuickBuildKeepAliveService.java | 2 +- .../quickbuild/runtime/QuickBuildRuntime.java | 2 +- .../quickbuild/runtime/ResourceStore.java | 2 +- .../runtime/ResourceSwapStrategy.java | 2 +- .../quickbuild/runtime/RestartHandoff.java | 2 +- .../quickbuild/runtime/RuntimeLog.java | 2 +- .../quickbuild/runtime/StatusOverlay.java | 4 +- .../quickbuild/runtime/Streams.java | 2 +- .../quickbuild/runtime/SwapAckGate.java | 2 +- .../AssetExtractorFailurePathTest.java | 2 +- .../runtime/AssetExtractorTest.java | 2 +- .../runtime/BaselineGenerationTest.java | 2 +- .../quickbuild/runtime/BootProbationTest.java | 2 +- .../quickbuild/runtime/BuildStatusTest.java | 2 +- .../quickbuild/runtime/CrashSummaryTest.java | 2 +- .../runtime/DeployMetadataTest.java | 2 +- .../runtime/DirectoryAssetsProviderTest.java | 2 +- .../runtime/FirstFrameGateTest.java | 2 +- .../quickbuild/runtime/GenerationsTest.java | 2 +- .../LegacyResourceSwapAddAssetPathTest.java | 2 +- .../runtime/LegacyResourceSwapSweepTest.java | 2 +- .../runtime/LegacyResourceSwapTest.java | 2 +- .../quickbuild/runtime/LoaderRouterTest.java | 2 +- .../ManifestAppComponentFactoryTest.java | 2 +- .../runtime/MiniJsonHardeningTest.java | 2 +- .../MiniJsonSeparatorAndLiteralTest.java | 2 +- .../quickbuild/runtime/MiniJsonTest.java | 2 +- .../runtime/OfflineNetworkGuardTest.java | 2 +- .../quickbuild/runtime/OverlayStateTest.java | 2 +- .../runtime/OverlayStateTextEdgeTest.java | 2 +- .../PayloadPersistenceAtomicSetTest.java | 2 +- .../PayloadPersistenceAtomicWriteTest.java | 2 +- .../PayloadPersistenceCorruptMetaTest.java | 2 +- .../PayloadPersistenceQuarantineTest.java | 2 +- .../runtime/PayloadPersistenceTest.java | 2 +- .../runtime/PersistedSelectionTest.java | 2 +- ...ckBuildAppComponentFactoryRethrowTest.java | 2 +- ...QuickBuildClassLoadersForActivityTest.java | 2 +- .../runtime/QuickBuildClassLoadersTest.java | 2 +- ...ickBuildRuntimeApplyFailureReportTest.java | 2 +- ...ckBuildRuntimeBootRestoreDispatchTest.java | 2 +- ...ickBuildRuntimeFailReloadDispatchTest.java | 2 +- .../QuickBuildRuntimeFrameCompletionTest.java | 2 +- ...QuickBuildRuntimeResumeCompletionTest.java | 2 +- .../ResourceStoreAbandonedSwapTest.java | 2 +- .../ResourceStoreLegacyAssetsTest.java | 2 +- .../ResourceStoreLegacyWriteSweepTest.java | 2 +- .../runtime/ResourceSwapStrategyTest.java | 2 +- .../runtime/RestartHandoffTest.java | 2 +- .../quickbuild/runtime/RuntimeLogTest.java | 2 +- .../runtime/StatusOverlayInsetActionTest.java | 2 +- .../runtime/StreamsCloseQuietlyTest.java | 2 +- .../quickbuild/runtime/StreamsTest.java | 2 +- .../quickbuild/runtime/SwapAckGateTest.java | 2 +- .../codeonthego}/resources/ITooltipView.java | 2 +- .../resources/TooltipMaterialCheckBox.java | 2 +- .../resources/TooltipTextInputLayout.java | 2 +- .../localization/LocaleProvider.java | 2 +- .../src/main/res/layout/layout_spinner.xml | 4 +- scripts/run_instrumentation_tests.sh | 2 +- .../codeonthego}/models/Locations.kt | 2 +- .../codeonthego}/models/LogLine.kt | 10 +- .../codeonthego}/progress/ICancelChecker.kt | 2 +- .../codeonthego}/progress/ProgressManager.kt | 4 +- .../utils/AndroidPluginVersion.kt | 2 +- .../codeonthego}/utils/Cache.java | 4 +- .../codeonthego}/utils/ClassTrie.kt | 2 +- .../codeonthego}/utils/DefaultRecyclable.kt | 2 +- .../codeonthego}/utils/DocumentUtils.java | 2 +- .../appdevforall/codeonthego}/utils/Either.kt | 2 +- .../codeonthego}/utils/FileProvider.kt | 224 +- .../codeonthego}/utils/HashUtils.kt | 2 +- .../utils/InputStreamLineReader.java | 2 +- .../codeonthego}/utils/IntPair.java | 2 +- .../codeonthego}/utils/ReaderInputStream.java | 2 +- .../utils/RecyclableObjectPool.kt | 2 +- .../codeonthego}/utils/ServiceLoader.java | 2 +- .../utils/ServiceNotFoundException.java | 2 +- .../codeonthego}/utils/SharedEnvironment.kt | 2 +- .../codeonthego}/utils/SourceClassTrie.kt | 4 +- .../codeonthego}/utils/StackFrameLocator.kt | 2 +- .../codeonthego}/utils/StopWatch.kt | 158 +- .../codeonthego}/utils/StringUtil.java | 2 +- .../codeonthego}/utils/UniqueNameBuilder.java | 2 +- .../codeonthego}/utils/VMUtils.kt | 2 +- .../codeonthego}/utils/miscUtils.kt | 2 +- .../utils/recyclableObjectPoolExtensions.kt | 2 +- .../codeonthego}/utils/stringExt.kt | 2 +- .../progress/ICancelCheckerTest.kt | 2 +- .../progress/ProgressManagerTest.kt | 2 +- .../codeonthego}/utils/FileProviderTest.kt | 2 +- .../utils/StackFrameLocatorTest.kt | 2 +- .../codeonthego}/aapt/Resources.kt | 2 +- .../codeonthego}/aapt/logging/IDELogger.kt | 2 +- .../codeonthego}/aaptcompiler/CompilerTest.kt | 4 +- .../test/resources/layout/activity_editor.xml | 10 +- .../builder/model/DefaultAndroidArtifact.kt | 2 +- .../DefaultAndroidGradlePluginProjectFlags.kt | 70 +- .../model/DefaultAndroidLibraryData.kt | 82 +- .../builder/model/DefaultApiVersion.kt | 58 +- .../model/DefaultArtifactDependencies.kt | 56 +- .../builder/model/DefaultBundleInfo.kt | 62 +- .../model/DefaultCustomSourceDirectory.kt | 60 +- .../builder/model/DefaultGraphItem.kt | 56 +- .../builder/model/DefaultJavaArtifact.kt | 78 +- .../model/DefaultJavaCompileOptions.kt | 84 +- .../builder/model/DefaultLibrary.kt | 2 +- .../builder/model/DefaultLibraryInfo.kt | 70 +- .../builder/model/DefaultProjectInfo.kt | 68 +- .../builder/model/DefaultProjectSyncIssues.kt | 52 +- .../builder/model/DefaultSourceProvider.kt | 2 +- .../model/DefaultSourceSetContainer.kt | 70 +- .../builder/model/DefaultSyncIssue.kt | 64 +- .../builder/model/DefaultTestInfo.kt | 64 +- .../model/DefaultTestedTargetVariant.kt | 56 +- .../model/DefaultUnresolvedDependency.kt | 54 +- .../builder/model/DefaultVariant.kt | 2 +- .../model/DefaultVariantDependencies.kt | 2 +- .../model/DefaultViewBindingOptions.kt | 54 +- .../builder/model/IDESyncIssue.kt | 2 +- .../builder/model/IJavaCompilerSettings.kt | 2 +- .../builder/model/modelConstants.kt | 4 +- .../codeonthego}/flashbar/Flashbar.kt | 18 +- .../flashbar/FlashbarContainerView.kt | 38 +- .../codeonthego}/flashbar/FlashbarView.kt | 28 +- .../flashbar/SwipeDismissTouchListener.kt | 2 +- .../flashbar/anim/BaseFlashAnimBuilder.kt | 2 +- .../codeonthego}/flashbar/anim/FlashAnim.kt | 2 +- .../flashbar/anim/FlashAnimBarBuilder.kt | 16 +- .../flashbar/anim/FlashAnimIconBuilder.kt | 2 +- .../codeonthego}/flashbar/util/CommonUtils.kt | 10 +- .../javac/services/CancelAbort.java | 2 +- .../javac/services/CancelService.java | 2 +- .../codeonthego}/javac/services/NBAttr.java | 2 +- .../javac/services/NBClassFinder.java | 2 +- .../javac/services/NBClassReader.java | 2 +- .../javac/services/NBClassWriter.java | 2 +- .../codeonthego}/javac/services/NBEnter.java | 2 +- .../javac/services/NBJavaCompiler.java | 2 +- .../javac/services/NBJavacTrees.java | 2 +- .../codeonthego}/javac/services/NBLog.java | 2 +- .../javac/services/NBMemberEnter.java | 2 +- .../codeonthego}/javac/services/NBNames.java | 2 +- .../javac/services/NBParserFactory.java | 2 +- .../javac/services/NBResolve.java | 2 +- .../javac/services/NBTreeMaker.java | 2 +- .../services/compiler/CancelServiceImpl.kt | 6 +- .../services/compiler/JavacFlowListener.java | 2 +- .../javac/services/compiler/ReusableBorrow.kt | 2 +- .../services/compiler/ReusableCompiler.kt | 4 +- .../services/compiler/ReusableContext.kt | 28 +- .../services/compiler/ReusableJavaCompiler.kt | 4 +- .../javac/services/compiler/ReusableLog.kt | 4 +- .../services/fs/AndroidFsProviderImpl.kt | 2 +- .../javac/services/fs/CacheFSInfoSingleton.kt | 4 +- .../javac/services/fs/CachedJarFileSystem.kt | 2 +- .../fs/CachingJarFileSystemProvider.kt | 2 +- .../services/fs/JarPackageProviderImpl.kt | 2 +- .../javac/services/partial/CompilationInfo.kt | 2 +- .../partial/DiagnosticListenerImpl.java | 2 +- .../javac/services/partial/PartialReparser.kt | 2 +- .../services/partial/PartialReparserImpl.kt | 22 +- .../services/partial/RichDiagnostic.java | 2 +- .../services/util/JavaDiagnosticUtils.kt | 118 +- .../javac/services/util/ReparserUtils.java | 6 +- .../visitors/ErrorAwareTreeScanner.kt | 2 +- .../services/visitors/FindAnonymousVisitor.kt | 6 +- .../TranslateMethodPositionsVisitor.java | 2 +- .../javac/services/visitors/UnEnter.kt | 4 +- .../androidide/projects/models/MyClass.kt | 3 - .../projects/models/AndroidProjectExts.kt | 4 +- .../projects/models/CommonProjectExts.kt | 4 +- .../projects/models/GradleProjectExts.kt | 4 +- .../projects/models/JavaProjectExts.kt | 4 +- .../codeonthego/projects/models/MyClass.kt | 3 + .../projects/models/SyncMetaExts.kt | 4 +- .../src/main/proto/android.proto | 2 +- .../src/main/proto/common.proto | 2 +- .../src/main/proto/gradle.proto | 2 +- .../project-models/src/main/proto/java.proto | 2 +- .../src/main/proto/sync_meta.proto | 2 +- .../projects/serial/ProtoProject.kt | 6 +- .../project/serial/ProtoProject.kt | 2 +- .../codeonthego}/projects/FileManager.kt | 18 +- .../codeonthego}/projects/IProjectManager.kt | 14 +- .../projects/ProjectManagerImpl.kt | 56 +- .../projects/api/AndroidModule.kt | 46 +- .../projects/api/GradleProject.kt | 4 +- .../codeonthego}/projects/api/JavaModule.kt | 14 +- .../projects/api/ModuleProject.kt | 28 +- .../codeonthego}/projects/api/Workspace.kt | 8 +- .../projects/builder/BuildService.kt | 22 +- .../projects/classpath/ClassInfo.kt | 2 +- .../projects/classpath/IClasspathReader.kt | 2 +- .../classpath/JarFsClasspathReader.kt | 6 +- .../classpath/ZipFileClasspathReader.kt | 2 +- .../projects/models/ActiveDocument.kt | 2 +- .../projects/models/ActiveJavaDocument.kt | 4 +- .../projects/util/BootClasspathProvider.java | 8 +- .../projects/util/StringSearch.java | 910 +++---- .../codeonthego}/projects/util/projects.kt | 6 +- .../projects/ActiveDocumentVersionTest.kt | 12 +- .../ProjectManagerImplGenerateSourcesTest.kt | 12 +- .../ProjectManagerImplResourceChangeTest.kt | 6 +- ...ProjectManagerImplUninitializedPathTest.kt | 2 +- ...AndroidModuleIntermediateClasspathsTest.kt | 6 +- .../AndroidModuleResourceDirectoriesTest.kt | 10 +- .../api/CompileModuleProjectsCycleTest.kt | 8 +- .../JarFsClasspathReaderCorruptJarTest.kt | 6 +- .../classpath/ZipFileClasspathReaderTest.kt | 4 +- .../projects/util/ClassTrieTest.kt | 4 +- .../src/main/AndroidManifest.xml | 18 +- .../moe/shizuku/manager/ShizukuSettings.kt | 2 +- .../moe/shizuku/manager/ShizukuStarter.kt | 2 +- .../java/moe/shizuku/manager/adb/AdbKey.kt | 2 +- .../src/main/AndroidManifest.xml | 2 +- .../tooling/events/FinishEvent.kt | 46 +- .../tooling/events/OperationDescriptor.kt | 60 +- .../tooling/events/OperationResult.kt | 52 +- .../tooling/events/ProgressEvent.kt | 62 +- .../codeonthego}/tooling/events/StartEvent.kt | 42 +- .../tooling/events/StatusEvent.kt | 56 +- .../ProjectConfigurationFinishEvent.kt | 56 +- ...ProjectConfigurationOperationDescriptor.kt | 92 +- .../ProjectConfigurationOperationResult.kt | 62 +- .../ProjectConfigurationProgressEvent.kt | 54 +- .../ProjectConfigurationStartEvent.kt | 54 +- .../download/FileDownloadFinishEvent.kt | 56 +- .../FileDownloadOperationDescriptor.kt | 92 +- .../download/FileDownloadProgressEvent.kt | 54 +- .../events/download/FileDownloadResult.kt | 54 +- .../events/download/FileDownloadStartEvent.kt | 54 +- .../events/internal/DefaultFinishEvent.kt | 60 +- .../internal/DefaultOperationDescriptor.kt | 80 +- .../events/internal/DefaultOperationResult.kt | 48 +- .../events/internal/DefaultProgressEvent.kt | 56 +- .../events/internal/DefaultStartEvent.kt | 50 +- .../events/task/TaskExecutionResult.kt | 52 +- .../tooling/events/task/TaskFailureResult.kt | 42 +- .../tooling/events/task/TaskFinishEvent.kt | 56 +- .../events/task/TaskOperationDescriptor.kt | 104 +- .../events/task/TaskOperationResult.kt | 48 +- .../tooling/events/task/TaskProgressEvent.kt | 54 +- .../tooling/events/task/TaskSkippedResult.kt | 44 +- .../tooling/events/task/TaskStartEvent.kt | 48 +- .../tooling/events/task/TaskSuccessResult.kt | 56 +- .../tooling/events/test/TestFinishEvent.kt | 56 +- .../events/test/TestOperationDescriptor.kt | 80 +- .../events/test/TestOperationResult.kt | 54 +- .../tooling/events/test/TestProgressEvent.kt | 54 +- .../tooling/events/test/TestStartEvent.kt | 54 +- .../events/transform/TransformFinishEvent.kt | 56 +- .../transform/TransformOperationDescriptor.kt | 110 +- .../transform/TransformOperationResult.kt | 54 +- .../transform/TransformProgressEvent.kt | 54 +- .../events/transform/TransformStartEvent.kt | 54 +- .../events/work/WorkItemFinishEvent.kt | 56 +- .../work/WorkItemOperationDescriptor.kt | 90 +- .../events/work/WorkItemOperationResult.kt | 54 +- .../events/work/WorkItemProgressEvent.kt | 54 +- .../tooling/events/work/WorkItemStartEvent.kt | 54 +- .../tooling/model/BuildIdentifier.kt | 44 +- .../tooling/model/PluginIdentifier.kt | 40 +- .../tooling/model/ProjectIdentifier.kt | 40 +- subprojects/tooling-api-impl/build.gradle.kts | 2 +- .../tooling/impl/GradleDaemonWatcher.kt | 2 +- .../tooling/impl/LoggingOutputStream.kt | 76 +- .../codeonthego}/tooling/impl/Main.kt | 12 +- .../impl/ProjectInitializationExeption.kt | 2 +- .../tooling/impl/ToolingApiServerImpl.kt | 74 +- .../impl/logging/ToolingApiAppender.kt | 10 +- .../tooling/impl/progress/EventTransformer.kt | 942 ++++---- .../progress/ForwardingProgressListener.kt | 216 +- .../tooling/impl/serial/AndroidProjectExts.kt | 40 +- .../tooling/impl/serial/GradleProjectExts.kt | 12 +- .../tooling/impl/serial/JavaProjectExts.kt | 22 +- .../tooling/impl/sync/AbstractModelBuilder.kt | 20 +- .../impl/sync/AbstractProjectModelBuilder.kt | 4 +- .../impl/sync/AndroidProjectModelBuilder.kt | 10 +- .../impl/sync/GradleProjectModelBuilder.kt | 8 +- .../tooling/impl/sync/IModelBuilder.kt | 4 +- .../tooling/impl/sync/IProjectModelBuilder.kt | 4 +- .../tooling/impl/sync/ISyncIssueReporter.kt | 2 +- .../impl/sync/JavaProjectModelBuilder.kt | 8 +- .../impl/sync/ModelBuilderException.java | 2 +- .../sync/NotAnAndroidProjectException.java | 2 +- .../tooling/impl/sync/RootModelBuilder.kt | 26 +- .../codeonthego}/tooling/impl/sync/types.kt | 4 +- .../tooling/impl/util/GradleBuildExts.kt | 12 +- .../tooling/api/sync/SyncLockTest.kt | 4 +- .../tooling/api/sync/SyncMetaVersionTest.kt | 2 +- .../tooling/impl/GradleDaemonWatcherTest.kt | 2 +- .../tooling/impl/ToolingApiServerImplTest.kt | 22 +- .../impl/logging/ToolingApiAppenderTest.kt | 12 +- .../serial/DependencyGraphFlatteningTest.kt | 4 +- .../impl/serial/VariantSourceProvidersTest.kt | 2 +- .../tooling/api/IAndroidProject.kt | 2 +- .../tooling/api/IGradleProject.kt | 6 +- .../codeonthego}/tooling/api/ProjectType.kt | 2 +- .../api/models/AndroidArtifactMetadata.kt | 2 +- .../api/models/AndroidProjectMetadata.kt | 10 +- .../api/models/AndroidVariantMetadata.kt | 2 +- .../api/models/BasicAndroidVariantMetadata.kt | 2 +- .../api/models/BasicProjectMetadata.kt | 2 +- .../tooling/api/models/BuildVariantInfo.kt | 2 +- .../tooling/api/models/GradleArtifact.kt | 2 +- .../tooling/api/models/GradleTask.kt | 2 +- .../tooling/api/models/IModuleMetadata.kt | 2 +- .../tooling/api/models/JavaContentRoot.kt | 54 +- .../api/models/JavaModuleCompilerSettings.kt | 4 +- .../api/models/JavaModuleDependency.kt | 62 +- .../models/JavaModuleExternalDependency.kt | 90 +- .../api/models/JavaModuleProjectDependency.kt | 80 +- .../tooling/api/models/JavaProjectMetadata.kt | 6 +- .../tooling/api/models/JavaSourceDirectory.kt | 62 +- .../tooling/api/models/Launchable.kt | 2 +- .../tooling/api/models/ProjectMetadata.kt | 4 +- .../api/models/ToolingServerMetadata.kt | 2 +- .../api/models/params/StringParameter.kt | 2 +- .../api/models/result/SelectProjectResult.kt | 4 +- .../api/util/AndroidModulePropertyCopier.kt | 34 +- .../codeonthego}/tooling/api/util/utils.kt | 10 +- .../tooling/api/ForwardingToolingApiClient.kt | 14 +- .../tooling/api/IToolingApiClient.kt | 14 +- .../tooling/api/IToolingApiServer.kt | 14 +- .../messages/AndroidInitializationParams.kt | 2 +- .../tooling/api/messages/BuildId.kt | 2 +- .../api/messages/ClientGradleBuildConfig.kt | 2 +- .../tooling/api/messages/GradleBuildParams.kt | 2 +- .../api/messages/GradleDistributionParams.kt | 2 +- .../api/messages/InitializeProjectParams.kt | 2 +- .../tooling/api/messages/LogMessageParams.kt | 6 +- .../tooling/api/messages/ShutDownMessage.kt | 50 +- .../api/messages/TaskExecutionMessage.kt | 2 +- .../result/BuildCancellationRequestResult.kt | 76 +- .../tooling/api/messages/result/BuildInfo.kt | 4 +- .../api/messages/result/BuildResult.kt | 4 +- .../result/GradleWrapperCheckResult.kt | 42 +- .../api/messages/result/InitializeResult.kt | 2 +- .../messages/result/TaskExecutionResult.kt | 2 +- .../tooling/api/sync/ProjectSyncHelper.kt | 18 +- .../tooling/api/util/FileTypeAdapter.java | 2 +- .../api/util/RuntimeTypeAdapterFactory.java | 624 ++--- .../tooling/api/util/ToolingApiLauncher.kt | 120 +- .../tooling/api/util/ToolingProps.kt | 6 +- .../codeonthego}/tooling/api/util/versions.kt | 2 +- .../eclipse/lemminx/commons/ILineTracker.java | 288 +-- .../lemminx/commons/ListLineTracker.java | 910 +++---- .../eclipse/lemminx/commons/TextDocument.java | 254 +- .../org/eclipse/lemminx/dom/DOMDocument.java | 1840 +++++++------- .../eclipse/lemminx/dom/DTDDeclParameter.java | 2 +- .../org/eclipse/lemminx/dom/TargetRange.java | 62 +- .../lemminx/utils/XMLPositionUtility.java | 2150 ++++++++--------- .../resources/DefaultResourceTableRegistry.kt | 18 +- .../internal/versions/DefaultApiVersions.kt | 6 +- .../versions/DefaultApiVersionsRegistry.kt | 16 +- .../xml/internal/versions/DefaultClassInfo.kt | 10 +- .../xml/internal/versions/DefaultFieldInfo.kt | 6 +- .../xml/internal/versions/DefaultInfo.kt | 6 +- .../internal/versions/DefaultMethodInfo.kt | 6 +- .../internal/widgets/DefaultWidgetTable.kt | 10 +- .../widgets/DefaultWidgetTableRegistry.kt | 6 +- .../internal/widgets/util/DefaultWidget.kt | 6 +- .../xml/internal/widgets/util/WidgetParser.kt | 4 +- .../ManifestPermissionConstants.java | 2 +- .../xml/permissions/Permission.kt | 2 +- .../xml/permissions/PermissionGroup.kt | 2 +- .../codeonthego}/xml/registry/XmlRegistry.kt | 2 +- .../xml/resources/ResourceTableRegistry.kt | 8 +- .../codeonthego}/xml/utils/patterns.kt | 2 +- .../codeonthego}/xml/versions/ApiVersion.kt | 2 +- .../codeonthego}/xml/versions/ApiVersions.kt | 4 +- .../xml/versions/ApiVersionsRegistry.kt | 6 +- .../codeonthego}/xml/versions/ClassInfo.kt | 2 +- .../codeonthego}/xml/versions/FieldInfo.kt | 2 +- .../codeonthego}/xml/versions/Info.kt | 2 +- .../codeonthego}/xml/versions/MethodInfo.kt | 2 +- .../codeonthego}/xml/widgets/Widget.kt | 2 +- .../codeonthego}/xml/widgets/WidgetTable.kt | 4 +- .../xml/widgets/WidgetTableRegistry.kt | 6 +- .../codeonthego}/xml/widgets/WidgetType.kt | 2 +- .../registry/PlatformDirDegradationTest.kt | 6 +- .../resources/ResourceTableRegistryTest.kt | 8 +- .../appdevforall/codeonthego}/xml/utils.kt | 4 +- .../xml/versions/ApiVersionTest.kt | 2 +- .../xml/versions/ApiVersionsMinorSdkTest.kt | 2 +- .../xml/versions/ApiVersionsRegistryTest.kt | 4 +- .../xml/widgets/WidgetTableRegistryTest.kt | 4 +- .../templates/ITemplateProvider.kt | 4 +- .../templates/ITemplateWidgetViewProvider.kt | 4 +- .../codeonthego}/templates/RecipeExecutor.kt | 2 +- .../templates/base/ProjectTemplateBuilder.kt | 12 +- .../codeonthego}/templates/base/base.kt | 56 +- .../templates/base/models/Dependency.kt | 4 +- .../base/models/DependencyConfiguration.kt | 2 +- .../templates/base/models/models.kt | 4 +- .../templates/base/templateBuilders.kt | 18 +- .../codeonthego}/templates/base/util/utils.kt | 6 +- .../templates/base/util/xmlBuilder.kt | 2 +- .../codeonthego}/templates/parameters.kt | 14 +- .../codeonthego}/templates/template.kt | 4 +- .../codeonthego}/templates/widget.kt | 2 +- templates-impl/proguard-rules.pro | 2 +- .../templates/impl/ConstraintVerifier.kt | 32 +- .../templates/impl/TemplateProviderImpl.kt | 12 +- .../templates/impl/TemplateWarning.kt | 2 +- .../impl/TemplateWidgetViewProviderImpl.kt | 32 +- .../templates/impl/base/results.kt | 6 +- .../templates/impl/zip/ZipJson.kt | 2 +- .../templates/impl/zip/ZipRecipeExecutor.kt | 20 +- .../impl/zip/ZipTemplateConstants.kt | 2 +- .../templates/impl/zip/ZipTemplateReader.kt | 32 +- .../src/main/res/layout/layout_checkbox.xml | 2 +- .../src/main/res/layout/layout_textfield.xml | 4 +- .../templates/TestRecipeExecutor.kt | 4 +- .../codeonthego}/templates/UtilTest.kt | 30 +- .../impl/zip/ZipRecipeExecutorTest.kt | 20 +- .../codeonthego}/templates/utils.kt | 14 +- .../java/com/termux/app/TermuxActivity.java | 4 +- .../TermuxTerminalSessionActivityClient.java | 2 +- .../activities/TerminalActivity.kt | 4 +- .../shared/activities/ReportActivity.java | 2 +- .../termux/shared/interact/ShareUtils.java | 2 +- .../environment/AndroidShellEnvironment.java | 2 +- .../shared/termux/shell/TermuxShellUtils.java | 2 +- .../environment/TermuxShellEnvironment.java | 2 +- .../com/termux/shared/theme/ThemeUtils.java | 4 +- .../com/termux/shared/view/ViewUtils.java | 4 +- testing/android/src/main/AndroidManifest.xml | 6 +- .../testing/android/Activities.kt | 2 +- .../android/TestInstrumentationRunner.kt | 2 +- .../testing/android/contextUtils.kt | 2 +- .../testing/android/uiAutomatorUtils.kt | 4 +- .../testing/android/uiDeviceUtils.kt | 2 +- .../testing/android/uiObjectUtils.kt | 2 +- .../testing/common/CIOnlyTestRule.kt | 2 +- .../testing/common/NoOpStatement.kt | 2 +- .../codeonthego}/lsp/api/LSPTest.kt | 40 +- .../lsp/api/util/ReflectiveLogListener.kt | 70 +- .../codeonthego}/tooling/test/Main.java | 10 +- .../codeonthego}/tooling/test/Main.java | 10 +- .../codeonthego}/tooling/test/Main.java | 10 +- .../codeonthego}/tooling/test/Main.java | 10 +- .../src/main/res/layout/unsupported_views.xml | 16 +- .../resources/SourceFileTest_template.java | 14 +- .../actions/AddImportAction_template.java | 14 +- ...enerateSettersAndGettersTest_template.java | 22 +- .../LambdaMembersCompletionTest_template.java | 32 +- .../LocalsCompletionTest_template.java | 22 +- .../MembersCompletionTest_template.java | 16 +- .../StaticMembersCompletionTest_template.java | 14 +- .../package/SourceFileTest_template.java | 14 +- .../PartialErrReparserTest_template.java | 2 +- .../partial/PartialReparserTest_template.java | 2 +- ...odBodySelectionExpansionTest_template.java | 14 +- ...SimpleSelectionExpansionTest_template.java | 12 +- .../TrySelectionExpansionTest_template.java | 26 +- .../FindHelperRegexElements_template.java | 2 +- .../itsaky/androidide/tooling/test/Main.java | 5 - .../codeonthego/tooling/test/Main.java | 5 + .../itsaky/androidide/tooling/test/Main.java | 5 - .../codeonthego/tooling/test/Main.java | 5 + .../itsaky/androidide/tooling/test/Main.java | 5 - .../codeonthego/tooling/test/Main.java | 5 + .../testing/tooling/ToolingApiTestLauncher.kt | 48 +- .../models/ToolingApiTestLauncherParams.kt | 10 +- .../tooling/models/ToolingApiTestScope.kt | 8 +- .../codeonthego}/testing/tooling/utils.kt | 2 +- .../uidesigner/ShowXmlActivity.kt | 20 +- .../uidesigner/UIDesignerActivity.kt | 28 +- .../uidesigner/actions/RedoAction.kt | 4 +- .../uidesigner/actions/ShowHierarchyAction.kt | 8 +- .../uidesigner/actions/ShowXmlAction.kt | 14 +- .../uidesigner/actions/UiDesignerAction.kt | 18 +- .../uidesigner/actions/UndoAction.kt | 4 +- .../uidesigner/actions/uiDesignerActions.kt | 6 +- .../uidesigner/adapters/AddAttrListAdapter.kt | 8 +- .../adapters/ViewAttrListAdapter.kt | 20 +- .../adapters/WidgetsCategoryAdapter.kt | 8 +- .../uidesigner/adapters/WidgetsItemAdapter.kt | 12 +- .../uidesigner/drag/WidgetDragListener.kt | 14 +- .../drag/WidgetDragShadowBuilder.kt | 2 +- .../uidesigner/drag/WidgetTouchListener.kt | 8 +- .../drawable/UiViewLayeredForeground.kt | 6 +- .../uidesigner/fragments/AddAttrFragment.kt | 12 +- .../fragments/AttrValueEditorFragment.kt | 8 +- .../fragments/DesignerWorkspaceFragment.kt | 40 +- .../uidesigner/fragments/ViewInfoFragment.kt | 14 +- .../uidesigner/fragments/ViewInfoSheet.kt | 4 +- .../fragments/WidgetsListFragment.kt | 10 +- .../WorkspaceLayoutInflationHandler.kt | 14 +- .../fragments/WorkspaceViewAttrHandler.kt | 18 +- .../WorkspaceViewHierarchyHandler.kt | 26 +- .../uidesigner/models/CommonUiView.kt | 2 +- .../uidesigner/models/CommonUiViewImpl.kt | 2 +- .../uidesigner/models/PlaceholderView.kt | 4 +- .../uidesigner/models/RootWorkspaceView.kt | 6 +- .../uidesigner/models/UiAttribute.kt | 14 +- .../codeonthego}/uidesigner/models/UiView.kt | 8 +- .../uidesigner/models/UiViewGroup.kt | 12 +- .../uidesigner/models/UiWidgetCategory.kt | 4 +- .../uidesigner/undo/AttrAction.kt | 6 +- .../uidesigner/undo/AttrAddedAction.kt | 8 +- .../uidesigner/undo/AttrRemovedAction.kt | 8 +- .../uidesigner/undo/AttrUpdatedAction.kt | 8 +- .../codeonthego}/uidesigner/undo/IUiAction.kt | 2 +- .../uidesigner/undo/UndoManager.kt | 2 +- .../uidesigner/undo/ViewAction.kt | 6 +- .../uidesigner/undo/ViewAddedAction.kt | 4 +- .../uidesigner/undo/ViewMovedAction.kt | 8 +- .../uidesigner/undo/ViewRemovedAction.kt | 4 +- .../codeonthego}/uidesigner/undo/undoUtils.kt | 4 +- .../utils/UiInflaterComponentFactory.kt | 22 +- .../uidesigner/utils/UiLayoutInflater.kt | 8 +- .../utils/ValueCompletionProvider.kt | 20 +- .../uidesigner/utils/ViewToXml.kt | 18 +- .../codeonthego}/uidesigner/utils/Widgets.kt | 8 +- .../utils/WorkspaceHierarchyChangeListener.kt | 8 +- .../uidesigner/utils/designerUtils.kt | 6 +- .../viewmodel/WorkspaceViewModel.kt | 10 +- .../uidesigner/views/LayoutHierarchyView.kt | 14 +- .../main/res/layout/activity_ui_designer.xml | 10 +- .../src/main/res/navigation/nav_viewinfo.xml | 8 +- .../codeonthego}/uidesigner/UiDesignerTest.kt | 24 +- .../uidesigner/undo/UndoManagerTest.kt | 10 +- .../codeonthego}/inflater/AbstractParser.kt | 34 +- .../inflater/AttributeHandlerScope.kt | 4 +- .../inflater/DefaultComponentFactory.kt | 10 +- .../inflater/ForwardingViewGroup.kt | 2 +- .../codeonthego}/inflater/IAttribute.kt | 2 +- .../inflater/IComponentFactory.kt | 6 +- .../codeonthego}/inflater/ILayoutInflater.kt | 22 +- .../codeonthego}/inflater/INamespace.kt | 4 +- .../codeonthego}/inflater/IView.kt | 2 +- .../codeonthego}/inflater/IViewAdapter.kt | 8 +- .../inflater/IViewAdapterIndex.kt | 4 +- .../codeonthego}/inflater/IViewGroup.kt | 2 +- .../inflater/IViewGroupAdapter.kt | 2 +- .../codeonthego}/inflater/InflateException.kt | 2 +- .../codeonthego}/inflater/LayoutStrategy.kt | 2 +- .../inflater/drawable/BitmapDrawableParser.kt | 4 +- .../inflater/drawable/ClipDrawableParser.kt | 2 +- .../drawable/DrawableParserFactory.java | 8 +- .../inflater/drawable/IDrawableParser.kt | 242 +- .../inflater/drawable/InsetDrawableParser.kt | 4 +- .../inflater/drawable/LayerListParser.kt | 4 +- .../inflater/drawable/ScaleDrawableParser.kt | 4 +- .../inflater/drawable/ShapeDrawableParser.kt | 556 ++--- .../inflater/drawable/StateListParser.kt | 4 +- .../inflater/events/IInflateEventsListener.kt | 2 +- .../inflater/events/IInflationEvent.kt | 2 +- .../inflater/events/inflationEvents.kt | 6 +- .../inflater/internal/AttributeImpl.kt | 10 +- .../inflater/internal/ErrorView.kt | 4 +- .../inflater/internal/ForwardingView.kt | 4 +- .../internal/ImmutableAttributeImpl.kt | 4 +- .../internal/ImmutableViewGroupImpl.kt | 8 +- .../inflater/internal/ImmutableViewImpl.kt | 8 +- .../inflater/internal/IncludeView.kt | 8 +- .../inflater/internal/LayoutFile.kt | 2 +- .../inflater/internal/LayoutInflaterImpl.kt | 60 +- .../inflater/internal/NamespaceImpl.kt | 4 +- .../inflater/internal/SingleChildViewGroup.kt | 4 +- .../inflater/internal/ViewGroupImpl.kt | 8 +- .../inflater/internal/ViewImpl.kt | 20 +- .../internal/adapters/AbsListViewAdapter.kt | 4 +- .../internal/adapters/AbsSeekBarAdapter.kt | 4 +- .../internal/adapters/AbsSpinnerAdapter.kt | 4 +- .../adapters/AbsoluteLayoutAdapter.kt | 2 +- .../internal/adapters/AdapterViewAdapter.kt | 6 +- .../internal/adapters/AnalogClockAdapter.kt | 6 +- .../adapters/AutoCompleteTextViewAdapter.kt | 6 +- .../internal/adapters/ButtonAdapter.kt | 4 +- .../internal/adapters/CalendarViewAdapter.kt | 6 +- .../internal/adapters/CheckBoxAdapter.kt | 4 +- .../adapters/CheckedTextViewAdapter.kt | 6 +- .../internal/adapters/ChronometerAdapter.kt | 6 +- .../adapters/CompoundButtonAdapter.kt | 6 +- .../internal/adapters/DigitalClockAdapter.kt | 4 +- .../internal/adapters/EditTextAdapter.kt | 4 +- .../internal/adapters/FrameLayoutAdapter.kt | 6 +- .../adapters/GestureOverlayViewAdapter.kt | 6 +- .../internal/adapters/GridLayoutAdapter.kt | 10 +- .../internal/adapters/GridViewAdapter.kt | 6 +- .../adapters/HorizontalScrollViewAdapter.kt | 10 +- .../internal/adapters/ImageButtonAdapter.kt | 4 +- .../internal/adapters/ImageSwitcherAdapter.kt | 4 +- .../internal/adapters/ImageViewAdapter.kt | 8 +- .../internal/adapters/LinearLayoutAdapter.kt | 18 +- .../internal/adapters/ListViewAdapter.kt | 8 +- .../MultiAutoCompleteTextViewAdapter.kt | 4 +- .../internal/adapters/NumberPickerAdapter.kt | 4 +- .../internal/adapters/ProgressBarAdapter.kt | 6 +- .../adapters/QuickContactBadgeAdapter.kt | 4 +- .../internal/adapters/RadioButtonAdapter.kt | 4 +- .../internal/adapters/RadioGroupAdapter.kt | 10 +- .../internal/adapters/RatingBarAdapter.kt | 6 +- .../adapters/RelativeLayoutAdapter.kt | 6 +- .../internal/adapters/ScrollViewAdapter.kt | 10 +- .../internal/adapters/SeekBarAdapter.kt | 6 +- .../internal/adapters/SpaceAdapter.kt | 4 +- .../internal/adapters/SpinnerAdapter.kt | 6 +- .../internal/adapters/SurfaceViewAdapter.kt | 4 +- .../internal/adapters/SwitchAdapter.kt | 6 +- .../internal/adapters/TextClockAdapter.kt | 6 +- .../internal/adapters/TextSwitcherAdapter.kt | 4 +- .../internal/adapters/TextViewAdapter.kt | 10 +- .../internal/adapters/TextureViewAdapter.kt | 8 +- .../internal/adapters/ToggleButtonAdapter.kt | 8 +- .../internal/adapters/VideoViewAdapter.kt | 4 +- .../inflater/internal/adapters/ViewAdapter.kt | 28 +- .../internal/adapters/ViewAnimatorAdapter.kt | 6 +- .../internal/adapters/ViewFlipperAdapter.kt | 6 +- .../internal/adapters/ViewGroupAdapter.kt | 12 +- .../internal/adapters/ViewSwitcherAdapter.kt | 4 +- .../internal/adapters/WebViewAdapter.kt | 4 +- .../adapters/appcompat/AppCompatTextView.kt | 2 +- .../internal/ui/DesignerTextureView.kt | 2 +- .../inflater/internal/utils/IDTable.kt | 2 +- .../inflater/internal/utils/TextDrawable.kt | 2 +- .../inflater/internal/utils/ViewFactory.kt | 6 +- .../inflater/internal/utils/ViewUtils.kt | 2 +- .../internal/utils/basicParseUtils.kt | 6 +- .../inflater/internal/utils/lookup.kt | 4 +- .../inflater/internal/utils/viewParseUtils.kt | 2 +- .../codeonthego}/inflater/models/UiWidget.kt | 22 +- .../inflater/utils/inflaterUtils.kt | 26 +- .../codeonthego}/inflater/utils/module.kt | 6 +- .../codeonthego}/inflater/utils/viewUtils.kt | 2 +- .../inflater/vectormaster/DefaultValues.java | 2 +- .../vectormaster/VectorMasterDrawable.java | 14 +- .../vectormaster/VectorMasterView.java | 12 +- .../inflater/vectormaster/enums/TintMode.java | 2 +- .../vectormaster/models/ClipPathModel.java | 6 +- .../vectormaster/models/GroupModel.java | 6 +- .../vectormaster/models/PathModel.java | 10 +- .../vectormaster/models/VectorModel.java | 4 +- .../vectormaster/utilities/Utils.java | 2 +- .../utilities/legacyparser/PathParser.java | 2 +- .../utilities/parser/ParserHelper.java | 2 +- .../utilities/parser/PathParser.java | 2 +- .../codeonthego}/inflater/AdapterIndexTest.kt | 2 +- .../codeonthego}/inflater/ExampleUnitTest.kt | 2 +- .../inflater/LayoutInflaterTest.kt | 32 +- .../codeonthego}/inflater/ValueParsersTest.kt | 18 +- .../codeonthego}/inflater/XmlInflaterTest.kt | 16 +- .../codeonthego}/inflater/adapterUtils.kt | 52 +- 2609 files changed, 30874 insertions(+), 30836 deletions(-) rename actions/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/ActionData.java (94%) rename actions/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/ActionItem.kt (96%) rename actions/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/ActionMenu.kt (97%) rename actions/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/ActionsRegistry.kt (92%) rename actions/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/EditTextAdapter.kt (98%) rename actions/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/EditorActionItem.kt (96%) rename actions/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/FillMenuParams.kt (90%) rename actions/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/OnActionClickListener.kt (96%) rename actions/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/SidebarActionItem.kt (97%) rename actions/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/SidebarSlotManager.kt (95%) rename actions/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/TextTarget.kt (86%) rename actions/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/actionUtils.kt (95%) rename actions/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/internal/DefaultActionsRegistry.kt (92%) rename actions/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/locations/CodeActionsMenu.kt (85%) rename actions/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/ActionTooltipResolutionTest.kt (98%) rename actions/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/SidebarSlotManagerTest.kt (92%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/AutomationEndToEndTest.kt (80%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/AutomationTestSuite.kt (86%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/CleanupTest.kt (96%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/EndToEndTest.kt (77%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/ExportCacheDirectoryTest.kt (99%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/OrderedTestSuite.kt (87%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/ProjectBuildTestWithGroovyGradle.kt (89%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/ProjectBuildTestWithKtsGradle.kt (91%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/QuickBuildFlagOffTest.kt (79%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/QuickBuildPipelineTest.kt (94%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/QuickBuildSmokeTest.kt (81%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/strictmode/FrameMatcherTest.kt (98%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/strictmode/StackMatcherTest.kt (98%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/strictmode/Utils.kt (95%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/strictmode/WhitelistEngineTest.kt (98%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/strictmode/WhitelistRulesTest.kt (97%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/ui/IDEEditorTest.kt (97%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/helper/AdvancePastWelcomeScreenHelper.kt (97%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/helper/ConfigureAutomationBuildPreferencesHelper.kt (91%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/helper/DevicePermissionGrantUiHelper.kt (99%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/helper/EnsureHomeScreenHelper.kt (94%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/helper/ExperimentsFlagHelper.kt (92%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/helper/FakeInstalledPackages.kt (96%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/helper/GrantRequiredPermissionsUiHelper.kt (93%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/helper/HandlePrivacyDisclosureHelper.kt (93%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/helper/ProjectBuildHelper.kt (79%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/scenarios/InitializationProjectAndCancelingBuildScenario.kt (98%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/scenarios/NavigateToMainScreenScenario.kt (90%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/scenarios/RunAssembleTasksScenario.kt (96%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/screens/EditorScreen.kt (87%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/screens/ErrorBannerScreen.kt (98%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/screens/HomeScreen.kt (89%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/screens/InstallToolsScreen.kt (87%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/screens/OnboardingScreen.kt (92%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/screens/PermissionScreen.kt (96%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/screens/ProjectSettingsScreen.kt (96%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/screens/QuickBuildScreen.kt (98%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/screens/SystemPermissionsScreen.kt (96%) rename app/src/androidTest/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/screens/TemplateScreen.kt (90%) rename app/src/debug/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/LeakCanaryConfig.kt (69%) rename app/src/debug/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/BenchEventsFile.kt (97%) rename app/src/debug/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/BenchQuickBuildMetricsSink.kt (99%) rename app/src/debug/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/BenchStateRecorder.kt (98%) rename app/src/debug/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildBenchActivity.kt (88%) rename app/src/debug/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildBenchAutostart.kt (93%) rename app/src/debug/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildBenchHooks.kt (96%) delete mode 100644 app/src/main/java/com/itsaky/androidide/events/PluginLanguagesChangedEvent.kt delete mode 100644 app/src/main/java/com/itsaky/androidide/fragments/debug/DisplayableUtils.kt delete mode 100644 app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutGroupProvider.kt rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/BaseBuildAction.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/BaseEditorAction.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/EditorActivityAction.kt (89%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/EditorRelatedAction.kt (88%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/FileActionManager.kt (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/PluginActionItem.kt (82%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/PluginSidebarActionItem.kt (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/PluginToolbarActionItem.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/Util.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/build/AbstractCancellableRunAction.kt (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/build/AbstractModuleAssemblerAction.kt (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/build/AbstractRunAction.kt (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/build/DebugAction.kt (71%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/build/PluginBuildActionItem.kt (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/build/ProjectSyncAction.kt (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/build/QuickBuildAction.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/build/QuickRunAction.kt (74%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/build/RunTasksAction.kt (86%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/build/StandardRunClobberDecision.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/debug/AbstractDebuggerAction.kt (77%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/debug/AbstractStepAction.kt (66%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/debug/KillVmAction.kt (74%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/debug/RestartVmAction.kt (76%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/debug/StepIntoAction.kt (75%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/debug/StepOutAction.kt (74%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/debug/StepOverAction.kt (75%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/debug/SuspendResumeVmAction.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/editor/CopyAction.kt (88%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/editor/CutAction.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/editor/ExpandSelectionAction.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/editor/LongSelectAction.kt (82%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/editor/PasteAction.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/editor/SelectAllAction.kt (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/etc/DisconnectLogSendersAction.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/etc/FindAction.kt (83%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/etc/FindInFileAction.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/etc/FindInProjectAction.kt (83%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/etc/LaunchAppAction.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/etc/ReplaceInProjectAction.kt (76%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/file/CloseAllFilesAction.kt (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/file/CloseFileAction.kt (88%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/file/CloseOtherFilesAction.kt (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/file/CreateLinkAction.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/file/FileTabAction.kt (77%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/file/FormatCodeAction.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/file/InstallFileAction.kt (82%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/file/SaveFileAction.kt (88%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/file/SaveFollowUp.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/file/ShowTooltipAction.kt (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/filetree/BaseDirNodeAction.kt (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/filetree/BaseFileTreeAction.kt (80%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/filetree/CopyPathAction.kt (78%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/filetree/DeleteAction.kt (81%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/filetree/HelpAction.kt (75%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/filetree/NewFileAction.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/filetree/NewFolderAction.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/filetree/OpenWithAction.kt (82%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/filetree/RenameAction.kt (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/internalActionUtils.kt (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/main/CloneRepositoryAction.kt (76%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/main/CreateProjectAction.kt (78%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/main/DeleteProjectAction.kt (79%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/main/DocsAction.kt (82%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/main/DonateAction.kt (77%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/main/OpenProjectAction.kt (78%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/main/OpenTerminalAction.kt (76%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/main/PreferencesAction.kt (78%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/observers/FileActionObserver.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/profiler/ProfilerAction.kt (75%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/profiler/ReleaseVariant.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/sidebar/AbstractSidebarAction.kt (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/sidebar/BuildVariantsSidebarAction.kt (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/sidebar/CloseProjectSidebarAction.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/sidebar/FileTreeSidebarAction.kt (88%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/sidebar/HelpSideBarAction.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/sidebar/OutlineSidebarAction.kt (79%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/sidebar/PreferencesSidebarAction.kt (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/sidebar/TerminalSidebarAction.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/text/RedoAction.kt (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/text/UndoAction.kt (86%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/AboutActivity.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/CrashHandlerActivity.java (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/DeepLinkActivity.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/ExternalFileInstallActivity.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/ExternalFileInstallScreen.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/MainActivity.kt (89%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/OnboardingActivity.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/PluginManagerActivity.kt (88%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/PluginScreenActivity.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/PluginScreenNavigator.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/PreferencesActivity.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/SetupState.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/SplashActivity.kt (79%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/BaseEditorActivity.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/EditorActivityKt.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/EditorHandlerActivity.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/FAQActivity.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/FileSaveOutcome.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/FullscreenManager.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/IDELogcatReader.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/PeerCursorOverlayManager.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/ProjectHandlerActivity.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/QuickBuildClobberConfirmation.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/SaveResultFlags.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/BuildVariantsAdapter.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/DeleteProjectListAdapter.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/DiagnosticItemAdapter.java (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/DiagnosticsAdapter.java (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/EditorBottomSheetTabAdapter.java (100%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/EditorBottomSheetTabAdapter.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/FilterableRecyclerViewAdapter.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/MainActionsListAdapter.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/OptionsSheetAdapter.java (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/RecentProjectsAdapter.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/RunTasksListAdapter.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/SearchListAdapter.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/SymbolInputAdapter.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/TemplateListAdapter.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/TemplateWidgetsListAdapter.kt (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/onboarding/DefaultOnboardingItemAdapter.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/onboarding/OnboardingPermissionsAdapter.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/viewholders/FileTreeViewHolder.java (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/viewholders/MultiSelectFileTreeViewHolder.java (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/agent/model/ModelLoadResult.kt (86%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/analytics/AnalyticsManager.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/analytics/AttachedDevicesCollector.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/analytics/AttachedDevicesMetric.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/analytics/DeepLinkMetric.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/analytics/Metric.kt (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/analytics/gradle/BuildCompletedMetric.kt (82%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/analytics/gradle/BuildMetric.kt (70%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/analytics/gradle/BuildStartedMetric.kt (82%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/analytics/gradle/StrategySelectedMetric.kt (81%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/analytics/quickbuild/AnalyticsQuickBuildMetricsSink.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/analytics/quickbuild/QuickBuildMetrics.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/api/ActionContextProvider.kt (89%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/api/BuildOutputProvider.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/api/IDEApiFacade.kt (88%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/api/LogsProvider.kt (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/ActivityLifecycleCallbacksDelegate.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/ApplicationLoader.kt (89%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/CredentialProtectedApplicationLoader.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/DeviceProtectedApplicationLoader.kt (86%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/EdgeToEdgeIDEActivity.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/EditorEvents.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/EditorProviderImpl.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/IDEActivity.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/IDEActivityDelegate.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/IDEApplication.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/PluginRunAppCoordinator.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/TermuxApplicationLoader.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/configuration/IDEBuildConfigProviderImpl.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/configuration/JdkDistributionProviderImpl.kt (89%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/strictmode/FrameMatcher.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/strictmode/StackMatcher.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/strictmode/StrictModeConfig.kt (86%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/strictmode/StrictModeManager.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/strictmode/ViolationDispatcher.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/strictmode/ViolationHandler.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/strictmode/ViolationListener.kt (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/strictmode/WhitelistBuilder.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/strictmode/WhitelistEngine.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/assets/AssetsInstallExceptions.kt (62%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/assets/AssetsInstallationHelper.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/assets/AssetsInstaller.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/assets/BaseAssetsInstaller.kt (82%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/assets/BundledAssetsInstaller.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/assets/SplitAssetsInstaller.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/deeplink/ConsumedRequests.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/deeplink/PendingDeepLinkOpen.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/di/AppModule.kt (62%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/di/PluginModule.kt (64%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/di/QuickBuildModule.kt (89%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/di/TemplateModule.kt (59%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/dnd/DragAndDropExtensions.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/dnd/DragEventRouter.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/dnd/DropTargetCallback.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/dnd/FileDragStarter.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/dnd/GitUrlDropExtensions.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/dnd/GitUrlDropTarget.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/floating/ChromeControlTooltips.kt (64%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/floating/EditorPanelDockableContent.kt (78%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/floating/IdeFloatingTabController.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/floating/MetricsCarouselDockableContent.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/floating/PluginTabDockableContent.kt (78%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/events/FileTree.kt (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/events/InstallationResultEvent.kt (86%) create mode 100644 app/src/main/java/org/appdevforall/codeonthego/events/PluginLanguagesChangedEvent.kt rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/BasePreferenceFragment.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/CloneRepositoryFragment.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/CrashReportFragment.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/DeleteProjectFragment.kt (83%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/DiagnosticsListFragment.kt (83%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/EmptyStateFragment.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/FindActionDialog.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/IDEPreferencesFragment.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/IDETooltipWebViewFragment.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/MainFragment.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/RecentProjectsFragment.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/RecyclerViewFragment.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/RunTasksDialogFragment.kt (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/SearchFieldToolbar.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/SearchResultFragment.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/TemplateDetailsFragment.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/TemplateListFragment.kt (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/debug/CallStackFragment.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/debug/DebuggerFragment.kt (92%) create mode 100644 app/src/main/java/org/appdevforall/codeonthego/fragments/debug/DisplayableUtils.kt rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/debug/Resolvable.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/debug/VariableIcon.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/debug/VariableListBinder.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/debug/VariableListFragment.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/debug/VariableTreeNodeGenerator.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/debug/WADBPermissionFragment.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/git/GitBottomSheetFragment.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/git/GitBranchPopupWindow.kt (89%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/git/GitCommitHistoryDialog.kt (89%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/git/GitDialogUtils.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/git/GitDiffViewerDialog.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/git/adapter/GitBranchAdapter.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/git/adapter/GitCommitHistoryAdapter.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/git/adapter/GitFileChangeAdapter.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/onboarding/GreetingFragment.kt (88%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/onboarding/IdeSetupConfigurationFragment.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/onboarding/OnboardingFragment.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/onboarding/OnboardingInfoFragment.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/onboarding/OnboardingMultiActionFragment.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/onboarding/PermissionsFragment.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/onboarding/ideSetupConfig.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/output/AppLogFragment.kt (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/output/BuildOutputFragment.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/output/FilterNoMatchTracker.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/output/IDELogFragment.kt (89%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/output/LogFilterBarController.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/output/LogViewFragment.kt (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/output/NonEditableEditorFragment.java (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/output/SearchableOutputFragment.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/output/ShareableOutputFragment.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/output/ViewOptionsOutputFragment.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/output/WrappableOutputFragment.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/sheets/BaseBottomSheetFragment.java (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/sheets/OptionsListFragment.java (89%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/sheets/ProgressSheet.java (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/sidebar/BuildVariantsFragment.kt (88%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/sidebar/EditorSidebarFragment.kt (82%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/sidebar/FileTreeDropController.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/sidebar/FileTreeFragment.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/sidebar/FileTreeSelectionFragment.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/sidebar/OutlineFragment.kt (88%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/handlers/BaseEventHandler.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/handlers/CrashEventSubscriber.kt (82%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/handlers/EditorActivityLifecyclerObserver.kt (70%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/handlers/EditorBuildEventListener.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/handlers/FileTreeActionHandler.kt (81%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/handlers/GlitchTipDiagnosticsContext.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/handlers/LspHandler.kt (73%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/handlers/MetricsCrashAttachment.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/handlers/SnippetHandler.kt (73%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/interfaces/DiagnosticClickListener.java (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/interfaces/IEditorHandler.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/localWebServer/WebServer.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logs/LogBuffer.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/BreakpointHandler.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/IDEDebugClientImpl.kt (89%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/IDELanguageClientImpl.java (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/PluginLanguageSupport.kt (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/SearchResultGrouping.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/ApkMetadata.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/ArtifactType.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/Checkable.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/ContextListItem.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/DeepLinkRequest.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/DefaultOnboardingItem.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/DiagnosticGroup.java (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/EditorIntentExtras.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/FileExtension.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/HyperlinkedOnboardingItem.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/IdeSetupArguments.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/InstallTaskRequest.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/LogFilter.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/MetadataElement.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/NewProjectDetails.java (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/OnboardingItem.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/OnboardingPermissionItem.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/OpenedFile.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/OpenedFilesCache.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/ProjectFile.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/ProjectTemplate.java (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/RunTasksCategory.kt (88%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/SearchResult.java (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/StepResult.kt (75%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/StorageInfo.kt (73%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/Symbol.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/aboutPrefExts.kt (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/buildAndRunPrefExts.kt (64%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/commonPrefExts.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/developerOptionsPrefExts.kt (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/editorPrefExts.kt (88%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/generalPrefExts.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/gitPrefExts.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/javaPrefExts.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/pluginPrefExts.kt (89%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/rootPrefExts.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/termuxPrefsExt.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/xmlPrefExts.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/builder/BuildResult.kt (69%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/builder/LaunchResult.kt (56%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/provider/IDEDocumentsProvider.java (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/provider/IDEFileProvider.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/AndroidProxyAppLauncher.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/AutostartBuild.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/CompositeQuickBuildMetricsSink.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/EnvironmentQuickBuildPaths.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/GenerateSourcesDeferral.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/GradleQuickBuildProvisioner.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/PreferencesQuickBuildHistoryStore.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildArtifactStager.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildFlashes.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildGraphWarmUp.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildInstallAdapters.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildMessages.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildOutputLines.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildOutputMetricsSink.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildOutputNarrator.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildPrebuildStagger.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildProjectSupport.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildStatusBar.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildTaskPaths.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildTransitions.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildWontStayUpRestart.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/repositories/BreakpointRepository.kt (88%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/repositories/PluginRepository.kt (89%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/repositories/PluginRepositoryImpl.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/repositories/RecentProjectRepository.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/repositories/RecentProjectRepositoryImpl.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/repositories/TemplateCollectionRepository.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/repositories/TemplateCollectionRepositoryImpl.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/repositories/TemplateRepository.kt (89%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/repositories/TemplateRepositoryImpl.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/roomData/recentproject/RecentProject.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/roomData/recentproject/RecentProjectDao.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/roomData/recentproject/RecentProjectMaintenance.kt (83%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/roomData/recentproject/RecentProjectMaintenanceDao.kt (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/roomData/recentproject/RecentProjectRoomDatabase.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/search/replace/OpenTabUndo.kt (84%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/search/replace/ProjectReplacer.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/search/replace/ReplaceCoordinator.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/search/replace/ReplaceSession.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/search/replace/TextReplacement.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/InstallationResultReceiver.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/ToolingServerAlreadyStartedException.java (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/ToolingServerNotStartedException.java (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/BalancedStrategy.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/BuildInProgressException.java (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/BuildProfile.kt (71%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/CpuInfo.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/DeviceInfo.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/DeviceProfile.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/GradleBuildService.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/GradleBuildServiceConnnection.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/GradleBuildTuner.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/GradleServiceBinder.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/GradleTuningConfig.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/GradleTuningStrategy.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/HighPerformanceStrategy.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/InternalBuildBracket.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/InternalBuildOutputCapture.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/LowMemoryStrategy.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/ThermalInfo.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/ThermalSafeStrategy.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/ToolingServerRunner.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/util.kt (83%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/debug/DebugOverlayManager.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/debug/DebuggerActionsOverlayAdapter.kt (83%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/debug/DebuggerService.kt (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/debug/ForegroundAppReceiver.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/log/CachingLogSender.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/log/ConnectionObserverParams.kt (87%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/log/LogReceiverImpl.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/log/LogReceiverService.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/log/LogReceiverServiceConnection.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/log/LogSenderHandler.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/log/LogSendersRegistry.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/log/MultiLogSenderHandler.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/log/utils.kt (88%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/shortcuts/IdeShortcutActions.kt (83%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/shortcuts/KeyShortcut.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/shortcuts/ShortcutCatalog.kt (86%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/shortcuts/ShortcutCategory.kt (71%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/shortcuts/ShortcutContext.kt (59%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/shortcuts/ShortcutDefinition.kt (80%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/shortcuts/ShortcutExecutionContext.kt (76%) create mode 100644 app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutGroupProvider.kt rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/shortcuts/ShortcutManager.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/shortcuts/groups/FileManagementGroup.kt (69%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/shortcuts/groups/ProjectsAndSolutionsGroup.kt (72%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/shortcuts/groups/SearchAndReplaceGroup.kt (73%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/shortcuts/groups/ShortcutDefinitionIds.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/shortcuts/groups/ShortcutGroup.kt (50%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/shortcuts/groups/WindowsAndDisplayGroup.kt (74%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tasks/callables/FileTreeCallable.java (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tasks/callables/ListDirectoryCallable.java (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tasks/callables/UnzipCallable.java (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/manager/models/CgtFileItem.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/manager/parsing/CgtTemplateReader.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/CodeEditorView.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/CustomDividerItemDecoration.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/CustomSnackbar.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/EditorBottomSheet.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/EmptyView.java (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/IdeNavigationRailView.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/InfoRowView.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MemoryUsageChartRenderer.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MetricsCarouselAdapter.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MetricsCarouselController.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MetricsCarouselLayout.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MetricsChartRenderer.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/NetworkUsageChartRenderer.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/PowerUsageChartRenderer.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/ProjectInfoBottomSheet.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/SafeLineChart.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/ScalableTabLayout.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/StorageDialog.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/SwipeRevealLayout.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/SymbolInputView.java (86%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/compose/ManagerScreen.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/compose/TooltipInterop.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/compose/common/FileImage.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/compose/plugins/PluginListItem.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/compose/plugins/PluginManagerContent.kt (89%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/compose/plugins/PluginManagerDialogs.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/compose/templates/TemplateListItem.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/compose/templates/TemplateManagerDialogs.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/compose/templates/TemplateManagerScreen.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/compose/theme/ManagerTheme.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/models/ExternalFileInstallUiModels.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/models/OutlineUiState.kt (79%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/models/PluginManagerUiState.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/models/TemplateManagerUiState.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/outline/OutlinePanel.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/outline/OutlineRows.kt (88%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/themes/ThemeManager.kt (89%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/transition/ArcMotionPlus.java (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/transition/CubicBezierArc.java (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/transition/ProgressTransition.java (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ActionMenuUtils.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ApkInstaller.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/BuildCancellation.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/BuildInfoUtils.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ClassBuilder.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/DeepLinkProjectResolution.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/DevicePowerSource.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/DiagnosticsFormatter.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/DropHighlighter.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/EditorActivityActions.kt (69%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/EditorDecorationBridge.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/EditorRightSidebarActions.kt (100%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/EditorSidebarActions.kt (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FileDeleteUtils.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FileImporter.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FlexboxUtils.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FragmentUtils.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/HtmlTextUtils.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/InstallTempFiles.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/InstallationResultHandler.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/InstallerIoUtils.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/IntentUtils.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/JSONUtility.java (88%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/JdkUtils.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/LastValueGate.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ListingFileRedirect.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MainScreenActions.kt (56%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MemoryUsageWatcher.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MetricsAnnotationStore.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MetricsCsv.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MetricsCsvFile.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MetricsFileName.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MetricsSamplingRates.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MetricsScratch.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MetricsSnapshot.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MetricsSnapshotAssembler.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MetricsSource.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MutableShiftedLongArray.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/NetworkUsageWatcher.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/NoOpServiceConnection.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/OverlayPermissionGuide.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/PermissionsHelper.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/PowerUsageWatcher.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/PrivilegedActions.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ProcessMemoryReader.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ProjectCreationManager.kt (78%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ProjectLocation.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ProjectOpenBookkeeping.kt (83%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ProjectSearchOptions.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ProjectStringsXmlResolver.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ProjectValidations.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ProjectWriter.java (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/RecentProjectLocationReconciler.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/RecursiveFileSearcher.java (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ShiftedLongArray.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/SingleBottomSheetCallback.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/StorageSizeUtils.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/StorageUtils.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/StringsXmlInjector.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/Symbols.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/TemplateRecipeExecutor.kt (89%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/TerminalInstallResultExtensions.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/TerminalInstaller.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/TextWatcherAdapter.java (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/UriFileImporter.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/WindowInsetsExtensions.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/WordBoundary.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ZipExts.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ui/TemplateScrollGateKeeper.kt (98%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/ApkInstallationViewModel.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/AppLogsCoordinator.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/AppLogsViewModel.kt (60%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/BottomSheetViewModel.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/BuildOutputViewModel.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/BuildState.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/BuildVariantsViewModel.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/BuildViewModel.kt (91%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/CloneRepositoryViewModel.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/DebuggerViewModel.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/EditorViewModel.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/EmptyStateFragmentViewModel.kt (97%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/FileManagerViewModel.kt (89%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/FileTreeViewModel.kt (90%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/GitBottomSheetViewModel.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/IDELogsViewModel.kt (82%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/InstallationState.kt (88%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/InstallationViewModel.kt (82%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/LogViewModel.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/MainViewModel.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/MetricsViewModel.kt (85%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/OutlineViewModel.kt (92%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/RecentProjectsViewModel.kt (93%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/RunTasksViewModel.kt (94%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/TaskState.kt (70%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/WADBConnectionViewModel.kt (99%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodels/ExternalFileInstallViewModel.kt (96%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodels/PluginManagerViewModel.kt (95%) rename app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodels/TemplateManagerViewModel.kt (91%) rename app/src/release/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/LeakCanaryConfig.kt (63%) rename app/src/release/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildBenchHooks.kt (89%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/build/QuickBuildActionPresentationTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/build/QuickBuildActionSaveOrderTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/build/SlotBusyBuildActionsTest.kt (87%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/build/StandardRunClobberDecisionTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/file/CreateLinkActionTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/file/SaveFollowUpTest.kt (96%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/actions/profiler/ReleaseVariantTest.kt (95%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/DeepLinkSetupGateTest.kt (95%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/DeepLinkTargetsNotExportedTest.kt (95%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/DebuggerServiceUnbindTest.kt (84%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/EditorHandlerActivityTest.kt (90%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/MemUsageLineColorTest.kt (92%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/OverlappingSaveFlagTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/QuickBuildClobberConfirmationTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/RestorePluginTabsThreadTest.kt (96%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/SameProjectDeepLinkMidSyncTest.kt (95%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/SaveFileResultTest.kt (95%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/SaveResultFlagsTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/analytics/AnalyticsManagerConsentTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/analytics/AttachedDevicesCollectorTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/analytics/AttachedDevicesMetricTest.kt (95%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/analytics/BuildCompletedMetricTest.kt (88%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/analytics/DeepLinkMetricTest.kt (95%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/analytics/quickbuild/AnalyticsQuickBuildMetricsSinkTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/api/BuildOutputProviderMainThreadTest.kt (96%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/api/BuildOutputProviderTest.kt (95%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/api/LogsProviderTest.kt (90%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/ForegroundActivityTrackingTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/PluginRunAppCoordinatorTest.kt (91%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/TelemetryConsentMigrationTest.kt (92%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/configuration/IDEBuildConfigProviderImplTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/assets/AssetsInstallationHelperTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/assets/ExtractZipToDirMergeTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/deeplink/ConsumedRequestsTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/floating/FloatingWindowProjectCloseTest.kt (93%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/IDEPreferencesFragmentTest.kt (95%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/ScrollIndicatorBlinkTest.kt (96%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/TemplateDetailsBlinkLifecycleTest.kt (96%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/git/GitCommitWatermarkTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/output/BuildOutputFragmentDetachedTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/output/FilterNoMatchTrackerTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/sheets/ProgressSheetDismissTest.kt (96%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/handlers/EditorBuildEventListenerAnnotationTest.kt (87%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/handlers/GlitchTipDiagnosticsContextTest.kt (94%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/handlers/MetricsCrashAttachmentEnvelopeTest.kt (93%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/handlers/MetricsCrashAttachmentTest.kt (93%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/handlers/SnippetHandlerTest.kt (90%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/localWebServer/AcceptFailureTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/localWebServer/BookshelfPayloadTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/localWebServer/BookshelfQueryTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/localWebServer/BrotliDictionaryDecodeTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/localWebServer/TestServerConfig.kt (93%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/localWebServer/WebServerTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logs/LogBufferTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/ComputeNewBreakpointPositionTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/SearchResultGroupingTest.kt (96%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/DeepLinkBuildUrlTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/DeepLinkManifestPrefixTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/DeepLinkRequestTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/InstallTaskRequestTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/LogFilterTest.kt (96%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/GitPreferencesTest.kt (90%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/IDEPreferencesTooltipTagsTest.kt (91%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/PluginPrefExtsTest.kt (93%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/PluginSettingsEntryPreferenceTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/StatPreferencesTest.kt (83%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/AndroidProxyAppLauncherTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/ApkSigningCertTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/CompositeQuickBuildMetricsSinkTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/EnvironmentQuickBuildPathsD8Test.kt (96%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/GenerateSourcesDeferralEntryPointTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/GenerateSourcesDeferralTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/GradleQuickBuildProvisionerAwaitTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/GradleQuickBuildProvisionerBaselineTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/GradleQuickBuildProvisionerCancelTest.kt (87%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/GradleQuickBuildProvisionerFailureArmsTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/GradleQuickBuildProvisionerFakes.kt (90%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/GradleQuickBuildProvisionerMessagesTest.kt (96%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/GradleQuickBuildProvisionerSigningTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/GradleQuickBuildProvisionerSlotTest.kt (84%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/GradleQuickBuildProvisionerStampTest.kt (95%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/InstallationEventFlowTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/PreferencesQuickBuildHistoryStoreTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildArtifactStagerTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildFlashesTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildGraphWarmUpTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildMessagesTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildOutputLinesTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildOutputMetricsSinkTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildOutputNarratorTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildPrebuildDecisionTest.kt (96%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildPrebuildStaggerTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildProjectSupportTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildStatusBarTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildStatusStringsTest.kt (95%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildTaskPathsTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildWontStayUpRestartTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/repositories/TemplateCollectionRepositoryImplTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/repositories/TemplateRepositoryImplTest.kt (94%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/roomData/recentproject/RecentProjectRoomDatabaseTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/search/replace/OpenTabUndoTest.kt (91%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/search/replace/ProjectReplacerTest.kt (95%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/search/replace/ReplaceSessionTest.kt (89%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/search/replace/TextReplacementTest.kt (90%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/GradleBuildParamsTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/GradleBuildServiceListenerWrapperTest.kt (94%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/GradleBuildServiceNotificationStatusTest.kt (94%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/GradleBuildServiceServerExitTest.kt (90%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/GradleBuildTunerTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/InternalBuildBracketTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/InternalBuildOutputCaptureTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/builder/ToolingServerRunnerTest.kt (89%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/services/debug/DebuggerServiceDestroyTest.kt (92%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/manager/models/CgtFileItemTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/manager/parsing/CgtTemplateReaderTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/ChartGestureHarness.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/ChartLayout.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/CollapsedHeaderHeightTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/IdeNavigationRailViewTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/LongPressHelpTimingTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MemoryUsageChartRendererTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MetricsAnnotationRenderingTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MetricsAnnotationSpanTest.kt (95%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MetricsCarouselAdapterTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MetricsCarouselHelpTest.kt (96%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MetricsCarouselLayoutTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MetricsCarouselRebindTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MetricsChartAxisTapTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MetricsChartGestureTeardownTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MetricsChartHoldHelpTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MetricsChartLargeTextTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MetricsChartLegendFormTest.kt (96%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MetricsChartNewestWindowTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/MetricsChartTextScaleTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/NetworkUsageChartRendererTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/PowerUsageChartRendererTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/SafeLineChartTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/outline/OutlineRowsTest.kt (86%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ClassBuilderTest.kt (87%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/DevicePowerEnvelopeTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FeatureFlagsTest.kt (95%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FileActionPopupLayoutTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FileDeleteUtilsTest.kt (95%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/InstallationResultHandlerSuppressLaunchTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/IntentUtilsShareTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/JdkUtilsTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MemoryUsageWatcherIntervalTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MemoryUsageWatcherLivenessTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MemoryUsageWatcherReaderFallbackTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MemoryUsageWatcherSampleAlignmentTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MetricsAnnotationStoreTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MetricsCsvFileTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MetricsCsvTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MetricsFileNameTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MetricsSamplingRatesTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MetricsScratchTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/MetricsSnapshotTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/NetworkUsageWatcherTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/NetworkWatcherLifecycleTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/PowerUsageWatcherTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ProcessMemoryReaderTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ProjectLocationTest.kt (94%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ProjectValidationsTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/RecentProjectLocationReconcilerTest.kt (95%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/RecursiveFileSearcherTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ShiftedArrayTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ShiftedLongArrayCopyIntoTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/WatcherIntervalChangeTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/WatcherLifecycleTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/WordBoundaryTest.kt (95%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/ApkInstallationViewModelDestroyTest.kt (94%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/ApkInstallationViewModelReloadStatusTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/BuildOutputFilterTest.kt (99%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/BuildOutputSessionSinkTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/BuildViewModelInstallReArmTest.kt (96%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/BuildViewModelTest.kt (92%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/CloneRepositoryViewModelTest.kt (95%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/EditorViewModelSaveFlagTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/EditorViewModelTest.kt (94%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/EmptyStateFragmentViewModelTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/GitBottomSheetViewModelTest.kt (93%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/LogViewModelTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/MainDispatcherRule.kt (93%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/MetricsViewModelTest.kt (98%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodel/OutlineViewModelTest.kt (93%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodels/ExternalFileInstallViewModelTest.kt (97%) rename app/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/viewmodels/TemplateManagerViewModelTest.kt (87%) rename app/src/testDebug/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/BenchEventsFileTest.kt (98%) rename app/src/testDebug/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/BenchQuickBuildMetricsSinkTest.kt (99%) rename app/src/testDebug/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/BenchStateRecorderTest.kt (99%) rename app/src/testDebug/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildBenchActivityGateTest.kt (97%) rename app/src/testDebug/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/QuickBuildBenchHooksInertTest.kt (90%) rename common-compose/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/common/compose/IdeColorScheme.kt (98%) rename common-compose/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/common/compose/IdeTheme.kt (97%) rename common-compose/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/common/compose/IdeColorSchemeTest.kt (98%) rename common-ui/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/DraggableTouchListener.kt (98%) rename common-ui/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/FabPositionCalculator.kt (97%) rename common-ui/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/FabPositionRepository.kt (96%) rename common-ui/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/FeedbackButtonManager.kt (95%) rename common/src/androidTest/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/DatabaseVersionResolverTest.kt (99%) rename common/src/androidTest/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FlashActivityUtilsKtTest.kt (92%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/editor/HelpActivity.kt (96%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/IconTextAdapter.java (98%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/IconTitleDescriptionAdapter.kt (93%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/SimpleIconTextAdapter.java (90%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/adapters/SimpleIconTitleDescriptionAdapter.kt (90%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/BaseApplication.kt (92%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/BaseIDEActivity.kt (91%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/configuration/CpuArch.kt (95%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/configuration/IDEBuildConfigProvider.kt (95%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/app/configuration/IJdkDistributionProvider.kt (93%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/colorpicker/ColorPickerView.java (96%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/documentation/DatabaseTemplateLoader.kt (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/documentation/DocumentationContentSource.kt (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/documentation/DocumentationRequestInterceptor.kt (98%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/BaseFragment.kt (94%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/fragments/FragmentWithBinding.kt (97%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/interfaces/Filter.java (94%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/interfaces/ProjectWriterCallback.java (95%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/managers/NoopSharedPreferencesImpl.kt (97%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/managers/PreferenceManager.kt (94%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/managers/ToolsManager.java (96%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/Constants.java (94%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/IconTextListItem.java (93%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/IconTitleDescriptionItem.kt (87%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/JdkDistribution.kt (95%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/SaveResult.java (97%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/SheetOption.java (97%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/SimpleIconTitleDescriptionItem.kt (97%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/shell/IProcessBuilder.kt (92%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/shell/ProcessBuilderImpl.kt (95%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/shell/shellUtils.kt (97%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/syntax/colorschemes/DynamicColorScheme.kt (95%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/syntax/colorschemes/SchemeAndroidIDE.java (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/syntax/decoration/EditorDecorationRegistry.kt (93%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/syntax/highlighters/Highlighter.java (90%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/syntax/highlighters/JavaHighlighter.java (98%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tasks/TaskExecutor.kt (98%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tasks/coroutineUtils.kt (95%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/Language.kt (94%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/BottomInsetHeightDistributor.kt (94%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/ContentTranslatingDrawerLayout.kt (98%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/InterceptableDrawerLayout.kt (98%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/ProjectActionsToolbar.kt (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/themes/IDETheme.kt (96%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/ui/themes/IThemeManager.kt (92%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/AndroidUtils.java (97%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/BuildInfoUtils.kt (96%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/CharSequenceInputStream.java (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/CharSequenceReader.java (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/CollectionExts.kt (72%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ColorUtil.kt (97%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ContentTypeHeaders.kt (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ContextUtils.kt (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/DatabaseVersionResolver.kt (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/DateFormatter.kt (93%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/DeviceFormFactor.kt (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/DeviceUtils.kt (97%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/DialogUtils.kt (96%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/DocumentationCompression.kt (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/EdgeToEdgeUtils.java (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/Environment.java (98%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FeatureFlags.kt (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FeedbackEmailHandler.kt (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FeedbackManager.kt (98%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FileProviderUtils.kt (96%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FileUtil.java (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FileUtils.kt (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FlashbarActivityUtils.kt (95%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FlashbarDismissGate.kt (96%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FlashbarUtils.kt (94%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FragmentExts.kt (95%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/GetProjectBuildVersions.kt (97%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/GetProjectDetails.kt (96%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ImageUtils.kt (98%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/InsetUtils.kt (98%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/IntProperty.java (97%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/IntentExtensions.kt (93%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/JavaCharacter.java (98%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/KeyboardUtils.kt (97%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/KeyedDebouncingAction.kt (95%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/LSPUtils.java (96%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/LegacyIdeDataDirMigration.java (97%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ManufacturerUtils.kt (97%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/NavigationBar.kt (98%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/OrientationUtilities.kt (96%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/PathTraversal.kt (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ProjectAttrs.kt (95%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ReflectUtils.kt (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ResourceUtils.kt (95%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/SelfSignedCert.kt (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/SingleSessionCallback.kt (96%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/SingleTextWatcher.java (91%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/SparseArrayUtils.kt (95%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/StrictModeExts.kt (96%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/TermuxProcessEnvironment.kt (94%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/TestModeUtils.kt (82%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/TypefaceUtils.kt (91%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/UriExtensions.kt (96%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ViewExtensions.kt (99%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/WindowInsetExtensions.kt (98%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/WindowUtils.kt (96%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ZipUtils.kt (98%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/buildVersionExt.kt (97%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/connectionUtilExt.kt (98%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ioUtils.kt (98%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/urlManager.kt (96%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/window/ActivityCompatHelper.kt (96%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/window/Bounds.kt (98%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/window/DisplayCompatHelper.kt (97%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/window/WindowManager.kt (95%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/window/WindowMetrics.kt (97%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/window/WindowMetricsCalculator.kt (98%) rename common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/window/WindowMetricsCalculatorCompat.kt (94%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/documentation/DatabaseTemplateLoaderTest.kt (99%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/documentation/DocumentationContentSourceTest.kt (99%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/documentation/DocumentationRequestInterceptorTest.kt (99%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/managers/ToolsManagerToolingJarTest.kt (99%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/BasicBuildInfoTest.kt (94%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ContentTypeHeadersTest.kt (99%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/DatabaseVersionResolverBranchTest.kt (98%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FeatureFlagsTest.kt (98%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FeedbackMetricsAttachmentTest.kt (98%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FileProviderUtilsTest.kt (95%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FileUtilsTest.kt (98%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FlashbarDismissGateTest.kt (97%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/GetProjectBuildVersionsTest.kt (99%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ImageUtilsTest.kt (98%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/KeyedDebouncingActionCancelTest.kt (98%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/KeyedDebouncingActionSelfScheduleTest.kt (97%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/PathTraversalTest.kt (99%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ReflectUtilsTest.kt (98%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ResourceUtilsTest.kt (97%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/SelfSignedCertTest.kt (98%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/SymlinkTestSupport.kt (97%) rename common/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ZipUtilsTest.kt (99%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/api/IEditor.java (97%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/api/ILspEditor.kt (90%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/TreeSitterInputEdit.kt (94%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/TreeSitterLookaheadIterator.kt (91%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/TreeSitterNativeLanguage.kt (92%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/TreeSitterNode.kt (93%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/TreeSitterObjectFactory.kt (100%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/TreeSitterObjectPoolProvider.kt (90%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/TreeSitterParser.kt (91%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/TreeSitterPoint.kt (91%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/TreeSitterQuery.kt (91%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/TreeSitterQueryCapture.kt (92%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/TreeSitterQueryCursor.kt (91%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/TreeSitterQueryMatch.kt (92%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/TreeSitterQueryPredicateStep.kt (91%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/TreeSitterRange.kt (93%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/TreeSitterTree.kt (92%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/TreeSitterTreeCursor.kt (92%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/TreeSitterTreeCursorNode.kt (92%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/tsRecyclableUtils.kt (95%) rename editor-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/api/tsUtils.kt (100%) rename editor-treesitter/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/nodeExt.kt (100%) rename editor-treesitter/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/treesitter/pointExt.kt (100%) rename editor/src/androidTest/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/outline/TreeSitterOutlineProviderTest.kt (98%) rename editor/src/androidTest/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/outline/TreeSitterOutlineQueryTest.kt (96%) rename editor/src/androidTest/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/LineSpansSnapshotTest.kt (96%) rename editor/src/androidTest/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/TsAnalyzeWorkerStopTest.kt (96%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/adapters/CompletionListAdapter.kt (79%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/adapters/IdeEditorAdapter.kt (79%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/events/FileUpdateEvent.kt (78%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/events/LanguageUpdateEvent.kt (81%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/CommonCompletionProvider.kt (81%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/CompletionCancelChecker.kt (91%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/IDELanguage.kt (87%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/LSPFormatter.kt (87%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/cpp/CppAnalyzer.java (88%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/cpp/CppLanguage.java (92%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/groovy/GroovyAnalyzer.kt (94%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/groovy/GroovyAutoComplete.java (98%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/groovy/GroovyLanguage.java (92%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/incremental/BaseIncrementalAnalyzeManager.java (96%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/incremental/IncrementalToken.kt (96%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/incremental/LineState.kt (95%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/newline/BaseNewlineHandler.kt (97%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/newline/BracketsNewlineHandler.kt (97%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/newline/CStyleBracketsHandler.kt (94%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/newline/TSBracketsHandler.kt (93%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/newline/TSCStyleBracketsHandler.kt (87%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/outline/OutlineProvider.kt (73%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/outline/OutlineSymbol.kt (87%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/outline/OutlineTreeBuilder.kt (93%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/outline/TreeSitterOutlineProvider.kt (91%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/JavaLanguage.kt (77%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/JsonLanguage.kt (89%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/KotlinLanguage.kt (80%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/LogLanguage.kt (87%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/PluginTreeSitterLanguage.kt (88%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/TSLanguageRegistry.kt (95%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/TreeSitterAnalyzeManager.kt (92%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/TreeSitterIndentProvider.kt (98%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/TreeSitterLanguage.kt (89%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/TreeSitterLanguageProvider.kt (96%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/TreeSitterLanguageSpec.kt (96%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/TreeSitterSpanFactory.kt (95%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/XMLLanguage.kt (82%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/common.kt (85%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/internal/TSLanguageRegistryImpl.kt (89%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/predicates/AnyOfPredicate.kt (97%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/predicates/EqualPredicate.kt (97%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/predicates/InvertingPredicate.kt (96%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/predicates/MatchPredicate.kt (97%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/predicates/NotEqualPredicate.kt (93%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/predicates/NotMatchPredicate.kt (92%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/treesitter/predicates/TreeSitterPredicate.kt (97%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/utils/CommonSymbolPairs.kt (96%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/utils/CompletionHelper.kt (96%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/processing/SimpleMacroProcessor.kt (98%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/processing/TextProcessor.kt (96%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/processing/TextProcessorEngine.kt (95%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/schemes/IDEColorScheme.kt (94%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/schemes/IDEColorSchemeProvider.kt (95%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/schemes/LanguageSpecProvider.kt (82%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/schemes/LocalCaptureSpecProvider.kt (97%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/schemes/internal/parser/EditorSchemeParser.kt (84%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/schemes/internal/parser/LanguageParser.kt (92%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/schemes/internal/parser/ParseException.kt (93%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/schemes/internal/parser/SchemeParser.kt (96%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/schemes/internal/parser/common.kt (92%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/snippets/AbstractSnippetVariableResolver.kt (94%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/snippets/FileVariableResolver.kt (92%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/snippets/WorkspaceVariableResolver.kt (93%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/ui/AbstractPopupWindow.kt (97%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/ui/BaseEditorWindow.java (97%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/ui/DiagnosticWindow.kt (91%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/ui/EditorActionsMenu.kt (90%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/ui/EditorCompletionLayout.kt (97%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/ui/EditorCompletionWindow.kt (93%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/ui/EditorEventDispatcher.kt (81%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/ui/EditorFeatures.kt (94%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/ui/EditorSearchLayout.kt (95%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/ui/GhostTextRenderer.kt (99%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/ui/IDECompletionPublisher.kt (96%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/ui/IDEEditor.kt (91%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/ui/ReplaceAction.kt (90%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/ui/SignatureHelpWindow.java (95%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/ui/TracingEditorRenderer.kt (99%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/utils/ContentExt.kt (97%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/utils/ContentReadWrite.kt (99%) rename editor/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/utils/OperatorSelection.kt (98%) rename editor/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/LSPFormatterTest.kt (90%) rename editor/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/outline/OutlineQueryCapturesTest.kt (93%) rename editor/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/language/outline/OutlineTreeBuilderTest.kt (95%) rename editor/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/schemes/internal/parser/SchemeParserTest.kt (98%) rename editor/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/editor/ui/SignatureHelpWindowTest.kt (85%) rename eventbus-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/eventbus/events/BuildEvent.kt (68%) rename eventbus-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/eventbus/events/Event.java (95%) rename eventbus-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/eventbus/events/EventReceiver.kt (95%) rename eventbus-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/eventbus/events/editor/ActivityLifecycleEvents.kt (93%) rename eventbus-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/eventbus/events/editor/DocumentEvents.kt (95%) rename eventbus-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/eventbus/events/editor/EditorEvents.kt (89%) rename eventbus-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/eventbus/events/editor/LayoutEditorEvents.kt (83%) rename eventbus-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/eventbus/events/file/FileEvents.kt (92%) rename eventbus-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/eventbus/events/filetree/FileTreeEvents.kt (91%) rename eventbus-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/eventbus/events/plugin/PluginCrashedEvent.kt (59%) rename eventbus-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/eventbus/events/preferences/PreferenceEvents.kt (90%) rename eventbus-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/eventbus/events/project/ProjectEvents.kt (88%) rename floating-window/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/floating/fragment/OverlayFragmentHost.kt (97%) rename floating-window/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/floating/model/ChromeControl.kt (57%) rename floating-window/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/floating/model/DockAction.kt (96%) rename floating-window/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/floating/model/DockableContent.kt (94%) rename floating-window/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/floating/model/DockingEvent.kt (92%) rename floating-window/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/floating/model/DockingManager.kt (92%) rename floating-window/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/floating/model/FloatingTab.kt (63%) rename floating-window/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/floating/permission/OverlayPermission.kt (89%) rename floating-window/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/floating/service/FloatingTabService.kt (95%) rename floating-window/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/floating/ui/FloatingTheme.kt (94%) rename floating-window/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/floating/ui/FloatingWindowChrome.kt (98%) rename floating-window/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/floating/window/FloatingWindow.kt (96%) rename floating-window/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/floating/window/FloatingWindowHost.kt (98%) rename floating-window/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/floating/window/FloatingWindowState.kt (79%) rename floating-window/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/floating/window/InitialBounds.kt (95%) rename floating-window/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/floating/window/OverlayDialogs.kt (88%) rename floating-window/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/floating/window/OverlayLayoutParams.kt (96%) rename git-core/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/git/core/CryptoManager.kt (98%) rename git-core/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/git/core/GitCredentialsManager.kt (98%) rename git-core/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/git/core/GitRepository.kt (91%) rename git-core/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/git/core/GitRepositoryManager.kt (98%) rename git-core/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/git/core/GitRepositoryUrls.kt (95%) rename git-core/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/git/core/JGitRepository.kt (97%) rename git-core/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/git/core/models/CloneRepoUiState.kt (94%) rename git-core/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/git/core/models/CommitHistoryUiState.kt (91%) rename git-core/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/git/core/models/FileChange.kt (86%) rename git-core/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/git/core/models/GitBranch.kt (78%) rename git-core/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/git/core/models/GitCommit.kt (84%) rename git-core/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/git/core/models/GitStatus.kt (92%) rename git-core/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/git/core/GitModelsTest.kt (94%) rename git-core/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/git/core/GitRepositoryManagerTest.kt (97%) rename git-core/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/git/core/JGitRepositoryTest.kt (99%) rename gradle-plugin-config/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/GradlePluginConfig.java (98%) rename gradle-plugin-config/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/ToolingConfig.java (94%) rename gradle-plugin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/AndroidIDEGradlePlugin.kt (88%) rename gradle-plugin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/AndroidIDEInitScriptPlugin.kt (100%) rename gradle-plugin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/COTGSettingsPlugin.kt (96%) rename gradle-plugin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/JdwpPlugin.kt (100%) rename gradle-plugin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/LogSenderPlugin.kt (97%) rename gradle-plugin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/ProfilerPlugin.kt (97%) rename gradle-plugin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/QuickBuildPlugin.kt (98%) rename gradle-plugin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/common.kt (97%) rename gradle-plugin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/BaselineGenerationAsset.kt (100%) rename gradle-plugin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/ClassOpener.kt (100%) rename gradle-plugin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/ComponentProxiabilityResolver.kt (99%) rename gradle-plugin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/ProxySourceGenerator.kt (98%) rename gradle-plugin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/QuickBuildJson.kt (100%) rename gradle-plugin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/QuickBuildManifestTransformer.kt (100%) rename gradle-plugin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/QuickBuildTasks.kt (99%) rename gradle-plugin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/RuntimeClassesExtractor.kt (100%) rename gradle-plugin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/SupertypeResolver.kt (100%) rename gradle-plugin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/AndroidIDEInitScriptPluginTest.kt (100%) rename gradle-plugin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/AndroidIDEPluginTest.kt (95%) rename gradle-plugin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/InitScriptClasspathTest.kt (100%) rename gradle-plugin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/InstallTaskReplacementTest.kt (97%) rename gradle-plugin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/QuickBuildPluginTest.kt (100%) rename gradle-plugin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/QuickBuildProxyAppBuildTest.kt (96%) rename gradle-plugin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/BaselineGenerationAssetTest.kt (100%) rename gradle-plugin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/ClassOpenerTest.kt (100%) rename gradle-plugin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/ComponentProxiabilityResolverTest.kt (100%) rename gradle-plugin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/ProxySourceGeneratorTest.kt (98%) rename gradle-plugin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/QuickBuildJsonTest.kt (100%) rename gradle-plugin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/QuickBuildManifestTransformerTest.kt (99%) rename gradle-plugin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/QuickBuildPayloadTransformTaskTest.kt (100%) rename gradle-plugin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/QuickBuildProxyAppReportTaskTest.kt (100%) rename gradle-plugin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/RuntimeClassesExtractorTest.kt (100%) rename gradle-plugin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/quickbuild/SupertypeResolverTest.kt (100%) rename gradle-plugin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/gradle/utils.kt (96%) rename idetooltips/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/idetooltips/DatabaseCorruptionException.kt (86%) rename idetooltips/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/idetooltips/DialogExtensions.kt (93%) rename idetooltips/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/idetooltips/IDETooltipItem.kt (95%) rename idetooltips/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/idetooltips/NoTooltipFoundException.kt (86%) rename idetooltips/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/idetooltips/ToolTipManager.kt (96%) rename idetooltips/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/idetooltips/TooltipCategory.kt (78%) rename idetooltips/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/idetooltips/TooltipTag.kt (99%) rename idetooltips/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ViewUtils.kt (98%) rename idetooltips/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/idetooltips/GradleTaskTooltipTagTest.kt (96%) rename lexers/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lexers/BaseLexerTest.kt (96%) rename lexers/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lexers/xml/XMLLexerTest.kt (98%) rename logger/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logging/provider/IdeGlobalLogBuffer.kt (98%) rename logger/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logging/provider/IdeLogFormatter.kt (97%) rename logger/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logging/provider/IdeLogSink.kt (94%) rename logger/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logging/provider/IdeLogger.kt (97%) rename logger/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logging/provider/IdeLoggerFactory.kt (95%) rename logger/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logging/provider/IdeSlf4jServiceProvider.kt (96%) rename logger/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logging/utils/LogUtils.java (93%) rename logger/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ILogger.java (92%) rename logger/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/LogTagUtils.java (96%) rename logger/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/StacktraceUtils.java (96%) rename logger/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logging/provider/IdeGlobalLogBufferTest.kt (98%) rename logger/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logging/provider/IdeLogFormatterTest.kt (82%) rename logger/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logging/provider/IdeLogRouterTest.kt (90%) rename logger/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logging/utils/LogUtilsTest.kt (96%) rename logsender-sample/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logsender/sample/MainActivity.java (94%) rename logsender/src/main/aidl/{com/itsaky/androidide => org/appdevforall/codeonthego}/logsender/ILogReceiver.aidl (81%) rename logsender/src/main/aidl/{com/itsaky/androidide => org/appdevforall/codeonthego}/logsender/ILogSender.aidl (92%) rename logsender/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logsender/LogSender.java (95%) rename logsender/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logsender/LogSenderService.java (97%) rename logsender/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logsender/socket/AbstractSocketCommand.java (96%) rename logsender/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logsender/socket/ISocketCommand.java (94%) rename logsender/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logsender/socket/SenderInfoCommand.java (95%) rename logsender/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logsender/socket/SignalCommand.java (96%) rename logsender/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logsender/socket/SocketCommandParser.java (97%) rename logsender/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logsender/utils/LogReader.java (94%) rename logsender/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logsender/utils/LogSenderInstaller.java (92%) rename logsender/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/logsender/utils/Logger.java (98%) rename lookup/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lookup/ForwardingLookup.kt (95%) rename lookup/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lookup/Lookup.java (98%) rename lookup/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lookup/LookupProvider.java (85%) rename lookup/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lookup/ServiceRegisteredException.java (95%) rename lookup/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lookup/internal/DefaultLookup.java (93%) rename lookup/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lookup/LookupTest.kt (93%) rename lookup/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lookup/internal/DefaultLookupTest.kt (80%) delete mode 100644 lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/events/BreakpointHitEvent.kt rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/actions/CommentLineAction.kt (83%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/actions/IActionsMenuProvider.kt (89%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/actions/SurroundWithTryCatch.kt (93%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/actions/SurroundWithTryCatchAction.kt (77%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/actions/UncommentLineAction.kt (84%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/api/AbstractServiceProvider.java (91%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/api/ConfigurableServiceProvider.java (88%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/api/DefaultLanguageServerRegistry.kt (93%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/api/ICompletionProvider.java (84%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/api/ILanguageClient.java (85%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/api/ILanguageServer.kt (80%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/api/ILanguageServerRegistry.kt (92%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/api/IServerSettings.java (94%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/api/helpers.kt (90%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/DebugClientConnectionResult.kt (91%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/IDebugAdapter.kt (80%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/IDebugClient.kt (91%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/IDebugEventHandler.kt (68%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/RemoteClient.kt (96%) create mode 100644 lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/events/BreakpointHitEvent.kt rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/events/EventOrResponse.kt (76%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/events/StepEvent.kt (52%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/events/StoppedEvent.kt (87%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/model/BreakpointRequest.kt (96%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/model/BreakpointResponse.kt (95%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/model/DapRequest.kt (66%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/model/DapResponse.kt (69%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/model/Location.kt (88%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/model/Source.kt (81%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/model/StepRequest.kt (77%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/model/StepResponse.kt (91%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/model/ThreadInfo.kt (97%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/model/ThreadInfoRequest.kt (91%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/model/Variables.kt (98%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/debug/utils/BreakpointNotFoundException.kt (81%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/internal/model/CachedCompletion.kt (84%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/snippets/DefaultSnippet.kt (96%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/snippets/ISnippet.kt (95%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/snippets/ISnippetScope.kt (95%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/snippets/SnippetLanguage.kt (88%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/snippets/SnippetParser.kt (94%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/snippets/SnippetRegistry.kt (97%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/snippets/UserSnippetLoader.kt (91%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/util/DefaultServerSettings.kt (92%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/util/DiagnosticUtil.java (94%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/util/DocumentationReferenceProvider.kt (87%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/util/LSPEditorActions.java (77%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/util/NoCompletionsProvider.kt (70%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/util/PrefBasedServerSettings.java (79%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/util/StringUtils.java (95%) rename lsp/api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/util/commonCompletionUtils.kt (81%) rename lsp/api/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/actions/SurroundWithTryCatchTest.kt (97%) rename lsp/api/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/api/DefaultLanguageServerRegistryTest.kt (67%) rename lsp/api/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/util/DiagnosticUtilTest.kt (93%) rename lsp/external/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/external/ExternalLanguageServer.kt (92%) rename lsp/external/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/external/Lsp4jConversions.kt (86%) rename lsp/external/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/external/ExternalLanguageServerTest.kt (91%) delete mode 100644 lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/JavaCodeActionsMenu.kt rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/CompilationCancellationException.kt (95%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/JavaCompilerProvider.java (95%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/JavaLanguageServer.kt (71%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/BaseJavaCodeAction.kt (75%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/ExtractMethodAction.kt (82%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/ExtractVariableAction.kt (78%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/FieldBasedAction.kt (82%) create mode 100644 lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/JavaCodeActionsMenu.kt rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/common/FindReferencesAction.kt (79%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/common/GoToDefinitionAction.kt (79%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/common/OrganizeImportsAction.kt (73%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/common/RemoveUnusedImportsAction.kt (74%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/diagnostics/AddImportAction.kt (80%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/diagnostics/AddThrowsAction.kt (74%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/diagnostics/AutoFixImportsAction.kt (86%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/diagnostics/CreateMissingMethodAction.kt (65%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/diagnostics/FieldToBlockAction.kt (71%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/diagnostics/ImplementAbstractMethodsAction.kt (72%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/diagnostics/RemoveClassAction.kt (66%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/diagnostics/RemoveMethodAction.kt (67%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/diagnostics/RemoveUnusedThrowsAction.kt (69%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/diagnostics/SuppressUncheckedWarningAction.kt (68%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/diagnostics/VariableToStatementAction.kt (65%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/generators/GenerateConstructorAction.kt (84%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/generators/GenerateMissingConstructorAction.kt (67%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/generators/GenerateSettersAndGettersAction.kt (84%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/generators/GenerateToStringMethodAction.kt (85%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/generators/OverrideSuperclassMethodsAction.kt (84%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/compiler/CompilationTaskProcessor.kt (96%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/compiler/CompileBatch.java (91%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/compiler/CompileTask.java (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/compiler/CompilerProvider.java (91%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/compiler/DefaultCompilationTaskProcessor.kt (93%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/compiler/JCReusableCompiler.kt (83%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/compiler/JavaCompilerConfig.kt (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/compiler/JavaCompilerImpl.kt (83%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/compiler/JavaCompilerService.java (92%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/compiler/SourceFileManager.java (93%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/compiler/SourceFileObject.java (96%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/compiler/SynchronizedTask.kt (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/EventConsumer.kt (96%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/EventHandler.kt (98%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/JavaDebugAdapter.kt (90%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/JdwpOptions.kt (97%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/ListenerState.kt (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/LspThreadInfo.kt (82%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/ThreadState.kt (98%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/Variables.kt (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/VmConnection.kt (80%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/spec/BreakpointSpec.kt (95%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/spec/ClassPatternReferenceTypeSpec.kt (96%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/spec/DebugEnv.kt (95%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/spec/EventRequestSpec.kt (99%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/spec/EventRequestSpecList.kt (96%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/spec/Exceptions.kt (74%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/spec/PatternReferenceTypeSpec.kt (92%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/spec/ReferenceTypeSpec.kt (91%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/spec/SourceReferenceTypeSpec.kt (75%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/utils/EvaluationContext.kt (98%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/utils/JdiTypes.kt (95%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/utils/KotlinClassNames.kt (96%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/utils/KotlinLocals.kt (98%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/utils/MirrorExts.kt (95%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/utils/MiscExts.kt (76%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/utils/ModelUtils.kt (91%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/utils/Strata.kt (99%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/utils/StringUtils.kt (88%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/utils/VariableValues.kt (96%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/utils/VmUtils.kt (93%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/edits/AdvancedJavaEditHandler.kt (84%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/edits/BaseJavaEditHandler.kt (83%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/edits/ClassImportEditHandler.kt (79%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/edits/MultipleClassImportEditHandler.kt (79%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/models/CompilationRequest.kt (87%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/models/DiagnosticCode.kt (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/models/JavaCompletionItem.kt (73%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/models/JavaServerConfiguration.java (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/models/JavaServerSettings.java (85%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/models/PartialReparseRequest.kt (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/parser/IJavaParser.kt (95%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/parser/ParseTask.java (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/parser/Parser.java (92%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/parser/ts/TSJavaParser.kt (90%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/parser/ts/TSMethodPruner.kt (97%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/parser/ts/TSParseCache.kt (95%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/parser/ts/TSParseResult.kt (95%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/BaseJavaServiceProvider.kt (76%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/CancelableServiceProvider.kt (88%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/CodeFormatProvider.java (86%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/CompletionProvider.java (83%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/DefinitionProvider.java (79%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/DiagnosticsProvider.kt (88%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/JavaDiagnosticProvider.kt (85%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/JavaSelectionProvider.java (85%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/ReferenceProvider.java (86%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/SignatureProvider.java (93%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/completion/ClassNamesCompletionProvider.kt (82%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/completion/IJavaCompletionProvider.kt (85%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/completion/IdentifierCompletionProvider.kt (85%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/completion/ImportCompletionProvider.kt (90%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/completion/KeywordCompletionProvider.kt (86%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/completion/MemberReferenceCompletionProvider.kt (88%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/completion/MemberSelectCompletionProvider.kt (89%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/completion/ScopeCompletionProvider.kt (83%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/completion/SnippetCompletionProvider.kt (80%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/completion/StaticImportCompletionProvider.kt (84%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/completion/SwitchConstantCompletionProvider.kt (84%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/definition/ErroneousDefinitionProvider.kt (81%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/definition/IJavaDefinitionProvider.kt (77%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/definition/LocalDefinitionProvider.kt (80%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/definition/RemoteDefinitionProvider.kt (82%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/snippet/JavaSnippetRepository.kt (81%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/snippet/JavaSnippetScope.kt (91%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/AnchorMember.kt (95%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/CandidateExpressions.kt (98%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/ExtractMethodEdit.kt (91%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/ExtractMethodPlan.kt (98%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/ExtractMethodPlanner.kt (96%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/ExtractVariableEdit.kt (84%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/ExtractVariablePlanner.kt (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/ExtractionPlan.kt (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/ExtractionRegion.kt (98%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/JavaExtractMethodUi.kt (85%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/JavaExtractVariableUi.kt (85%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/MethodSignature.kt (98%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/NameSuggestion.kt (86%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/Occurrences.kt (99%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/RegionReferences.kt (97%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/RegionTypes.kt (98%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/ScopeChain.kt (97%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/SourceNormalizer.kt (98%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/ThrownTypes.kt (99%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/TypeText.kt (99%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/rewrite/AddException.java (88%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/rewrite/AddImport.java (78%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/rewrite/AddSuppressWarningAnnotation.java (85%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/rewrite/ConvertFieldToBlock.java (83%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/rewrite/ConvertVariableToStatement.java (88%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/rewrite/CreateMissingMethod.java (90%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/rewrite/GenerateRecordConstructor.java (90%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/rewrite/ImplementAbstractMethods.java (85%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/rewrite/RemoveClass.java (78%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/rewrite/RemoveException.java (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/rewrite/RemoveMethod.java (86%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/rewrite/Rewrite.kt (85%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/ASTFixer.java (98%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/AnalyzeTimer.java (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/CancelChecker.kt (90%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/CodeActionUtils.java (89%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/CompletableDeferredExts.kt (91%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/EditHelper.java (93%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/Extractors.java (96%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/FindHelper.java (95%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/JavaParserUtils.kt (96%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/JavaPoetUtils.kt (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/MarkdownHelper.java (97%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/MethodPtr.java (95%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/NavigationHelper.java (93%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/ScopeHelper.java (96%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/ShortTypePrinter.java (98%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/TestUtils.kt (92%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/TreeUtils.kt (97%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/TypeUtils.java (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/insertUtils.kt (90%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/DiagnosticVisitor.kt (95%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/FindAnonymousTypeDeclaration.java (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/FindBiggerRange.java (96%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/FindCompletionsAt.java (98%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/FindInvocationAt.java (95%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/FindMethodAt.kt (97%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/FindMethodCallAt.java (99%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/FindMethodDeclarationAt.java (96%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/FindNameAt.java (95%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/FindReferences.java (97%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/FindTypeDeclarationAt.java (97%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/FindTypeDeclarationNamed.java (96%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/FindTypeDeclarations.java (96%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/FindVariableAtCursor.java (97%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/FindVariablesBetween.java (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/MethodRangeScanner.kt (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/PrettyPrintingVisitor.java (94%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/PrintingVisitor.kt (96%) rename lsp/java/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/visitors/PruneMethodBodies.java (97%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/JavaCompilerProviderTest.kt (89%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/JavaLSPTest.kt (81%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/AddImportTest.kt (89%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/actions/JavaCodeActionTooltipTagTest.kt (97%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/compiler/CompilerTest.kt (96%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/KotlinClassNamesTest.kt (90%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/KotlinLocalsTest.kt (95%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/SourceReferenceTypeSpecTest.kt (94%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/debug/StrataTest.kt (95%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/partial/PartialReparserImplTest.kt (90%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/JavaCompletionProviderTest.kt (88%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/providers/JavaSelectionProviderTest.kt (86%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/ExtractMethodEditTest.kt (98%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/ExtractMethodPlanTest.kt (99%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/ExtractMethodRegionTest.kt (98%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/ExtractMethodSignatureTest.kt (98%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/ExtractVariablePrimitivesTest.kt (95%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/ExtractVariableSoundnessTest.kt (98%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/ExtractionRegionSoundnessTest.kt (99%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/JavacFixture.kt (98%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/RegionAnalysisPrimitivesTest.kt (97%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/refactor/SourceNormalizerTest.kt (96%) rename lsp/java/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/java/utils/FindHelperTest.kt (85%) delete mode 100644 lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/KotlinCodeActionsMenu.kt rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/FileEventConsumer.kt (82%) create mode 100644 lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/KotlinCodeActionsMenu.kt rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/KotlinLanguageServer.kt (80%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/KotlinServerSettings.kt (90%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/actions/AddImportAction.kt (83%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/actions/BaseKotlinCodeAction.kt (69%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/actions/ExtractMethodAction.kt (79%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/actions/ExtractVariableAction.kt (73%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/actions/FindReferencesAction.kt (83%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/actions/GoToDefinitionAction.kt (80%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/actions/ImplementMembersAction.kt (87%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/actions/InlineVariableAction.kt (82%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/actions/NullSafetyAction.kt (82%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/actions/OrganizeImportsAction.kt (76%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/AbstractCompilationEnvironment.kt (94%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/CompilationEnvironment.kt (88%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/CompilationKind.kt (93%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/Compiler.kt (92%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/CompilerExts.kt (79%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/IncrementalModificationTracker.kt (89%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/KotlinApplicationEnvironmentPin.kt (92%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/KotlinProjectModel.kt (94%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/ReadWriteLock.kt (91%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/WorkspaceExts.kt (76%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/index/IndexCommand.kt (89%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/index/IndexWorker.kt (93%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/index/KtSymbolIndex.kt (95%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/index/LiveKtFile.kt (93%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/index/ScanningWorker.kt (79%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/index/SourceFileIndexer.kt (96%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/index/WorkerQueue.kt (96%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/modules/AbstractKtModule.kt (97%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/modules/AbstractSourceModule.kt (91%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/modules/AnalysisScheduler.kt (98%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/modules/AnalysisThreadContext.java (95%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/modules/CancelCheckerProgressIndicator.kt (91%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/modules/KtFileExts.kt (96%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/modules/KtLibraryModule.kt (96%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/modules/KtModule.kt (96%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/modules/KtSourceModule.kt (90%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/modules/NotUnderContentRootModule.kt (95%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/registrar/AnalysisApiServiceProvider.kt (98%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/registrar/AnalysisApiServiceProviders.kt (77%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/registrar/LspAnalysisApiServiceRegistrar.kt (96%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/services/AnalysisPermissionOptions.kt (81%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/services/AnnotationsResolver.kt (94%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/services/DeclarationsProvider.kt (94%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/services/DirectInheritorsProvider.kt (93%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/services/JavaModuleAccessibilityChecker.kt (95%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/services/JavaModuleAnnotationsProvider.kt (90%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/services/KtLspService.kt (55%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/services/LanguageSettings.kt (84%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/services/ModificationTrackerFactory.kt (80%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/services/ModuleDependentsProvider.kt (91%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/services/NoOpAsyncExecutionService.kt (99%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/services/PackageProvider.kt (89%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/services/PlatformSettings.kt (84%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/services/ProjectStructureProvider.kt (93%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/services/ResolutionScopeProvider.kt (95%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/services/WriteAccessGuard.kt (82%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/util/SLF4JLogger.kt (95%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/completion/AdvancedKotlinEditHandler.kt (81%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/completion/BaseKotlinEditHandler.kt (65%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/completion/CompletionContext.kt (82%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/completion/ContextKeywords.kt (96%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/completion/ContextResolver.kt (99%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/completion/DeclarationContext.kt (90%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/completion/KotlinAutoImportEditHandler.kt (64%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/completion/KotlinCompletionItem.kt (59%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/completion/KotlinCompletions.kt (93%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/completion/KotlinSnippetRepository.kt (57%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/completion/KotlinSnippetScope.kt (83%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/completion/ModifierFilter.kt (98%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/diagnostic/KotlinDiagnosticProvider.kt (90%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/format/KotlinCodeFormatter.kt (76%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/navigation/FindUsages.kt (94%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/navigation/GoToDefinition.kt (91%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/navigation/ReferenceAtCaret.kt (98%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/navigation/TargetAtCaret.kt (98%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/refactor/KotlinExtractMethodUi.kt (67%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/refactor/KotlinExtractVariableUi.kt (76%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/refactor/ui/InlineVariableSheet.kt (89%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/refactor/ui/InlineVariableSheetContent.kt (88%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/signaturehelp/ActiveParameterResolver.kt (96%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/signaturehelp/CallAtCursorFinder.kt (96%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/signaturehelp/KotlinSignatureHelp.kt (86%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/signaturehelp/SignatureInfoBuilder.kt (82%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/AbstractMemberStubs.kt (99%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/ContextKeywords.kt (94%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/ContextResolver.kt (93%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/EditExts.kt (92%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/ImportOrganizer.kt (98%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/ImportUsageCollector.kt (98%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/ModifierFilter.kt (96%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/NullSafetyFix.kt (96%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/SymbolExts.kt (92%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/SymbolVisibilityChecker.kt (95%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/TypeRendering.kt (92%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/VirtualFileExts.kt (86%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/CandidateExpressions.kt (98%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/ExtractMethodEdit.kt (92%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/ExtractMethodPlan.kt (96%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/ExtractMethodPlanner.kt (91%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/ExtractVariableEdit.kt (84%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/ExtractVariablePlanner.kt (92%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/ExtractionPlan.kt (95%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/ExtractionRegion.kt (97%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/InlineVariableEdit.kt (93%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/InlineVariablePlan.kt (98%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/InlineVariablePlanner.kt (98%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/MethodSignature.kt (99%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/NameSuggestion.kt (87%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/Occurrences.kt (99%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/RefactoringPlan.kt (91%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/ScopeChain.kt (96%) rename lsp/kotlin/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/TypeText.kt (98%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/KotlinCodeActionTooltipTagTest.kt (68%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/actions/AddImportActionPinScopeTest.kt (87%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/actions/AddImportActionTest.kt (93%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/index/BufferMovedWhileComputingTest.kt (82%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/index/CurrentKtFileCacheTest.kt (92%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/index/DiskCopyEvictionTest.kt (79%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/index/IndexWorkerBatchRemovalTest.kt (99%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/index/IndexWorkerDisposalTest.kt (95%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/index/LiveKtFilePinTest.kt (92%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/index/SourceFileIndexerTest.kt (95%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/index/StaleKtFileInstanceDiagnosticsTest.kt (85%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/index/StalePinEditRefusalTest.kt (86%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/modules/AnalysisSerializationTest.kt (98%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/modules/ContentScopeStalenessTest.kt (92%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/compiler/util/SLF4JLoggerTest.kt (88%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/completion/CompletionRequestBufferTest.kt (82%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/completion/MatchLevelMemoTest.kt (92%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/fixtures/InterModuleResolutionTest.kt (96%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/fixtures/KtLspTest.kt (87%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/fixtures/KtLspTestEnvironment.kt (93%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/fixtures/KtLspTestEnvironmentTest.kt (96%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/fixtures/KtLspTestRule.kt (97%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/fixtures/TestKtSourceModule.kt (80%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/fixtures/TestSourceModuleSpec.kt (89%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/format/KotlinCodeFormatterTest.kt (91%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/navigation/FindDefinitionRequestTest.kt (89%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/navigation/FindUsagesLiveDocumentTest.kt (85%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/navigation/FindUsagesTest.kt (96%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/navigation/GoToDefinitionTest.kt (97%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/navigation/ReferenceAtCaretTest.kt (96%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/navigation/TargetAtCaretTest.kt (97%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/refactor/KotlinExtractMethodUiTest.kt (73%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/signaturehelp/ActiveParameterResolverTest.kt (93%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/signaturehelp/CallAtCursorFinderTest.kt (90%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/signaturehelp/KotlinSignatureHelpTest.kt (93%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/signaturehelp/SignatureInfoBuilderTest.kt (92%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/AbstractMemberStubsTest.kt (97%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/ContextKeywordsTest.kt (97%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/EditExtsTest.kt (89%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/ImplementMembersEndToEndTest.kt (93%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/ImportOrganizerTest.kt (95%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/ImportUsageCollectorTest.kt (97%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/NullSafetyFixTest.kt (95%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/OrganizeImportsEndToEndTest.kt (88%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/SymbolVisibilityCheckerTest.kt (97%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/ExtractMethodEditTest.kt (98%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/ExtractMethodPlanEndToEndTest.kt (99%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/ExtractMethodRegionTest.kt (95%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/ExtractVariableEditTest.kt (97%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/ExtractVariablePlanEndToEndTest.kt (98%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/InlineVariableEditTest.kt (98%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/InlineVariablePlanEndToEndTest.kt (98%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/InlineVariablePlanTest.kt (97%) rename lsp/kotlin/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/kotlin/utils/refactor/RefactorPrimitivesTest.kt (93%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/CancellableRequestParams.kt (89%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/LspParams.kt (95%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/edits/DefaultEditHandler.kt (91%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/edits/IEditHandler.kt (91%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/models/CodeActions.kt (93%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/models/CodeFormatException.kt (66%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/models/CodeFormatting.kt (94%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/models/CompletionData.kt (98%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/models/CompletionItemComparator.java (93%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/models/Completions.kt (87%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/models/Definitions.kt (79%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/models/Diagnostics.kt (85%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/models/Edits.kt (93%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/models/ExpandSelectionParams.kt (89%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/models/HighlightToken.kt (93%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/models/Initialization.kt (96%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/models/LSPFailure.kt (95%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/models/Markups.kt (88%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/models/References.kt (79%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/models/Signatures.kt (87%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/models/TextDocument.kt (89%) rename lsp/models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/util/RewriteHelper.kt (93%) rename lsp/refactor-core/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/refactor/BlockRewrite.kt (99%) rename lsp/refactor-core/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/refactor/NamePrimitives.kt (97%) rename lsp/refactor-core/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/refactor/RewriteSpan.kt (82%) rename lsp/refactor-core/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/refactor/SourceText.kt (98%) rename lsp/refactor-core/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/refactor/TextSpan.kt (91%) rename lsp/refactor-core/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/refactor/RefactorCoreTest.kt (99%) rename lsp/ui/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/ui/ExtractMethodContract.kt (97%) rename lsp/ui/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/ui/ExtractMethodSheet.kt (97%) rename lsp/ui/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/ui/ExtractMethodSheetContent.kt (98%) rename lsp/ui/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/ui/ExtractMethodUiState.kt (96%) rename lsp/ui/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/ui/ExtractMethodViewModel.kt (98%) rename lsp/ui/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/ui/ExtractVariableContract.kt (98%) rename lsp/ui/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/ui/ExtractVariableSheet.kt (97%) rename lsp/ui/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/ui/ExtractVariableSheetContent.kt (99%) rename lsp/ui/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/ui/ExtractVariableUiState.kt (97%) rename lsp/ui/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/ui/ExtractVariableViewModel.kt (99%) rename lsp/ui/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/ui/SheetComponents.kt (97%) rename lsp/ui/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/ui/VariableName.kt (97%) rename lsp/ui/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/ui/ExtractMethodViewModelTest.kt (99%) rename lsp/ui/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/ui/ExtractVariableViewModelTest.kt (99%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/XMLLanguageServer.kt (63%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/edits/AttrValueEditHandler.kt (94%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/edits/QualifiedValueEditHandler.kt (85%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/edits/TagEditHandler.kt (94%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/models/XMLFormattingOptions.kt (90%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/models/XMLServerSettings.kt (89%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/AdvancedEditProvider.kt (89%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/CodeFormatProvider.java (74%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/XmlCompletionProvider.kt (69%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/AttrCompletionProvider.kt (92%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/AttrValueCompletionProvider.kt (90%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/IXmlCompletionProvider.kt (85%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/common/CommonAttrCompletionProvider.kt (85%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/etc/InheritingAttrCompletionProvider.kt (86%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/layout/LayoutAttrCompletionProvider.kt (75%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/layout/LayoutTagCompletionProvider.kt (76%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/layout/QualifiedTagCompleter.kt (76%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/layout/SimpleTagCompleter.kt (78%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/layoutFileCompletions.kt (87%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/manifest/ManifestAttrCompletionProvider.kt (73%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/manifest/ManifestAttrValueCompletionProvider.kt (81%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/manifest/ManifestTagCompletionProvider.kt (66%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/manifestFileCompletions.kt (81%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/xmlCompletions.kt (88%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/format/DOMAttributeFormatter.java (95%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/format/DOMCDATAFormatter.java (96%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/format/DOMCommentFormatter.java (95%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/format/DOMDocTypeFormatter.java (96%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/format/DOMElementFormatter.java (96%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/format/DOMProcessingInstructionFormatter.java (94%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/format/DOMTextFormatter.java (95%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/format/FormatElementCategory.java (95%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/format/TextEditUtils.java (94%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/format/XMLFormatter.java (90%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/format/XMLFormatterDocument.java (95%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/format/XMLFormatterDocumentNew.java (95%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/format/XMLFormattingConstraints.java (94%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/snippet/XmlSnippetRepository.kt (80%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/snippet/XmlSnippetScope.kt (91%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/utils/StringUtils.java (99%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/utils/XMLBuilder.java (93%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/utils/XmlUtils.kt (88%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/utils/inheritingAttrs.kt (96%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/utils/tagTransforms.kt (96%) rename lsp/xml/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/utils/xmlCompletionUtils.kt (94%) rename lsp/xml/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/CompletionHelper.kt (89%) rename lsp/xml/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/CompletionHelperImpl.kt (87%) rename lsp/xml/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/XMLLSPTest.kt (82%) rename lsp/xml/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/AttributeValueCompletionTest.kt (96%) rename lsp/xml/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/CommonAttrCompletionProviderTest.kt (90%) rename lsp/xml/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/CommonAttrValueCompletionTest.kt (89%) rename lsp/xml/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/LayoutAttributeCompletionProviderTest.kt (97%) rename lsp/xml/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/ManifestAttrCompletionProviderTest.kt (89%) rename lsp/xml/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/ManifestAttrValueCompletionProviderTest.kt (95%) rename lsp/xml/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/ManifestTagCompletionProviderTest.kt (88%) rename lsp/xml/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/providers/completion/XMLCompletionProviderTest.kt (88%) rename lsp/xml/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/xml/utils/TagTransformsTest.kt (98%) rename plugin-api/plugin-builder/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/build/GenerateCgpBuildProperties.kt (98%) rename plugin-api/plugin-builder/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/build/PluginBuilder.kt (99%) rename plugin-api/plugin-builder/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/build/PluginBuilderExtension.kt (95%) rename plugin-api/plugin-builder/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/build/PluginProvenance.kt (99%) rename plugin-api/plugin-builder/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/build/ProvenanceResolver.kt (98%) rename plugin-api/plugin-builder/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/build/CgpBuildPropertiesTest.kt (98%) rename plugin-api/plugin-builder/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/build/GitDirectoryReaderTest.kt (98%) rename plugin-api/plugin-builder/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/build/PluginProvenanceTest.kt (99%) rename plugin-api/plugin-builder/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/build/ProvenanceResolverTest.kt (99%) rename plugin-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/CapabilityStatus.java (94%) rename plugin-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/LlmInferenceService.java (99%) rename plugin-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/ToolSourceRegistry.java (99%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/IPlugin.kt (97%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/PluginContext.kt (99%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/ai/LlmBackendRegistration.kt (94%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/ai/prompt/PromptConfigDocument.kt (98%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/ai/prompt/PromptConfigException.kt (80%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/ai/prompt/PromptConfigLoader.kt (98%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/ai/prompt/PromptConfigObject.kt (98%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/ai/prompt/PromptConfigSource.kt (95%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/ai/prompt/PromptConfigStore.kt (98%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/ai/prompt/PromptTemplateEngine.kt (99%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/ai/prompt/PromptText.kt (88%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/ai/ui/PaneStyling.kt (98%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/ai/ui/SecretRevealController.kt (98%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/base/InternalPluginApi.kt (84%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/base/PluginFragment.kt (97%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/base/PluginWindows.kt (99%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/base/SafePluginLayoutInflater.kt (98%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/extensions/BuildActionExtension.kt (96%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/extensions/DocumentationExtension.kt (97%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/extensions/EditorDecorationProvider.kt (94%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/extensions/EditorExtension.kt (95%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/extensions/EditorTabExtension.kt (95%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/extensions/FileOpenExtension.kt (84%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/extensions/LanguageExtension.kt (83%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/extensions/ProjectExtension.kt (94%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/extensions/ProjectSearchExtension.kt (96%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/extensions/SettingsExtension.kt (94%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/extensions/SnippetExtension.kt (69%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/extensions/UIExtension.kt (97%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/security/KeystoreSecretStore.kt (99%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/security/SecretKeySource.kt (98%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/IdeArchiveService.kt (97%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/IdeCommandService.kt (63%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/IdeEditorTabService.kt (94%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/IdeEnvironmentService.kt (91%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/IdeFeatureFlagService.kt (59%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/IdeLogService.kt (98%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/IdeServices.kt (96%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/IdeSidebarService.kt (81%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/IdeSnippetService.kt (58%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/IdeTemplateService.kt (74%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/IdeThemeService.kt (83%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/IdeTooltipService.kt (94%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/SharedServices.kt (95%) rename plugin-api/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/templates/CgtTemplateBuilder.kt (98%) rename plugin-api/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/LlmInferenceServiceTest.java (99%) rename plugin-api/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/ToolSourceRegistryTest.java (98%) rename plugin-api/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/PluginContextTest.kt (99%) rename plugin-api/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/ai/LlmBackendRegistrationTest.kt (93%) rename plugin-api/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/ai/prompt/PromptConfigFixture.kt (98%) rename plugin-api/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/ai/prompt/PromptConfigLoaderTest.kt (93%) rename plugin-api/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/ai/prompt/PromptConfigObjectTest.kt (96%) rename plugin-api/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/ai/prompt/PromptConfigStoreTest.kt (96%) rename plugin-api/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/ai/prompt/PromptTemplateEngineTest.kt (99%) rename plugin-api/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/security/KeystoreSecretStoreTest.kt (99%) rename plugin-api/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/services/LogQueryTest.kt (92%) delete mode 100644 plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeFeatureFlagServiceImpl.kt rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/PluginTooltipNaming.kt (80%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/build/PluginBuildActionManager.kt (89%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/context/PluginContextImpl.kt (98%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/core/PluginCrashTracker.kt (97%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/core/PluginManager.kt (90%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/core/PluginSettingsEntries.kt (87%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/documentation/ExtensionToContentTypeResolver.kt (95%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/documentation/PluginDocumentationManager.kt (98%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/documentation/Tier3AssetWalker.kt (97%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/fragment/PluginFragmentFactory.kt (98%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/language/PluginLanguageContribution.kt (61%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/loaders/PluginLoader.kt (99%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/loaders/PluginManifest.kt (97%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/loaders/PluginResourceContext.kt (98%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/project/PluginProjectManager.kt (96%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/security/PluginSecurityManager.kt (95%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/CogoProjectProvider.kt (92%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeArchiveServiceImpl.kt (97%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeBuildServiceImpl.kt (91%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeCommandServiceImpl.kt (93%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeEditorServiceImpl.kt (96%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeEditorTabServiceImpl.kt (94%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeEnvironmentServiceImpl.kt (81%) create mode 100644 plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeFeatureFlagServiceImpl.kt rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeFileServiceImpl.kt (95%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeLogServiceImpl.kt (81%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeProjectManipulationServiceImpl.kt (93%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeProjectServiceImpl.kt (93%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeSidebarServiceImpl.kt (69%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeSnippetServiceImpl.kt (77%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeTemplateServiceImpl.kt (91%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeThemeServiceImpl.kt (84%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeTooltipServiceImpl.kt (84%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeUIServiceImpl.kt (85%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/ModuleContextResolver.kt (92%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/PluginPathAllowlist.kt (90%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/snippets/PluginSnippetManager.kt (90%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/ui/PluginDrawableResolver.kt (90%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/ui/PluginEditorTabManager.kt (95%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/ui/PluginToolbarHost.kt (91%) rename plugin-manager/src/main/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/ui/PluginUiActionManager.kt (90%) rename plugin-manager/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/E2EIntegrationTest.kt (85%) rename plugin-manager/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/core/PluginManagerIntegrationTest.kt (86%) rename plugin-manager/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/core/PluginSettingsEntriesTest.kt (92%) rename plugin-manager/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/loaders/PluginProvenanceMappingTest.kt (98%) rename plugin-manager/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeBuildServiceImplExecuteTasksTest.kt (81%) rename plugin-manager/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeEditorServiceImplSaveFileTest.kt (95%) rename plugin-manager/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeFileServiceImplTest.kt (97%) rename plugin-manager/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeLogServiceImplTest.kt (79%) rename plugin-manager/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeProjectServiceImplModuleContextTest.kt (86%) rename plugin-manager/src/test/kotlin/{com/itsaky/androidide => org/appdevforall/codeonthego}/plugins/manager/services/IdeSidebarServiceImplTest.kt (83%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/BaseIDEPreferences.kt (96%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/BasePreference.kt (93%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/ChoiceBasedDialogPreference.kt (98%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/DialogPreference.kt (92%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/EditTextPreference.kt (97%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/IDEPreferences.kt (92%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/IPreference.kt (96%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/IPreferenceGroup.kt (97%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/IPreferenceInflater.kt (95%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/IPreferenceScreen.kt (96%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/MultiChoicePreference.kt (97%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/NumberInputEditTextPreference.kt (98%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/PreferenceChoices.kt (97%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/PreferenceValueType.kt (95%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/SimpleClickablePreference.kt (96%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/SimplePreference.kt (95%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/SingleChoicePreference.kt (98%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/SwitchPreference.kt (96%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/internal/BuildPreferences.kt (98%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/internal/DevOpsPreferences.kt (96%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/internal/EditorPreferences.kt (99%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/internal/GeneralPreferences.kt (95%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/internal/GitPreferences.kt (92%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/internal/JavaPreferences.kt (94%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/internal/StatPreferences.kt (93%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/internal/XmlPreferences.kt (98%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/internal/preferences.kt (82%) rename preferences/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/preferences/utils/editorUtil.kt (92%) rename quickbuild/runtime/src/main/aidl/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/IQuickBuildHost.aidl (88%) rename quickbuild/runtime/src/main/aidl/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/IQuickBuildTarget.aidl (97%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/ActivityTracker.java (99%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/AssetExtractor.java (99%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/BaselineGeneration.java (97%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/BootProbation.java (98%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/BuildStatus.java (98%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/CrashSummary.java (99%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/DeployMetadata.java (97%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/DirectoryAssetsProvider.java (98%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/FirstFrameGate.java (98%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/Generations.java (98%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/LegacyResourceSwap.java (99%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/LoaderRouter.java (96%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/MiniJson.java (99%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/OverlayState.java (99%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/PayloadPersistence.java (99%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/PayloadStore.java (99%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/PersistedSelection.java (96%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/QuickBuildAppComponentFactory.java (99%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/QuickBuildClassLoaders.java (97%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/QuickBuildClient.java (98%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/QuickBuildKeepAliveService.java (97%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/QuickBuildRuntime.java (99%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/ResourceStore.java (99%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/ResourceSwapStrategy.java (95%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/RestartHandoff.java (99%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/RuntimeLog.java (98%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/StatusOverlay.java (98%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/Streams.java (99%) rename quickbuild/runtime/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/SwapAckGate.java (98%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/AssetExtractorFailurePathTest.java (98%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/AssetExtractorTest.java (99%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/BaselineGenerationTest.java (97%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/BootProbationTest.java (99%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/BuildStatusTest.java (98%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/CrashSummaryTest.java (99%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/DeployMetadataTest.java (97%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/DirectoryAssetsProviderTest.java (98%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/FirstFrameGateTest.java (98%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/GenerationsTest.java (98%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/LegacyResourceSwapAddAssetPathTest.java (94%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/LegacyResourceSwapSweepTest.java (98%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/LegacyResourceSwapTest.java (98%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/LoaderRouterTest.java (97%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/ManifestAppComponentFactoryTest.java (97%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/MiniJsonHardeningTest.java (98%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/MiniJsonSeparatorAndLiteralTest.java (97%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/MiniJsonTest.java (98%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/OfflineNetworkGuardTest.java (97%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/OverlayStateTest.java (98%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/OverlayStateTextEdgeTest.java (97%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/PayloadPersistenceAtomicSetTest.java (99%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/PayloadPersistenceAtomicWriteTest.java (98%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/PayloadPersistenceCorruptMetaTest.java (99%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/PayloadPersistenceQuarantineTest.java (99%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/PayloadPersistenceTest.java (99%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/PersistedSelectionTest.java (98%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/QuickBuildAppComponentFactoryRethrowTest.java (98%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/QuickBuildClassLoadersForActivityTest.java (96%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/QuickBuildClassLoadersTest.java (93%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/QuickBuildRuntimeApplyFailureReportTest.java (98%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/QuickBuildRuntimeBootRestoreDispatchTest.java (96%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/QuickBuildRuntimeFailReloadDispatchTest.java (96%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/QuickBuildRuntimeFrameCompletionTest.java (98%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/QuickBuildRuntimeResumeCompletionTest.java (97%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/ResourceStoreAbandonedSwapTest.java (98%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/ResourceStoreLegacyAssetsTest.java (97%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/ResourceStoreLegacyWriteSweepTest.java (97%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/ResourceSwapStrategyTest.java (94%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/RestartHandoffTest.java (99%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/RuntimeLogTest.java (96%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/StatusOverlayInsetActionTest.java (96%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/StreamsCloseQuietlyTest.java (92%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/StreamsTest.java (99%) rename quickbuild/runtime/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/quickbuild/runtime/SwapAckGateTest.java (98%) rename resources/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/resources/ITooltipView.java (91%) rename resources/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/resources/TooltipMaterialCheckBox.java (96%) rename resources/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/resources/TooltipTextInputLayout.java (98%) rename resources/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/resources/localization/LocaleProvider.java (98%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/Locations.kt (99%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/models/LogLine.kt (94%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/progress/ICancelChecker.kt (98%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/progress/ProgressManager.kt (96%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/AndroidPluginVersion.kt (99%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/Cache.java (96%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ClassTrie.kt (99%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/DefaultRecyclable.kt (96%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/DocumentUtils.java (97%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/Either.kt (92%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FileProvider.kt (95%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/HashUtils.kt (95%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/InputStreamLineReader.java (97%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/IntPair.java (97%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ReaderInputStream.java (99%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/RecyclableObjectPool.kt (99%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ServiceLoader.java (99%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/ServiceNotFoundException.java (95%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/SharedEnvironment.kt (97%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/SourceClassTrie.kt (97%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/StackFrameLocator.kt (96%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/StopWatch.kt (94%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/StringUtil.java (95%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/UniqueNameBuilder.java (99%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/VMUtils.kt (97%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/miscUtils.kt (94%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/recyclableObjectPoolExtensions.kt (97%) rename shared/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/stringExt.kt (95%) rename shared/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/progress/ICancelCheckerTest.kt (98%) rename shared/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/progress/ProgressManagerTest.kt (97%) rename shared/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/FileProviderTest.kt (97%) rename shared/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/utils/StackFrameLocatorTest.kt (98%) rename subprojects/aaptcompiler/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/aapt/Resources.kt (93%) rename subprojects/aaptcompiler/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/aapt/logging/IDELogger.kt (97%) rename subprojects/aaptcompiler/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/aaptcompiler/CompilerTest.kt (95%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultAndroidArtifact.kt (97%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultAndroidGradlePluginProjectFlags.kt (94%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultAndroidLibraryData.kt (94%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultApiVersion.kt (93%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultArtifactDependencies.kt (94%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultBundleInfo.kt (93%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultCustomSourceDirectory.kt (93%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultGraphItem.kt (93%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultJavaArtifact.kt (95%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultJavaCompileOptions.kt (94%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultLibrary.kt (97%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultLibraryInfo.kt (93%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultProjectInfo.kt (93%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultProjectSyncIssues.kt (93%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultSourceProvider.kt (97%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultSourceSetContainer.kt (95%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultSyncIssue.kt (93%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultTestInfo.kt (93%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultTestedTargetVariant.kt (93%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultUnresolvedDependency.kt (93%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultVariant.kt (97%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultVariantDependencies.kt (97%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/DefaultViewBindingOptions.kt (93%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/IDESyncIssue.kt (97%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/IJavaCompilerSettings.kt (95%) rename subprojects/builder-model-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/builder/model/modelConstants.kt (85%) rename subprojects/flashbar/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/flashbar/Flashbar.kt (97%) rename subprojects/flashbar/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/flashbar/FlashbarContainerView.kt (89%) rename subprojects/flashbar/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/flashbar/FlashbarView.kt (94%) rename subprojects/flashbar/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/flashbar/SwipeDismissTouchListener.kt (99%) rename subprojects/flashbar/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/flashbar/anim/BaseFlashAnimBuilder.kt (97%) rename subprojects/flashbar/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/flashbar/anim/FlashAnim.kt (96%) rename subprojects/flashbar/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/flashbar/anim/FlashAnimBarBuilder.kt (88%) rename subprojects/flashbar/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/flashbar/anim/FlashAnimIconBuilder.kt (98%) rename subprojects/flashbar/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/flashbar/util/CommonUtils.kt (89%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/CancelAbort.java (96%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/CancelService.java (97%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/NBAttr.java (98%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/NBClassFinder.java (99%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/NBClassReader.java (99%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/NBClassWriter.java (97%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/NBEnter.java (98%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/NBJavaCompiler.java (98%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/NBJavacTrees.java (98%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/NBLog.java (98%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/NBMemberEnter.java (98%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/NBNames.java (98%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/NBParserFactory.java (99%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/NBResolve.java (98%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/NBTreeMaker.java (98%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/compiler/CancelServiceImpl.kt (87%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/compiler/JavacFlowListener.java (94%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/compiler/ReusableBorrow.kt (95%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/compiler/ReusableCompiler.kt (97%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/compiler/ReusableContext.kt (82%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/compiler/ReusableJavaCompiler.kt (90%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/compiler/ReusableLog.kt (95%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/fs/AndroidFsProviderImpl.kt (95%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/fs/CacheFSInfoSingleton.kt (94%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/fs/CachedJarFileSystem.kt (97%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/fs/CachingJarFileSystemProvider.kt (98%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/fs/JarPackageProviderImpl.kt (95%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/partial/CompilationInfo.kt (95%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/partial/DiagnosticListenerImpl.java (99%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/partial/PartialReparser.kt (94%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/partial/PartialReparserImpl.kt (92%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/partial/RichDiagnostic.java (97%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/util/JavaDiagnosticUtils.kt (94%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/util/ReparserUtils.java (96%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/visitors/ErrorAwareTreeScanner.kt (94%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/visitors/FindAnonymousVisitor.kt (88%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/visitors/TranslateMethodPositionsVisitor.java (98%) rename subprojects/javac-services/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/javac/services/visitors/UnEnter.kt (93%) delete mode 100644 subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/MyClass.kt rename subprojects/project-models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/models/AndroidProjectExts.kt (92%) rename subprojects/project-models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/models/CommonProjectExts.kt (53%) rename subprojects/project-models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/models/GradleProjectExts.kt (63%) rename subprojects/project-models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/models/JavaProjectExts.kt (64%) create mode 100644 subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/MyClass.kt rename subprojects/project-models/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/models/SyncMetaExts.kt (77%) rename subprojects/project-serial/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/serial/ProtoProject.kt (92%) rename subprojects/project-serialization/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/project/serial/ProtoProject.kt (50%) rename subprojects/projects/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/FileManager.kt (90%) rename subprojects/projects/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/IProjectManager.kt (91%) rename subprojects/projects/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/ProjectManagerImpl.kt (89%) rename subprojects/projects/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/api/AndroidModule.kt (93%) rename subprojects/projects/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/api/GradleProject.kt (89%) rename subprojects/projects/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/api/JavaModule.kt (92%) rename subprojects/projects/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/api/ModuleProject.kt (93%) rename subprojects/projects/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/api/Workspace.kt (93%) rename subprojects/projects/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/builder/BuildService.kt (82%) rename subprojects/projects/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/classpath/ClassInfo.kt (97%) rename subprojects/projects/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/classpath/IClasspathReader.kt (94%) rename subprojects/projects/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/classpath/JarFsClasspathReader.kt (95%) rename subprojects/projects/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/classpath/ZipFileClasspathReader.kt (96%) rename subprojects/projects/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/models/ActiveDocument.kt (98%) rename subprojects/projects/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/models/ActiveJavaDocument.kt (90%) rename subprojects/projects/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/util/BootClasspathProvider.java (94%) rename subprojects/projects/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/util/StringSearch.java (95%) rename subprojects/projects/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/util/projects.kt (84%) rename subprojects/projects/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/ActiveDocumentVersionTest.kt (75%) rename subprojects/projects/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/ProjectManagerImplGenerateSourcesTest.kt (87%) rename subprojects/projects/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/ProjectManagerImplResourceChangeTest.kt (91%) rename subprojects/projects/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/ProjectManagerImplUninitializedPathTest.kt (98%) rename subprojects/projects/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/api/AndroidModuleIntermediateClasspathsTest.kt (94%) rename subprojects/projects/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/api/AndroidModuleResourceDirectoriesTest.kt (93%) rename subprojects/projects/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/api/CompileModuleProjectsCycleTest.kt (98%) rename subprojects/projects/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/classpath/JarFsClasspathReaderCorruptJarTest.kt (95%) rename subprojects/projects/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/classpath/ZipFileClasspathReaderTest.kt (95%) rename subprojects/projects/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/projects/util/ClassTrieTest.kt (96%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/FinishEvent.kt (92%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/OperationDescriptor.kt (92%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/OperationResult.kt (92%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/ProgressEvent.kt (92%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/StartEvent.kt (91%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/StatusEvent.kt (92%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/configuration/ProjectConfigurationFinishEvent.kt (87%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/configuration/ProjectConfigurationOperationDescriptor.kt (85%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/configuration/ProjectConfigurationOperationResult.kt (83%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/configuration/ProjectConfigurationProgressEvent.kt (86%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/configuration/ProjectConfigurationStartEvent.kt (87%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/download/FileDownloadFinishEvent.kt (87%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/download/FileDownloadOperationDescriptor.kt (89%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/download/FileDownloadProgressEvent.kt (86%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/download/FileDownloadResult.kt (86%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/download/FileDownloadStartEvent.kt (87%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/internal/DefaultFinishEvent.kt (78%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/internal/DefaultOperationDescriptor.kt (88%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/internal/DefaultOperationResult.kt (85%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/internal/DefaultProgressEvent.kt (81%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/internal/DefaultStartEvent.kt (81%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/task/TaskExecutionResult.kt (92%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/task/TaskFailureResult.kt (92%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/task/TaskFinishEvent.kt (87%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/task/TaskOperationDescriptor.kt (88%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/task/TaskOperationResult.kt (86%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/task/TaskProgressEvent.kt (86%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/task/TaskSkippedResult.kt (92%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/task/TaskStartEvent.kt (87%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/task/TaskSuccessResult.kt (92%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/test/TestFinishEvent.kt (87%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/test/TestOperationDescriptor.kt (88%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/test/TestOperationResult.kt (86%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/test/TestProgressEvent.kt (86%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/test/TestStartEvent.kt (87%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/transform/TransformFinishEvent.kt (87%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/transform/TransformOperationDescriptor.kt (91%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/transform/TransformOperationResult.kt (85%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/transform/TransformProgressEvent.kt (86%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/transform/TransformStartEvent.kt (86%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/work/WorkItemFinishEvent.kt (87%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/work/WorkItemOperationDescriptor.kt (89%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/work/WorkItemOperationResult.kt (86%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/work/WorkItemProgressEvent.kt (87%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/events/work/WorkItemStartEvent.kt (87%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/model/BuildIdentifier.kt (92%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/model/PluginIdentifier.kt (92%) rename subprojects/tooling-api-events/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/model/ProjectIdentifier.kt (92%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/GradleDaemonWatcher.kt (99%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/LoggingOutputStream.kt (88%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/Main.kt (92%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/ProjectInitializationExeption.kt (94%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/ToolingApiServerImpl.kt (85%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/logging/ToolingApiAppender.kt (80%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/progress/EventTransformer.kt (73%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/progress/ForwardingProgressListener.kt (92%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/serial/AndroidProjectExts.kt (92%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/serial/GradleProjectExts.kt (71%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/serial/JavaProjectExts.kt (82%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/sync/AbstractModelBuilder.kt (91%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/sync/AbstractProjectModelBuilder.kt (66%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/sync/AndroidProjectModelBuilder.kt (92%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/sync/GradleProjectModelBuilder.kt (78%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/sync/IModelBuilder.kt (90%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/sync/IProjectModelBuilder.kt (63%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/sync/ISyncIssueReporter.kt (96%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/sync/JavaProjectModelBuilder.kt (80%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/sync/ModelBuilderException.java (95%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/sync/NotAnAndroidProjectException.java (95%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/sync/RootModelBuilder.kt (89%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/sync/types.kt (95%) rename subprojects/tooling-api-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/util/GradleBuildExts.kt (77%) rename subprojects/tooling-api-impl/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/sync/SyncLockTest.kt (97%) rename subprojects/tooling-api-impl/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/sync/SyncMetaVersionTest.kt (99%) rename subprojects/tooling-api-impl/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/GradleDaemonWatcherTest.kt (99%) rename subprojects/tooling-api-impl/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/ToolingApiServerImplTest.kt (93%) rename subprojects/tooling-api-impl/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/logging/ToolingApiAppenderTest.kt (80%) rename subprojects/tooling-api-impl/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/serial/DependencyGraphFlatteningTest.kt (98%) rename subprojects/tooling-api-impl/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/impl/serial/VariantSourceProvidersTest.kt (98%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/IAndroidProject.kt (98%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/IGradleProject.kt (87%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/ProjectType.kt (96%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/AndroidArtifactMetadata.kt (96%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/AndroidProjectMetadata.kt (86%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/AndroidVariantMetadata.kt (95%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/BasicAndroidVariantMetadata.kt (95%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/BasicProjectMetadata.kt (95%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/BuildVariantInfo.kt (97%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/GradleArtifact.kt (94%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/GradleTask.kt (95%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/IModuleMetadata.kt (94%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/JavaContentRoot.kt (92%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/JavaModuleCompilerSettings.kt (91%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/JavaModuleDependency.kt (92%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/JavaModuleExternalDependency.kt (93%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/JavaModuleProjectDependency.kt (93%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/JavaProjectMetadata.kt (89%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/JavaSourceDirectory.kt (92%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/Launchable.kt (95%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/ProjectMetadata.kt (91%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/ToolingServerMetadata.kt (93%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/params/StringParameter.kt (93%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/models/result/SelectProjectResult.kt (88%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/util/AndroidModulePropertyCopier.kt (88%) rename subprojects/tooling-api-model/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/util/utils.kt (85%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/ForwardingToolingApiClient.kt (79%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/IToolingApiClient.kt (88%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/IToolingApiServer.kt (79%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/messages/AndroidInitializationParams.kt (95%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/messages/BuildId.kt (90%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/messages/ClientGradleBuildConfig.kt (83%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/messages/GradleBuildParams.kt (83%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/messages/GradleDistributionParams.kt (97%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/messages/InitializeProjectParams.kt (96%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/messages/LogMessageParams.kt (87%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/messages/ShutDownMessage.kt (91%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/messages/TaskExecutionMessage.kt (94%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/messages/result/BuildCancellationRequestResult.kt (93%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/messages/result/BuildInfo.kt (87%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/messages/result/BuildResult.kt (93%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/messages/result/GradleWrapperCheckResult.kt (90%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/messages/result/InitializeResult.kt (96%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/messages/result/TaskExecutionResult.kt (95%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/sync/ProjectSyncHelper.kt (98%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/util/FileTypeAdapter.java (96%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/util/RuntimeTypeAdapterFactory.java (96%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/util/ToolingApiLauncher.kt (56%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/util/ToolingProps.kt (93%) rename subprojects/tooling-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/api/util/versions.kt (96%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/internal/resources/DefaultResourceTableRegistry.kt (91%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/internal/versions/DefaultApiVersions.kt (85%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/internal/versions/DefaultApiVersionsRegistry.kt (94%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/internal/versions/DefaultClassInfo.kt (85%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/internal/versions/DefaultFieldInfo.kt (83%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/internal/versions/DefaultInfo.kt (89%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/internal/versions/DefaultMethodInfo.kt (88%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/internal/widgets/DefaultWidgetTable.kt (93%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/internal/widgets/DefaultWidgetTableRegistry.kt (93%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/internal/widgets/util/DefaultWidget.kt (84%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/internal/widgets/util/WidgetParser.kt (91%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/permissions/ManifestPermissionConstants.java (99%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/permissions/Permission.kt (99%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/permissions/PermissionGroup.kt (97%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/registry/XmlRegistry.kt (95%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/resources/ResourceTableRegistry.kt (93%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/utils/patterns.kt (95%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/versions/ApiVersion.kt (98%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/versions/ApiVersions.kt (91%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/versions/ApiVersionsRegistry.kt (88%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/versions/ClassInfo.kt (95%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/versions/FieldInfo.kt (94%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/versions/Info.kt (95%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/versions/MethodInfo.kt (95%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/widgets/Widget.kt (96%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/widgets/WidgetTable.kt (93%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/widgets/WidgetTableRegistry.kt (88%) rename subprojects/xml-utils/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/widgets/WidgetType.kt (96%) rename subprojects/xml-utils/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/registry/PlatformDirDegradationTest.kt (92%) rename subprojects/xml-utils/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/resources/ResourceTableRegistryTest.kt (96%) rename subprojects/xml-utils/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/utils.kt (94%) rename subprojects/xml-utils/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/versions/ApiVersionTest.kt (98%) rename subprojects/xml-utils/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/versions/ApiVersionsMinorSdkTest.kt (98%) rename subprojects/xml-utils/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/versions/ApiVersionsRegistryTest.kt (96%) rename subprojects/xml-utils/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/xml/widgets/WidgetTableRegistryTest.kt (96%) rename templates-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/ITemplateProvider.kt (95%) rename templates-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/ITemplateWidgetViewProvider.kt (94%) rename templates-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/RecipeExecutor.kt (97%) rename templates-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/base/ProjectTemplateBuilder.kt (80%) rename templates-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/base/base.kt (70%) rename templates-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/base/models/Dependency.kt (97%) rename templates-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/base/models/DependencyConfiguration.kt (94%) rename templates-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/base/models/models.kt (92%) rename templates-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/base/templateBuilders.kt (76%) rename templates-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/base/util/utils.kt (92%) rename templates-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/base/util/xmlBuilder.kt (97%) rename templates-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/parameters.kt (97%) rename templates-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/template.kt (98%) rename templates-api/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/widget.kt (97%) rename templates-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/impl/ConstraintVerifier.kt (82%) rename templates-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/impl/TemplateProviderImpl.kt (86%) rename templates-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/impl/TemplateWarning.kt (59%) rename templates-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/impl/TemplateWidgetViewProviderImpl.kt (92%) rename templates-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/impl/base/results.kt (81%) rename templates-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/impl/zip/ZipJson.kt (96%) rename templates-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/impl/zip/ZipRecipeExecutor.kt (96%) rename templates-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/impl/zip/ZipTemplateConstants.kt (96%) rename templates-impl/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/impl/zip/ZipTemplateReader.kt (84%) rename templates-impl/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/TestRecipeExecutor.kt (96%) rename templates-impl/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/UtilTest.kt (86%) rename templates-impl/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/impl/zip/ZipRecipeExecutorTest.kt (92%) rename templates-impl/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/templates/utils.kt (91%) rename termux/termux-app/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/activities/TerminalActivity.kt (97%) rename testing/android/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/testing/android/Activities.kt (92%) rename testing/android/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/testing/android/TestInstrumentationRunner.kt (86%) rename testing/android/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/testing/android/contextUtils.kt (95%) rename testing/android/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/testing/android/uiAutomatorUtils.kt (96%) rename testing/android/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/testing/android/uiDeviceUtils.kt (97%) rename testing/android/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/testing/android/uiObjectUtils.kt (97%) rename testing/common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/testing/common/CIOnlyTestRule.kt (91%) rename testing/common/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/testing/common/NoOpStatement.kt (94%) rename testing/lsp/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/api/LSPTest.kt (78%) rename testing/lsp/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/lsp/api/util/ReflectiveLogListener.kt (86%) rename testing/resources/test-project/android-library/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/test/Main.java (56%) rename testing/resources/test-project/another-android-library/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/test/Main.java (56%) rename testing/resources/test-project/another-java-library/nested-java-library/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/test/Main.java (56%) rename testing/resources/test-project/another-java-library/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/tooling/test/Main.java (56%) delete mode 100644 testing/resources/test-project/java-library/nested-java-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java create mode 100644 testing/resources/test-project/java-library/nested-java-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java delete mode 100644 testing/resources/test-project/java-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java create mode 100644 testing/resources/test-project/java-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java delete mode 100644 testing/resources/test-project/other-java-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java create mode 100644 testing/resources/test-project/other-java-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java rename testing/tooling/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/testing/tooling/ToolingApiTestLauncher.kt (87%) rename testing/tooling/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/testing/tooling/models/ToolingApiTestLauncherParams.kt (81%) rename testing/tooling/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/testing/tooling/models/ToolingApiTestScope.kt (82%) rename testing/tooling/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/testing/tooling/utils.kt (95%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/ShowXmlActivity.kt (83%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/UIDesignerActivity.kt (87%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/actions/RedoAction.kt (92%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/actions/ShowHierarchyAction.kt (87%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/actions/ShowXmlAction.kt (84%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/actions/UiDesignerAction.kt (76%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/actions/UndoAction.kt (92%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/actions/uiDesignerActions.kt (84%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/adapters/AddAttrListAdapter.kt (85%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/adapters/ViewAttrListAdapter.kt (79%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/adapters/WidgetsCategoryAdapter.kt (89%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/adapters/WidgetsItemAdapter.kt (83%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/drag/WidgetDragListener.kt (88%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/drag/WidgetDragShadowBuilder.kt (96%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/drag/WidgetTouchListener.kt (89%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/drawable/UiViewLayeredForeground.kt (87%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/fragments/AddAttrFragment.kt (88%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/fragments/AttrValueEditorFragment.kt (93%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/fragments/DesignerWorkspaceFragment.kt (81%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/fragments/ViewInfoFragment.kt (88%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/fragments/ViewInfoSheet.kt (96%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/fragments/WidgetsListFragment.kt (84%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/fragments/WorkspaceLayoutInflationHandler.kt (77%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/fragments/WorkspaceViewAttrHandler.kt (62%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/fragments/WorkspaceViewHierarchyHandler.kt (78%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/models/CommonUiView.kt (94%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/models/CommonUiViewImpl.kt (94%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/models/PlaceholderView.kt (89%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/models/RootWorkspaceView.kt (86%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/models/UiAttribute.kt (85%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/models/UiView.kt (80%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/models/UiViewGroup.kt (84%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/models/UiWidgetCategory.kt (88%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/undo/AttrAction.kt (78%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/undo/AttrAddedAction.kt (78%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/undo/AttrRemovedAction.kt (78%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/undo/AttrUpdatedAction.kt (78%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/undo/IUiAction.kt (94%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/undo/UndoManager.kt (97%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/undo/ViewAction.kt (85%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/undo/ViewAddedAction.kt (82%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/undo/ViewMovedAction.kt (81%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/undo/ViewRemovedAction.kt (83%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/undo/undoUtils.kt (84%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/utils/UiInflaterComponentFactory.kt (65%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/utils/UiLayoutInflater.kt (80%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/utils/ValueCompletionProvider.kt (79%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/utils/ViewToXml.kt (86%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/utils/Widgets.kt (88%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/utils/WorkspaceHierarchyChangeListener.kt (76%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/utils/designerUtils.kt (87%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/viewmodel/WorkspaceViewModel.kt (91%) rename uidesigner/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/views/LayoutHierarchyView.kt (90%) rename uidesigner/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/UiDesignerTest.kt (65%) rename uidesigner/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/uidesigner/undo/UndoManagerTest.kt (97%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/AbstractParser.kt (81%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/AttributeHandlerScope.kt (90%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/DefaultComponentFactory.kt (80%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/ForwardingViewGroup.kt (95%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/IAttribute.kt (96%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/IComponentFactory.kt (90%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/ILayoutInflater.kt (75%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/INamespace.kt (90%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/IView.kt (99%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/IViewAdapter.kt (96%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/IViewAdapterIndex.kt (95%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/IViewGroup.kt (99%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/IViewGroupAdapter.kt (98%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/InflateException.kt (96%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/LayoutStrategy.kt (98%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/drawable/BitmapDrawableParser.kt (96%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/drawable/ClipDrawableParser.kt (97%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/drawable/DrawableParserFactory.java (96%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/drawable/IDrawableParser.kt (94%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/drawable/InsetDrawableParser.kt (94%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/drawable/LayerListParser.kt (96%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/drawable/ScaleDrawableParser.kt (95%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/drawable/ShapeDrawableParser.kt (96%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/drawable/StateListParser.kt (96%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/events/IInflateEventsListener.kt (95%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/events/IInflationEvent.kt (93%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/events/inflationEvents.kt (90%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/AttributeImpl.kt (86%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/ErrorView.kt (94%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/ForwardingView.kt (89%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/ImmutableAttributeImpl.kt (90%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/ImmutableViewGroupImpl.kt (87%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/ImmutableViewImpl.kt (87%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/IncludeView.kt (85%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/LayoutFile.kt (94%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/LayoutInflaterImpl.kt (85%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/NamespaceImpl.kt (88%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/SingleChildViewGroup.kt (91%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/ViewGroupImpl.kt (94%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/ViewImpl.kt (90%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/AbsListViewAdapter.kt (94%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/AbsSeekBarAdapter.kt (91%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/AbsSpinnerAdapter.kt (90%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/AbsoluteLayoutAdapter.kt (94%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/AdapterViewAdapter.kt (90%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/AnalogClockAdapter.kt (93%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/AutoCompleteTextViewAdapter.kt (91%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/ButtonAdapter.kt (91%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/CalendarViewAdapter.kt (93%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/CheckBoxAdapter.kt (92%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/CheckedTextViewAdapter.kt (90%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/ChronometerAdapter.kt (90%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/CompoundButtonAdapter.kt (89%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/DigitalClockAdapter.kt (92%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/EditTextAdapter.kt (92%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/FrameLayoutAdapter.kt (90%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/GestureOverlayViewAdapter.kt (93%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/GridLayoutAdapter.kt (90%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/GridViewAdapter.kt (92%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/HorizontalScrollViewAdapter.kt (86%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/ImageButtonAdapter.kt (92%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/ImageSwitcherAdapter.kt (92%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/ImageViewAdapter.kt (93%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/LinearLayoutAdapter.kt (87%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/ListViewAdapter.kt (89%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/MultiAutoCompleteTextViewAdapter.kt (92%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/NumberPickerAdapter.kt (92%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/ProgressBarAdapter.kt (94%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/QuickContactBadgeAdapter.kt (92%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/RadioButtonAdapter.kt (92%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/RadioGroupAdapter.kt (86%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/RatingBarAdapter.kt (90%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/RelativeLayoutAdapter.kt (90%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/ScrollViewAdapter.kt (85%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/SeekBarAdapter.kt (89%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/SpaceAdapter.kt (91%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/SpinnerAdapter.kt (91%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/SurfaceViewAdapter.kt (92%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/SwitchAdapter.kt (93%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/TextClockAdapter.kt (90%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/TextSwitcherAdapter.kt (92%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/TextViewAdapter.kt (95%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/TextureViewAdapter.kt (87%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/ToggleButtonAdapter.kt (85%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/VideoViewAdapter.kt (92%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/ViewAdapter.kt (92%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/ViewAnimatorAdapter.kt (89%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/ViewFlipperAdapter.kt (90%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/ViewGroupAdapter.kt (85%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/ViewSwitcherAdapter.kt (92%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/WebViewAdapter.kt (91%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/adapters/appcompat/AppCompatTextView.kt (91%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/ui/DesignerTextureView.kt (96%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/utils/IDTable.kt (94%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/utils/TextDrawable.kt (97%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/utils/ViewFactory.kt (92%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/utils/ViewUtils.kt (95%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/utils/basicParseUtils.kt (98%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/utils/lookup.kt (96%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/internal/utils/viewParseUtils.kt (97%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/models/UiWidget.kt (79%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/utils/inflaterUtils.kt (80%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/utils/module.kt (87%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/utils/viewUtils.kt (95%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/vectormaster/DefaultValues.java (97%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/vectormaster/VectorMasterDrawable.java (97%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/vectormaster/VectorMasterView.java (97%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/vectormaster/enums/TintMode.java (92%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/vectormaster/models/ClipPathModel.java (90%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/vectormaster/models/GroupModel.java (97%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/vectormaster/models/PathModel.java (95%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/vectormaster/models/VectorModel.java (97%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/vectormaster/utilities/Utils.java (97%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/vectormaster/utilities/legacyparser/PathParser.java (99%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/vectormaster/utilities/parser/ParserHelper.java (99%) rename xml-inflater/src/main/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/vectormaster/utilities/parser/PathParser.java (99%) rename xml-inflater/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/AdapterIndexTest.kt (96%) rename xml-inflater/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/ExampleUnitTest.kt (95%) rename xml-inflater/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/LayoutInflaterTest.kt (88%) rename xml-inflater/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/ValueParsersTest.kt (91%) rename xml-inflater/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/XmlInflaterTest.kt (83%) rename xml-inflater/src/test/java/{com/itsaky/androidide => org/appdevforall/codeonthego}/inflater/adapterUtils.kt (63%) diff --git a/.github/workflows/instrumentation-test.yml b/.github/workflows/instrumentation-test.yml index ac07df9f54..63e56c76da 100644 --- a/.github/workflows/instrumentation-test.yml +++ b/.github/workflows/instrumentation-test.yml @@ -101,7 +101,7 @@ jobs: --results-dir=test-results/kotlin \ --results-bucket=gs://firebase-test-results-${RANDOM} \ --project=codeonthego-64a92 \ - --test-targets "class com.itsaky.androidide.ProjectBuildTestWithKtsGradle" > test-results/kotlin/test_output.txt 2>&1 || KOTLIN_EXIT_CODE=$? + --test-targets "class org.appdevforall.codeonthego.ProjectBuildTestWithKtsGradle" > test-results/kotlin/test_output.txt 2>&1 || KOTLIN_EXIT_CODE=$? echo "Kotlin tests exit code: $KOTLIN_EXIT_CODE" @@ -129,7 +129,7 @@ jobs: --results-dir=test-results/groovy \ --results-bucket=gs://firebase-test-results-${RANDOM} \ --project=codeonthego-64a92 \ - --test-targets "class com.itsaky.androidide.ProjectBuildTestWithGroovyGradle" > test-results/groovy/test_output.txt 2>&1 || GROOVY_EXIT_CODE=$? + --test-targets "class org.appdevforall.codeonthego.ProjectBuildTestWithGroovyGradle" > test-results/groovy/test_output.txt 2>&1 || GROOVY_EXIT_CODE=$? echo "Groovy tests exit code: $GROOVY_EXIT_CODE" diff --git a/REVIEW.md b/REVIEW.md index 036de3a0bc..92940d0881 100644 --- a/REVIEW.md +++ b/REVIEW.md @@ -213,7 +213,7 @@ Features that aren't fully stabilized ship behind the **experimental feature fla The plugin API is **not frozen** and we don't yet guarantee backward/binary compatibility (see [plugin-api.md](docs/plugin-api.md)). So the bar isn't "never break plugins" — it's **don't break them by accident**. -- **Does the change touch the plugin API surface?** Anything in `:plugin-api` (package `com.itsaky.androidide.plugins`), a manifest `plugin.*` meta-data key, a permission key string, a service interface reached via `ServiceRegistry`, or a format contract (`.cgp`/`.cgt`, the `plugin_documentation.db` schema, `scripts.json`, the `localhost:6174` help URLs). If so, treat it as a contract change. +- **Does the change touch the plugin API surface?** Anything in `:plugin-api` (package `org.appdevforall.codeonthego.plugins`), a manifest `plugin.*` meta-data key, a permission key string, a service interface reached via `ServiceRegistry`, or a format contract (`.cgp`/`.cgt`, the `plugin_documentation.db` schema, `scripts.json`, the `localhost:6174` help URLs). If so, treat it as a contract change. - **If it breaks compatibility, is that deliberate and documented?** The PR should say what breaks, who's affected, and why it's worth it. Watch the Kotlin traps that look source-compatible but aren't — data-class constructor params, enum constants, methods added to plugin-implemented interfaces (plugin-api.md lists them). - **Do a mechanical impact check:** build/load the in-tree example plugins (`apk-viewer-plugin`, `markdown-preview-plugin`, `keystore-generator-plugin`) — and, for significant changes, the external `plugin-examples` repo — against the change. - **Even without an API change,** new core features can break plugins (shared UI, toolbar action IDs, service behavior) and plugins can conflict with each other. Keep that in view. diff --git a/actions/src/main/java/com/itsaky/androidide/actions/ActionData.java b/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionData.java similarity index 94% rename from actions/src/main/java/com/itsaky/androidide/actions/ActionData.java rename to actions/src/main/java/org/appdevforall/codeonthego/actions/ActionData.java index d41a215070..b7f400af73 100644 --- a/actions/src/main/java/com/itsaky/androidide/actions/ActionData.java +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionData.java @@ -1,71 +1,71 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.actions; - -import android.content.Context; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** - * @author Akash Yadav - */ -public class ActionData { - - private ActionData() {} - - /** - * Creates a new {@link ActionData} instance. - * - * @param context The context to this instance is attached to. - * @return A new {@link ActionData} instance. - */ - @NonNull - public static ActionData create(@NonNull Context context) { - final var data = new ActionData(); - data.put(Context.class, context); - return data; - } - - private final Map, Object> instances = new HashMap<>(); - - public void put(@NonNull Class type, @Nullable T object) { - Objects.requireNonNull(type); - this.instances.put(type, object); - } - - @Nullable - public T get(@NonNull Class type) { - Objects.requireNonNull(type); - - final var object = this.instances.get(type); - if (object == null) { - return null; - } - - return type.cast(object); - } - - public void clear() { - this.instances.clear(); - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.actions; + +import android.content.Context; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * @author Akash Yadav + */ +public class ActionData { + + private ActionData() {} + + /** + * Creates a new {@link ActionData} instance. + * + * @param context The context to this instance is attached to. + * @return A new {@link ActionData} instance. + */ + @NonNull + public static ActionData create(@NonNull Context context) { + final var data = new ActionData(); + data.put(Context.class, context); + return data; + } + + private final Map, Object> instances = new HashMap<>(); + + public void put(@NonNull Class type, @Nullable T object) { + Objects.requireNonNull(type); + this.instances.put(type, object); + } + + @Nullable + public T get(@NonNull Class type) { + Objects.requireNonNull(type); + + final var object = this.instances.get(type); + if (object == null) { + return null; + } + + return type.cast(object); + } + + public void clear() { + this.instances.clear(); + } +} diff --git a/actions/src/main/java/com/itsaky/androidide/actions/ActionItem.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionItem.kt similarity index 96% rename from actions/src/main/java/com/itsaky/androidide/actions/ActionItem.kt rename to actions/src/main/java/org/appdevforall/codeonthego/actions/ActionItem.kt index 82c9f5506d..5ca0d8854f 100644 --- a/actions/src/main/java/com/itsaky/androidide/actions/ActionItem.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionItem.kt @@ -15,8 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions + +import com.itsaky.androidide.actions.R import android.graphics.ColorFilter import android.graphics.PorterDuff import android.graphics.PorterDuffColorFilter @@ -24,12 +26,12 @@ import android.graphics.drawable.Drawable import android.view.Menu import android.view.View import androidx.annotation.CallSuper -import com.itsaky.androidide.idetooltips.TooltipCategory -import com.itsaky.androidide.utils.resolveAttr +import org.appdevforall.codeonthego.idetooltips.TooltipCategory +import org.appdevforall.codeonthego.utils.resolveAttr /** * An action that can be registered using the [ActionsRegistry] - * [com.itsaky.androidide.actions.ActionsRegistry] + * [org.appdevforall.codeonthego.actions.ActionsRegistry] * * @author Akash Yadav */ diff --git a/actions/src/main/java/com/itsaky/androidide/actions/ActionMenu.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionMenu.kt similarity index 97% rename from actions/src/main/java/com/itsaky/androidide/actions/ActionMenu.kt rename to actions/src/main/java/org/appdevforall/codeonthego/actions/ActionMenu.kt index 8b773e5c2f..4e1c816239 100644 --- a/actions/src/main/java/com/itsaky/androidide/actions/ActionMenu.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionMenu.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions /** * An action menu is an action which can contain child actions. diff --git a/actions/src/main/java/com/itsaky/androidide/actions/ActionsRegistry.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionsRegistry.kt similarity index 92% rename from actions/src/main/java/com/itsaky/androidide/actions/ActionsRegistry.kt rename to actions/src/main/java/org/appdevforall/codeonthego/actions/ActionsRegistry.kt index b779774b33..25f0e76360 100644 --- a/actions/src/main/java/com/itsaky/androidide/actions/ActionsRegistry.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionsRegistry.kt @@ -1,123 +1,123 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.actions - -import com.itsaky.androidide.actions.internal.DefaultActionsRegistry -import com.itsaky.androidide.utils.ServiceLoader -import com.itsaky.androidide.utils.VMUtils - -/** @author Akash Yadav */ -abstract class ActionsRegistry { - - companion object { - - private var instance: ActionsRegistry? = null - - @JvmStatic - fun getInstance(): ActionsRegistry { - if (instance == null) { - instance = if (VMUtils.isJvm) { - DefaultActionsRegistry() - } else ServiceLoader.load(ActionsRegistry::class.java).findFirstOrThrow() - } - - return instance as ActionsRegistry - } - } - - /** - * Register the given action. - * - * @param action The action to register. Must not be `null`. - * @return `true` if the action was registered successfully. `false` otherwise. - */ - abstract fun registerAction(action: ActionItem): Boolean - - /** - * Unregister the given action. - * - * @param action The action to unregister. Must not be `null`. - * @return `true` if the action was unregistered successfully. `false` otherwise. - */ - abstract fun unregisterAction(action: ActionItem): Boolean - - /** - * Unregister the action with the given ID. - * - * @param id The ID of action to unregister. Must not be `null`. - * @return `true` if the action was unregistered successfully. `false` otherwise. - */ - abstract fun unregisterAction(id: String): Boolean - - /** - * Find the action with the given ID. - * - * @param id The ID of the action to find. - * @return The found action or `null`. - */ - abstract fun findAction(location: ActionItem.Location, id: String): ActionItem? - - /** - * Find the action with the given unique item ID. - * - * @param itemId The ID of the action to find. - * @return The found action or `null`. - */ - abstract fun findAction(location: ActionItem.Location, itemId: Int): ActionItem? - - /** - * Fill the given menu with the registered actions. - * - * Subclasses must first call [ActionItem.prepare] to update the action. - */ - abstract fun fillMenu(params: FillMenuParams) - - /** Get all the registered actions at the given location. */ - abstract fun getActions(location: ActionItem.Location): Map - - /** Clear all the registered actions. */ - abstract fun clearActions(location: ActionItem.Location) - - /** Clear all actions at the given location except those matching the predicate. */ - abstract fun clearActionsExceptWhere(location: ActionItem.Location, predicate: (ActionItem) -> Boolean) - - /** - * Register a listener that will be called when any action is executed. The callbacks are called - * irrespective of the action's execution result. - * - * @param listener The listener to register. - */ - abstract fun registerActionExecListener(listener: ActionExecListener) - - /** - * Unregister the given listener. - * - * @param listener The listener to unregister. - */ - abstract fun unregisterActionExecListener(listener: ActionExecListener) - - /** Listener for listening to callbacks for action execution. */ - interface ActionExecListener { - - /** - * The given action was executed. - * @param action The action that was executed. - * @param result The result of the action execution. - */ - fun onExec(action: ActionItem, result: Any) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.actions + +import org.appdevforall.codeonthego.actions.internal.DefaultActionsRegistry +import org.appdevforall.codeonthego.utils.ServiceLoader +import org.appdevforall.codeonthego.utils.VMUtils + +/** @author Akash Yadav */ +abstract class ActionsRegistry { + + companion object { + + private var instance: ActionsRegistry? = null + + @JvmStatic + fun getInstance(): ActionsRegistry { + if (instance == null) { + instance = if (VMUtils.isJvm) { + DefaultActionsRegistry() + } else ServiceLoader.load(ActionsRegistry::class.java).findFirstOrThrow() + } + + return instance as ActionsRegistry + } + } + + /** + * Register the given action. + * + * @param action The action to register. Must not be `null`. + * @return `true` if the action was registered successfully. `false` otherwise. + */ + abstract fun registerAction(action: ActionItem): Boolean + + /** + * Unregister the given action. + * + * @param action The action to unregister. Must not be `null`. + * @return `true` if the action was unregistered successfully. `false` otherwise. + */ + abstract fun unregisterAction(action: ActionItem): Boolean + + /** + * Unregister the action with the given ID. + * + * @param id The ID of action to unregister. Must not be `null`. + * @return `true` if the action was unregistered successfully. `false` otherwise. + */ + abstract fun unregisterAction(id: String): Boolean + + /** + * Find the action with the given ID. + * + * @param id The ID of the action to find. + * @return The found action or `null`. + */ + abstract fun findAction(location: ActionItem.Location, id: String): ActionItem? + + /** + * Find the action with the given unique item ID. + * + * @param itemId The ID of the action to find. + * @return The found action or `null`. + */ + abstract fun findAction(location: ActionItem.Location, itemId: Int): ActionItem? + + /** + * Fill the given menu with the registered actions. + * + * Subclasses must first call [ActionItem.prepare] to update the action. + */ + abstract fun fillMenu(params: FillMenuParams) + + /** Get all the registered actions at the given location. */ + abstract fun getActions(location: ActionItem.Location): Map + + /** Clear all the registered actions. */ + abstract fun clearActions(location: ActionItem.Location) + + /** Clear all actions at the given location except those matching the predicate. */ + abstract fun clearActionsExceptWhere(location: ActionItem.Location, predicate: (ActionItem) -> Boolean) + + /** + * Register a listener that will be called when any action is executed. The callbacks are called + * irrespective of the action's execution result. + * + * @param listener The listener to register. + */ + abstract fun registerActionExecListener(listener: ActionExecListener) + + /** + * Unregister the given listener. + * + * @param listener The listener to unregister. + */ + abstract fun unregisterActionExecListener(listener: ActionExecListener) + + /** Listener for listening to callbacks for action execution. */ + interface ActionExecListener { + + /** + * The given action was executed. + * @param action The action that was executed. + * @param result The result of the action execution. + */ + fun onExec(action: ActionItem, result: Any) + } +} diff --git a/actions/src/main/java/com/itsaky/androidide/actions/EditTextAdapter.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/EditTextAdapter.kt similarity index 98% rename from actions/src/main/java/com/itsaky/androidide/actions/EditTextAdapter.kt rename to actions/src/main/java/org/appdevforall/codeonthego/actions/EditTextAdapter.kt index 78362bbe3b..a3cac8ed7f 100644 --- a/actions/src/main/java/com/itsaky/androidide/actions/EditTextAdapter.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/EditTextAdapter.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions import android.content.ClipData import android.content.ClipboardManager diff --git a/actions/src/main/java/com/itsaky/androidide/actions/EditorActionItem.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/EditorActionItem.kt similarity index 96% rename from actions/src/main/java/com/itsaky/androidide/actions/EditorActionItem.kt rename to actions/src/main/java/org/appdevforall/codeonthego/actions/EditorActionItem.kt index a2f68c43dd..90d71da3e4 100644 --- a/actions/src/main/java/com/itsaky/androidide/actions/EditorActionItem.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/EditorActionItem.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions /** * A [ActionItem] related to the code editor. Subclasses can choose whether to dismiss the actions diff --git a/actions/src/main/java/com/itsaky/androidide/actions/FillMenuParams.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/FillMenuParams.kt similarity index 90% rename from actions/src/main/java/com/itsaky/androidide/actions/FillMenuParams.kt rename to actions/src/main/java/org/appdevforall/codeonthego/actions/FillMenuParams.kt index cef44b6123..3ae65926d0 100644 --- a/actions/src/main/java/com/itsaky/androidide/actions/FillMenuParams.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/FillMenuParams.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions import android.view.Menu -import com.itsaky.androidide.actions.internal.DefaultActionsRegistry +import org.appdevforall.codeonthego.actions.internal.DefaultActionsRegistry /** * Parameters required by [ActionsRegistry] to fill a menu. diff --git a/actions/src/main/java/com/itsaky/androidide/actions/OnActionClickListener.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/OnActionClickListener.kt similarity index 96% rename from actions/src/main/java/com/itsaky/androidide/actions/OnActionClickListener.kt rename to actions/src/main/java/org/appdevforall/codeonthego/actions/OnActionClickListener.kt index 6c35ab0cc1..24ddd6e2c8 100644 --- a/actions/src/main/java/com/itsaky/androidide/actions/OnActionClickListener.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/OnActionClickListener.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions import android.view.MenuItem diff --git a/actions/src/main/java/com/itsaky/androidide/actions/SidebarActionItem.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/SidebarActionItem.kt similarity index 97% rename from actions/src/main/java/com/itsaky/androidide/actions/SidebarActionItem.kt rename to actions/src/main/java/org/appdevforall/codeonthego/actions/SidebarActionItem.kt index b243391a1a..40c5d54a3d 100644 --- a/actions/src/main/java/com/itsaky/androidide/actions/SidebarActionItem.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/SidebarActionItem.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions import androidx.fragment.app.Fragment import androidx.navigation.fragment.FragmentNavigatorDestinationBuilder diff --git a/actions/src/main/java/com/itsaky/androidide/actions/SidebarSlotManager.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/SidebarSlotManager.kt similarity index 95% rename from actions/src/main/java/com/itsaky/androidide/actions/SidebarSlotManager.kt rename to actions/src/main/java/org/appdevforall/codeonthego/actions/SidebarSlotManager.kt index c4837525ee..a6574bcefd 100644 --- a/actions/src/main/java/com/itsaky/androidide/actions/SidebarSlotManager.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/SidebarSlotManager.kt @@ -1,5 +1,5 @@ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.atomic.AtomicInteger diff --git a/actions/src/main/java/com/itsaky/androidide/actions/TextTarget.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/TextTarget.kt similarity index 86% rename from actions/src/main/java/com/itsaky/androidide/actions/TextTarget.kt rename to actions/src/main/java/org/appdevforall/codeonthego/actions/TextTarget.kt index f4d611f3ad..4ff0e6d4cc 100644 --- a/actions/src/main/java/com/itsaky/androidide/actions/TextTarget.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/TextTarget.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions import android.view.View diff --git a/actions/src/main/java/com/itsaky/androidide/actions/actionUtils.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/actionUtils.kt similarity index 95% rename from actions/src/main/java/com/itsaky/androidide/actions/actionUtils.kt rename to actions/src/main/java/org/appdevforall/codeonthego/actions/actionUtils.kt index 1254e58746..875947dd56 100644 --- a/actions/src/main/java/com/itsaky/androidide/actions/actionUtils.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/actionUtils.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions import android.content.Context import com.google.android.material.dialog.MaterialAlertDialogBuilder -import com.itsaky.androidide.utils.DialogUtils +import org.appdevforall.codeonthego.utils.DialogUtils import io.github.rosemoe.sora.widget.CodeEditor import java.io.File import java.nio.file.Path diff --git a/actions/src/main/java/com/itsaky/androidide/actions/internal/DefaultActionsRegistry.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/internal/DefaultActionsRegistry.kt similarity index 92% rename from actions/src/main/java/com/itsaky/androidide/actions/internal/DefaultActionsRegistry.kt rename to actions/src/main/java/org/appdevforall/codeonthego/actions/internal/DefaultActionsRegistry.kt index 67c086f76d..f4b518c583 100644 --- a/actions/src/main/java/com/itsaky/androidide/actions/internal/DefaultActionsRegistry.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/internal/DefaultActionsRegistry.kt @@ -1,286 +1,286 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.actions.internal - -import android.view.Menu -import android.view.MenuItem -import com.google.auto.service.AutoService -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.ActionMenu -import com.itsaky.androidide.actions.ActionsRegistry -import com.itsaky.androidide.actions.FillMenuParams -import com.itsaky.androidide.actions.OnActionClickListener -import com.itsaky.androidide.actions.locations.CodeActionsMenu -import com.itsaky.androidide.utils.withStopWatch -import kotlinx.coroutines.CancellationException -import kotlinx.coroutines.CoroutineName -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.Job -import kotlinx.coroutines.launch -import kotlinx.coroutines.plus -import kotlinx.coroutines.withContext -import org.slf4j.LoggerFactory -import java.util.concurrent.ConcurrentHashMap - -/** - * Default implementation for the [ActionsRegistry] - * - * @author Akash Yadav - */ -@AutoService(ActionsRegistry::class) -class DefaultActionsRegistry : ActionsRegistry() { - - private val actions = ConcurrentHashMap>() - private val listeners = HashSet() - - private val actionsCoroutineScope = CoroutineScope(Dispatchers.Default) + - CoroutineName("DefaultActionsRegistry") - - companion object { - private val log = LoggerFactory.getLogger(DefaultActionsRegistry::class.java) - private const val DEBUG_PREFIX = "ACTION_DEBUG: " - } - - init { - registerAction(CodeActionsMenu) - } - - override fun getActions(location: ActionItem.Location): MutableMap { - return actions.getOrPut(location.id) { LinkedHashMap() } - } - - override fun registerAction(action: ActionItem): Boolean { - val actions = getActions(action.location) - val isUpdating = actions.containsKey(action.id) - log.debug( - "$DEBUG_PREFIX ${if (isUpdating) "Updating" else "Registering"} action '${action.id}' at location '${action.location.id}'. " + - "Current count: ${actions.size}." - ) - actions.remove(action.id) - actions[action.id] = action - log.debug("$DEBUG_PREFIX Location '${action.location.id}' now has ${actions.size} actions.") - if (actions.size == 3) { - log.debug("$DEBUG_PREFIX readhed the 3 target") - } - return true - } - - override fun unregisterAction(action: ActionItem): Boolean { - val actions = getActions(action.location) - log.debug( - "$DEBUG_PREFIX Unregistering action '${action.id}' from location '${action.location.id}'. " + - "Current count: ${actions.size}." - ) - val older = actions.remove(action.id) - if (older != null) { - older.destroy() - log.debug("$DEBUG_PREFIX Unregistered '${action.id}'. Location '${action.location.id}' now has ${actions.size} actions.") - return true - } - log.debug("$DEBUG_PREFIX Action '${action.id}' not found at location '${action.location.id}'.") - return false - } - - override fun unregisterAction(id: String): Boolean { - log.debug("$DEBUG_PREFIX Attempting to unregister action with id '$id' from all locations.") - for ((locationId, locations) in this.actions) { - val older = locations.remove(id) - if (older != null) { - older.destroy() - log.debug("$DEBUG_PREFIX Removed action '$id' from location '$locationId'. New count: ${locations.size}.") - return true - } - } - log.debug("$DEBUG_PREFIX Action with id '$id' not found in any location.") - return false - } - - override fun findAction(location: ActionItem.Location, id: String): ActionItem? = - getActions(location)[id] - - override fun findAction(location: ActionItem.Location, itemId: Int): ActionItem? { - for (action in getActions(location)) { - if (action.value.itemId == itemId) { - return action.value - } - } - - return null - } - - override fun clearActions(location: ActionItem.Location) { - val actions = getActions(location) - log.debug("$DEBUG_PREFIX Clearing all ${actions.size} actions from location '${location.id}'.") - actions.forEach { it.value.destroy() } - actions.clear() - log.debug("$DEBUG_PREFIX Location '${location.id}' is now empty.") - } - - override fun clearActionsExceptWhere( - location: ActionItem.Location, - predicate: (ActionItem) -> Boolean - ) { - val actions = getActions(location) - val initialCount = actions.size - val toRemove = mutableListOf() - - log.debug("$DEBUG_PREFIX Conditionally clearing actions from location '${location.id}'. Initial count: $initialCount.") - - actions.forEach { (key, action) -> - if (!predicate(action)) { - toRemove.add(key) - } - } - - if (toRemove.isNotEmpty()) { - log.debug("$DEBUG_PREFIX Removing ${toRemove.size} actions from location '${location.id}': $toRemove") - toRemove.forEach { key -> - actions[key]?.destroy() - actions.remove(key) - } - log.debug("$DEBUG_PREFIX Location '${location.id}' now has ${actions.size} actions.") - } else { - log.debug("$DEBUG_PREFIX No actions met the removal criteria for location '${location.id}'.") - } - } - - override fun registerActionExecListener(listener: ActionExecListener) { - listeners.add(listener) - } - - override fun unregisterActionExecListener(listener: ActionExecListener) { - listeners.remove(listener) - } - - override fun fillMenu(params: FillMenuParams) { - val (data, location, menu, onClickListener) = params - val actions = getActions(location) - - val sortedActions = actions.values.sortedWith(compareBy({ it.order }, { it.id })) - - for (action in sortedActions) { - action.prepare(data) - - if (!action.visible) { - continue - } - addActionToMenu(menu, action, data, onClickListener) - } - } - - private fun addActionToMenu( - menu: Menu, - action: ActionItem, - data: ActionData, - onClickListener: OnActionClickListener - ) { - - val item: MenuItem = if (action is ActionMenu) { - val sub = menu.addSubMenu(Menu.NONE, action.itemId, action.order, action.label) - - var shouldBeEnabled = false - for (subItem in action.children) { - subItem.prepare(data) - if (subItem.visible) { - addActionToMenu(sub, subItem, data, onClickListener) - } - - if (action.enabled && subItem.enabled && !shouldBeEnabled) { - shouldBeEnabled = true - } - } - - action.enabled = shouldBeEnabled - sub.item - } else { - menu.add(Menu.NONE, action.itemId, action.order, action.label) - } - - item.isEnabled = action.enabled - - item.contentDescription = action.label - - item.icon = action.icon?.apply { - colorFilter = action.createColorFilter(data) - alpha = if (action.enabled) 255 else 76 - } - - var showAsAction = action.getShowAsActionFlags(data) - if (showAsAction == -1) { - showAsAction = if (action.icon != null) { - MenuItem.SHOW_AS_ACTION_IF_ROOM - } else { - MenuItem.SHOW_AS_ACTION_NEVER - } - } - - if (!action.enabled) { - showAsAction = MenuItem.SHOW_AS_ACTION_NEVER - } - - item.setShowAsAction(showAsAction) - - action.createActionView(data)?.let { item.actionView = it } - - if (action !is ActionMenu) { - item.setOnMenuItemClickListener { - onClickListener.onClick(this, action, it, data) - } - } - } - - /** Executes the given action item with the given */ - fun executeAction(action: ActionItem, data: ActionData): Job { - val onMainThread = action.requiresUIThread - val context = if (onMainThread) Dispatchers.Main.immediate else Dispatchers.Default - return actionsCoroutineScope.launch(context) { - val result = try { - withStopWatch("Action '${action.id}'") { action.execAction(data) } - } catch (e: IllegalArgumentException) { - log.error("An error occurred when performing action '{}'", action.id, e) - return@launch - } - - val post = fun() = run { - action.postExec(data, result) - notifyActionExec(action, result) - } - - if (onMainThread) { - post() - } else { - withContext(Dispatchers.Main.immediate) { post() } - } - }.also { job -> - job.invokeOnCompletion { cause -> - when (cause) { - null -> log.debug("Action '{}' execution completed.", action.id) - is CancellationException -> log.debug("Action '{}' execution was cancelled.", action.id) - else -> log.debug("Action '{}' execution failed.", action.id, cause) - } - } - } - } - - private fun notifyActionExec(action: ActionItem, result: Any) { - for (listener in listeners) { - listener.onExec(action, result) - } - } +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.actions.internal + +import android.view.Menu +import android.view.MenuItem +import com.google.auto.service.AutoService +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionMenu +import org.appdevforall.codeonthego.actions.ActionsRegistry +import org.appdevforall.codeonthego.actions.FillMenuParams +import org.appdevforall.codeonthego.actions.OnActionClickListener +import org.appdevforall.codeonthego.actions.locations.CodeActionsMenu +import org.appdevforall.codeonthego.utils.withStopWatch +import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.CoroutineName +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.Job +import kotlinx.coroutines.launch +import kotlinx.coroutines.plus +import kotlinx.coroutines.withContext +import org.slf4j.LoggerFactory +import java.util.concurrent.ConcurrentHashMap + +/** + * Default implementation for the [ActionsRegistry] + * + * @author Akash Yadav + */ +@AutoService(ActionsRegistry::class) +class DefaultActionsRegistry : ActionsRegistry() { + + private val actions = ConcurrentHashMap>() + private val listeners = HashSet() + + private val actionsCoroutineScope = CoroutineScope(Dispatchers.Default) + + CoroutineName("DefaultActionsRegistry") + + companion object { + private val log = LoggerFactory.getLogger(DefaultActionsRegistry::class.java) + private const val DEBUG_PREFIX = "ACTION_DEBUG: " + } + + init { + registerAction(CodeActionsMenu) + } + + override fun getActions(location: ActionItem.Location): MutableMap { + return actions.getOrPut(location.id) { LinkedHashMap() } + } + + override fun registerAction(action: ActionItem): Boolean { + val actions = getActions(action.location) + val isUpdating = actions.containsKey(action.id) + log.debug( + "$DEBUG_PREFIX ${if (isUpdating) "Updating" else "Registering"} action '${action.id}' at location '${action.location.id}'. " + + "Current count: ${actions.size}." + ) + actions.remove(action.id) + actions[action.id] = action + log.debug("$DEBUG_PREFIX Location '${action.location.id}' now has ${actions.size} actions.") + if (actions.size == 3) { + log.debug("$DEBUG_PREFIX readhed the 3 target") + } + return true + } + + override fun unregisterAction(action: ActionItem): Boolean { + val actions = getActions(action.location) + log.debug( + "$DEBUG_PREFIX Unregistering action '${action.id}' from location '${action.location.id}'. " + + "Current count: ${actions.size}." + ) + val older = actions.remove(action.id) + if (older != null) { + older.destroy() + log.debug("$DEBUG_PREFIX Unregistered '${action.id}'. Location '${action.location.id}' now has ${actions.size} actions.") + return true + } + log.debug("$DEBUG_PREFIX Action '${action.id}' not found at location '${action.location.id}'.") + return false + } + + override fun unregisterAction(id: String): Boolean { + log.debug("$DEBUG_PREFIX Attempting to unregister action with id '$id' from all locations.") + for ((locationId, locations) in this.actions) { + val older = locations.remove(id) + if (older != null) { + older.destroy() + log.debug("$DEBUG_PREFIX Removed action '$id' from location '$locationId'. New count: ${locations.size}.") + return true + } + } + log.debug("$DEBUG_PREFIX Action with id '$id' not found in any location.") + return false + } + + override fun findAction(location: ActionItem.Location, id: String): ActionItem? = + getActions(location)[id] + + override fun findAction(location: ActionItem.Location, itemId: Int): ActionItem? { + for (action in getActions(location)) { + if (action.value.itemId == itemId) { + return action.value + } + } + + return null + } + + override fun clearActions(location: ActionItem.Location) { + val actions = getActions(location) + log.debug("$DEBUG_PREFIX Clearing all ${actions.size} actions from location '${location.id}'.") + actions.forEach { it.value.destroy() } + actions.clear() + log.debug("$DEBUG_PREFIX Location '${location.id}' is now empty.") + } + + override fun clearActionsExceptWhere( + location: ActionItem.Location, + predicate: (ActionItem) -> Boolean + ) { + val actions = getActions(location) + val initialCount = actions.size + val toRemove = mutableListOf() + + log.debug("$DEBUG_PREFIX Conditionally clearing actions from location '${location.id}'. Initial count: $initialCount.") + + actions.forEach { (key, action) -> + if (!predicate(action)) { + toRemove.add(key) + } + } + + if (toRemove.isNotEmpty()) { + log.debug("$DEBUG_PREFIX Removing ${toRemove.size} actions from location '${location.id}': $toRemove") + toRemove.forEach { key -> + actions[key]?.destroy() + actions.remove(key) + } + log.debug("$DEBUG_PREFIX Location '${location.id}' now has ${actions.size} actions.") + } else { + log.debug("$DEBUG_PREFIX No actions met the removal criteria for location '${location.id}'.") + } + } + + override fun registerActionExecListener(listener: ActionExecListener) { + listeners.add(listener) + } + + override fun unregisterActionExecListener(listener: ActionExecListener) { + listeners.remove(listener) + } + + override fun fillMenu(params: FillMenuParams) { + val (data, location, menu, onClickListener) = params + val actions = getActions(location) + + val sortedActions = actions.values.sortedWith(compareBy({ it.order }, { it.id })) + + for (action in sortedActions) { + action.prepare(data) + + if (!action.visible) { + continue + } + addActionToMenu(menu, action, data, onClickListener) + } + } + + private fun addActionToMenu( + menu: Menu, + action: ActionItem, + data: ActionData, + onClickListener: OnActionClickListener + ) { + + val item: MenuItem = if (action is ActionMenu) { + val sub = menu.addSubMenu(Menu.NONE, action.itemId, action.order, action.label) + + var shouldBeEnabled = false + for (subItem in action.children) { + subItem.prepare(data) + if (subItem.visible) { + addActionToMenu(sub, subItem, data, onClickListener) + } + + if (action.enabled && subItem.enabled && !shouldBeEnabled) { + shouldBeEnabled = true + } + } + + action.enabled = shouldBeEnabled + sub.item + } else { + menu.add(Menu.NONE, action.itemId, action.order, action.label) + } + + item.isEnabled = action.enabled + + item.contentDescription = action.label + + item.icon = action.icon?.apply { + colorFilter = action.createColorFilter(data) + alpha = if (action.enabled) 255 else 76 + } + + var showAsAction = action.getShowAsActionFlags(data) + if (showAsAction == -1) { + showAsAction = if (action.icon != null) { + MenuItem.SHOW_AS_ACTION_IF_ROOM + } else { + MenuItem.SHOW_AS_ACTION_NEVER + } + } + + if (!action.enabled) { + showAsAction = MenuItem.SHOW_AS_ACTION_NEVER + } + + item.setShowAsAction(showAsAction) + + action.createActionView(data)?.let { item.actionView = it } + + if (action !is ActionMenu) { + item.setOnMenuItemClickListener { + onClickListener.onClick(this, action, it, data) + } + } + } + + /** Executes the given action item with the given */ + fun executeAction(action: ActionItem, data: ActionData): Job { + val onMainThread = action.requiresUIThread + val context = if (onMainThread) Dispatchers.Main.immediate else Dispatchers.Default + return actionsCoroutineScope.launch(context) { + val result = try { + withStopWatch("Action '${action.id}'") { action.execAction(data) } + } catch (e: IllegalArgumentException) { + log.error("An error occurred when performing action '{}'", action.id, e) + return@launch + } + + val post = fun() = run { + action.postExec(data, result) + notifyActionExec(action, result) + } + + if (onMainThread) { + post() + } else { + withContext(Dispatchers.Main.immediate) { post() } + } + }.also { job -> + job.invokeOnCompletion { cause -> + when (cause) { + null -> log.debug("Action '{}' execution completed.", action.id) + is CancellationException -> log.debug("Action '{}' execution was cancelled.", action.id) + else -> log.debug("Action '{}' execution failed.", action.id, cause) + } + } + } + } + + private fun notifyActionExec(action: ActionItem, result: Any) { + for (listener in listeners) { + listener.onExec(action, result) + } + } } \ No newline at end of file diff --git a/actions/src/main/java/com/itsaky/androidide/actions/locations/CodeActionsMenu.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/locations/CodeActionsMenu.kt similarity index 85% rename from actions/src/main/java/com/itsaky/androidide/actions/locations/CodeActionsMenu.kt rename to actions/src/main/java/org/appdevforall/codeonthego/actions/locations/CodeActionsMenu.kt index 2915f7db2d..d9aa46a941 100644 --- a/actions/src/main/java/com/itsaky/androidide/actions/locations/CodeActionsMenu.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/locations/CodeActionsMenu.kt @@ -1,52 +1,52 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.actions.locations - -import android.content.Context -import android.graphics.drawable.Drawable -import androidx.core.content.ContextCompat -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.ActionMenu -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R - -/** @author Akash Yadav */ -object CodeActionsMenu : ActionMenu { - - const val ID = "ide.editor.code.actions" - - override val children: MutableSet = mutableSetOf() - override val id: String = ID - - override var label: String = "Code actions" - override var visible = true - override var enabled: Boolean = true - override var icon: Drawable? = null - override fun retrieveTooltipTag(isAlternateContext: Boolean) = - TooltipTag.EDITOR_TOOLBAR_CODE_ACTIONS - override var requiresUIThread: Boolean = false - override var location: ActionItem.Location = ActionItem.Location.EDITOR_TEXT_ACTIONS - - override fun prepare(data: ActionData) { - super.prepare(data) - if (icon == null) { - icon = ContextCompat.getDrawable(data[Context::class.java]!!, R.drawable.ic_code) - } - } +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.actions.locations + +import android.content.Context +import android.graphics.drawable.Drawable +import androidx.core.content.ContextCompat +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionMenu +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import com.itsaky.androidide.resources.R + +/** @author Akash Yadav */ +object CodeActionsMenu : ActionMenu { + + const val ID = "ide.editor.code.actions" + + override val children: MutableSet = mutableSetOf() + override val id: String = ID + + override var label: String = "Code actions" + override var visible = true + override var enabled: Boolean = true + override var icon: Drawable? = null + override fun retrieveTooltipTag(isAlternateContext: Boolean) = + TooltipTag.EDITOR_TOOLBAR_CODE_ACTIONS + override var requiresUIThread: Boolean = false + override var location: ActionItem.Location = ActionItem.Location.EDITOR_TEXT_ACTIONS + + override fun prepare(data: ActionData) { + super.prepare(data) + if (icon == null) { + icon = ContextCompat.getDrawable(data[Context::class.java]!!, R.drawable.ic_code) + } + } } \ No newline at end of file diff --git a/actions/src/test/java/com/itsaky/androidide/actions/ActionTooltipResolutionTest.kt b/actions/src/test/java/org/appdevforall/codeonthego/actions/ActionTooltipResolutionTest.kt similarity index 98% rename from actions/src/test/java/com/itsaky/androidide/actions/ActionTooltipResolutionTest.kt rename to actions/src/test/java/org/appdevforall/codeonthego/actions/ActionTooltipResolutionTest.kt index b1340fbc4b..b21a4a8140 100644 --- a/actions/src/test/java/com/itsaky/androidide/actions/ActionTooltipResolutionTest.kt +++ b/actions/src/test/java/org/appdevforall/codeonthego/actions/ActionTooltipResolutionTest.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions import android.graphics.drawable.Drawable import com.google.common.truth.Truth.assertThat diff --git a/actions/src/test/java/com/itsaky/androidide/actions/SidebarSlotManagerTest.kt b/actions/src/test/java/org/appdevforall/codeonthego/actions/SidebarSlotManagerTest.kt similarity index 92% rename from actions/src/test/java/com/itsaky/androidide/actions/SidebarSlotManagerTest.kt rename to actions/src/test/java/org/appdevforall/codeonthego/actions/SidebarSlotManagerTest.kt index b8c151d309..0c1c4e3aa1 100644 --- a/actions/src/test/java/com/itsaky/androidide/actions/SidebarSlotManagerTest.kt +++ b/actions/src/test/java/org/appdevforall/codeonthego/actions/SidebarSlotManagerTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions import com.google.common.truth.Truth.assertThat import org.junit.After diff --git a/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/utils.kt b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/utils.kt index 7dc521638a..8246c6ed5c 100644 --- a/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/utils.kt +++ b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/utils.kt @@ -23,12 +23,12 @@ val ANDROID_VIEW_PCK = "android.view" val ANDROID_VIEW_CLASS = "View" val VIEW_CLASS = "$ANDROID_VIEW_PCK.$ANDROID_VIEW_CLASS" -const val ADAPTER_BASE_CLASS_PCK = "com.itsaky.androidide.inflater" +const val ADAPTER_BASE_CLASS_PCK = "org.appdevforall.codeonthego.inflater" const val ADAPTER_BASE_CLASS_NAME = "IViewAdapter" const val ADAPTER_BASE_CLASS = "$ADAPTER_BASE_CLASS_PCK.$ADAPTER_BASE_CLASS_NAME" const val ADAPTER_FUNC_CREATE_WIDGET = "createUiWidgets" -const val INDEX_PACKAGE_NAME = "com.itsaky.androidide.inflater.internal" +const val INDEX_PACKAGE_NAME = "org.appdevforall.codeonthego.inflater.internal" const val INDEX_CLASS_NAME = "ViewAdapterIndexImpl" const val INDEX_MAP_FIELD = "adapterMap" const val INDEX_PROVIDER_MAP_FIELD = "widgetProviders" @@ -38,5 +38,5 @@ const val METHOD_SET_MODULE = "setModuleNamespace" val viewAdapter = ClassName.get(ADAPTER_BASE_CLASS_PCK, ADAPTER_BASE_CLASS_NAME) val viewAdapterInterface: ClassName = - ClassName.get("com.itsaky.androidide.inflater", "IViewAdapterIndex") + ClassName.get("org.appdevforall.codeonthego.inflater", "IViewAdapterIndex") val viewClass = ClassName.get(ANDROID_VIEW_PCK, ANDROID_VIEW_CLASS) \ No newline at end of file diff --git a/apk-viewer-plugin/build.gradle.kts b/apk-viewer-plugin/build.gradle.kts index 27fdbdf08b..c0638fa81b 100644 --- a/apk-viewer-plugin/build.gradle.kts +++ b/apk-viewer-plugin/build.gradle.kts @@ -1,7 +1,7 @@ plugins { id("com.android.application") version "8.8.2" id("org.jetbrains.kotlin.android") version "2.1.21" - id("com.itsaky.androidide.plugins.build") + id("org.appdevforall.codeonthego.plugins.build") } pluginBuilder { diff --git a/apk-viewer-plugin/proguard-rules.pro b/apk-viewer-plugin/proguard-rules.pro index 923af538d5..a908042025 100644 --- a/apk-viewer-plugin/proguard-rules.pro +++ b/apk-viewer-plugin/proguard-rules.pro @@ -9,8 +9,8 @@ -keep class com.example.sampleplugin.fragments.** { *; } # Keep plugin interfaces --keep interface com.itsaky.androidide.plugins.** { *; } --keep class com.itsaky.androidide.plugins.** { *; } +-keep interface org.appdevforall.codeonthego.plugins.** { *; } +-keep class org.appdevforall.codeonthego.plugins.** { *; } # Keep Android components -keepclassmembers class * extends androidx.fragment.app.Fragment { diff --git a/apk-viewer-plugin/src/main/kotlin/com/example/sampleplugin/ApkViewer.kt b/apk-viewer-plugin/src/main/kotlin/com/example/sampleplugin/ApkViewer.kt index 7f2d1033e7..54a3584fb5 100644 --- a/apk-viewer-plugin/src/main/kotlin/com/example/sampleplugin/ApkViewer.kt +++ b/apk-viewer-plugin/src/main/kotlin/com/example/sampleplugin/ApkViewer.kt @@ -1,17 +1,17 @@ package com.example.sampleplugin import androidx.fragment.app.Fragment -import com.itsaky.androidide.plugins.IPlugin -import com.itsaky.androidide.plugins.PluginContext -import com.itsaky.androidide.plugins.extensions.UIExtension -import com.itsaky.androidide.plugins.extensions.EditorTabExtension -import com.itsaky.androidide.plugins.extensions.MenuItem -import com.itsaky.androidide.plugins.extensions.TabItem -import com.itsaky.androidide.plugins.extensions.EditorTabItem -import com.itsaky.androidide.plugins.extensions.NavigationItem -import com.itsaky.androidide.plugins.extensions.FileOpenExtension -import com.itsaky.androidide.plugins.extensions.FileTabMenuItem -import com.itsaky.androidide.plugins.services.IdeEditorTabService +import org.appdevforall.codeonthego.plugins.IPlugin +import org.appdevforall.codeonthego.plugins.PluginContext +import org.appdevforall.codeonthego.plugins.extensions.UIExtension +import org.appdevforall.codeonthego.plugins.extensions.EditorTabExtension +import org.appdevforall.codeonthego.plugins.extensions.MenuItem +import org.appdevforall.codeonthego.plugins.extensions.TabItem +import org.appdevforall.codeonthego.plugins.extensions.EditorTabItem +import org.appdevforall.codeonthego.plugins.extensions.NavigationItem +import org.appdevforall.codeonthego.plugins.extensions.FileOpenExtension +import org.appdevforall.codeonthego.plugins.extensions.FileTabMenuItem +import org.appdevforall.codeonthego.plugins.services.IdeEditorTabService import com.example.sampleplugin.R import com.example.sampleplugin.fragments.ApkAnalyzerFragment import java.io.File diff --git a/apk-viewer-plugin/src/main/kotlin/com/example/sampleplugin/fragments/ApkAnalyzerFragment.kt b/apk-viewer-plugin/src/main/kotlin/com/example/sampleplugin/fragments/ApkAnalyzerFragment.kt index a2da07cf2a..c5b9a633f7 100644 --- a/apk-viewer-plugin/src/main/kotlin/com/example/sampleplugin/fragments/ApkAnalyzerFragment.kt +++ b/apk-viewer-plugin/src/main/kotlin/com/example/sampleplugin/fragments/ApkAnalyzerFragment.kt @@ -24,7 +24,7 @@ import com.example.sampleplugin.R import com.example.sampleplugin.viewmodel.ApkAnalyzerViewModel import com.example.sampleplugin.viewmodel.ApkParseResult import com.google.android.material.color.MaterialColors -import com.itsaky.androidide.plugins.base.PluginFragmentHelper +import org.appdevforall.codeonthego.plugins.base.PluginFragmentHelper import kotlinx.coroutines.launch data class TableSection( diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d0e1bfc9b5..0770b94e7a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -72,7 +72,7 @@ android { defaultConfig { applicationId = BuildConfig.PACKAGE_NAME vectorDrawables.useSupportLibrary = true - testInstrumentationRunnerArguments["class"] = "com.itsaky.androidide.OrderedTestSuite" + testInstrumentationRunnerArguments["class"] = "org.appdevforall.codeonthego.OrderedTestSuite" } signingConfigs { @@ -633,7 +633,7 @@ tasks.register("createPluginArtifactsZip") { destinationDirectory.set(rootProject.file("assets")) } -// Fat compile-only jar published as com.itsaky.androidide:plugin-api:1.0.0. +// Fat compile-only jar published as org.appdevforall.codeonthego:plugin-api:1.0.0. // Merges the API surface plugins already compile against (plugin-api + common + // eventbus-events + idetooltips) into one coordinate. The three add-ons are // v7/v8-flavored (unlike plugin-api); their classes are ABI-neutral so v8 is used. @@ -757,10 +757,10 @@ val pluginApiKeepRules = fatJar.set(pluginApiFatJar.flatMap { it.archiveFile }) sentinelClasses.set( mapOf( - ":plugin-api" to "com.itsaky.androidide.plugins.IPlugin", - ":common" to "com.itsaky.androidide.utils.Environment", - ":eventbus-events" to "com.itsaky.androidide.eventbus.events.Event", - ":idetooltips" to "com.itsaky.androidide.idetooltips.IDETooltipItem", + ":plugin-api" to "org.appdevforall.codeonthego.plugins.IPlugin", + ":common" to "org.appdevforall.codeonthego.utils.Environment", + ":eventbus-events" to "org.appdevforall.codeonthego.eventbus.events.Event", + ":idetooltips" to "org.appdevforall.codeonthego.idetooltips.IDETooltipItem", ), ) keepRules.set(layout.buildDirectory.file("generated/proguard/plugin-api-keep.pro")) @@ -787,7 +787,7 @@ tasks.register("writePluginApiPom") { xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.itsaky.androidide + org.appdevforall.codeonthego plugin-api 1.0.0 jar @@ -810,11 +810,11 @@ tasks.register("createPluginMavenRepoZip") { archiveFileName.set("plugin-maven-repo.zip") destinationDirectory.set(rootProject.file("assets")) - into("com/itsaky/androidide/plugin-api/1.0.0") { + into("org/appdevforall/codeonthego/plugin-api/1.0.0") { from(layout.buildDirectory.file("plugin-maven-repo-staging/plugin-api-1.0.0.jar")) from(layout.buildDirectory.file("plugin-maven-repo-staging/plugin-api-1.0.0.pom")) } - // Builder tree is already in Maven layout (com/itsaky/androidide/plugins/...). + // Builder tree is already in Maven layout (org/appdevforall/codeonthego/plugins/...). from(rootProject.file("plugin-api/plugin-builder/build/plugin-maven-repo")) } diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index d47e27c123..478ab56640 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -24,10 +24,10 @@ -keep class com.android.** { *; } # Tooling API classes --keep class com.itsaky.androidide.tooling.** { *; } +-keep class org.appdevforall.codeonthego.tooling.** { *; } # Builder model implementations --keep class com.itsaky.androidide.builder.model.** { *; } +-keep class org.appdevforall.codeonthego.builder.model.** { *; } # lsp/kotlin registers its own IntelliJ project/application services -- some # by class name in lsp/kotlin/src/main/resources/META-INF/kt-lsp/kt-lsp.xml, @@ -40,7 +40,7 @@ # then a PicoInitializationException on ModuleDependentsProvider's missing # constructor). Keep the whole package rather than list every implementation # class in AnalysisApiServiceProviders.kt individually. --keep class com.itsaky.androidide.lsp.kotlin.compiler.services.** { *; } +-keep class org.appdevforall.codeonthego.lsp.kotlin.compiler.services.** { *; } # Kotlin Analysis API (bundled in subprojects/kotlin-analysis-api, used by the # Kotlin LSP). subprojects/kotlin-analysis-api/consumer-rules.pro keeps every @@ -94,30 +94,30 @@ io.github.rosemoe.sora.widget.component.EditorCompletionAdapter adapter; int currentSelection; } --keep class com.itsaky.androidide.projects.util.StringSearch { +-keep class org.appdevforall.codeonthego.projects.util.StringSearch { packageName(java.nio.file.Path); } -keep class * implements org.antlr.v4.runtime.Lexer { (...); } --keep class * extends com.itsaky.androidide.lsp.java.providers.completion.IJavaCompletionProvider { +-keep class * extends org.appdevforall.codeonthego.lsp.java.providers.completion.IJavaCompletionProvider { (...); } --keep class com.itsaky.androidide.editor.api.IEditor { *; } --keep class * extends com.itsaky.androidide.inflater.IViewAdapter { *; } --keep class * extends com.itsaky.androidide.inflater.drawable.IDrawableParser { +-keep class org.appdevforall.codeonthego.editor.api.IEditor { *; } +-keep class * extends org.appdevforall.codeonthego.inflater.IViewAdapter { *; } +-keep class * extends org.appdevforall.codeonthego.inflater.drawable.IDrawableParser { (...); android.graphics.drawable.Drawable parse(); android.graphics.drawable.Drawable parseDrawable(); } --keep class com.itsaky.androidide.utils.DialogUtils { public ; } +-keep class org.appdevforall.codeonthego.utils.DialogUtils { public ; } # Gson model classes deserialized only via reflection (gson.fromJson(..., # X::class.java)), same "R8 strips the unreachable constructor" issue as # templates.impl.zip below. Covers OpenedFilesCache/OpenedFile (no prior # rule) as well as the APK metadata classes already listed individually. --keep class com.itsaky.androidide.models.** { *; } --keep class com.itsaky.androidide.lsp.debug.model.** { *; } +-keep class org.appdevforall.codeonthego.models.** { *; } +-keep class org.appdevforall.codeonthego.lsp.debug.model.** { *; } # Parcelable -keepclassmembers class * implements android.os.Parcelable { @@ -126,7 +126,7 @@ # Used in preferences -keep enum org.eclipse.lemminx.dom.builder.EmptyElements { *; } --keep enum com.itsaky.androidide.xml.permissions.Permission { *; } +-keep enum org.appdevforall.codeonthego.xml.permissions.Permission { *; } # Lots of native methods in tree-sitter # There are some fields as well that are accessed from native field @@ -168,7 +168,7 @@ # With no traceable constructor call, R8 strips the constructor and Gson's # runtime then reports the class as abstract ("Failed to load template # archive ... Abstract classes can't be instantiated!"). --keep class com.itsaky.androidide.templates.impl.zip.** { *; } +-keep class org.appdevforall.codeonthego.templates.impl.zip.** { *; } -keepclassmembers,allowobfuscation class * { @com.google.gson.annotations.SerializedName ; @@ -179,12 +179,12 @@ -keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken ## Themes --keep enum com.itsaky.androidide.ui.themes.IDETheme { +-keep enum org.appdevforall.codeonthego.ui.themes.IDETheme { *; } ## Contributor models - deserialized with GSON --keep class * implements com.itsaky.androidide.contributors.Contributor { +-keep class * implements org.appdevforall.codeonthego.contributors.Contributor { *; } @@ -268,8 +268,8 @@ ## returning emptyList()) to EmptyList, then inserts CHECKCAST at call sites. ## When a plugin returns a non-EmptyList (listOf(x), mutableListOf(), etc), ## the cast fails at runtime. --keep class com.itsaky.androidide.plugins.** { *; } --keep interface com.itsaky.androidide.plugins.** { *; } +-keep class org.appdevforall.codeonthego.plugins.** { *; } +-keep interface org.appdevforall.codeonthego.plugins.** { *; } ## ADFA-3604: JDI's SocketAttachingConnector/SocketListeningConnector are ## loaded via ServiceLoader (META-INF/services), which R8 can't trace, so it @@ -286,6 +286,6 @@ ## R8 Kotlin metadata workaround for Kotlin 2.3.0 compatibility ## Suppresses D8 errors when parsing kotlin metadata for StopWatch inline functions --keep class com.itsaky.androidide.utils.StopWatch { *; } --keepclassmembers class com.itsaky.androidide.utils.StopWatch** { *; } +-keep class org.appdevforall.codeonthego.utils.StopWatch { *; } +-keepclassmembers class org.appdevforall.codeonthego.utils.StopWatch** { *; } diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/AutomationEndToEndTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/AutomationEndToEndTest.kt similarity index 80% rename from app/src/androidTest/kotlin/com/itsaky/androidide/AutomationEndToEndTest.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/AutomationEndToEndTest.kt index 8d0ba2fc8a..4156bcae12 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/AutomationEndToEndTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/AutomationEndToEndTest.kt @@ -1,26 +1,28 @@ -package com.itsaky.androidide +package org.appdevforall.codeonthego + +import com.itsaky.androidide.R import androidx.test.core.app.ActivityScenario import androidx.test.espresso.matcher.ViewMatchers.isNotEnabled import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry -import com.itsaky.androidide.activities.SplashActivity -import com.itsaky.androidide.helper.advancePastWelcomeScreen -import com.itsaky.androidide.helper.clickFirstAccessibilityNodeByText -import com.itsaky.androidide.helper.configureAutomationBuildPreferences -import com.itsaky.androidide.helper.ensureOnHomeScreenBeforeCreateProject -import com.itsaky.androidide.helper.grantAllRequiredPermissionsThroughOnboardingUi -import com.itsaky.androidide.helper.handlePrivacyDisclosure -import com.itsaky.androidide.helper.initializeProjectRunAssembleTasksAndCancelBuild -import com.itsaky.androidide.helper.selectProjectTemplate -import com.itsaky.androidide.helper.waitForMainHomeOrEditorUi -import com.itsaky.androidide.screens.HomeScreen.clickCreateProjectHomeScreen -import com.itsaky.androidide.screens.OnboardingScreen -import com.itsaky.androidide.screens.PermissionScreen -import com.itsaky.androidide.screens.ProjectSettingsScreen.clickCreateProjectProjectSettings -import com.itsaky.androidide.screens.ProjectSettingsScreen.selectKotlinLanguage -import com.itsaky.androidide.screens.ProjectSettingsScreen.setProjectName -import com.itsaky.androidide.utils.PermissionsHelper +import org.appdevforall.codeonthego.activities.SplashActivity +import org.appdevforall.codeonthego.helper.advancePastWelcomeScreen +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText +import org.appdevforall.codeonthego.helper.configureAutomationBuildPreferences +import org.appdevforall.codeonthego.helper.ensureOnHomeScreenBeforeCreateProject +import org.appdevforall.codeonthego.helper.grantAllRequiredPermissionsThroughOnboardingUi +import org.appdevforall.codeonthego.helper.handlePrivacyDisclosure +import org.appdevforall.codeonthego.helper.initializeProjectRunAssembleTasksAndCancelBuild +import org.appdevforall.codeonthego.helper.selectProjectTemplate +import org.appdevforall.codeonthego.helper.waitForMainHomeOrEditorUi +import org.appdevforall.codeonthego.screens.HomeScreen.clickCreateProjectHomeScreen +import org.appdevforall.codeonthego.screens.OnboardingScreen +import org.appdevforall.codeonthego.screens.PermissionScreen +import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.clickCreateProjectProjectSettings +import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.selectKotlinLanguage +import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.setProjectName +import org.appdevforall.codeonthego.utils.PermissionsHelper import com.kaspersky.kaspresso.testcases.api.testcase.TestCase import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/AutomationTestSuite.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/AutomationTestSuite.kt similarity index 86% rename from app/src/androidTest/kotlin/com/itsaky/androidide/AutomationTestSuite.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/AutomationTestSuite.kt index b9228953eb..eb9b20ccd8 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/AutomationTestSuite.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/AutomationTestSuite.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide +package org.appdevforall.codeonthego import org.junit.runner.RunWith import org.junit.runners.Suite diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/CleanupTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/CleanupTest.kt similarity index 96% rename from app/src/androidTest/kotlin/com/itsaky/androidide/CleanupTest.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/CleanupTest.kt index effaeb3aa6..bee1785b22 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/CleanupTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/CleanupTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide +package org.appdevforall.codeonthego import android.app.Instrumentation import android.os.ParcelFileDescriptor diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/EndToEndTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/EndToEndTest.kt similarity index 77% rename from app/src/androidTest/kotlin/com/itsaky/androidide/EndToEndTest.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/EndToEndTest.kt index a85d84c5c0..84dfff57bd 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/EndToEndTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/EndToEndTest.kt @@ -1,25 +1,27 @@ -package com.itsaky.androidide +package org.appdevforall.codeonthego + +import com.itsaky.androidide.R import androidx.test.core.app.ActivityScenario import androidx.test.espresso.matcher.ViewMatchers.isNotEnabled import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry -import com.itsaky.androidide.activities.SplashActivity -import com.itsaky.androidide.helper.advancePastWelcomeScreen -import com.itsaky.androidide.helper.clickFirstAccessibilityNodeByText -import com.itsaky.androidide.helper.configureAutomationBuildPreferences -import com.itsaky.androidide.helper.ensureOnHomeScreenBeforeCreateProject -import com.itsaky.androidide.helper.grantAllRequiredPermissionsThroughOnboardingUi -import com.itsaky.androidide.helper.handlePrivacyDisclosure -import com.itsaky.androidide.helper.initializeProjectAndCancelBuild -import com.itsaky.androidide.helper.selectProjectTemplate -import com.itsaky.androidide.helper.waitForMainHomeOrEditorUi -import com.itsaky.androidide.screens.HomeScreen.clickCreateProjectHomeScreen -import com.itsaky.androidide.screens.OnboardingScreen -import com.itsaky.androidide.screens.PermissionScreen -import com.itsaky.androidide.screens.ProjectSettingsScreen.clickCreateProjectProjectSettings -import com.itsaky.androidide.screens.ProjectSettingsScreen.setProjectName -import com.itsaky.androidide.utils.PermissionsHelper +import org.appdevforall.codeonthego.activities.SplashActivity +import org.appdevforall.codeonthego.helper.advancePastWelcomeScreen +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText +import org.appdevforall.codeonthego.helper.configureAutomationBuildPreferences +import org.appdevforall.codeonthego.helper.ensureOnHomeScreenBeforeCreateProject +import org.appdevforall.codeonthego.helper.grantAllRequiredPermissionsThroughOnboardingUi +import org.appdevforall.codeonthego.helper.handlePrivacyDisclosure +import org.appdevforall.codeonthego.helper.initializeProjectAndCancelBuild +import org.appdevforall.codeonthego.helper.selectProjectTemplate +import org.appdevforall.codeonthego.helper.waitForMainHomeOrEditorUi +import org.appdevforall.codeonthego.screens.HomeScreen.clickCreateProjectHomeScreen +import org.appdevforall.codeonthego.screens.OnboardingScreen +import org.appdevforall.codeonthego.screens.PermissionScreen +import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.clickCreateProjectProjectSettings +import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.setProjectName +import org.appdevforall.codeonthego.utils.PermissionsHelper import com.kaspersky.kaspresso.testcases.api.testcase.TestCase import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/ExportCacheDirectoryTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/ExportCacheDirectoryTest.kt similarity index 99% rename from app/src/androidTest/kotlin/com/itsaky/androidide/ExportCacheDirectoryTest.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/ExportCacheDirectoryTest.kt index 317160cb1a..4bd8ffedf1 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/ExportCacheDirectoryTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/ExportCacheDirectoryTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide +package org.appdevforall.codeonthego import android.os.Environment import androidx.test.ext.junit.runners.AndroidJUnit4 diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/OrderedTestSuite.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/OrderedTestSuite.kt similarity index 87% rename from app/src/androidTest/kotlin/com/itsaky/androidide/OrderedTestSuite.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/OrderedTestSuite.kt index 1d4f99ac8d..ea3860e7f9 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/OrderedTestSuite.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/OrderedTestSuite.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide +package org.appdevforall.codeonthego import org.junit.runner.RunWith import org.junit.runners.Suite diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/ProjectBuildTestWithGroovyGradle.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/ProjectBuildTestWithGroovyGradle.kt similarity index 89% rename from app/src/androidTest/kotlin/com/itsaky/androidide/ProjectBuildTestWithGroovyGradle.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/ProjectBuildTestWithGroovyGradle.kt index 72b29811e3..ad0be533e1 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/ProjectBuildTestWithGroovyGradle.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/ProjectBuildTestWithGroovyGradle.kt @@ -1,14 +1,16 @@ -package com.itsaky.androidide +package org.appdevforall.codeonthego + +import com.itsaky.androidide.R import androidx.test.platform.app.InstrumentationRegistry -import com.itsaky.androidide.helper.initializeProjectAndCancelBuild -import com.itsaky.androidide.helper.navigateToMainScreen -import com.itsaky.androidide.helper.selectProjectTemplate -import com.itsaky.androidide.screens.HomeScreen.clickCreateProjectHomeScreen -import com.itsaky.androidide.screens.ProjectSettingsScreen.clickCreateProjectProjectSettings -import com.itsaky.androidide.screens.ProjectSettingsScreen.selectJavaLanguage -import com.itsaky.androidide.screens.ProjectSettingsScreen.selectKotlinLanguage -import com.itsaky.androidide.screens.ProjectSettingsScreen.uncheckKotlinScript +import org.appdevforall.codeonthego.helper.initializeProjectAndCancelBuild +import org.appdevforall.codeonthego.helper.navigateToMainScreen +import org.appdevforall.codeonthego.helper.selectProjectTemplate +import org.appdevforall.codeonthego.screens.HomeScreen.clickCreateProjectHomeScreen +import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.clickCreateProjectProjectSettings +import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.selectJavaLanguage +import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.selectKotlinLanguage +import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.uncheckKotlinScript import com.kaspersky.kaspresso.testcases.api.testcase.TestCase import org.junit.Test diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/ProjectBuildTestWithKtsGradle.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/ProjectBuildTestWithKtsGradle.kt similarity index 91% rename from app/src/androidTest/kotlin/com/itsaky/androidide/ProjectBuildTestWithKtsGradle.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/ProjectBuildTestWithKtsGradle.kt index 9bde1720c2..4204adc7a2 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/ProjectBuildTestWithKtsGradle.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/ProjectBuildTestWithKtsGradle.kt @@ -1,13 +1,15 @@ -package com.itsaky.androidide +package org.appdevforall.codeonthego + +import com.itsaky.androidide.R import androidx.test.platform.app.InstrumentationRegistry -import com.itsaky.androidide.helper.initializeProjectAndCancelBuild -import com.itsaky.androidide.helper.navigateToMainScreen -import com.itsaky.androidide.helper.selectProjectTemplate -import com.itsaky.androidide.screens.HomeScreen.clickCreateProjectHomeScreen -import com.itsaky.androidide.screens.ProjectSettingsScreen.clickCreateProjectProjectSettings -import com.itsaky.androidide.screens.ProjectSettingsScreen.selectJavaLanguage -import com.itsaky.androidide.screens.ProjectSettingsScreen.selectKotlinLanguage +import org.appdevforall.codeonthego.helper.initializeProjectAndCancelBuild +import org.appdevforall.codeonthego.helper.navigateToMainScreen +import org.appdevforall.codeonthego.helper.selectProjectTemplate +import org.appdevforall.codeonthego.screens.HomeScreen.clickCreateProjectHomeScreen +import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.clickCreateProjectProjectSettings +import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.selectJavaLanguage +import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.selectKotlinLanguage import com.kaspersky.kaspresso.testcases.api.testcase.TestCase import org.junit.Test diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/QuickBuildFlagOffTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildFlagOffTest.kt similarity index 79% rename from app/src/androidTest/kotlin/com/itsaky/androidide/QuickBuildFlagOffTest.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildFlagOffTest.kt index 95a60ff21f..2e77267f34 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/QuickBuildFlagOffTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildFlagOffTest.kt @@ -1,17 +1,17 @@ -package com.itsaky.androidide +package org.appdevforall.codeonthego import androidx.test.core.app.ActivityScenario import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry -import com.itsaky.androidide.activities.SplashActivity -import com.itsaky.androidide.activities.editor.EditorHandlerActivity -import com.itsaky.androidide.app.configuration.IJdkDistributionProvider -import com.itsaky.androidide.helper.isExperimentsFlagSet -import com.itsaky.androidide.helper.setExperimentsFlagForTest -import com.itsaky.androidide.helper.waitForMainHomeOrEditorUi -import com.itsaky.androidide.screens.QuickBuildScreen.assertQuickBuildButtonAbsent -import com.itsaky.androidide.screens.QuickBuildScreen.assertQuickBuildButtonShown -import com.itsaky.androidide.utils.EditorActivityActions +import org.appdevforall.codeonthego.activities.SplashActivity +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.app.configuration.IJdkDistributionProvider +import org.appdevforall.codeonthego.helper.isExperimentsFlagSet +import org.appdevforall.codeonthego.helper.setExperimentsFlagForTest +import org.appdevforall.codeonthego.helper.waitForMainHomeOrEditorUi +import org.appdevforall.codeonthego.screens.QuickBuildScreen.assertQuickBuildButtonAbsent +import org.appdevforall.codeonthego.screens.QuickBuildScreen.assertQuickBuildButtonShown +import org.appdevforall.codeonthego.utils.EditorActivityActions import com.kaspersky.kaspresso.testcases.api.testcase.TestCase import org.junit.Test import org.junit.runner.RunWith @@ -22,7 +22,7 @@ private const val TOOLBAR_TIMEOUT_MS = 15_000L * The shipping-state gate for Quick Build (ADFA-4128, manual test T13): with no * `CodeOnTheGo.exp` flag file on the device, the feature must be invisible. * - * The gate is a single read of [com.itsaky.androidide.utils.FeatureFlags.isExperimentsEnabled] + * The gate is a single read of [org.appdevforall.codeonthego.utils.FeatureFlags.isExperimentsEnabled] * at [EditorActivityActions.register], so this drives that decision directly instead of * restarting the process: flip the flag, re-register, rebuild the toolbar, look. That also * makes the test honest about what it covers - the registration site, not the process-start diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/QuickBuildPipelineTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildPipelineTest.kt similarity index 94% rename from app/src/androidTest/kotlin/com/itsaky/androidide/QuickBuildPipelineTest.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildPipelineTest.kt index 91b727f54b..2e61b2e1ba 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/QuickBuildPipelineTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildPipelineTest.kt @@ -1,28 +1,30 @@ -package com.itsaky.androidide +package org.appdevforall.codeonthego + +import com.itsaky.androidide.R import android.os.Build import androidx.test.core.app.ActivityScenario import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiSelector -import com.itsaky.androidide.activities.SplashActivity -import com.itsaky.androidide.app.configuration.IJdkDistributionProvider -import com.itsaky.androidide.helper.FakeInstalledPackages -import com.itsaky.androidide.helper.ensureOnHomeScreenBeforeCreateProject -import com.itsaky.androidide.helper.isExperimentsFlagSet -import com.itsaky.androidide.helper.selectProjectTemplate -import com.itsaky.androidide.helper.setAccessibilityEditText -import com.itsaky.androidide.helper.setExperimentsFlagForTest -import com.itsaky.androidide.helper.waitForMainHomeOrEditorUi -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.quickbuild.AndroidInstalledPackages -import com.itsaky.androidide.screens.HomeScreen.clickCreateProjectHomeScreen -import com.itsaky.androidide.screens.ProjectSettingsScreen.clickCreateProjectProjectSettings -import com.itsaky.androidide.screens.ProjectSettingsScreen.selectKotlinLanguage -import com.itsaky.androidide.screens.ProjectSettingsScreen.setProjectName -import com.itsaky.androidide.screens.QuickBuildScreen.assertQuickBuildButtonShown -import com.itsaky.androidide.screens.QuickBuildScreen.dismissFirstBuildNoticeIfShown -import com.itsaky.androidide.screens.QuickBuildScreen.tapQuickBuildButton +import org.appdevforall.codeonthego.activities.SplashActivity +import org.appdevforall.codeonthego.app.configuration.IJdkDistributionProvider +import org.appdevforall.codeonthego.helper.FakeInstalledPackages +import org.appdevforall.codeonthego.helper.ensureOnHomeScreenBeforeCreateProject +import org.appdevforall.codeonthego.helper.isExperimentsFlagSet +import org.appdevforall.codeonthego.helper.selectProjectTemplate +import org.appdevforall.codeonthego.helper.setAccessibilityEditText +import org.appdevforall.codeonthego.helper.setExperimentsFlagForTest +import org.appdevforall.codeonthego.helper.waitForMainHomeOrEditorUi +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.quickbuild.AndroidInstalledPackages +import org.appdevforall.codeonthego.screens.HomeScreen.clickCreateProjectHomeScreen +import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.clickCreateProjectProjectSettings +import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.selectKotlinLanguage +import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.setProjectName +import org.appdevforall.codeonthego.screens.QuickBuildScreen.assertQuickBuildButtonShown +import org.appdevforall.codeonthego.screens.QuickBuildScreen.dismissFirstBuildNoticeIfShown +import org.appdevforall.codeonthego.screens.QuickBuildScreen.tapQuickBuildButton import com.kaspersky.kaspresso.testcases.api.testcase.TestCase import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext import kotlinx.coroutines.CoroutineScope diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/QuickBuildSmokeTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildSmokeTest.kt similarity index 81% rename from app/src/androidTest/kotlin/com/itsaky/androidide/QuickBuildSmokeTest.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildSmokeTest.kt index 665a6e74fd..a522dffbf4 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/QuickBuildSmokeTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildSmokeTest.kt @@ -1,39 +1,41 @@ -package com.itsaky.androidide +package org.appdevforall.codeonthego + +import com.itsaky.androidide.R import androidx.test.core.app.ActivityScenario import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiSelector -import com.itsaky.androidide.activities.SplashActivity -import com.itsaky.androidide.activities.editor.EditorHandlerActivity -import com.itsaky.androidide.app.configuration.IJdkDistributionProvider -import com.itsaky.androidide.helper.FakeInstalledPackages -import com.itsaky.androidide.helper.ensureOnHomeScreenBeforeCreateProject -import com.itsaky.androidide.helper.isExperimentsFlagSet -import com.itsaky.androidide.helper.selectProjectTemplate -import com.itsaky.androidide.helper.setAccessibilityEditText -import com.itsaky.androidide.helper.setExperimentsFlagForTest -import com.itsaky.androidide.helper.waitForMainHomeOrEditorUi -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.quickbuild.AndroidInstalledPackages -import com.itsaky.androidide.screens.ErrorBannerScreen.assertErrorBannerShown -import com.itsaky.androidide.screens.ErrorBannerScreen.dismissErrorBannerViaButton -import com.itsaky.androidide.screens.ErrorBannerScreen.dismissErrorBannerViaSwipe -import com.itsaky.androidide.screens.ErrorBannerScreen.dismissErrorBannerViaTapOnBar -import com.itsaky.androidide.screens.HomeScreen.clickCreateProjectHomeScreen -import com.itsaky.androidide.screens.ProjectSettingsScreen.clickCreateProjectProjectSettings -import com.itsaky.androidide.screens.ProjectSettingsScreen.setProjectName -import com.itsaky.androidide.screens.QuickBuildScreen.acceptClobberConfirm -import com.itsaky.androidide.screens.QuickBuildScreen.assertClobberConfirmShown -import com.itsaky.androidide.screens.QuickBuildScreen.assertQuickBuildButtonShown -import com.itsaky.androidide.screens.QuickBuildScreen.assertQuickBuildButtonShowsStop -import com.itsaky.androidide.screens.QuickBuildScreen.declineClobberConfirm -import com.itsaky.androidide.screens.QuickBuildScreen.dismissFirstBuildNoticeIfShown -import com.itsaky.androidide.screens.QuickBuildScreen.dismissQuickBuildDropdown -import com.itsaky.androidide.screens.QuickBuildScreen.longPressOpensQuickBuildDropdown -import com.itsaky.androidide.screens.QuickBuildScreen.restartSessionViaDropdown -import com.itsaky.androidide.screens.QuickBuildScreen.tapQuickBuildButton -import com.itsaky.androidide.utils.flashError +import org.appdevforall.codeonthego.activities.SplashActivity +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.app.configuration.IJdkDistributionProvider +import org.appdevforall.codeonthego.helper.FakeInstalledPackages +import org.appdevforall.codeonthego.helper.ensureOnHomeScreenBeforeCreateProject +import org.appdevforall.codeonthego.helper.isExperimentsFlagSet +import org.appdevforall.codeonthego.helper.selectProjectTemplate +import org.appdevforall.codeonthego.helper.setAccessibilityEditText +import org.appdevforall.codeonthego.helper.setExperimentsFlagForTest +import org.appdevforall.codeonthego.helper.waitForMainHomeOrEditorUi +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.quickbuild.AndroidInstalledPackages +import org.appdevforall.codeonthego.screens.ErrorBannerScreen.assertErrorBannerShown +import org.appdevforall.codeonthego.screens.ErrorBannerScreen.dismissErrorBannerViaButton +import org.appdevforall.codeonthego.screens.ErrorBannerScreen.dismissErrorBannerViaSwipe +import org.appdevforall.codeonthego.screens.ErrorBannerScreen.dismissErrorBannerViaTapOnBar +import org.appdevforall.codeonthego.screens.HomeScreen.clickCreateProjectHomeScreen +import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.clickCreateProjectProjectSettings +import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.setProjectName +import org.appdevforall.codeonthego.screens.QuickBuildScreen.acceptClobberConfirm +import org.appdevforall.codeonthego.screens.QuickBuildScreen.assertClobberConfirmShown +import org.appdevforall.codeonthego.screens.QuickBuildScreen.assertQuickBuildButtonShown +import org.appdevforall.codeonthego.screens.QuickBuildScreen.assertQuickBuildButtonShowsStop +import org.appdevforall.codeonthego.screens.QuickBuildScreen.declineClobberConfirm +import org.appdevforall.codeonthego.screens.QuickBuildScreen.dismissFirstBuildNoticeIfShown +import org.appdevforall.codeonthego.screens.QuickBuildScreen.dismissQuickBuildDropdown +import org.appdevforall.codeonthego.screens.QuickBuildScreen.longPressOpensQuickBuildDropdown +import org.appdevforall.codeonthego.screens.QuickBuildScreen.restartSessionViaDropdown +import org.appdevforall.codeonthego.screens.QuickBuildScreen.tapQuickBuildButton +import org.appdevforall.codeonthego.utils.flashError import com.kaspersky.kaspresso.testcases.api.testcase.TestCase import kotlinx.coroutines.flow.first import kotlinx.coroutines.runBlocking @@ -73,7 +75,7 @@ private const val BANNER_MESSAGE = "Quick Build smoke: injected error banner" /** * Kaspresso smoke for the Quick Build surfaces added by ADFA-4128: - * - the lightning-bolt toolbar action (via [com.itsaky.androidide.screens.QuickBuildScreen]) + * - the lightning-bolt toolbar action (via [org.appdevforall.codeonthego.screens.QuickBuildScreen]) * and its long-press split-button dropdown; * - the indefinite error banner (the surface `userMessages` renders through `flashError`) * and its three dismiss paths: Dismiss button, tap-anywhere, swipe; diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/app/strictmode/FrameMatcherTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/FrameMatcherTest.kt similarity index 98% rename from app/src/androidTest/kotlin/com/itsaky/androidide/app/strictmode/FrameMatcherTest.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/FrameMatcherTest.kt index afc93c99df..eb7d174e17 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/app/strictmode/FrameMatcherTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/FrameMatcherTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.app.strictmode +package org.appdevforall.codeonthego.app.strictmode import com.google.common.truth.Truth.assertThat import org.junit.Test diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/app/strictmode/StackMatcherTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/StackMatcherTest.kt similarity index 98% rename from app/src/androidTest/kotlin/com/itsaky/androidide/app/strictmode/StackMatcherTest.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/StackMatcherTest.kt index 7a445d9c80..614738a65c 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/app/strictmode/StackMatcherTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/StackMatcherTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.app.strictmode +package org.appdevforall.codeonthego.app.strictmode import com.google.common.truth.Truth.assertThat import org.junit.Test diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/app/strictmode/Utils.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/Utils.kt similarity index 95% rename from app/src/androidTest/kotlin/com/itsaky/androidide/app/strictmode/Utils.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/Utils.kt index a4dd496d9f..00c119aa6a 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/app/strictmode/Utils.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/Utils.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.app.strictmode +package org.appdevforall.codeonthego.app.strictmode import android.os.strictmode.Violation import com.google.common.truth.Truth.assertThat diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/app/strictmode/WhitelistEngineTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/WhitelistEngineTest.kt similarity index 98% rename from app/src/androidTest/kotlin/com/itsaky/androidide/app/strictmode/WhitelistEngineTest.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/WhitelistEngineTest.kt index c86b7abaf1..168cd6de82 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/app/strictmode/WhitelistEngineTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/WhitelistEngineTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.app.strictmode +package org.appdevforall.codeonthego.app.strictmode import android.os.strictmode.CustomViolation import android.os.strictmode.DiskReadViolation diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/app/strictmode/WhitelistRulesTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/WhitelistRulesTest.kt similarity index 97% rename from app/src/androidTest/kotlin/com/itsaky/androidide/app/strictmode/WhitelistRulesTest.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/WhitelistRulesTest.kt index c061a2fbc5..d1c5c7abe4 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/app/strictmode/WhitelistRulesTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/WhitelistRulesTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.app.strictmode +package org.appdevforall.codeonthego.app.strictmode import android.os.strictmode.DiskReadViolation import android.os.strictmode.DiskWriteViolation @@ -81,9 +81,9 @@ class WhitelistRulesTest { @Test fun allow_DiskRead_on_ServiceLoader_JdkDistributionProvider() { assertAllowed( - stackTraceElement("com.itsaky.androidide.utils.ServiceLoader", "parse"), + stackTraceElement("org.appdevforall.codeonthego.utils.ServiceLoader", "parse"), stackTraceElement( - "com.itsaky.androidide.app.configuration.IJdkDistributionProvider\$Companion", + "org.appdevforall.codeonthego.app.configuration.IJdkDistributionProvider\$Companion", "_instance_delegate\$lambda\$0" ), ) @@ -94,7 +94,7 @@ class WhitelistRulesTest { assertAllowed( stackTraceElement("java.io.File", "exists"), stackTraceElement( - "com.itsaky.androidide.activities.OnboardingActivity", + "org.appdevforall.codeonthego.activities.OnboardingActivity", "checkToolsIsInstalled" ), ) diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/editor/ui/IDEEditorTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/editor/ui/IDEEditorTest.kt similarity index 97% rename from app/src/androidTest/kotlin/com/itsaky/androidide/editor/ui/IDEEditorTest.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/editor/ui/IDEEditorTest.kt index a9a87c2877..a9f6b8cdb8 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/editor/ui/IDEEditorTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/editor/ui/IDEEditorTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.editor.ui +package org.appdevforall.codeonthego.editor.ui import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/helper/AdvancePastWelcomeScreenHelper.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/AdvancePastWelcomeScreenHelper.kt similarity index 97% rename from app/src/androidTest/kotlin/com/itsaky/androidide/helper/AdvancePastWelcomeScreenHelper.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/AdvancePastWelcomeScreenHelper.kt index ffbe5a17d6..f6af7737f7 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/helper/AdvancePastWelcomeScreenHelper.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/AdvancePastWelcomeScreenHelper.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.helper +package org.appdevforall.codeonthego.helper import android.view.accessibility.AccessibilityNodeInfo import androidx.test.platform.app.InstrumentationRegistry diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/helper/ConfigureAutomationBuildPreferencesHelper.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ConfigureAutomationBuildPreferencesHelper.kt similarity index 91% rename from app/src/androidTest/kotlin/com/itsaky/androidide/helper/ConfigureAutomationBuildPreferencesHelper.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ConfigureAutomationBuildPreferencesHelper.kt index 1eaddee4ca..8002152386 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/helper/ConfigureAutomationBuildPreferencesHelper.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ConfigureAutomationBuildPreferencesHelper.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.helper +package org.appdevforall.codeonthego.helper import android.util.Log import androidx.test.platform.app.InstrumentationRegistry -import com.itsaky.androidide.preferences.internal.BuildPreferences +import org.appdevforall.codeonthego.preferences.internal.BuildPreferences import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext private const val TAG = "AutomationBuildPrefs" diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/helper/DevicePermissionGrantUiHelper.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/DevicePermissionGrantUiHelper.kt similarity index 99% rename from app/src/androidTest/kotlin/com/itsaky/androidide/helper/DevicePermissionGrantUiHelper.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/DevicePermissionGrantUiHelper.kt index 95545047f3..a16c2a435f 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/helper/DevicePermissionGrantUiHelper.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/DevicePermissionGrantUiHelper.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.helper +package org.appdevforall.codeonthego.helper import android.Manifest import android.os.SystemClock diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/helper/EnsureHomeScreenHelper.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/EnsureHomeScreenHelper.kt similarity index 94% rename from app/src/androidTest/kotlin/com/itsaky/androidide/helper/EnsureHomeScreenHelper.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/EnsureHomeScreenHelper.kt index 06d06bb7c5..58e94283bc 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/helper/EnsureHomeScreenHelper.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/EnsureHomeScreenHelper.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.helper +package org.appdevforall.codeonthego.helper import android.content.Context import android.content.Intent @@ -9,9 +9,9 @@ import androidx.test.uiautomator.UiDevice import androidx.test.uiautomator.UiSelector import com.itsaky.androidide.BuildConfig import com.itsaky.androidide.R -import com.itsaky.androidide.activities.MainActivity -import com.itsaky.androidide.preferences.internal.GeneralPreferences -import com.itsaky.androidide.screens.HomeScreen +import org.appdevforall.codeonthego.activities.MainActivity +import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences +import org.appdevforall.codeonthego.screens.HomeScreen import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext import org.hamcrest.Matchers @@ -235,9 +235,9 @@ fun logOnboardingNavigation(msg: String) { } /** - * After "Finish installation" on the permissions slide, [com.itsaky.androidide.fragments.onboarding.PermissionsFragment] - * runs IDE setup — there is **no** guarantee that AppIntro's `@id/done` exists ([com.itsaky.androidide.activities.OnboardingActivity] does not add - * [com.itsaky.androidide.fragments.onboarding.IdeSetupConfigurationFragment] as a slide). Poll until **Get started** + * After "Finish installation" on the permissions slide, [org.appdevforall.codeonthego.fragments.onboarding.PermissionsFragment] + * runs IDE setup — there is **no** guarantee that AppIntro's `@id/done` exists ([org.appdevforall.codeonthego.activities.OnboardingActivity] does not add + * [org.appdevforall.codeonthego.fragments.onboarding.IdeSetupConfigurationFragment] as a slide). Poll until **Get started** * or **editor** is visible. * * First-run IDE setup extracts multi-GB assets (bootstrap, SDK, Gradle dist, diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/helper/ExperimentsFlagHelper.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ExperimentsFlagHelper.kt similarity index 92% rename from app/src/androidTest/kotlin/com/itsaky/androidide/helper/ExperimentsFlagHelper.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ExperimentsFlagHelper.kt index d2bbb99493..458ea7df64 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/helper/ExperimentsFlagHelper.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ExperimentsFlagHelper.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.helper +package org.appdevforall.codeonthego.helper import android.os.ParcelFileDescriptor import androidx.test.platform.app.InstrumentationRegistry -import com.itsaky.androidide.utils.FeatureFlags +import org.appdevforall.codeonthego.utils.FeatureFlags import kotlinx.coroutines.runBlocking import org.junit.Assert.assertEquals @@ -36,7 +36,7 @@ fun setExperimentsFlagForTest(enabled: Boolean) { .apply { isAccessible = true } val defaultFlags = Class - .forName("com.itsaky.androidide.utils.FlagsCache") + .forName("org.appdevforall.codeonthego.utils.FlagsCache") .getDeclaredField("DEFAULT") .apply { isAccessible = true } .get(null) diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/helper/FakeInstalledPackages.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/FakeInstalledPackages.kt similarity index 96% rename from app/src/androidTest/kotlin/com/itsaky/androidide/helper/FakeInstalledPackages.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/FakeInstalledPackages.kt index 4f00488e88..3a87c2ab95 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/helper/FakeInstalledPackages.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/FakeInstalledPackages.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.helper +package org.appdevforall.codeonthego.helper import org.appdevforall.cotg.quickbuild.service.provision.InstalledPackages import java.io.File diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/helper/GrantRequiredPermissionsUiHelper.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/GrantRequiredPermissionsUiHelper.kt similarity index 93% rename from app/src/androidTest/kotlin/com/itsaky/androidide/helper/GrantRequiredPermissionsUiHelper.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/GrantRequiredPermissionsUiHelper.kt index e3d65fe98e..f4403300ce 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/helper/GrantRequiredPermissionsUiHelper.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/GrantRequiredPermissionsUiHelper.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.helper +package org.appdevforall.codeonthego.helper import android.Manifest import androidx.test.platform.app.InstrumentationRegistry import com.itsaky.androidide.R -import com.itsaky.androidide.screens.PermissionScreen -import com.itsaky.androidide.utils.PermissionsHelper +import org.appdevforall.codeonthego.screens.PermissionScreen +import org.appdevforall.codeonthego.utils.PermissionsHelper import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext /** diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/helper/HandlePrivacyDisclosureHelper.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/HandlePrivacyDisclosureHelper.kt similarity index 93% rename from app/src/androidTest/kotlin/com/itsaky/androidide/helper/HandlePrivacyDisclosureHelper.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/HandlePrivacyDisclosureHelper.kt index 9a766b8765..ba64c88ace 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/helper/HandlePrivacyDisclosureHelper.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/HandlePrivacyDisclosureHelper.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.helper +package org.appdevforall.codeonthego.helper import android.util.Log import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiSelector -import com.itsaky.androidide.preferences.internal.StatPreferences -import com.itsaky.androidide.preferences.internal.TelemetryConsent +import org.appdevforall.codeonthego.preferences.internal.StatPreferences +import org.appdevforall.codeonthego.preferences.internal.TelemetryConsent import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/helper/ProjectBuildHelper.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ProjectBuildHelper.kt similarity index 79% rename from app/src/androidTest/kotlin/com/itsaky/androidide/helper/ProjectBuildHelper.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ProjectBuildHelper.kt index 55aac447be..69017debef 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/helper/ProjectBuildHelper.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ProjectBuildHelper.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.helper +package org.appdevforall.codeonthego.helper -import com.itsaky.androidide.scenarios.InitializationProjectAndCancelingBuildScenario -import com.itsaky.androidide.scenarios.NavigateToMainScreenScenario -import com.itsaky.androidide.scenarios.RunAssembleTasksScenario -import com.itsaky.androidide.screens.TemplateScreen.selectTemplate +import org.appdevforall.codeonthego.scenarios.InitializationProjectAndCancelingBuildScenario +import org.appdevforall.codeonthego.scenarios.NavigateToMainScreenScenario +import org.appdevforall.codeonthego.scenarios.RunAssembleTasksScenario +import org.appdevforall.codeonthego.screens.TemplateScreen.selectTemplate import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext fun TestContext.navigateToMainScreen() { diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/scenarios/InitializationProjectAndCancelingBuildScenario.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/InitializationProjectAndCancelingBuildScenario.kt similarity index 98% rename from app/src/androidTest/kotlin/com/itsaky/androidide/scenarios/InitializationProjectAndCancelingBuildScenario.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/InitializationProjectAndCancelingBuildScenario.kt index deee418d32..3c422f32ad 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/scenarios/InitializationProjectAndCancelingBuildScenario.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/InitializationProjectAndCancelingBuildScenario.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.scenarios +package org.appdevforall.codeonthego.scenarios import android.util.Log import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiSelector import com.itsaky.androidide.R -import com.itsaky.androidide.helper.clickFirstAccessibilityNodeByDescription -import com.itsaky.androidide.helper.clickFirstAccessibilityNodeByText +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByDescription +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText import com.kaspersky.kaspresso.testcases.api.scenario.Scenario import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/scenarios/NavigateToMainScreenScenario.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/NavigateToMainScreenScenario.kt similarity index 90% rename from app/src/androidTest/kotlin/com/itsaky/androidide/scenarios/NavigateToMainScreenScenario.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/NavigateToMainScreenScenario.kt index cf83459e1b..bb02229280 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/scenarios/NavigateToMainScreenScenario.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/NavigateToMainScreenScenario.kt @@ -1,12 +1,12 @@ -package com.itsaky.androidide.scenarios +package org.appdevforall.codeonthego.scenarios -import com.itsaky.androidide.helper.advancePastWelcomeScreen -import com.itsaky.androidide.helper.clickFirstAccessibilityNodeByText -import com.itsaky.androidide.helper.grantAllRequiredPermissionsThroughOnboardingUi -import com.itsaky.androidide.helper.logOnboardingNavigation -import com.itsaky.androidide.helper.waitForMainHomeOrEditorUi -import com.itsaky.androidide.screens.InstallToolsScreen -import com.itsaky.androidide.screens.PermissionScreen +import org.appdevforall.codeonthego.helper.advancePastWelcomeScreen +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText +import org.appdevforall.codeonthego.helper.grantAllRequiredPermissionsThroughOnboardingUi +import org.appdevforall.codeonthego.helper.logOnboardingNavigation +import org.appdevforall.codeonthego.helper.waitForMainHomeOrEditorUi +import org.appdevforall.codeonthego.screens.InstallToolsScreen +import org.appdevforall.codeonthego.screens.PermissionScreen import com.kaspersky.kaspresso.testcases.api.scenario.Scenario import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext import androidx.test.platform.app.InstrumentationRegistry diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/scenarios/RunAssembleTasksScenario.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/RunAssembleTasksScenario.kt similarity index 96% rename from app/src/androidTest/kotlin/com/itsaky/androidide/scenarios/RunAssembleTasksScenario.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/RunAssembleTasksScenario.kt index 37aa151486..7c675278e0 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/scenarios/RunAssembleTasksScenario.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/RunAssembleTasksScenario.kt @@ -1,12 +1,12 @@ -package com.itsaky.androidide.scenarios +package org.appdevforall.codeonthego.scenarios import android.util.Log import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiScrollable import androidx.test.uiautomator.UiSelector import com.itsaky.androidide.R -import com.itsaky.androidide.helper.clickFirstAccessibilityNodeByDescription -import com.itsaky.androidide.helper.clickFirstAccessibilityNodeParentByText +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByDescription +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeParentByText import com.kaspersky.kaspresso.testcases.api.scenario.Scenario import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/EditorScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/EditorScreen.kt similarity index 87% rename from app/src/androidTest/kotlin/com/itsaky/androidide/screens/EditorScreen.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/EditorScreen.kt index 1aff39405a..b9a212fbb0 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/EditorScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/EditorScreen.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.screens +package org.appdevforall.codeonthego.screens import com.kaspersky.kaspresso.screens.KScreen import io.github.kakaocup.kakao.dialog.KAlertDialog diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/ErrorBannerScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/ErrorBannerScreen.kt similarity index 98% rename from app/src/androidTest/kotlin/com/itsaky/androidide/screens/ErrorBannerScreen.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/ErrorBannerScreen.kt index 0c3bd5b661..61e1eeb17d 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/ErrorBannerScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/ErrorBannerScreen.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.screens +package org.appdevforall.codeonthego.screens import androidx.test.uiautomator.UiObject import androidx.test.uiautomator.UiSelector diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/HomeScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/HomeScreen.kt similarity index 89% rename from app/src/androidTest/kotlin/com/itsaky/androidide/screens/HomeScreen.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/HomeScreen.kt index d922930d78..e33410e97c 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/HomeScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/HomeScreen.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.screens +package org.appdevforall.codeonthego.screens import androidx.test.platform.app.InstrumentationRegistry import com.itsaky.androidide.R -import com.itsaky.androidide.helper.clickFirstAccessibilityNodeByText +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText import com.kaspersky.kaspresso.screens.KScreen import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext import io.github.kakaocup.kakao.text.KTextView diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/InstallToolsScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/InstallToolsScreen.kt similarity index 87% rename from app/src/androidTest/kotlin/com/itsaky/androidide/screens/InstallToolsScreen.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/InstallToolsScreen.kt index e224d84456..dcd91b0a8a 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/InstallToolsScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/InstallToolsScreen.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.screens +package org.appdevforall.codeonthego.screens import com.itsaky.androidide.R import com.kaspersky.kaspresso.screens.KScreen diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/OnboardingScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/OnboardingScreen.kt similarity index 92% rename from app/src/androidTest/kotlin/com/itsaky/androidide/screens/OnboardingScreen.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/OnboardingScreen.kt index 30a988a5a6..ca12c4b3f6 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/OnboardingScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/OnboardingScreen.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.screens +package org.appdevforall.codeonthego.screens import com.itsaky.androidide.R import com.kaspersky.kaspresso.screens.KScreen diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/PermissionScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/PermissionScreen.kt similarity index 96% rename from app/src/androidTest/kotlin/com/itsaky/androidide/screens/PermissionScreen.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/PermissionScreen.kt index 50b158eea4..abe4a2596b 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/PermissionScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/PermissionScreen.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.screens +package org.appdevforall.codeonthego.screens import android.view.View import com.itsaky.androidide.R diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/ProjectSettingsScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/ProjectSettingsScreen.kt similarity index 96% rename from app/src/androidTest/kotlin/com/itsaky/androidide/screens/ProjectSettingsScreen.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/ProjectSettingsScreen.kt index 4f2935b96a..af61dfa237 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/ProjectSettingsScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/ProjectSettingsScreen.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.screens +package org.appdevforall.codeonthego.screens import androidx.test.uiautomator.UiSelector import com.itsaky.androidide.R -import com.itsaky.androidide.helper.clickFirstAccessibilityNodeByText -import com.itsaky.androidide.helper.setAccessibilityEditText +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText +import org.appdevforall.codeonthego.helper.setAccessibilityEditText import com.kaspersky.kaspresso.screens.KScreen import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext import io.github.kakaocup.kakao.check.KCheckBox diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/QuickBuildScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/QuickBuildScreen.kt similarity index 98% rename from app/src/androidTest/kotlin/com/itsaky/androidide/screens/QuickBuildScreen.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/QuickBuildScreen.kt index 69726610af..8490fd5e14 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/QuickBuildScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/QuickBuildScreen.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.screens +package org.appdevforall.codeonthego.screens import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiObject import androidx.test.uiautomator.UiSelector -import com.itsaky.androidide.helper.clickFirstAccessibilityNodeByText +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText import com.itsaky.androidide.resources.R import com.kaspersky.kaspresso.screens.KScreen import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/SystemPermissionsScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/SystemPermissionsScreen.kt similarity index 96% rename from app/src/androidTest/kotlin/com/itsaky/androidide/screens/SystemPermissionsScreen.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/SystemPermissionsScreen.kt index 0a56785a42..203139d2d8 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/SystemPermissionsScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/SystemPermissionsScreen.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.screens +package org.appdevforall.codeonthego.screens import com.kaspersky.components.kautomator.component.common.views.UiView import com.kaspersky.components.kautomator.screen.UiScreen diff --git a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/TemplateScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/TemplateScreen.kt similarity index 90% rename from app/src/androidTest/kotlin/com/itsaky/androidide/screens/TemplateScreen.kt rename to app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/TemplateScreen.kt index 5cc40b1fbb..533d905fcf 100644 --- a/app/src/androidTest/kotlin/com/itsaky/androidide/screens/TemplateScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/TemplateScreen.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.screens +package org.appdevforall.codeonthego.screens import androidx.test.uiautomator.UiSelector import androidx.test.uiautomator.UiScrollable -import com.itsaky.androidide.helper.clickFirstAccessibilityNodeParentByText +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeParentByText import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext object TemplateScreen { diff --git a/app/src/debug/AndroidManifest.xml b/app/src/debug/AndroidManifest.xml index aac7406859..f4e82db803 100644 --- a/app/src/debug/AndroidManifest.xml +++ b/app/src/debug/AndroidManifest.xml @@ -22,7 +22,7 @@ android:permission="android.permission.DUMP" android:theme="@android:style/Theme.NoDisplay"> - + diff --git a/app/src/debug/java/com/itsaky/androidide/app/LeakCanaryConfig.kt b/app/src/debug/java/org/appdevforall/codeonthego/app/LeakCanaryConfig.kt similarity index 69% rename from app/src/debug/java/com/itsaky/androidide/app/LeakCanaryConfig.kt rename to app/src/debug/java/org/appdevforall/codeonthego/app/LeakCanaryConfig.kt index 878cf5964b..9639e18844 100644 --- a/app/src/debug/java/com/itsaky/androidide/app/LeakCanaryConfig.kt +++ b/app/src/debug/java/org/appdevforall/codeonthego/app/LeakCanaryConfig.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.app +package org.appdevforall.codeonthego.app -import com.itsaky.androidide.utils.FeatureFlags +import org.appdevforall.codeonthego.utils.FeatureFlags import leakcanary.LeakCanary internal object LeakCanaryConfig { diff --git a/app/src/debug/java/com/itsaky/androidide/quickbuild/BenchEventsFile.kt b/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/BenchEventsFile.kt similarity index 97% rename from app/src/debug/java/com/itsaky/androidide/quickbuild/BenchEventsFile.kt rename to app/src/debug/java/org/appdevforall/codeonthego/quickbuild/BenchEventsFile.kt index 61fe245230..235cbb8bd6 100644 --- a/app/src/debug/java/com/itsaky/androidide/quickbuild/BenchEventsFile.kt +++ b/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/BenchEventsFile.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import org.json.JSONObject import org.slf4j.LoggerFactory diff --git a/app/src/debug/java/com/itsaky/androidide/quickbuild/BenchQuickBuildMetricsSink.kt b/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/BenchQuickBuildMetricsSink.kt similarity index 99% rename from app/src/debug/java/com/itsaky/androidide/quickbuild/BenchQuickBuildMetricsSink.kt rename to app/src/debug/java/org/appdevforall/codeonthego/quickbuild/BenchQuickBuildMetricsSink.kt index 1716b17b43..fda9f2e0dd 100644 --- a/app/src/debug/java/com/itsaky/androidide/quickbuild/BenchQuickBuildMetricsSink.kt +++ b/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/BenchQuickBuildMetricsSink.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import org.appdevforall.cotg.quickbuild.domain.ChangedFiles import org.appdevforall.cotg.quickbuild.domain.classify.BuildRoute diff --git a/app/src/debug/java/com/itsaky/androidide/quickbuild/BenchStateRecorder.kt b/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/BenchStateRecorder.kt similarity index 98% rename from app/src/debug/java/com/itsaky/androidide/quickbuild/BenchStateRecorder.kt rename to app/src/debug/java/org/appdevforall/codeonthego/quickbuild/BenchStateRecorder.kt index 6e6990ef2e..c771d29f5f 100644 --- a/app/src/debug/java/com/itsaky/androidide/quickbuild/BenchStateRecorder.kt +++ b/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/BenchStateRecorder.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.StateFlow diff --git a/app/src/debug/java/com/itsaky/androidide/quickbuild/QuickBuildBenchActivity.kt b/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/QuickBuildBenchActivity.kt similarity index 88% rename from app/src/debug/java/com/itsaky/androidide/quickbuild/QuickBuildBenchActivity.kt rename to app/src/debug/java/org/appdevforall/codeonthego/quickbuild/QuickBuildBenchActivity.kt index e5442ddf14..8e8a932a7c 100644 --- a/app/src/debug/java/com/itsaky/androidide/quickbuild/QuickBuildBenchActivity.kt +++ b/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/QuickBuildBenchActivity.kt @@ -1,14 +1,14 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import android.app.Activity import android.content.Intent import android.os.Bundle -import com.itsaky.androidide.activities.editor.EditorActivityKt -import com.itsaky.androidide.models.EditorIntentExtras -import com.itsaky.androidide.preferences.internal.GeneralPreferences -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.FeatureFlags +import org.appdevforall.codeonthego.activities.editor.EditorActivityKt +import org.appdevforall.codeonthego.models.EditorIntentExtras +import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.FeatureFlags import kotlinx.coroutines.runBlocking import org.appdevforall.cotg.quickbuild.service.session.QuickBuildSessionManager import org.koin.core.context.GlobalContext @@ -17,7 +17,7 @@ import java.io.File /** * adb-triggerable "open project + start Quick Build", for the ADFA-4128 benchmark harness - * only. Opens a project the same way [com.itsaky.androidide.activities.MainActivity] does + * only. Opens a project the same way [org.appdevforall.codeonthego.activities.MainActivity] does * and arms [QuickBuildBenchAutostart] so the editor fires the first Quick Build tap the * moment the project initializes - replacing the human's lightning-bolt tap in an * unattended edit->hot-reload measurement. @@ -133,8 +133,8 @@ class QuickBuildBenchActivity : Activity() { } companion object { - const val ACTION_BENCH_OPEN_PROJECT = "com.itsaky.androidide.quickbuild.action.BENCH_OPEN_PROJECT" - const val EXTRA_PROJECT_PATH = "com.itsaky.androidide.quickbuild.extra.PROJECT_PATH" + const val ACTION_BENCH_OPEN_PROJECT = "org.appdevforall.codeonthego.quickbuild.action.BENCH_OPEN_PROJECT" + const val EXTRA_PROJECT_PATH = "org.appdevforall.codeonthego.quickbuild.extra.PROJECT_PATH" /** * Which build the autostart fires once the project initializes: @@ -142,7 +142,7 @@ class QuickBuildBenchActivity : Activity() { * [QuickBuildBenchAutostart.MODE_STANDARD] (standard Run, for the cold * standard-vs-proxy app build comparison). Unknown values reject the intent. */ - const val EXTRA_MODE = "com.itsaky.androidide.quickbuild.extra.MODE" + const val EXTRA_MODE = "org.appdevforall.codeonthego.quickbuild.extra.MODE" private val log = LoggerFactory.getLogger("QB-BenchActivity") } diff --git a/app/src/debug/java/com/itsaky/androidide/quickbuild/QuickBuildBenchAutostart.kt b/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/QuickBuildBenchAutostart.kt similarity index 93% rename from app/src/debug/java/com/itsaky/androidide/quickbuild/QuickBuildBenchAutostart.kt rename to app/src/debug/java/org/appdevforall/codeonthego/quickbuild/QuickBuildBenchAutostart.kt index 9e43a76a14..67b045806f 100644 --- a/app/src/debug/java/com/itsaky/androidide/quickbuild/QuickBuildBenchAutostart.kt +++ b/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/QuickBuildBenchAutostart.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild /** * One-shot handoff from [QuickBuildBenchActivity] to the editor: the bench activity records * the project it is about to open (and which build the harness wants), and - * [com.itsaky.androidide.activities.editor.ProjectHandlerActivity] claims it exactly once - + * [org.appdevforall.codeonthego.activities.editor.ProjectHandlerActivity] claims it exactly once - * when that project finishes initializing - to fire the first build in place of the human's * tap: either the Quick Build lightning-bolt ([MODE_QUICK_BUILD]) or the standard Run * ([MODE_STANDARD], for the cold standard-build-vs-proxy-app-build comparison). diff --git a/app/src/debug/java/com/itsaky/androidide/quickbuild/QuickBuildBenchHooks.kt b/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/QuickBuildBenchHooks.kt similarity index 96% rename from app/src/debug/java/com/itsaky/androidide/quickbuild/QuickBuildBenchHooks.kt rename to app/src/debug/java/org/appdevforall/codeonthego/quickbuild/QuickBuildBenchHooks.kt index 83aca8d644..2a29d1c3d7 100644 --- a/app/src/debug/java/com/itsaky/androidide/quickbuild/QuickBuildBenchHooks.kt +++ b/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/QuickBuildBenchHooks.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild -import com.itsaky.androidide.utils.FeatureFlags +import org.appdevforall.codeonthego.utils.FeatureFlags import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob @@ -15,7 +15,7 @@ import java.io.File * Every hook the ADFA-4128 benchmark harness needs from shipping code, in one place, in the * debug source set. `src/release/` carries a no-op twin with the same signatures, so a * release APK contains no benchmark code at all - same debug/release pair as - * [com.itsaky.androidide.app.LeakCanaryConfig]. + * [org.appdevforall.codeonthego.app.LeakCanaryConfig]. * * Every hook is additionally gated on [isEnabled] (the `CodeOnTheGo.qbbench` flag file), so * a debug build with the flag absent behaves exactly like a release one. diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7222fbdafc..748049f645 100755 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -5,7 +5,7 @@ tools:ignore="Instantiatable"> - + @@ -73,7 +73,7 @@ android:exported="true" android:windowSoftInputMode="stateAlwaysHidden"> - + @@ -158,7 +158,7 @@ android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize" android:exported="false"> - + @@ -318,7 +318,7 @@ android:value="false" /> @@ -355,7 +355,7 @@ android:exported="true" tools:ignore="ExportedReceiver"> - + @@ -374,7 +374,7 @@ tools:ignore="ExportedReceiver"> - + @@ -389,9 +389,9 @@ + android:permission="org.appdevforall.codeonthego.permission.BIND_LOG_SERVICE"> - + = listOf( - ProjectsAndSolutionsGroup(), - WindowsAndDisplayGroup(), - FileManagementGroup(), - SearchAndReplaceGroup(), - ) -} diff --git a/app/src/main/java/com/itsaky/androidide/actions/BaseBuildAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/BaseBuildAction.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/actions/BaseBuildAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/BaseBuildAction.kt index 4edd1bd7f5..676fe38396 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/BaseBuildAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/BaseBuildAction.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.projects.builder.BuildService +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.projects.builder.BuildService import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.flashInfoLong +import org.appdevforall.codeonthego.utils.flashInfoLong /** * Marker class for actions that execute build related tasks. diff --git a/app/src/main/java/com/itsaky/androidide/actions/BaseEditorAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/BaseEditorAction.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/actions/BaseEditorAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/BaseEditorAction.kt index c5f38ece0a..7439b04d25 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/BaseEditorAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/BaseEditorAction.kt @@ -1,97 +1,97 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.actions - -import android.content.Context -import android.graphics.drawable.Drawable -import android.widget.EditText -import androidx.core.content.ContextCompat -import androidx.core.graphics.drawable.DrawableCompat -import com.itsaky.androidide.editor.ui.IDEEditor -import com.itsaky.androidide.resources.R -import com.itsaky.androidide.editor.adapters.IdeEditorAdapter - -/** @author Akash Yadav */ -abstract class BaseEditorAction : EditorActionItem { - - override var label: String = "" - override var visible: Boolean = true - override var enabled: Boolean = true - override var icon: Drawable? = null - override var requiresUIThread: Boolean = true // all editor actions must be executed on UI thread - override var location: ActionItem.Location = ActionItem.Location.EDITOR_TEXT_ACTIONS - - override fun prepare(data: ActionData) { - super.prepare(data) - - val textTarget = getTextTarget(data) - val ideEditor = data.get(IDEEditor::class.java) - - if (textTarget != null) { - visible = true - enabled = (textTarget as? MutableTextTarget)?.isEditable() ?: false - return - } - - if (ideEditor != null) { - visible = true - enabled = true - return - } - - visible = false - enabled = visible - } - - fun getTextTarget(data: ActionData): TextTarget? { - val mutable = data.get(MutableTextTarget::class.java) - if (mutable != null) return mutable - - val target = data.get(TextTarget::class.java) - if (target != null) return target - - val editor = data.get(IDEEditor::class.java) - if (editor != null) { - return IdeEditorAdapter(editor) - } - - val view = data.get(EditText::class.java) - if (view != null) { - return EditTextAdapter(view) - } - - return null - } - - fun getEditor(data: ActionData): IDEEditor? { - return data.get(IDEEditor::class.java) - } - - fun getContext(data: ActionData): Context? { - return getTextTarget(data)?.getAnchorView()?.context - } - - fun tintDrawable(context: Context, drawable: Drawable): Drawable { - val wrapped = DrawableCompat.wrap(drawable).mutate() - val solidColor = ContextCompat.getColor(context, R.color.primaryIconColor) - - wrapped.alpha = 255 - DrawableCompat.setTint(wrapped, solidColor) - return wrapped - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.actions + +import android.content.Context +import android.graphics.drawable.Drawable +import android.widget.EditText +import androidx.core.content.ContextCompat +import androidx.core.graphics.drawable.DrawableCompat +import org.appdevforall.codeonthego.editor.ui.IDEEditor +import com.itsaky.androidide.resources.R +import org.appdevforall.codeonthego.editor.adapters.IdeEditorAdapter + +/** @author Akash Yadav */ +abstract class BaseEditorAction : EditorActionItem { + + override var label: String = "" + override var visible: Boolean = true + override var enabled: Boolean = true + override var icon: Drawable? = null + override var requiresUIThread: Boolean = true // all editor actions must be executed on UI thread + override var location: ActionItem.Location = ActionItem.Location.EDITOR_TEXT_ACTIONS + + override fun prepare(data: ActionData) { + super.prepare(data) + + val textTarget = getTextTarget(data) + val ideEditor = data.get(IDEEditor::class.java) + + if (textTarget != null) { + visible = true + enabled = (textTarget as? MutableTextTarget)?.isEditable() ?: false + return + } + + if (ideEditor != null) { + visible = true + enabled = true + return + } + + visible = false + enabled = visible + } + + fun getTextTarget(data: ActionData): TextTarget? { + val mutable = data.get(MutableTextTarget::class.java) + if (mutable != null) return mutable + + val target = data.get(TextTarget::class.java) + if (target != null) return target + + val editor = data.get(IDEEditor::class.java) + if (editor != null) { + return IdeEditorAdapter(editor) + } + + val view = data.get(EditText::class.java) + if (view != null) { + return EditTextAdapter(view) + } + + return null + } + + fun getEditor(data: ActionData): IDEEditor? { + return data.get(IDEEditor::class.java) + } + + fun getContext(data: ActionData): Context? { + return getTextTarget(data)?.getAnchorView()?.context + } + + fun tintDrawable(context: Context, drawable: Drawable): Drawable { + val wrapped = DrawableCompat.wrap(drawable).mutate() + val solidColor = ContextCompat.getColor(context, R.color.primaryIconColor) + + wrapped.alpha = 255 + DrawableCompat.setTint(wrapped, solidColor) + return wrapped + } +} diff --git a/app/src/main/java/com/itsaky/androidide/actions/EditorActivityAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/EditorActivityAction.kt similarity index 89% rename from app/src/main/java/com/itsaky/androidide/actions/EditorActivityAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/EditorActivityAction.kt index 6708527f7a..10c02bdee1 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/EditorActivityAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/EditorActivityAction.kt @@ -1,64 +1,64 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.actions - -import android.content.Context -import android.graphics.drawable.Drawable -import com.itsaky.androidide.activities.editor.EditorHandlerActivity -import com.itsaky.androidide.tasks.cancelIfActive -import kotlinx.coroutines.CoroutineName -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.plus - -/** @author Akash Yadav */ -abstract class EditorActivityAction : ActionItem { - - override var enabled: Boolean = true - override var visible: Boolean = true - override var icon: Drawable? = null - override var label: String = "" - override var location: ActionItem.Location = ActionItem.Location.EDITOR_TOOLBAR - - override var requiresUIThread: Boolean = false - - protected val actionScope = CoroutineScope(Dispatchers.Default) + - CoroutineName("${javaClass.simpleName}Scope") - - override fun prepare(data: ActionData) { - super.prepare(data) - if (!data.hasRequiredData(Context::class.java)) { - markInvisible() - return - } - } - - fun ActionData.getActivity(): EditorHandlerActivity? { - return this[Context::class.java] as? EditorHandlerActivity - } - - fun ActionData.requireActivity(): EditorHandlerActivity { - return getActivity()!! - } - - override fun destroy() { - super.destroy() - actionScope.cancelIfActive("Action is being destroyed") - } - -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.actions + +import android.content.Context +import android.graphics.drawable.Drawable +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.tasks.cancelIfActive +import kotlinx.coroutines.CoroutineName +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.plus + +/** @author Akash Yadav */ +abstract class EditorActivityAction : ActionItem { + + override var enabled: Boolean = true + override var visible: Boolean = true + override var icon: Drawable? = null + override var label: String = "" + override var location: ActionItem.Location = ActionItem.Location.EDITOR_TOOLBAR + + override var requiresUIThread: Boolean = false + + protected val actionScope = CoroutineScope(Dispatchers.Default) + + CoroutineName("${javaClass.simpleName}Scope") + + override fun prepare(data: ActionData) { + super.prepare(data) + if (!data.hasRequiredData(Context::class.java)) { + markInvisible() + return + } + } + + fun ActionData.getActivity(): EditorHandlerActivity? { + return this[Context::class.java] as? EditorHandlerActivity + } + + fun ActionData.requireActivity(): EditorHandlerActivity { + return getActivity()!! + } + + override fun destroy() { + super.destroy() + actionScope.cancelIfActive("Action is being destroyed") + } + +} diff --git a/app/src/main/java/com/itsaky/androidide/actions/EditorRelatedAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/EditorRelatedAction.kt similarity index 88% rename from app/src/main/java/com/itsaky/androidide/actions/EditorRelatedAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/EditorRelatedAction.kt index 3e4a1400cb..2e68266728 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/EditorRelatedAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/EditorRelatedAction.kt @@ -1,49 +1,49 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.actions - -import com.itsaky.androidide.editor.ui.IDEEditor -import com.itsaky.androidide.ui.CodeEditorView - -/** @author Akash Yadav */ -abstract class EditorRelatedAction : EditorActivityAction(), EditorActionItem { - - override var requiresUIThread: Boolean = true - - override fun prepare(data: ActionData) { - super.prepare(data) - super.prepare(data) - val editor = - data.getEditor() - ?: run { - visible = false - enabled = false - return - } - - val file = editor.file - - visible = file != null - enabled = visible - } - - fun ActionData.getEditor(): IDEEditor? = get(IDEEditor::class.java) - - fun ActionData.getEditorView(): CodeEditorView? = get(CodeEditorView::class.java) - -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.actions + +import org.appdevforall.codeonthego.editor.ui.IDEEditor +import org.appdevforall.codeonthego.ui.CodeEditorView + +/** @author Akash Yadav */ +abstract class EditorRelatedAction : EditorActivityAction(), EditorActionItem { + + override var requiresUIThread: Boolean = true + + override fun prepare(data: ActionData) { + super.prepare(data) + super.prepare(data) + val editor = + data.getEditor() + ?: run { + visible = false + enabled = false + return + } + + val file = editor.file + + visible = file != null + enabled = visible + } + + fun ActionData.getEditor(): IDEEditor? = get(IDEEditor::class.java) + + fun ActionData.getEditorView(): CodeEditorView? = get(CodeEditorView::class.java) + +} diff --git a/app/src/main/java/com/itsaky/androidide/actions/FileActionManager.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/FileActionManager.kt similarity index 85% rename from app/src/main/java/com/itsaky/androidide/actions/FileActionManager.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/FileActionManager.kt index e5e941a9bb..95b30b5127 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/FileActionManager.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/FileActionManager.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions -import com.itsaky.androidide.actions.observers.FileActionObserver -import com.itsaky.androidide.eventbus.events.file.FileCreationEvent -import com.itsaky.androidide.utils.FileIOUtils +import org.appdevforall.codeonthego.actions.observers.FileActionObserver +import org.appdevforall.codeonthego.eventbus.events.file.FileCreationEvent +import org.appdevforall.codeonthego.utils.FileIOUtils import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/itsaky/androidide/actions/PluginActionItem.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/PluginActionItem.kt similarity index 82% rename from app/src/main/java/com/itsaky/androidide/actions/PluginActionItem.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/PluginActionItem.kt index c62642eb08..adf7f34c33 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/PluginActionItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/PluginActionItem.kt @@ -1,14 +1,16 @@ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions + +import com.itsaky.androidide.R import android.content.Context import android.graphics.drawable.Drawable import androidx.core.content.ContextCompat -import com.itsaky.androidide.plugins.extensions.MenuItem -import com.itsaky.androidide.plugins.manager.pluginCategory -import com.itsaky.androidide.plugins.manager.pluginTooltipTag -import com.itsaky.androidide.plugins.manager.ui.PluginDrawableResolver +import org.appdevforall.codeonthego.plugins.extensions.MenuItem +import org.appdevforall.codeonthego.plugins.manager.pluginCategory +import org.appdevforall.codeonthego.plugins.manager.pluginTooltipTag +import org.appdevforall.codeonthego.plugins.manager.ui.PluginDrawableResolver class PluginActionItem( diff --git a/app/src/main/java/com/itsaky/androidide/actions/PluginSidebarActionItem.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/PluginSidebarActionItem.kt similarity index 87% rename from app/src/main/java/com/itsaky/androidide/actions/PluginSidebarActionItem.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/PluginSidebarActionItem.kt index 8377105f56..77acb77ea8 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/PluginSidebarActionItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/PluginSidebarActionItem.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions import android.content.Context import android.graphics.drawable.Drawable import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment -import com.itsaky.androidide.plugins.extensions.NavigationItem -import com.itsaky.androidide.plugins.manager.pluginCategory -import com.itsaky.androidide.plugins.manager.pluginTooltipTag -import com.itsaky.androidide.plugins.manager.ui.PluginDrawableResolver +import org.appdevforall.codeonthego.plugins.extensions.NavigationItem +import org.appdevforall.codeonthego.plugins.manager.pluginCategory +import org.appdevforall.codeonthego.plugins.manager.pluginTooltipTag +import org.appdevforall.codeonthego.plugins.manager.ui.PluginDrawableResolver import com.itsaky.androidide.R import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext diff --git a/app/src/main/java/com/itsaky/androidide/actions/PluginToolbarActionItem.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/PluginToolbarActionItem.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/actions/PluginToolbarActionItem.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/PluginToolbarActionItem.kt index feb651b915..8b80712e48 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/PluginToolbarActionItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/PluginToolbarActionItem.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions import android.content.Context import android.util.Log import android.view.MenuItem import androidx.core.content.ContextCompat import com.itsaky.androidide.R -import com.itsaky.androidide.plugins.extensions.ShowAsAction -import com.itsaky.androidide.plugins.extensions.ToolbarAction -import com.itsaky.androidide.plugins.manager.pluginCategory -import com.itsaky.androidide.plugins.manager.pluginTooltipTag -import com.itsaky.androidide.plugins.manager.ui.PluginDrawableResolver +import org.appdevforall.codeonthego.plugins.extensions.ShowAsAction +import org.appdevforall.codeonthego.plugins.extensions.ToolbarAction +import org.appdevforall.codeonthego.plugins.manager.pluginCategory +import org.appdevforall.codeonthego.plugins.manager.pluginTooltipTag +import org.appdevforall.codeonthego.plugins.manager.ui.PluginDrawableResolver /** * Adapts a plugin-contributed [ToolbarAction] (from `UIExtension.getToolbarActions()`) diff --git a/app/src/main/java/com/itsaky/androidide/actions/Util.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/Util.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/actions/Util.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/Util.kt index fd7908f38d..05957d05e5 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/Util.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/Util.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions import android.app.AppOpsManager import android.app.ForegroundServiceStartNotAllowedException @@ -17,15 +17,15 @@ import androidx.appcompat.app.AlertDialog import androidx.core.content.ContextCompat.startForegroundService import androidx.core.view.setPadding import com.google.android.material.textview.MaterialTextView -import com.itsaky.androidide.activities.editor.EditorHandlerActivity -import com.itsaky.androidide.activities.editor.HelpActivity +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.activities.editor.HelpActivity import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.DialogUtils -import com.itsaky.androidide.utils.PermissionsHelper -import com.itsaky.androidide.utils.appendHtmlWithLinks -import com.itsaky.androidide.utils.appendOrderedList -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.isAtLeastS +import org.appdevforall.codeonthego.utils.DialogUtils +import org.appdevforall.codeonthego.utils.PermissionsHelper +import org.appdevforall.codeonthego.utils.appendHtmlWithLinks +import org.appdevforall.codeonthego.utils.appendOrderedList +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.isAtLeastS import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import moe.shizuku.manager.adb.AdbPairingService diff --git a/app/src/main/java/com/itsaky/androidide/actions/build/AbstractCancellableRunAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/build/AbstractCancellableRunAction.kt similarity index 85% rename from app/src/main/java/com/itsaky/androidide/actions/build/AbstractCancellableRunAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/build/AbstractCancellableRunAction.kt index 46c0d3a350..9029f04c12 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/build/AbstractCancellableRunAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/build/AbstractCancellableRunAction.kt @@ -1,18 +1,18 @@ -package com.itsaky.androidide.actions.build +package org.appdevforall.codeonthego.actions.build import android.content.Context import androidx.annotation.DrawableRes import androidx.annotation.StringRes import androidx.core.content.ContextCompat -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.BaseBuildAction -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.activities.editor.EditorHandlerActivity -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.projects.builder.BuildService +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.BaseBuildAction +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.projects.builder.BuildService import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.requestBuildCancellation +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.requestBuildCancellation import org.slf4j.Logger import org.slf4j.LoggerFactory diff --git a/app/src/main/java/com/itsaky/androidide/actions/build/AbstractModuleAssemblerAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/build/AbstractModuleAssemblerAction.kt similarity index 87% rename from app/src/main/java/com/itsaky/androidide/actions/build/AbstractModuleAssemblerAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/build/AbstractModuleAssemblerAction.kt index b514c4bedc..851a0704d9 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/build/AbstractModuleAssemblerAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/build/AbstractModuleAssemblerAction.kt @@ -1,20 +1,20 @@ -package com.itsaky.androidide.actions.build +package org.appdevforall.codeonthego.actions.build import android.content.Context import androidx.activity.viewModels import androidx.annotation.DrawableRes import androidx.annotation.StringRes -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.openApplicationModuleChooser -import com.itsaky.androidide.actions.profiler.ProfilerAction -import com.itsaky.androidide.activities.editor.QuickBuildClobberConfirmation -import com.itsaky.androidide.project.AndroidModels -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.api.AndroidModule -import com.itsaky.androidide.projects.isPluginProject +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.openApplicationModuleChooser +import org.appdevforall.codeonthego.actions.profiler.ProfilerAction +import org.appdevforall.codeonthego.activities.editor.QuickBuildClobberConfirmation +import org.appdevforall.codeonthego.project.AndroidModels +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.api.AndroidModule +import org.appdevforall.codeonthego.projects.isPluginProject import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.viewmodel.BuildViewModel +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.viewmodel.BuildViewModel /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/actions/build/AbstractRunAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/build/AbstractRunAction.kt similarity index 85% rename from app/src/main/java/com/itsaky/androidide/actions/build/AbstractRunAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/build/AbstractRunAction.kt index adb32dfc13..d0d3addece 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/build/AbstractRunAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/build/AbstractRunAction.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.actions.build +package org.appdevforall.codeonthego.actions.build import android.content.Context import androidx.annotation.DrawableRes diff --git a/app/src/main/java/com/itsaky/androidide/actions/build/DebugAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/build/DebugAction.kt similarity index 71% rename from app/src/main/java/com/itsaky/androidide/actions/build/DebugAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/build/DebugAction.kt index a76431c2e8..c519ed90c7 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/build/DebugAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/build/DebugAction.kt @@ -1,22 +1,22 @@ -package com.itsaky.androidide.actions.build +package org.appdevforall.codeonthego.actions.build import android.content.Context -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.canShowPairingNotification -import com.itsaky.androidide.actions.handleMissingOverlayPermission -import com.itsaky.androidide.actions.showDebuggerNotReadyMessage -import com.itsaky.androidide.actions.showNotificationPermissionDialog -import com.itsaky.androidide.actions.showPairingDialog -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.api.ILanguageServerRegistry -import com.itsaky.androidide.lsp.java.JavaLanguageServer -import com.itsaky.androidide.lsp.java.debug.JdwpOptions -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.isPluginProject +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.canShowPairingNotification +import org.appdevforall.codeonthego.actions.handleMissingOverlayPermission +import org.appdevforall.codeonthego.actions.showDebuggerNotReadyMessage +import org.appdevforall.codeonthego.actions.showNotificationPermissionDialog +import org.appdevforall.codeonthego.actions.showPairingDialog +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.api.ILanguageServerRegistry +import org.appdevforall.codeonthego.lsp.java.JavaLanguageServer +import org.appdevforall.codeonthego.lsp.java.debug.JdwpOptions +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.isPluginProject import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.PermissionsHelper -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.isAtLeastR +import org.appdevforall.codeonthego.utils.PermissionsHelper +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.isAtLeastR import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import rikka.shizuku.Shizuku diff --git a/app/src/main/java/com/itsaky/androidide/actions/build/PluginBuildActionItem.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/build/PluginBuildActionItem.kt similarity index 85% rename from app/src/main/java/com/itsaky/androidide/actions/build/PluginBuildActionItem.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/build/PluginBuildActionItem.kt index 97d74eddf5..7d4b3d3f2b 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/build/PluginBuildActionItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/build/PluginBuildActionItem.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.actions.build +package org.appdevforall.codeonthego.actions.build import android.content.Context import android.graphics.ColorFilter @@ -6,22 +6,22 @@ import android.graphics.PorterDuff import android.graphics.PorterDuffColorFilter import android.graphics.drawable.Drawable import androidx.core.content.ContextCompat -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.BaseBuildAction -import com.itsaky.androidide.actions.getContext -import com.itsaky.androidide.plugins.extensions.CommandOutput -import com.itsaky.androidide.plugins.manager.build.PluginBuildActionManager -import com.itsaky.androidide.plugins.manager.build.RegisteredBuildAction -import com.itsaky.androidide.plugins.manager.core.PluginManager -import com.itsaky.androidide.plugins.manager.ui.PluginDrawableResolver -import com.itsaky.androidide.plugins.services.IdeCommandService +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.BaseBuildAction +import org.appdevforall.codeonthego.actions.getContext +import org.appdevforall.codeonthego.plugins.extensions.CommandOutput +import org.appdevforall.codeonthego.plugins.manager.build.PluginBuildActionManager +import org.appdevforall.codeonthego.plugins.manager.build.RegisteredBuildAction +import org.appdevforall.codeonthego.plugins.manager.core.PluginManager +import org.appdevforall.codeonthego.plugins.manager.ui.PluginDrawableResolver +import org.appdevforall.codeonthego.plugins.services.IdeCommandService import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.resolveAttr -import com.itsaky.androidide.viewmodel.BottomSheetViewModel +import org.appdevforall.codeonthego.utils.resolveAttr +import org.appdevforall.codeonthego.viewmodel.BottomSheetViewModel import com.google.android.material.bottomsheet.BottomSheetBehavior import androidx.lifecycle.lifecycleScope -import com.itsaky.androidide.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/itsaky/androidide/actions/build/ProjectSyncAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/build/ProjectSyncAction.kt similarity index 87% rename from app/src/main/java/com/itsaky/androidide/actions/build/ProjectSyncAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/build/ProjectSyncAction.kt index ac2d13634e..9780bd9f4f 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/build/ProjectSyncAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/build/ProjectSyncAction.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.build +package org.appdevforall.codeonthego.actions.build import android.content.Context import androidx.core.content.ContextCompat -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.BaseBuildAction -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.BaseBuildAction +import org.appdevforall.codeonthego.idetooltips.TooltipTag import com.itsaky.androidide.resources.R import com.itsaky.androidide.resources.R.string diff --git a/app/src/main/java/com/itsaky/androidide/actions/build/QuickBuildAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/build/QuickBuildAction.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/actions/build/QuickBuildAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/build/QuickBuildAction.kt index c0801faf8d..20fc9cc4c6 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/build/QuickBuildAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/build/QuickBuildAction.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.actions.build +package org.appdevforall.codeonthego.actions.build import android.content.Context import android.graphics.ColorFilter @@ -9,17 +9,17 @@ import androidx.annotation.DrawableRes import androidx.annotation.StringRes import androidx.core.content.ContextCompat import androidx.lifecycle.lifecycleScope -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.EditorActivityAction -import com.itsaky.androidide.actions.getContext -import com.itsaky.androidide.analytics.IAnalyticsManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.projects.builder.BuildService -import com.itsaky.androidide.quickbuild.QuickBuildGraphWarmUp +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.EditorActivityAction +import org.appdevforall.codeonthego.actions.getContext +import org.appdevforall.codeonthego.analytics.IAnalyticsManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.projects.builder.BuildService +import org.appdevforall.codeonthego.quickbuild.QuickBuildGraphWarmUp import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.resolveAttr +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.resolveAttr import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/itsaky/androidide/actions/build/QuickRunAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/build/QuickRunAction.kt similarity index 74% rename from app/src/main/java/com/itsaky/androidide/actions/build/QuickRunAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/build/QuickRunAction.kt index 29ead3e45c..9fafde27d1 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/build/QuickRunAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/build/QuickRunAction.kt @@ -1,70 +1,70 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.actions.build - -import android.content.Context -import android.graphics.ColorFilter -import android.graphics.PorterDuff -import android.graphics.PorterDuffColorFilter -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.getContext -import com.itsaky.androidide.activities.editor.EditorHandlerActivity -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.projects.api.AndroidModule -import com.itsaky.androidide.projects.builder.BuildService -import com.itsaky.androidide.resources.R -import com.itsaky.androidide.tooling.api.messages.TaskExecutionMessage -import com.itsaky.androidide.tooling.api.models.BasicAndroidVariantMetadata -import com.itsaky.androidide.utils.resolveAttr - -/** - * The 'Quick Run' and 'Cancel build' action in the editor activity. - * - * If a build is in progress, executing this action cancels the build. Otherwise, the selected - * build variant is built and installed to the device. - * - * @author Akash Yadav - */ -class QuickRunAction(context: Context, override val order: Int) : - AbstractRunAction( - context = context, - labelRes = R.string.quick_run_debug, - iconRes = R.drawable.ic_run_outline - ) { - - override val id: String = ID - - companion object { - const val ID = "ide.editor.build.quickRun" - } - - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = - TooltipTag.EDITOR_TOOLBAR_QUICK_RUN - - override fun createColorFilter(data: ActionData): ColorFilter? { - return data.getContext()?.let { - PorterDuffColorFilter( - it.resolveAttr( - if (data.getActivity().isBuildInProgress()) - R.attr.colorError - else R.attr.colorSuccess - ), PorterDuff.Mode.SRC_ATOP - ) - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.actions.build + +import android.content.Context +import android.graphics.ColorFilter +import android.graphics.PorterDuff +import android.graphics.PorterDuffColorFilter +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.getContext +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.projects.api.AndroidModule +import org.appdevforall.codeonthego.projects.builder.BuildService +import com.itsaky.androidide.resources.R +import org.appdevforall.codeonthego.tooling.api.messages.TaskExecutionMessage +import org.appdevforall.codeonthego.tooling.api.models.BasicAndroidVariantMetadata +import org.appdevforall.codeonthego.utils.resolveAttr + +/** + * The 'Quick Run' and 'Cancel build' action in the editor activity. + * + * If a build is in progress, executing this action cancels the build. Otherwise, the selected + * build variant is built and installed to the device. + * + * @author Akash Yadav + */ +class QuickRunAction(context: Context, override val order: Int) : + AbstractRunAction( + context = context, + labelRes = R.string.quick_run_debug, + iconRes = R.drawable.ic_run_outline + ) { + + override val id: String = ID + + companion object { + const val ID = "ide.editor.build.quickRun" + } + + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = + TooltipTag.EDITOR_TOOLBAR_QUICK_RUN + + override fun createColorFilter(data: ActionData): ColorFilter? { + return data.getContext()?.let { + PorterDuffColorFilter( + it.resolveAttr( + if (data.getActivity().isBuildInProgress()) + R.attr.colorError + else R.attr.colorSuccess + ), PorterDuff.Mode.SRC_ATOP + ) + } + } +} diff --git a/app/src/main/java/com/itsaky/androidide/actions/build/RunTasksAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/build/RunTasksAction.kt similarity index 86% rename from app/src/main/java/com/itsaky/androidide/actions/build/RunTasksAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/build/RunTasksAction.kt index 2a0ecb34fd..b47553635f 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/build/RunTasksAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/build/RunTasksAction.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.build +package org.appdevforall.codeonthego.actions.build import android.content.Context import androidx.core.content.ContextCompat -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.BaseBuildAction -import com.itsaky.androidide.fragments.RunTasksDialogFragment -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.BaseBuildAction +import org.appdevforall.codeonthego.fragments.RunTasksDialogFragment +import org.appdevforall.codeonthego.idetooltips.TooltipTag import com.itsaky.androidide.resources.R /** @author Akash Yadav */ diff --git a/app/src/main/java/com/itsaky/androidide/actions/build/StandardRunClobberDecision.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/build/StandardRunClobberDecision.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/actions/build/StandardRunClobberDecision.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/build/StandardRunClobberDecision.kt index 29667a136e..896a63d8df 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/build/StandardRunClobberDecision.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/build/StandardRunClobberDecision.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.actions.build +package org.appdevforall.codeonthego.actions.build /** * Whether a Run has to ask the user before it may replace whatever currently holds the project's diff --git a/app/src/main/java/com/itsaky/androidide/actions/debug/AbstractDebuggerAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/AbstractDebuggerAction.kt similarity index 77% rename from app/src/main/java/com/itsaky/androidide/actions/debug/AbstractDebuggerAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/debug/AbstractDebuggerAction.kt index 58ad2e29ab..7aef72b282 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/debug/AbstractDebuggerAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/AbstractDebuggerAction.kt @@ -1,12 +1,12 @@ -package com.itsaky.androidide.actions.debug +package org.appdevforall.codeonthego.actions.debug import android.graphics.drawable.Drawable import androidx.annotation.DrawableRes import androidx.core.content.ContextCompat -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.lsp.IDEDebugClientImpl +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.lsp.IDEDebugClientImpl /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/actions/debug/AbstractStepAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/AbstractStepAction.kt similarity index 66% rename from app/src/main/java/com/itsaky/androidide/actions/debug/AbstractStepAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/debug/AbstractStepAction.kt index 5fd6d0e757..ac010565b4 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/debug/AbstractStepAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/AbstractStepAction.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.actions.debug +package org.appdevforall.codeonthego.actions.debug import androidx.annotation.DrawableRes -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.viewmodel.DebuggerConnectionState +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.viewmodel.DebuggerConnectionState abstract class AbstractStepAction( @DrawableRes iconRes: Int diff --git a/app/src/main/java/com/itsaky/androidide/actions/debug/KillVmAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/KillVmAction.kt similarity index 74% rename from app/src/main/java/com/itsaky/androidide/actions/debug/KillVmAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/debug/KillVmAction.kt index 28c995dc78..48ecfaf1e4 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/debug/KillVmAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/KillVmAction.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.actions.debug +package org.appdevforall.codeonthego.actions.debug import android.content.Context import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.idetooltips.TooltipTag /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/actions/debug/RestartVmAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/RestartVmAction.kt similarity index 76% rename from app/src/main/java/com/itsaky/androidide/actions/debug/RestartVmAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/debug/RestartVmAction.kt index 3760db5e05..786a28b53f 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/debug/RestartVmAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/RestartVmAction.kt @@ -1,12 +1,12 @@ -package com.itsaky.androidide.actions.debug +package org.appdevforall.codeonthego.actions.debug import android.content.Context import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.IDEDebugClientImpl -import com.itsaky.androidide.utils.IntentUtils +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.IDEDebugClientImpl +import org.appdevforall.codeonthego.utils.IntentUtils import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.delay import kotlinx.coroutines.withContext diff --git a/app/src/main/java/com/itsaky/androidide/actions/debug/StepIntoAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepIntoAction.kt similarity index 75% rename from app/src/main/java/com/itsaky/androidide/actions/debug/StepIntoAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepIntoAction.kt index 6c31f8271d..96f409743b 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/debug/StepIntoAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepIntoAction.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.actions.debug +package org.appdevforall.codeonthego.actions.debug import android.content.Context import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.idetooltips.TooltipTag /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/actions/debug/StepOutAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepOutAction.kt similarity index 74% rename from app/src/main/java/com/itsaky/androidide/actions/debug/StepOutAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepOutAction.kt index 823af23d89..a37c416de8 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/debug/StepOutAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepOutAction.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.actions.debug +package org.appdevforall.codeonthego.actions.debug import android.content.Context import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.idetooltips.TooltipTag /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/actions/debug/StepOverAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepOverAction.kt similarity index 75% rename from app/src/main/java/com/itsaky/androidide/actions/debug/StepOverAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepOverAction.kt index c9957b255d..66440acdaa 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/debug/StepOverAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepOverAction.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.actions.debug +package org.appdevforall.codeonthego.actions.debug import android.content.Context import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.idetooltips.TooltipTag /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/actions/debug/SuspendResumeVmAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/SuspendResumeVmAction.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/actions/debug/SuspendResumeVmAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/debug/SuspendResumeVmAction.kt index e76bf508ea..75034f28ed 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/debug/SuspendResumeVmAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/SuspendResumeVmAction.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.actions.debug +package org.appdevforall.codeonthego.actions.debug import android.content.Context import androidx.core.content.ContextCompat import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.idetooltips.TooltipTag /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/actions/editor/CopyAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/CopyAction.kt similarity index 88% rename from app/src/main/java/com/itsaky/androidide/actions/editor/CopyAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/editor/CopyAction.kt index c9696540ac..413803442a 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/editor/CopyAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/CopyAction.kt @@ -1,70 +1,70 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.actions.editor - -import android.content.Context -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.BaseEditorAction -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R - -/** @author Akash Yadav */ -class CopyAction(context: Context, override val order: Int) : - BaseEditorAction() { - - init { - label = context.getString(R.string.copy) - - val arr = context.obtainStyledAttributes(intArrayOf(android.R.attr.actionModeCopyDrawable)) - icon = arr.getDrawable(0)?.let { tintDrawable(context, it) } - arr.recycle() - } - - companion object { - const val ID = "ide.editor.code.text.copy" - } - - override val id: String = ID - - override fun prepare(data: ActionData) { - super.prepare(data) - - if (!visible) return - - val target = getTextTarget(data) - - visible = target != null - enabled = visible && target?.hasSelection() == true - } - - override suspend fun execAction(data: ActionData): Boolean { - val target = getTextTarget(data) ?: return false - if (!target.hasSelection()) return false - - target.copyText() - return true - } - - override fun retrieveTooltipTag(isAlternateContext: Boolean): String { - return if (isAlternateContext) { - TooltipTag.EDITOR_TOOLBAR_OUTPUT_COPY - } else { - TooltipTag.EDITOR_TOOLBAR_COPY - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.actions.editor + +import android.content.Context +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.BaseEditorAction +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import com.itsaky.androidide.resources.R + +/** @author Akash Yadav */ +class CopyAction(context: Context, override val order: Int) : + BaseEditorAction() { + + init { + label = context.getString(R.string.copy) + + val arr = context.obtainStyledAttributes(intArrayOf(android.R.attr.actionModeCopyDrawable)) + icon = arr.getDrawable(0)?.let { tintDrawable(context, it) } + arr.recycle() + } + + companion object { + const val ID = "ide.editor.code.text.copy" + } + + override val id: String = ID + + override fun prepare(data: ActionData) { + super.prepare(data) + + if (!visible) return + + val target = getTextTarget(data) + + visible = target != null + enabled = visible && target?.hasSelection() == true + } + + override suspend fun execAction(data: ActionData): Boolean { + val target = getTextTarget(data) ?: return false + if (!target.hasSelection()) return false + + target.copyText() + return true + } + + override fun retrieveTooltipTag(isAlternateContext: Boolean): String { + return if (isAlternateContext) { + TooltipTag.EDITOR_TOOLBAR_OUTPUT_COPY + } else { + TooltipTag.EDITOR_TOOLBAR_COPY + } + } +} diff --git a/app/src/main/java/com/itsaky/androidide/actions/editor/CutAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/CutAction.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/actions/editor/CutAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/editor/CutAction.kt index 1cac541504..15cd284b4e 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/editor/CutAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/CutAction.kt @@ -1,60 +1,60 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.actions.editor - -import android.content.Context -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.BaseEditorAction -import com.itsaky.androidide.actions.MutableTextTarget -import com.itsaky.androidide.idetooltips.TooltipTag -/** @author Akash Yadav */ -class CutAction(context: Context, override val order: Int) : BaseEditorAction() { - - init { - label = context.getString(android.R.string.cut) - - val arr = context.obtainStyledAttributes(intArrayOf(android.R.attr.actionModeCutDrawable)) - icon = arr.getDrawable(0)?.let { tintDrawable(context, it) } - arr.recycle() - } - - companion object { - const val ID = "ide.editor.code.text.cut" - } - - override fun prepare(data: ActionData) { - super.prepare(data) - - if (!visible) return - - val target = getTextTarget(data) - visible = (target is MutableTextTarget) && target.isEditable() - enabled = visible && target?.hasSelection() == true - } - - override val id: String = ID - override suspend fun execAction(data: ActionData): Boolean { - val target = getTextTarget(data) ?: return false - if (target is MutableTextTarget) { - target.cut() - return true - } - return false - } - override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.EDITOR_TOOLBAR_CUT -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.actions.editor + +import android.content.Context +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.BaseEditorAction +import org.appdevforall.codeonthego.actions.MutableTextTarget +import org.appdevforall.codeonthego.idetooltips.TooltipTag +/** @author Akash Yadav */ +class CutAction(context: Context, override val order: Int) : BaseEditorAction() { + + init { + label = context.getString(android.R.string.cut) + + val arr = context.obtainStyledAttributes(intArrayOf(android.R.attr.actionModeCutDrawable)) + icon = arr.getDrawable(0)?.let { tintDrawable(context, it) } + arr.recycle() + } + + companion object { + const val ID = "ide.editor.code.text.cut" + } + + override fun prepare(data: ActionData) { + super.prepare(data) + + if (!visible) return + + val target = getTextTarget(data) + visible = (target is MutableTextTarget) && target.isEditable() + enabled = visible && target?.hasSelection() == true + } + + override val id: String = ID + override suspend fun execAction(data: ActionData): Boolean { + val target = getTextTarget(data) ?: return false + if (target is MutableTextTarget) { + target.cut() + return true + } + return false + } + override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.EDITOR_TOOLBAR_CUT +} diff --git a/app/src/main/java/com/itsaky/androidide/actions/editor/ExpandSelectionAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/ExpandSelectionAction.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/actions/editor/ExpandSelectionAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/editor/ExpandSelectionAction.kt index 2258745f81..c6f9c20566 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/editor/ExpandSelectionAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/ExpandSelectionAction.kt @@ -1,48 +1,48 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.actions.editor - -import android.content.Context -import androidx.core.content.ContextCompat -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.EditorRelatedAction -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R - -/** - * Expands the current selection using the language server set in editor. - * - * @author Akash Yadav - */ -class ExpandSelectionAction(context: Context, override val order: Int) : EditorRelatedAction() { - override val id: String = "ide.editor.code.actions.expandSelection" - override var location: ActionItem.Location = ActionItem.Location.EDITOR_TEXT_ACTIONS - - init { - label = context.getString(R.string.action_expand_selection) - icon = ContextCompat.getDrawable(context, R.drawable.ic_expand_selection) - } - - override suspend fun execAction(data: ActionData): Any { - return data.getEditor()?.expandSelection() ?: false - } - - override fun retrieveTooltipTag(isAlternateContext: Boolean) = - TooltipTag.EDITOR_TOOLBAR_EXPAND_SELECTION -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.actions.editor + +import android.content.Context +import androidx.core.content.ContextCompat +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.EditorRelatedAction +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import com.itsaky.androidide.resources.R + +/** + * Expands the current selection using the language server set in editor. + * + * @author Akash Yadav + */ +class ExpandSelectionAction(context: Context, override val order: Int) : EditorRelatedAction() { + override val id: String = "ide.editor.code.actions.expandSelection" + override var location: ActionItem.Location = ActionItem.Location.EDITOR_TEXT_ACTIONS + + init { + label = context.getString(R.string.action_expand_selection) + icon = ContextCompat.getDrawable(context, R.drawable.ic_expand_selection) + } + + override suspend fun execAction(data: ActionData): Any { + return data.getEditor()?.expandSelection() ?: false + } + + override fun retrieveTooltipTag(isAlternateContext: Boolean) = + TooltipTag.EDITOR_TOOLBAR_EXPAND_SELECTION +} diff --git a/app/src/main/java/com/itsaky/androidide/actions/editor/LongSelectAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/LongSelectAction.kt similarity index 82% rename from app/src/main/java/com/itsaky/androidide/actions/editor/LongSelectAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/editor/LongSelectAction.kt index 0cc1dadc62..dacf149350 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/editor/LongSelectAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/LongSelectAction.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.editor +package org.appdevforall.codeonthego.actions.editor import android.content.Context import androidx.core.content.ContextCompat import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.EditorRelatedAction -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.EditorRelatedAction +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.idetooltips.TooltipTag /** * An action to long select text in the editor. * diff --git a/app/src/main/java/com/itsaky/androidide/actions/editor/PasteAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/PasteAction.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/actions/editor/PasteAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/editor/PasteAction.kt index b0e467aba8..ff79a2d7ed 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/editor/PasteAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/PasteAction.kt @@ -1,62 +1,62 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.actions.editor - -import android.content.Context -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.BaseEditorAction -import com.itsaky.androidide.actions.MutableTextTarget -import com.itsaky.androidide.idetooltips.TooltipTag -/** @author Akash Yadav */ -class PasteAction(context: Context, override val order: Int) : BaseEditorAction() { - - init { - label = context.getString(android.R.string.paste) - - val arr = context.obtainStyledAttributes(intArrayOf(android.R.attr.actionModePasteDrawable)) - icon = arr.getDrawable(0)?.let { tintDrawable(context, it) } - arr.recycle() - } - - companion object { - const val ID = "ide.editor.code.text.paste" - } - - override val id: String = ID - - override fun prepare(data: ActionData) { - super.prepare(data) - - if (!visible) return - - val target = getTextTarget(data) - visible = (target is MutableTextTarget) && target.isEditable() - enabled = visible - } - - override suspend fun execAction(data: ActionData): Boolean { - val target = getTextTarget(data) ?: return false - if (target is MutableTextTarget) { - target.paste() - return true - } - return false - } - - override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.EDITOR_TOOLBAR_PASTE -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.actions.editor + +import android.content.Context +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.BaseEditorAction +import org.appdevforall.codeonthego.actions.MutableTextTarget +import org.appdevforall.codeonthego.idetooltips.TooltipTag +/** @author Akash Yadav */ +class PasteAction(context: Context, override val order: Int) : BaseEditorAction() { + + init { + label = context.getString(android.R.string.paste) + + val arr = context.obtainStyledAttributes(intArrayOf(android.R.attr.actionModePasteDrawable)) + icon = arr.getDrawable(0)?.let { tintDrawable(context, it) } + arr.recycle() + } + + companion object { + const val ID = "ide.editor.code.text.paste" + } + + override val id: String = ID + + override fun prepare(data: ActionData) { + super.prepare(data) + + if (!visible) return + + val target = getTextTarget(data) + visible = (target is MutableTextTarget) && target.isEditable() + enabled = visible + } + + override suspend fun execAction(data: ActionData): Boolean { + val target = getTextTarget(data) ?: return false + if (target is MutableTextTarget) { + target.paste() + return true + } + return false + } + + override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.EDITOR_TOOLBAR_PASTE +} diff --git a/app/src/main/java/com/itsaky/androidide/actions/editor/SelectAllAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/SelectAllAction.kt similarity index 87% rename from app/src/main/java/com/itsaky/androidide/actions/editor/SelectAllAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/editor/SelectAllAction.kt index 9ca37f8206..2598de4b92 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/editor/SelectAllAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/SelectAllAction.kt @@ -1,67 +1,67 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.actions.editor - -import android.content.Context -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.BaseEditorAction -import com.itsaky.androidide.idetooltips.TooltipTag -/** @author Akash Yadav */ -class SelectAllAction(context: Context, override val order: Int) : BaseEditorAction() { - - init { - label = context.getString(android.R.string.selectAll) - - val arr = context.obtainStyledAttributes(intArrayOf(android.R.attr.actionModeSelectAllDrawable)) - icon = arr.getDrawable(0)?.let { tintDrawable(context, it) } - arr.recycle() - } - - companion object { - const val ID = "ide.editor.code.text.selectAll" - } - - override val id: String = ID - - override fun prepare(data: ActionData) { - super.prepare(data) - - if (!visible) return - - val target = getTextTarget(data) - - visible = target != null - enabled = visible - } - - override suspend fun execAction(data: ActionData): Boolean { - val target = getTextTarget(data) ?: return false - target.selectAll() - return true - } - - override fun dismissOnAction() = false - - override fun retrieveTooltipTag(isAlternateContext: Boolean): String { - return if (isAlternateContext) { - TooltipTag.EDITOR_TOOLBAR_OUTPUT_SELECT_ALL - } else { - TooltipTag.EDITOR_TOOLBAR_SELECT_ALL - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.actions.editor + +import android.content.Context +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.BaseEditorAction +import org.appdevforall.codeonthego.idetooltips.TooltipTag +/** @author Akash Yadav */ +class SelectAllAction(context: Context, override val order: Int) : BaseEditorAction() { + + init { + label = context.getString(android.R.string.selectAll) + + val arr = context.obtainStyledAttributes(intArrayOf(android.R.attr.actionModeSelectAllDrawable)) + icon = arr.getDrawable(0)?.let { tintDrawable(context, it) } + arr.recycle() + } + + companion object { + const val ID = "ide.editor.code.text.selectAll" + } + + override val id: String = ID + + override fun prepare(data: ActionData) { + super.prepare(data) + + if (!visible) return + + val target = getTextTarget(data) + + visible = target != null + enabled = visible + } + + override suspend fun execAction(data: ActionData): Boolean { + val target = getTextTarget(data) ?: return false + target.selectAll() + return true + } + + override fun dismissOnAction() = false + + override fun retrieveTooltipTag(isAlternateContext: Boolean): String { + return if (isAlternateContext) { + TooltipTag.EDITOR_TOOLBAR_OUTPUT_SELECT_ALL + } else { + TooltipTag.EDITOR_TOOLBAR_SELECT_ALL + } + } +} diff --git a/app/src/main/java/com/itsaky/androidide/actions/etc/DisconnectLogSendersAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/DisconnectLogSendersAction.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/actions/etc/DisconnectLogSendersAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/etc/DisconnectLogSendersAction.kt index 4dc5b669ce..ea00e051ee 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/etc/DisconnectLogSendersAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/DisconnectLogSendersAction.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.etc +package org.appdevforall.codeonthego.actions.etc import android.content.Context import androidx.core.content.ContextCompat import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.EditorActivityAction -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.services.log.lookupLogService +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.EditorActivityAction +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.services.log.lookupLogService /** * An action to disconnect all connected LogSenders at once. diff --git a/app/src/main/java/com/itsaky/androidide/actions/etc/FindAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindAction.kt similarity index 83% rename from app/src/main/java/com/itsaky/androidide/actions/etc/FindAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindAction.kt index 2e36efc844..43f5f91638 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/etc/FindAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindAction.kt @@ -1,59 +1,59 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.actions.etc - -import android.content.Context -import androidx.core.content.ContextCompat -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.EditorActivityAction -import com.itsaky.androidide.actions.build.AbstractCancellableRunAction.Companion.isBuildInProgress -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R - -/** @author Akash Yadav */ -class FindAction() : EditorActivityAction() { - - override var requiresUIThread: Boolean = true - override var order: Int = 0 - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String { - return TooltipTag.EDITOR_TOOLBAR_FIND - } - - constructor(context: Context, order: Int) : this() { - this.label = context.getString(R.string.menu_find) - this.icon = ContextCompat.getDrawable(context, R.drawable.ic_search) - this.order = order - } - - override val id: String = "ide.editor.find" - - override fun prepare(data: ActionData) { - super.prepare(data) - enabled = data.getActivity().isBuildInProgress().not() - } - - override suspend fun execAction(data: ActionData): Boolean { - val context = data.getActivity() ?: return false - val dialog = context.findActionDialog(data) - - return run { - dialog.show() - true - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.actions.etc + +import android.content.Context +import androidx.core.content.ContextCompat +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.EditorActivityAction +import org.appdevforall.codeonthego.actions.build.AbstractCancellableRunAction.Companion.isBuildInProgress +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import com.itsaky.androidide.resources.R + +/** @author Akash Yadav */ +class FindAction() : EditorActivityAction() { + + override var requiresUIThread: Boolean = true + override var order: Int = 0 + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String { + return TooltipTag.EDITOR_TOOLBAR_FIND + } + + constructor(context: Context, order: Int) : this() { + this.label = context.getString(R.string.menu_find) + this.icon = ContextCompat.getDrawable(context, R.drawable.ic_search) + this.order = order + } + + override val id: String = "ide.editor.find" + + override fun prepare(data: ActionData) { + super.prepare(data) + enabled = data.getActivity().isBuildInProgress().not() + } + + override suspend fun execAction(data: ActionData): Boolean { + val context = data.getActivity() ?: return false + val dialog = context.findActionDialog(data) + + return run { + dialog.show() + true + } + } +} diff --git a/app/src/main/java/com/itsaky/androidide/actions/etc/FindInFileAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindInFileAction.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/actions/etc/FindInFileAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindInFileAction.kt index 4c953bd7ad..6a101158f8 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/etc/FindInFileAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindInFileAction.kt @@ -1,52 +1,52 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.actions.etc - -import android.content.Context -import androidx.core.content.ContextCompat -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.EditorRelatedAction -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R - -/** @author Akash Yadav */ -class FindInFileAction() : EditorRelatedAction() { - - override val id: String = ID - override var requiresUIThread: Boolean = true - override var location: ActionItem.Location = ActionItem.Location.EDITOR_FIND_ACTION_MENU - override var order: Int = 0 - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.EDITOR_TOOLBAR_FIND_IN_FILE - - companion object{ - const val ID = "ide.editor.find.inFile" - } - - constructor(context: Context, order: Int) : this() { - this.label = context.getString(R.string.menu_find_file) - this.icon = ContextCompat.getDrawable(context, R.drawable.ic_search_file) - this.order = order - } - - override suspend fun execAction(data: ActionData): Boolean { - val editor = data.getEditorView() ?: return false - editor.beginSearch() - return true - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.actions.etc + +import android.content.Context +import androidx.core.content.ContextCompat +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.EditorRelatedAction +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import com.itsaky.androidide.resources.R + +/** @author Akash Yadav */ +class FindInFileAction() : EditorRelatedAction() { + + override val id: String = ID + override var requiresUIThread: Boolean = true + override var location: ActionItem.Location = ActionItem.Location.EDITOR_FIND_ACTION_MENU + override var order: Int = 0 + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.EDITOR_TOOLBAR_FIND_IN_FILE + + companion object{ + const val ID = "ide.editor.find.inFile" + } + + constructor(context: Context, order: Int) : this() { + this.label = context.getString(R.string.menu_find_file) + this.icon = ContextCompat.getDrawable(context, R.drawable.ic_search_file) + this.order = order + } + + override suspend fun execAction(data: ActionData): Boolean { + val editor = data.getEditorView() ?: return false + editor.beginSearch() + return true + } +} diff --git a/app/src/main/java/com/itsaky/androidide/actions/etc/FindInProjectAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindInProjectAction.kt similarity index 83% rename from app/src/main/java/com/itsaky/androidide/actions/etc/FindInProjectAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindInProjectAction.kt index e66f88c728..920687ae28 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/etc/FindInProjectAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindInProjectAction.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.etc +package org.appdevforall.codeonthego.actions.etc import android.content.Context import androidx.core.content.ContextCompat -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.EditorActivityAction -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.projects.IProjectManager +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.EditorActivityAction +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.projects.IProjectManager import com.itsaky.androidide.resources.R /** @author Akash Yadav */ diff --git a/app/src/main/java/com/itsaky/androidide/actions/etc/LaunchAppAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/LaunchAppAction.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/actions/etc/LaunchAppAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/etc/LaunchAppAction.kt index a84e904b60..a1f3f3514c 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/etc/LaunchAppAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/LaunchAppAction.kt @@ -15,20 +15,20 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.etc +package org.appdevforall.codeonthego.actions.etc import android.content.Context import android.view.MenuItem import androidx.core.content.ContextCompat import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.EditorActivityAction -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.openApplicationModuleChooser -import com.itsaky.androidide.idetooltips.TooltipTag.EDITOR_TOOLBAR_LAUNCH_APP -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.utils.IntentUtils -import com.itsaky.androidide.utils.flashError +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.EditorActivityAction +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.openApplicationModuleChooser +import org.appdevforall.codeonthego.idetooltips.TooltipTag.EDITOR_TOOLBAR_LAUNCH_APP +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.utils.IntentUtils +import org.appdevforall.codeonthego.utils.flashError import kotlinx.coroutines.launch import org.slf4j.LoggerFactory diff --git a/app/src/main/java/com/itsaky/androidide/actions/etc/ReplaceInProjectAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/ReplaceInProjectAction.kt similarity index 76% rename from app/src/main/java/com/itsaky/androidide/actions/etc/ReplaceInProjectAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/etc/ReplaceInProjectAction.kt index 06dc66c537..97ea41f541 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/etc/ReplaceInProjectAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/ReplaceInProjectAction.kt @@ -1,13 +1,13 @@ -package com.itsaky.androidide.actions.etc +package org.appdevforall.codeonthego.actions.etc import android.content.Context import androidx.core.content.ContextCompat -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.EditorActivityAction -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.projects.IProjectManager +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.EditorActivityAction +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.projects.IProjectManager import com.itsaky.androidide.resources.R class ReplaceInProjectAction() : EditorActivityAction() { diff --git a/app/src/main/java/com/itsaky/androidide/actions/file/CloseAllFilesAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseAllFilesAction.kt similarity index 87% rename from app/src/main/java/com/itsaky/androidide/actions/file/CloseAllFilesAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseAllFilesAction.kt index c4bc1311f7..bc597feba8 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/file/CloseAllFilesAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseAllFilesAction.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.file +package org.appdevforall.codeonthego.actions.file import android.content.Context import androidx.core.content.ContextCompat import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity /** * Closes all opened files. diff --git a/app/src/main/java/com/itsaky/androidide/actions/file/CloseFileAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseFileAction.kt similarity index 88% rename from app/src/main/java/com/itsaky/androidide/actions/file/CloseFileAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseFileAction.kt index ba3e0e1a71..e559f43253 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/file/CloseFileAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseFileAction.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.file +package org.appdevforall.codeonthego.actions.file import android.content.Context import androidx.core.content.ContextCompat import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity /** * Closes the current file. diff --git a/app/src/main/java/com/itsaky/androidide/actions/file/CloseOtherFilesAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseOtherFilesAction.kt similarity index 87% rename from app/src/main/java/com/itsaky/androidide/actions/file/CloseOtherFilesAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseOtherFilesAction.kt index cb0e5f8845..ab73029bc2 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/file/CloseOtherFilesAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseOtherFilesAction.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.file +package org.appdevforall.codeonthego.actions.file import android.content.Context import androidx.core.content.ContextCompat import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity /** * Closes all opened files except the selected one. diff --git a/app/src/main/java/com/itsaky/androidide/actions/file/CreateLinkAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/file/CreateLinkAction.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/actions/file/CreateLinkAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/file/CreateLinkAction.kt index af06fb8cd0..f75c1dac80 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/file/CreateLinkAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/file/CreateLinkAction.kt @@ -15,23 +15,23 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.file +package org.appdevforall.codeonthego.actions.file import android.content.Context import androidx.annotation.VisibleForTesting import androidx.core.content.ContextCompat import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.activities.editor.EditorHandlerActivity -import com.itsaky.androidide.activities.projectsRoot -import com.itsaky.androidide.models.DeepLinkRequest -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.utils.copyToClipboard -import com.itsaky.androidide.utils.deepLinkTargetOfOpenProjectOrNull -import com.itsaky.androidide.utils.deepLinkTargetOfOpenProjectWithoutIo -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashSuccess +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.activities.projectsRoot +import org.appdevforall.codeonthego.models.DeepLinkRequest +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.utils.copyToClipboard +import org.appdevforall.codeonthego.utils.deepLinkTargetOfOpenProjectOrNull +import org.appdevforall.codeonthego.utils.deepLinkTargetOfOpenProjectWithoutIo +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashSuccess import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -43,7 +43,7 @@ import java.util.concurrent.ConcurrentHashMap * Copies a deep link to the current file -- and to the cursor's line and column within it -- to the * clipboard, so it can be pasted somewhere another person (or the same person on another device) can * tap it. The read side of the same link is - * [DeepLinkActivity][com.itsaky.androidide.activities.DeepLinkActivity]. + * [DeepLinkActivity][org.appdevforall.codeonthego.activities.DeepLinkActivity]. * * @author David Schachter */ diff --git a/app/src/main/java/com/itsaky/androidide/actions/file/FileTabAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/file/FileTabAction.kt similarity index 77% rename from app/src/main/java/com/itsaky/androidide/actions/file/FileTabAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/file/FileTabAction.kt index d863a082c9..ddc4c7772e 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/file/FileTabAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/file/FileTabAction.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.file - -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem.Location -import com.itsaky.androidide.actions.ActionItem.Location.EDITOR_FILE_TABS -import com.itsaky.androidide.actions.EditorActivityAction -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.activities.editor.EditorHandlerActivity +package org.appdevforall.codeonthego.actions.file + +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem.Location +import org.appdevforall.codeonthego.actions.ActionItem.Location.EDITOR_FILE_TABS +import org.appdevforall.codeonthego.actions.EditorActivityAction +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity /** * Action related to file tabs. Shown only when there is at least one file opened. diff --git a/app/src/main/java/com/itsaky/androidide/actions/file/FormatCodeAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/file/FormatCodeAction.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/actions/file/FormatCodeAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/file/FormatCodeAction.kt index e1875860fd..93de1c4f2a 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/file/FormatCodeAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/file/FormatCodeAction.kt @@ -1,55 +1,55 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.actions.file - -import android.content.Context -import androidx.core.content.ContextCompat -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.EditorRelatedAction -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R - -/** - * Action that formats the code in the editor. - * - * @author Akash Yadav - */ -class FormatCodeAction(context: Context, override val order: Int) : EditorRelatedAction() { - override val id: String = "ide.editor.code.text.format" - override var location: ActionItem.Location = ActionItem.Location.EDITOR_TEXT_ACTIONS - override fun retrieveTooltipTag(isReadOnlyContext: Boolean) = - TooltipTag.EDITOR_TOOLBAR_FORMAT_CODE - - init { - label = context.getString(R.string.title_format_code) - icon = ContextCompat.getDrawable(context, R.drawable.ic_format_code) - } - - override suspend fun execAction(data: ActionData): Any { - val editor = data.getEditor()!! - val cursor = editor.text.cursor - - if (cursor.isSelected) { - editor.formatCodeAsync(cursor.left(), cursor.right()) - } else { - editor.formatCodeAsync() - } - return true - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.actions.file + +import android.content.Context +import androidx.core.content.ContextCompat +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.EditorRelatedAction +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import com.itsaky.androidide.resources.R + +/** + * Action that formats the code in the editor. + * + * @author Akash Yadav + */ +class FormatCodeAction(context: Context, override val order: Int) : EditorRelatedAction() { + override val id: String = "ide.editor.code.text.format" + override var location: ActionItem.Location = ActionItem.Location.EDITOR_TEXT_ACTIONS + override fun retrieveTooltipTag(isReadOnlyContext: Boolean) = + TooltipTag.EDITOR_TOOLBAR_FORMAT_CODE + + init { + label = context.getString(R.string.title_format_code) + icon = ContextCompat.getDrawable(context, R.drawable.ic_format_code) + } + + override suspend fun execAction(data: ActionData): Any { + val editor = data.getEditor()!! + val cursor = editor.text.cursor + + if (cursor.isSelected) { + editor.formatCodeAsync(cursor.left(), cursor.right()) + } else { + editor.formatCodeAsync() + } + return true + } +} diff --git a/app/src/main/java/com/itsaky/androidide/actions/file/InstallFileAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/file/InstallFileAction.kt similarity index 82% rename from app/src/main/java/com/itsaky/androidide/actions/file/InstallFileAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/file/InstallFileAction.kt index 52e7f95f20..aeab26c72b 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/file/InstallFileAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/file/InstallFileAction.kt @@ -15,18 +15,18 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.file +package org.appdevforall.codeonthego.actions.file import android.content.Context import androidx.lifecycle.lifecycleScope -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.activities.editor.EditorHandlerActivity -import com.itsaky.androidide.repositories.PluginRepository +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.repositories.PluginRepository import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.DialogUtils -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashSuccess +import org.appdevforall.codeonthego.utils.DialogUtils +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashSuccess import kotlinx.coroutines.launch import org.adfa.constants.PLUGIN_ARCHIVE_EXTENSION import org.koin.core.context.GlobalContext diff --git a/app/src/main/java/com/itsaky/androidide/actions/file/SaveFileAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/file/SaveFileAction.kt similarity index 88% rename from app/src/main/java/com/itsaky/androidide/actions/file/SaveFileAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/file/SaveFileAction.kt index 74a08d3d34..a9ed37b62d 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/file/SaveFileAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/file/SaveFileAction.kt @@ -15,18 +15,18 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.file +package org.appdevforall.codeonthego.actions.file import android.content.Context import androidx.core.content.ContextCompat -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.EditorRelatedAction -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.models.SaveResult -import com.itsaky.androidide.quickbuild.GenerateSourcesDeferral +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.EditorRelatedAction +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.models.SaveResult +import org.appdevforall.codeonthego.quickbuild.GenerateSourcesDeferral import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashSuccess +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashSuccess import org.slf4j.LoggerFactory /** @author Akash Yadav */ diff --git a/app/src/main/java/com/itsaky/androidide/actions/file/SaveFollowUp.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/file/SaveFollowUp.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/actions/file/SaveFollowUp.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/file/SaveFollowUp.kt index b547706ba8..4f82684e9a 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/file/SaveFollowUp.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/file/SaveFollowUp.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.file +package org.appdevforall.codeonthego.actions.file -import com.itsaky.androidide.models.SaveResult +import org.appdevforall.codeonthego.models.SaveResult /** * What a finished save-all asks the editor to do next. Both members are decided from the save's diff --git a/app/src/main/java/com/itsaky/androidide/actions/file/ShowTooltipAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/file/ShowTooltipAction.kt similarity index 85% rename from app/src/main/java/com/itsaky/androidide/actions/file/ShowTooltipAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/file/ShowTooltipAction.kt index 5b6d8779ff..14a8e50827 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/file/ShowTooltipAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/file/ShowTooltipAction.kt @@ -15,20 +15,20 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.file +package org.appdevforall.codeonthego.actions.file import android.content.Context import androidx.core.content.ContextCompat import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.BaseEditorAction -import com.itsaky.androidide.editor.utils.isJavaOperatorToken -import com.itsaky.androidide.editor.utils.isKotlinOperatorToken -import com.itsaky.androidide.editor.utils.isXmlAttribute -import com.itsaky.androidide.idetooltips.TooltipCategory -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.BaseEditorAction +import org.appdevforall.codeonthego.editor.utils.isJavaOperatorToken +import org.appdevforall.codeonthego.editor.utils.isKotlinOperatorToken +import org.appdevforall.codeonthego.editor.utils.isXmlAttribute +import org.appdevforall.codeonthego.idetooltips.TooltipCategory +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag class ShowTooltipAction(private val context: Context, override val order: Int) : BaseEditorAction() { diff --git a/app/src/main/java/com/itsaky/androidide/actions/filetree/BaseDirNodeAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/BaseDirNodeAction.kt similarity index 85% rename from app/src/main/java/com/itsaky/androidide/actions/filetree/BaseDirNodeAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/filetree/BaseDirNodeAction.kt index 1244c9141d..5dbd14da99 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/filetree/BaseDirNodeAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/BaseDirNodeAction.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.filetree +package org.appdevforall.codeonthego.actions.filetree import android.content.Context import androidx.annotation.DrawableRes import androidx.annotation.StringRes -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireFile +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireFile /** * Base class for action items for directory nodes. diff --git a/app/src/main/java/com/itsaky/androidide/actions/filetree/BaseFileTreeAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/BaseFileTreeAction.kt similarity index 80% rename from app/src/main/java/com/itsaky/androidide/actions/filetree/BaseFileTreeAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/filetree/BaseFileTreeAction.kt index 2f206a62e7..918c5b8553 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/filetree/BaseFileTreeAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/BaseFileTreeAction.kt @@ -15,21 +15,21 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.filetree +package org.appdevforall.codeonthego.actions.filetree import android.content.Context import androidx.annotation.DrawableRes import androidx.annotation.StringRes import androidx.core.content.ContextCompat -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.EditorActivityAction -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.eventbus.events.Event -import com.itsaky.androidide.events.CollapseTreeNodeRequestEvent -import com.itsaky.androidide.events.ExpandTreeNodeRequestEvent -import com.itsaky.androidide.events.ListProjectFilesRequestEvent +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.EditorActivityAction +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.eventbus.events.Event +import org.appdevforall.codeonthego.events.CollapseTreeNodeRequestEvent +import org.appdevforall.codeonthego.events.ExpandTreeNodeRequestEvent +import org.appdevforall.codeonthego.events.ListProjectFilesRequestEvent import com.unnamed.b.atv.model.TreeNode import org.greenrobot.eventbus.EventBus import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/actions/filetree/CopyPathAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/CopyPathAction.kt similarity index 78% rename from app/src/main/java/com/itsaky/androidide/actions/filetree/CopyPathAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/filetree/CopyPathAction.kt index 7e0a126e81..06ef61de88 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/filetree/CopyPathAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/CopyPathAction.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.filetree +package org.appdevforall.codeonthego.actions.filetree import android.content.Context -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.idetooltips.TooltipTag import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.copyToClipboard -import com.itsaky.androidide.utils.flashSuccess +import org.appdevforall.codeonthego.utils.copyToClipboard +import org.appdevforall.codeonthego.utils.flashSuccess /** * Action to copy the absolute path of the selected file. diff --git a/app/src/main/java/com/itsaky/androidide/actions/filetree/DeleteAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/DeleteAction.kt similarity index 81% rename from app/src/main/java/com/itsaky/androidide/actions/filetree/DeleteAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/filetree/DeleteAction.kt index 5d40f72972..caad99de4f 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/filetree/DeleteAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/DeleteAction.kt @@ -15,22 +15,22 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.filetree +package org.appdevforall.codeonthego.actions.filetree import android.app.ProgressDialog import android.content.Context -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.eventbus.events.file.FileDeletionEvent -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.idetooltips.attachTooltip -import com.itsaky.androidide.projects.FileManager +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.eventbus.events.file.FileDeletionEvent +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.idetooltips.attachTooltip +import org.appdevforall.codeonthego.projects.FileManager import com.itsaky.androidide.resources.R -import com.itsaky.androidide.tasks.executeAsync -import com.itsaky.androidide.utils.DialogUtils -import com.itsaky.androidide.utils.FileUtils -import com.itsaky.androidide.utils.FlashType -import com.itsaky.androidide.utils.flashMessage +import org.appdevforall.codeonthego.tasks.executeAsync +import org.appdevforall.codeonthego.utils.DialogUtils +import org.appdevforall.codeonthego.utils.FileUtils +import org.appdevforall.codeonthego.utils.FlashType +import org.appdevforall.codeonthego.utils.flashMessage import org.greenrobot.eventbus.EventBus import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/actions/filetree/HelpAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/HelpAction.kt similarity index 75% rename from app/src/main/java/com/itsaky/androidide/actions/filetree/HelpAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/filetree/HelpAction.kt index 4ec1c5d527..b6e14dc801 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/filetree/HelpAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/HelpAction.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.actions.filetree +package org.appdevforall.codeonthego.actions.filetree import android.content.Context import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag class HelpAction(context: Context, override val order: Int) : BaseFileTreeAction( diff --git a/app/src/main/java/com/itsaky/androidide/actions/filetree/NewFileAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/NewFileAction.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/actions/filetree/NewFileAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/filetree/NewFileAction.kt index 2b0a8398b6..648dc8a5ce 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/filetree/NewFileAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/NewFileAction.kt @@ -15,32 +15,32 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.filetree +package org.appdevforall.codeonthego.actions.filetree import android.content.Context import android.view.LayoutInflater import androidx.core.view.isVisible -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.FileActionManager -import com.itsaky.androidide.actions.observers.FileActionObserver -import com.itsaky.androidide.actions.requireFile +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.FileActionManager +import org.appdevforall.codeonthego.actions.observers.FileActionObserver +import org.appdevforall.codeonthego.actions.requireFile import com.itsaky.androidide.databinding.LayoutCreateFileJavaBinding -import com.itsaky.androidide.eventbus.events.file.FileCreationEvent -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.idetooltips.attachTooltip +import org.appdevforall.codeonthego.eventbus.events.file.FileCreationEvent +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.idetooltips.attachTooltip import com.itsaky.androidide.preferences.databinding.LayoutDialogTextInputBinding -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.ProjectManagerImpl import com.itsaky.androidide.resources.R -import com.itsaky.androidide.templates.base.models.Dependency -import com.itsaky.androidide.utils.ClassBuilder.SourceLanguage -import com.itsaky.androidide.utils.DialogUtils -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.FileIOUtils -import com.itsaky.androidide.utils.ProjectWriter -import com.itsaky.androidide.utils.SingleTextWatcher -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashSuccess +import org.appdevforall.codeonthego.templates.base.models.Dependency +import org.appdevforall.codeonthego.utils.ClassBuilder.SourceLanguage +import org.appdevforall.codeonthego.utils.DialogUtils +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.FileIOUtils +import org.appdevforall.codeonthego.utils.ProjectWriter +import org.appdevforall.codeonthego.utils.SingleTextWatcher +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashSuccess import com.unnamed.b.atv.model.TreeNode import jdkx.lang.model.SourceVersion import kotlinx.coroutines.CancellationException diff --git a/app/src/main/java/com/itsaky/androidide/actions/filetree/NewFolderAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/NewFolderAction.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/actions/filetree/NewFolderAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/filetree/NewFolderAction.kt index 06c13abf82..aaa54f041c 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/filetree/NewFolderAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/NewFolderAction.kt @@ -15,20 +15,20 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.filetree +package org.appdevforall.codeonthego.actions.filetree import android.content.Context import android.view.LayoutInflater -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.adapters.viewholders.FileTreeViewHolder -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.idetooltips.attachTooltip +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.adapters.viewholders.FileTreeViewHolder +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.idetooltips.attachTooltip import com.itsaky.androidide.preferences.databinding.LayoutDialogTextInputBinding import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.DialogUtils -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashSuccess +import org.appdevforall.codeonthego.utils.DialogUtils +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashSuccess import com.unnamed.b.atv.model.TreeNode import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/actions/filetree/OpenWithAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/OpenWithAction.kt similarity index 82% rename from app/src/main/java/com/itsaky/androidide/actions/filetree/OpenWithAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/filetree/OpenWithAction.kt index 791a02d53d..dceed85bf3 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/filetree/OpenWithAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/OpenWithAction.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.filetree +package org.appdevforall.codeonthego.actions.filetree import android.content.Context import android.content.Intent -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.idetooltips.TooltipTag import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.IntentUtils +import org.appdevforall.codeonthego.utils.IntentUtils /** * File tree action to open files with external applications. diff --git a/app/src/main/java/com/itsaky/androidide/actions/filetree/RenameAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/RenameAction.kt similarity index 85% rename from app/src/main/java/com/itsaky/androidide/actions/filetree/RenameAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/filetree/RenameAction.kt index 801618aa28..09e469533b 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/filetree/RenameAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/RenameAction.kt @@ -15,20 +15,20 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.filetree +package org.appdevforall.codeonthego.actions.filetree import android.content.Context import android.view.LayoutInflater import androidx.activity.viewModels import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.idetooltips.attachTooltip +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.idetooltips.attachTooltip import com.itsaky.androidide.preferences.databinding.LayoutDialogTextInputBinding -import com.itsaky.androidide.utils.DialogUtils -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.viewmodel.FileManagerViewModel +import org.appdevforall.codeonthego.utils.DialogUtils +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.viewmodel.FileManagerViewModel /** * Action to rename the selected file. diff --git a/app/src/main/java/com/itsaky/androidide/actions/internalActionUtils.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/internalActionUtils.kt similarity index 87% rename from app/src/main/java/com/itsaky/androidide/actions/internalActionUtils.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/internalActionUtils.kt index ff7b40ee4f..f07f0128db 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/internalActionUtils.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/internalActionUtils.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions +package org.appdevforall.codeonthego.actions import android.content.Context import com.itsaky.androidide.R -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.api.AndroidModule -import com.itsaky.androidide.utils.DialogUtils -import com.itsaky.androidide.utils.ILogger -import com.itsaky.androidide.utils.flashError +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.api.AndroidModule +import org.appdevforall.codeonthego.utils.DialogUtils +import org.appdevforall.codeonthego.utils.ILogger +import org.appdevforall.codeonthego.utils.flashError /** * @see openApplicationModuleChooser diff --git a/app/src/main/java/com/itsaky/androidide/actions/main/CloneRepositoryAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/main/CloneRepositoryAction.kt similarity index 76% rename from app/src/main/java/com/itsaky/androidide/actions/main/CloneRepositoryAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/main/CloneRepositoryAction.kt index 369e5b5abb..ed188c3df8 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/main/CloneRepositoryAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/main/CloneRepositoryAction.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.actions.main +package org.appdevforall.codeonthego.actions.main import android.content.Context import android.graphics.drawable.Drawable import androidx.core.content.ContextCompat import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.activities.MainActivity -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.utils.FeatureFlags +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.activities.MainActivity +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.utils.FeatureFlags class CloneRepositoryAction(context: Context) : ActionItem { diff --git a/app/src/main/java/com/itsaky/androidide/actions/main/CreateProjectAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/main/CreateProjectAction.kt similarity index 78% rename from app/src/main/java/com/itsaky/androidide/actions/main/CreateProjectAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/main/CreateProjectAction.kt index 42b405ef51..c0f1a6ac61 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/main/CreateProjectAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/main/CreateProjectAction.kt @@ -1,14 +1,14 @@ -package com.itsaky.androidide.actions.main +package org.appdevforall.codeonthego.actions.main import android.content.Context import android.graphics.drawable.Drawable import androidx.core.content.ContextCompat import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.activities.MainActivity -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.activities.MainActivity +import org.appdevforall.codeonthego.idetooltips.TooltipTag class CreateProjectAction(context: Context) : ActionItem { diff --git a/app/src/main/java/com/itsaky/androidide/actions/main/DeleteProjectAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/main/DeleteProjectAction.kt similarity index 79% rename from app/src/main/java/com/itsaky/androidide/actions/main/DeleteProjectAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/main/DeleteProjectAction.kt index 23fc18802f..326a566675 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/main/DeleteProjectAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/main/DeleteProjectAction.kt @@ -1,14 +1,14 @@ -package com.itsaky.androidide.actions.main +package org.appdevforall.codeonthego.actions.main import android.content.Context import android.graphics.drawable.Drawable import androidx.core.content.ContextCompat import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.viewmodel.MainViewModel +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.viewmodel.MainViewModel class DeleteProjectAction(context: Context) : ActionItem { diff --git a/app/src/main/java/com/itsaky/androidide/actions/main/DocsAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/main/DocsAction.kt similarity index 82% rename from app/src/main/java/com/itsaky/androidide/actions/main/DocsAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/main/DocsAction.kt index 349107e487..db339e37de 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/main/DocsAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/main/DocsAction.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.actions.main +package org.appdevforall.codeonthego.actions.main import android.content.Context import android.content.Intent import android.graphics.drawable.Drawable import androidx.core.content.ContextCompat import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.activities.editor.HelpActivity -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.activities.editor.HelpActivity +import org.appdevforall.codeonthego.idetooltips.TooltipTag import com.itsaky.androidide.resources.R.string import org.adfa.constants.CONTENT_KEY import org.adfa.constants.CONTENT_TITLE_KEY diff --git a/app/src/main/java/com/itsaky/androidide/actions/main/DonateAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/main/DonateAction.kt similarity index 77% rename from app/src/main/java/com/itsaky/androidide/actions/main/DonateAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/main/DonateAction.kt index caa6f6852d..e77007786a 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/main/DonateAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/main/DonateAction.kt @@ -1,14 +1,14 @@ -package com.itsaky.androidide.actions.main +package org.appdevforall.codeonthego.actions.main import android.content.Context import android.graphics.drawable.Drawable import androidx.core.content.ContextCompat import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.utils.UrlManager +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.utils.UrlManager class DonateAction(context: Context) : ActionItem { diff --git a/app/src/main/java/com/itsaky/androidide/actions/main/OpenProjectAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/main/OpenProjectAction.kt similarity index 78% rename from app/src/main/java/com/itsaky/androidide/actions/main/OpenProjectAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/main/OpenProjectAction.kt index 1120fdd629..27228f67b1 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/main/OpenProjectAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/main/OpenProjectAction.kt @@ -1,14 +1,14 @@ -package com.itsaky.androidide.actions.main +package org.appdevforall.codeonthego.actions.main import android.content.Context import android.graphics.drawable.Drawable import androidx.core.content.ContextCompat import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.activities.MainActivity -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.activities.MainActivity +import org.appdevforall.codeonthego.idetooltips.TooltipTag class OpenProjectAction(context: Context) : ActionItem { diff --git a/app/src/main/java/com/itsaky/androidide/actions/main/OpenTerminalAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/main/OpenTerminalAction.kt similarity index 76% rename from app/src/main/java/com/itsaky/androidide/actions/main/OpenTerminalAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/main/OpenTerminalAction.kt index 93a9986101..ba2aebb0e6 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/main/OpenTerminalAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/main/OpenTerminalAction.kt @@ -1,16 +1,16 @@ -package com.itsaky.androidide.actions.main +package org.appdevforall.codeonthego.actions.main import android.content.Context import android.content.Intent import android.graphics.drawable.Drawable import androidx.core.content.ContextCompat import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.activities.TerminalActivity -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.utils.applyMultiWindowFlags +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.activities.TerminalActivity +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.utils.applyMultiWindowFlags class OpenTerminalAction(context: Context) : ActionItem { diff --git a/app/src/main/java/com/itsaky/androidide/actions/main/PreferencesAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/main/PreferencesAction.kt similarity index 78% rename from app/src/main/java/com/itsaky/androidide/actions/main/PreferencesAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/main/PreferencesAction.kt index 6e70f4c511..42b6de5cac 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/main/PreferencesAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/main/PreferencesAction.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.actions.main +package org.appdevforall.codeonthego.actions.main import android.content.Context import android.content.Intent import android.graphics.drawable.Drawable import androidx.core.content.ContextCompat import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.activities.PreferencesActivity -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.activities.PreferencesActivity +import org.appdevforall.codeonthego.idetooltips.TooltipTag class PreferencesAction(context: Context) : ActionItem { diff --git a/app/src/main/java/com/itsaky/androidide/actions/observers/FileActionObserver.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/observers/FileActionObserver.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/actions/observers/FileActionObserver.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/observers/FileActionObserver.kt index 032117d1d1..df8086620c 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/observers/FileActionObserver.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/observers/FileActionObserver.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.actions.observers +package org.appdevforall.codeonthego.actions.observers import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/actions/profiler/ProfilerAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/profiler/ProfilerAction.kt similarity index 75% rename from app/src/main/java/com/itsaky/androidide/actions/profiler/ProfilerAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/profiler/ProfilerAction.kt index ebc0cebc6d..edd03fb1b8 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/profiler/ProfilerAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/profiler/ProfilerAction.kt @@ -1,20 +1,20 @@ -package com.itsaky.androidide.actions.profiler +package org.appdevforall.codeonthego.actions.profiler import android.content.Context -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.build.AbstractRunAction -import com.itsaky.androidide.actions.canShowPairingNotification -import com.itsaky.androidide.actions.showNotificationPermissionDialog -import com.itsaky.androidide.actions.showPairingDialog -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.project.AndroidModels -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.api.AndroidModule -import com.itsaky.androidide.projects.isPluginProject +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.build.AbstractRunAction +import org.appdevforall.codeonthego.actions.canShowPairingNotification +import org.appdevforall.codeonthego.actions.showNotificationPermissionDialog +import org.appdevforall.codeonthego.actions.showPairingDialog +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.project.AndroidModels +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.api.AndroidModule +import org.appdevforall.codeonthego.projects.isPluginProject import com.itsaky.androidide.resources.R -import com.itsaky.androidide.tooling.api.GradlePluginConfig.PROPERTY_PROFILEABLE_ENABLED -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.isAtLeastR +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_PROFILEABLE_ENABLED +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.isAtLeastR import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import rikka.shizuku.Shizuku diff --git a/app/src/main/java/com/itsaky/androidide/actions/profiler/ReleaseVariant.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/profiler/ReleaseVariant.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/actions/profiler/ReleaseVariant.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/profiler/ReleaseVariant.kt index f97e1b2c50..354d83ad66 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/profiler/ReleaseVariant.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/profiler/ReleaseVariant.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.actions.profiler +package org.appdevforall.codeonthego.actions.profiler /** * Maps [selectedVariant] to the name of its release counterpart, or `null` when there is none. diff --git a/app/src/main/java/com/itsaky/androidide/actions/sidebar/AbstractSidebarAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/AbstractSidebarAction.kt similarity index 85% rename from app/src/main/java/com/itsaky/androidide/actions/sidebar/AbstractSidebarAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/AbstractSidebarAction.kt index b9885b151e..1b65667349 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/sidebar/AbstractSidebarAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/AbstractSidebarAction.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.sidebar +package org.appdevforall.codeonthego.actions.sidebar import android.graphics.drawable.Drawable -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.SidebarActionItem +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.SidebarActionItem /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/actions/sidebar/BuildVariantsSidebarAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/BuildVariantsSidebarAction.kt similarity index 87% rename from app/src/main/java/com/itsaky/androidide/actions/sidebar/BuildVariantsSidebarAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/BuildVariantsSidebarAction.kt index d4e9b3f1e7..95d2c72f65 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/sidebar/BuildVariantsSidebarAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/BuildVariantsSidebarAction.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.sidebar +package org.appdevforall.codeonthego.actions.sidebar import android.content.Context import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.fragments.sidebar.BuildVariantsFragment -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.fragments.sidebar.BuildVariantsFragment +import org.appdevforall.codeonthego.idetooltips.TooltipTag import kotlin.reflect.KClass /** diff --git a/app/src/main/java/com/itsaky/androidide/actions/sidebar/CloseProjectSidebarAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/CloseProjectSidebarAction.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/actions/sidebar/CloseProjectSidebarAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/CloseProjectSidebarAction.kt index f9299aed9e..8432a3f8e1 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/sidebar/CloseProjectSidebarAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/CloseProjectSidebarAction.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.sidebar +package org.appdevforall.codeonthego.actions.sidebar import android.content.Context import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.activities.editor.BaseEditorActivity -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.activities.editor.BaseEditorActivity +import org.appdevforall.codeonthego.idetooltips.TooltipTag import com.itsaky.androidide.resources.R import kotlin.reflect.KClass diff --git a/app/src/main/java/com/itsaky/androidide/actions/sidebar/FileTreeSidebarAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/FileTreeSidebarAction.kt similarity index 88% rename from app/src/main/java/com/itsaky/androidide/actions/sidebar/FileTreeSidebarAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/FileTreeSidebarAction.kt index 732c868841..32bf3fc9b4 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/sidebar/FileTreeSidebarAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/FileTreeSidebarAction.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.sidebar +package org.appdevforall.codeonthego.actions.sidebar import android.content.Context import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import com.itsaky.androidide.R -import com.itsaky.androidide.fragments.sidebar.FileTreeFragment -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.fragments.sidebar.FileTreeFragment +import org.appdevforall.codeonthego.idetooltips.TooltipTag import kotlin.reflect.KClass /** diff --git a/app/src/main/java/com/itsaky/androidide/actions/sidebar/HelpSideBarAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/HelpSideBarAction.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/actions/sidebar/HelpSideBarAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/HelpSideBarAction.kt index 4d3445d5a7..2f66420d6d 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/sidebar/HelpSideBarAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/HelpSideBarAction.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.actions.sidebar +package org.appdevforall.codeonthego.actions.sidebar /* * This file is part of AndroidIDE. @@ -20,10 +20,10 @@ package com.itsaky.androidide.actions.sidebar import android.content.Context import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.activities.editor.BaseEditorActivity -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.activities.editor.BaseEditorActivity +import org.appdevforall.codeonthego.idetooltips.TooltipTag import com.itsaky.androidide.resources.R import kotlin.reflect.KClass diff --git a/app/src/main/java/com/itsaky/androidide/actions/sidebar/OutlineSidebarAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/OutlineSidebarAction.kt similarity index 79% rename from app/src/main/java/com/itsaky/androidide/actions/sidebar/OutlineSidebarAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/OutlineSidebarAction.kt index 1b2436855f..0f341482ca 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/sidebar/OutlineSidebarAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/OutlineSidebarAction.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.actions.sidebar +package org.appdevforall.codeonthego.actions.sidebar import android.content.Context import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import com.itsaky.androidide.R -import com.itsaky.androidide.fragments.sidebar.OutlineFragment -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.fragments.sidebar.OutlineFragment +import org.appdevforall.codeonthego.idetooltips.TooltipTag import kotlin.reflect.KClass class OutlineSidebarAction( diff --git a/app/src/main/java/com/itsaky/androidide/actions/sidebar/PreferencesSidebarAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/PreferencesSidebarAction.kt similarity index 85% rename from app/src/main/java/com/itsaky/androidide/actions/sidebar/PreferencesSidebarAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/PreferencesSidebarAction.kt index 69cf782a8d..3763c8c027 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/sidebar/PreferencesSidebarAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/PreferencesSidebarAction.kt @@ -15,17 +15,17 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.sidebar +package org.appdevforall.codeonthego.actions.sidebar import android.content.Context import android.content.Intent import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.activities.PreferencesActivity -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.activities.PreferencesActivity +import org.appdevforall.codeonthego.idetooltips.TooltipTag import kotlin.reflect.KClass /** diff --git a/app/src/main/java/com/itsaky/androidide/actions/sidebar/TerminalSidebarAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/TerminalSidebarAction.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/actions/sidebar/TerminalSidebarAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/TerminalSidebarAction.kt index 9f346c01cd..d1cca9359b 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/sidebar/TerminalSidebarAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/TerminalSidebarAction.kt @@ -15,19 +15,19 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.sidebar +package org.appdevforall.codeonthego.actions.sidebar import android.content.Context import android.content.Intent import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.activities.TerminalActivity -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.utils.applyMultiWindowFlags +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.activities.TerminalActivity +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.utils.applyMultiWindowFlags import com.termux.shared.termux.TermuxConstants.TERMUX_APP.TERMUX_ACTIVITY import java.util.Objects import kotlin.reflect.KClass diff --git a/app/src/main/java/com/itsaky/androidide/actions/text/RedoAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/text/RedoAction.kt similarity index 85% rename from app/src/main/java/com/itsaky/androidide/actions/text/RedoAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/text/RedoAction.kt index ed4fd5a1b7..98a4e46adf 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/text/RedoAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/text/RedoAction.kt @@ -15,18 +15,18 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.actions.text +package org.appdevforall.codeonthego.actions.text import android.app.Activity import android.content.Context import android.view.MenuItem import androidx.core.content.ContextCompat -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.EditorRelatedAction -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.EditorRelatedAction +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.idetooltips.TooltipTag import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.isSoftInputVisible +import org.appdevforall.codeonthego.utils.isSoftInputVisible /** @author Akash Yadav */ class RedoAction( diff --git a/app/src/main/java/com/itsaky/androidide/actions/text/UndoAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/text/UndoAction.kt similarity index 86% rename from app/src/main/java/com/itsaky/androidide/actions/text/UndoAction.kt rename to app/src/main/java/org/appdevforall/codeonthego/actions/text/UndoAction.kt index 9993aab707..391fcb0be3 100644 --- a/app/src/main/java/com/itsaky/androidide/actions/text/UndoAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/text/UndoAction.kt @@ -1,63 +1,63 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.actions.text - -import android.content.Context -import androidx.core.content.ContextCompat -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.EditorRelatedAction -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R - -/** @author Akash Yadav */ -class UndoAction(context: Context, override val order: Int) : EditorRelatedAction() { - - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.EDITOR_TOOLBAR_UNDO - override val id: String = ID - - companion object { - const val ID = "ide.editor.code.text.undo" - } - - init { - label = context.getString(R.string.undo) - icon = ContextCompat.getDrawable(context, R.drawable.ic_undo) - } - - override fun prepare(data: ActionData) { - super.prepare(data) - - if (!visible) { - return - } - - val editor = data.getEditor()!! - enabled = editor.canUndo() - } - - override suspend fun execAction(data: ActionData): Any { - val editor = data.getEditor() - return if (editor != null) { - editor.undo() - data.getActivity()?.invalidateOptionsMenu() - true - } else { - false - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.actions.text + +import android.content.Context +import androidx.core.content.ContextCompat +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.EditorRelatedAction +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import com.itsaky.androidide.resources.R + +/** @author Akash Yadav */ +class UndoAction(context: Context, override val order: Int) : EditorRelatedAction() { + + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.EDITOR_TOOLBAR_UNDO + override val id: String = ID + + companion object { + const val ID = "ide.editor.code.text.undo" + } + + init { + label = context.getString(R.string.undo) + icon = ContextCompat.getDrawable(context, R.drawable.ic_undo) + } + + override fun prepare(data: ActionData) { + super.prepare(data) + + if (!visible) { + return + } + + val editor = data.getEditor()!! + enabled = editor.canUndo() + } + + override suspend fun execAction(data: ActionData): Any { + val editor = data.getEditor() + return if (editor != null) { + editor.undo() + data.getActivity()?.invalidateOptionsMenu() + true + } else { + false + } + } +} diff --git a/app/src/main/java/com/itsaky/androidide/activities/AboutActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/AboutActivity.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/activities/AboutActivity.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/AboutActivity.kt index a19d59df68..38cd1b198c 100755 --- a/app/src/main/java/com/itsaky/androidide/activities/AboutActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/AboutActivity.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.activities +package org.appdevforall.codeonthego.activities import android.content.Context import android.os.Bundle @@ -28,22 +28,22 @@ import androidx.core.content.ContextCompat import androidx.core.graphics.Insets import androidx.core.view.updatePaddingRelative import com.itsaky.androidide.BuildConfig -import com.itsaky.androidide.FeedbackButtonManager +import org.appdevforall.codeonthego.FeedbackButtonManager import com.itsaky.androidide.R -import com.itsaky.androidide.adapters.SimpleIconTitleDescriptionAdapter -import com.itsaky.androidide.app.EdgeToEdgeIDEActivity -import com.itsaky.androidide.app.configuration.IDEBuildConfigProvider +import org.appdevforall.codeonthego.adapters.SimpleIconTitleDescriptionAdapter +import org.appdevforall.codeonthego.app.EdgeToEdgeIDEActivity +import org.appdevforall.codeonthego.app.configuration.IDEBuildConfigProvider import com.itsaky.androidide.buildinfo.BuildInfo import com.itsaky.androidide.databinding.ActivityAboutBinding -import com.itsaky.androidide.models.IconTitleDescriptionItem -import com.itsaky.androidide.models.SimpleIconTitleDescriptionItem -import com.itsaky.androidide.utils.BasicBuildInfo -import com.itsaky.androidide.utils.BuildInfoUtils -import com.itsaky.androidide.utils.UrlManager -import com.itsaky.androidide.utils.copyToClipboard -import com.itsaky.androidide.utils.dpToPx -import com.itsaky.androidide.utils.flashSuccess -import com.itsaky.androidide.utils.resolveAttr +import org.appdevforall.codeonthego.models.IconTitleDescriptionItem +import org.appdevforall.codeonthego.models.SimpleIconTitleDescriptionItem +import org.appdevforall.codeonthego.utils.BasicBuildInfo +import org.appdevforall.codeonthego.utils.BuildInfoUtils +import org.appdevforall.codeonthego.utils.UrlManager +import org.appdevforall.codeonthego.utils.copyToClipboard +import org.appdevforall.codeonthego.utils.dpToPx +import org.appdevforall.codeonthego.utils.flashSuccess +import org.appdevforall.codeonthego.utils.resolveAttr class AboutActivity : EdgeToEdgeIDEActivity() { @Suppress("ktlint:standard:backing-property-naming") diff --git a/app/src/main/java/com/itsaky/androidide/activities/CrashHandlerActivity.java b/app/src/main/java/org/appdevforall/codeonthego/activities/CrashHandlerActivity.java similarity index 87% rename from app/src/main/java/com/itsaky/androidide/activities/CrashHandlerActivity.java rename to app/src/main/java/org/appdevforall/codeonthego/activities/CrashHandlerActivity.java index cb288a0b78..5be98f5697 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/CrashHandlerActivity.java +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/CrashHandlerActivity.java @@ -15,20 +15,20 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.activities; +package org.appdevforall.codeonthego.activities; import android.os.Bundle; import android.view.View; import androidx.annotation.NonNull; -import com.itsaky.androidide.app.IDEActivity; +import org.appdevforall.codeonthego.app.IDEActivity; import com.itsaky.androidide.databinding.ActivityCrashHandlerBinding; -import com.itsaky.androidide.fragments.CrashReportFragment; +import org.appdevforall.codeonthego.fragments.CrashReportFragment; public class CrashHandlerActivity extends IDEActivity { - public static final String REPORT_ACTION = "com.itsaky.androidide.REPORT_CRASH"; + public static final String REPORT_ACTION = "org.appdevforall.codeonthego.REPORT_CRASH"; public static final String TRACE_KEY = "crash_trace"; private ActivityCrashHandlerBinding binding; diff --git a/app/src/main/java/com/itsaky/androidide/activities/DeepLinkActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/DeepLinkActivity.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/activities/DeepLinkActivity.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/DeepLinkActivity.kt index b5ead707b0..483e769552 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/DeepLinkActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/DeepLinkActivity.kt @@ -15,20 +15,20 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.activities +package org.appdevforall.codeonthego.activities import android.app.Activity import android.content.Intent import android.os.Bundle import android.widget.Toast -import com.itsaky.androidide.activities.editor.EditorActivityKt -import com.itsaky.androidide.analytics.DeepLinkDepth -import com.itsaky.androidide.analytics.DeepLinkMetric -import com.itsaky.androidide.analytics.DeepLinkOutcome -import com.itsaky.androidide.analytics.IAnalyticsManager -import com.itsaky.androidide.analytics.depth -import com.itsaky.androidide.api.ActionContextProvider -import com.itsaky.androidide.models.DeepLinkRequest +import org.appdevforall.codeonthego.activities.editor.EditorActivityKt +import org.appdevforall.codeonthego.analytics.DeepLinkDepth +import org.appdevforall.codeonthego.analytics.DeepLinkMetric +import org.appdevforall.codeonthego.analytics.DeepLinkOutcome +import org.appdevforall.codeonthego.analytics.IAnalyticsManager +import org.appdevforall.codeonthego.analytics.depth +import org.appdevforall.codeonthego.api.ActionContextProvider +import org.appdevforall.codeonthego.models.DeepLinkRequest import com.itsaky.androidide.resources.R.string import org.koin.android.ext.android.inject @@ -40,7 +40,7 @@ import org.koin.android.ext.android.inject * [MainActivity] if nothing is open yet, or the already-running [EditorActivityKt] (via its * `singleTask` `onNewIntent`) if one is. * - * Kept as a plain [Activity] (like [SplashActivity]), not [com.itsaky.androidide.app.BaseIDEActivity], + * Kept as a plain [Activity] (like [SplashActivity]), not [org.appdevforall.codeonthego.app.BaseIDEActivity], * since it never calls `setContentView` and has no theming needs of its own. */ class DeepLinkActivity : Activity() { diff --git a/app/src/main/java/com/itsaky/androidide/activities/ExternalFileInstallActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/ExternalFileInstallActivity.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/activities/ExternalFileInstallActivity.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/ExternalFileInstallActivity.kt index 9ff9b806cc..6a92a3377e 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/ExternalFileInstallActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/ExternalFileInstallActivity.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.activities +package org.appdevforall.codeonthego.activities import android.content.Intent import android.os.Bundle import android.view.View import androidx.compose.ui.platform.ComposeView -import com.itsaky.androidide.app.IDEActivity -import com.itsaky.androidide.viewmodels.ExternalFileInstallViewModel +import org.appdevforall.codeonthego.app.IDEActivity +import org.appdevforall.codeonthego.viewmodels.ExternalFileInstallViewModel import org.koin.androidx.viewmodel.ext.android.viewModel /** diff --git a/app/src/main/java/com/itsaky/androidide/activities/ExternalFileInstallScreen.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/ExternalFileInstallScreen.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/activities/ExternalFileInstallScreen.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/ExternalFileInstallScreen.kt index 530f115285..3e55195970 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/ExternalFileInstallScreen.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/ExternalFileInstallScreen.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.activities +package org.appdevforall.codeonthego.activities import android.app.Activity import android.content.Intent @@ -22,15 +22,15 @@ import androidx.compose.ui.text.TextRange import androidx.compose.ui.text.input.TextFieldValue import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.itsaky.androidide.R -import com.itsaky.androidide.floating.ui.FloatingTheme -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.repositories.TemplateCollectionRepository -import com.itsaky.androidide.ui.compose.longPressTooltip -import com.itsaky.androidide.ui.models.ExternalFileInstallUiEffect -import com.itsaky.androidide.ui.models.ExternalFileInstallUiEvent -import com.itsaky.androidide.utils.flashErrorAwaitShown -import com.itsaky.androidide.utils.flashSuccessAwaitShown -import com.itsaky.androidide.viewmodels.ExternalFileInstallViewModel +import org.appdevforall.codeonthego.floating.ui.FloatingTheme +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.repositories.TemplateCollectionRepository +import org.appdevforall.codeonthego.ui.compose.longPressTooltip +import org.appdevforall.codeonthego.ui.models.ExternalFileInstallUiEffect +import org.appdevforall.codeonthego.ui.models.ExternalFileInstallUiEvent +import org.appdevforall.codeonthego.utils.flashErrorAwaitShown +import org.appdevforall.codeonthego.utils.flashSuccessAwaitShown +import org.appdevforall.codeonthego.viewmodels.ExternalFileInstallViewModel import java.io.File private sealed interface DialogUiState { diff --git a/app/src/main/java/com/itsaky/androidide/activities/MainActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/MainActivity.kt similarity index 89% rename from app/src/main/java/com/itsaky/androidide/activities/MainActivity.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/MainActivity.kt index 04220129e7..f3fec5883b 100755 --- a/app/src/main/java/com/itsaky/androidide/activities/MainActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/MainActivity.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.activities +package org.appdevforall.codeonthego.activities import android.content.Intent import android.content.res.Configuration @@ -33,58 +33,58 @@ import androidx.lifecycle.lifecycleScope import androidx.transition.TransitionManager import androidx.transition.doOnEnd import com.google.android.material.transition.MaterialSharedAxis -import com.itsaky.androidide.FeedbackButtonManager +import org.appdevforall.codeonthego.FeedbackButtonManager import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.activities.editor.EditorActivityKt -import com.itsaky.androidide.analytics.DeepLinkMetric -import com.itsaky.androidide.analytics.DeepLinkOutcome -import com.itsaky.androidide.analytics.IAnalyticsManager -import com.itsaky.androidide.analytics.depth -import com.itsaky.androidide.app.EdgeToEdgeIDEActivity +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.activities.editor.EditorActivityKt +import org.appdevforall.codeonthego.analytics.DeepLinkMetric +import org.appdevforall.codeonthego.analytics.DeepLinkOutcome +import org.appdevforall.codeonthego.analytics.IAnalyticsManager +import org.appdevforall.codeonthego.analytics.depth +import org.appdevforall.codeonthego.app.EdgeToEdgeIDEActivity import com.itsaky.androidide.databinding.ActivityMainBinding -import com.itsaky.androidide.deeplink.ConsumedRequests -import com.itsaky.androidide.fragments.MainFragment -import com.itsaky.androidide.fragments.RecentProjectsFragment -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag.PROJECT_RECENT_TOP -import com.itsaky.androidide.idetooltips.TooltipTag.SETUP_OVERVIEW -import com.itsaky.androidide.localWebServer.ServerConfig -import com.itsaky.androidide.localWebServer.WebServer -import com.itsaky.androidide.models.DeepLinkRequest -import com.itsaky.androidide.models.EditorIntentExtras -import com.itsaky.androidide.models.PendingFileRequest -import com.itsaky.androidide.preferences.internal.GeneralPreferences -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.repositories.RecentProjectRepository +import org.appdevforall.codeonthego.deeplink.ConsumedRequests +import org.appdevforall.codeonthego.fragments.MainFragment +import org.appdevforall.codeonthego.fragments.RecentProjectsFragment +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PROJECT_RECENT_TOP +import org.appdevforall.codeonthego.idetooltips.TooltipTag.SETUP_OVERVIEW +import org.appdevforall.codeonthego.localWebServer.ServerConfig +import org.appdevforall.codeonthego.localWebServer.WebServer +import org.appdevforall.codeonthego.models.DeepLinkRequest +import org.appdevforall.codeonthego.models.EditorIntentExtras +import org.appdevforall.codeonthego.models.PendingFileRequest +import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.repositories.RecentProjectRepository import com.itsaky.androidide.resources.R.string -import com.itsaky.androidide.roomData.recentproject.RecentProject -import com.itsaky.androidide.shortcuts.IdeShortcutActions -import com.itsaky.androidide.shortcuts.ShortcutContext -import com.itsaky.androidide.shortcuts.ShortcutExecutionContext -import com.itsaky.androidide.shortcuts.ShortcutManager -import com.itsaky.androidide.templates.ITemplateProvider -import com.itsaky.androidide.utils.DeepLinkProjectLookup -import com.itsaky.androidide.utils.DialogUtils -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.FeatureFlags -import com.itsaky.androidide.utils.MainScreenActions -import com.itsaky.androidide.utils.UrlManager -import com.itsaky.androidide.utils.applyBottomWindowInsetsPadding -import com.itsaky.androidide.utils.findValidProjects -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashInfo -import com.itsaky.androidide.utils.hasVisibleDialog -import com.itsaky.androidide.utils.recordProjectOpenedBookkeeping -import com.itsaky.androidide.utils.resolveDeepLinkProject -import com.itsaky.androidide.viewmodel.MainViewModel -import com.itsaky.androidide.viewmodel.MainViewModel.Companion.SCREEN_CLONE_REPO -import com.itsaky.androidide.viewmodel.MainViewModel.Companion.SCREEN_DELETE_PROJECTS -import com.itsaky.androidide.viewmodel.MainViewModel.Companion.SCREEN_MAIN -import com.itsaky.androidide.viewmodel.MainViewModel.Companion.SCREEN_SAVED_PROJECTS -import com.itsaky.androidide.viewmodel.MainViewModel.Companion.SCREEN_TEMPLATE_DETAILS -import com.itsaky.androidide.viewmodel.MainViewModel.Companion.SCREEN_TEMPLATE_LIST -import com.itsaky.androidide.viewmodel.MainViewModel.Companion.TOOLTIPS_WEB_VIEW +import org.appdevforall.codeonthego.roomData.recentproject.RecentProject +import org.appdevforall.codeonthego.shortcuts.IdeShortcutActions +import org.appdevforall.codeonthego.shortcuts.ShortcutContext +import org.appdevforall.codeonthego.shortcuts.ShortcutExecutionContext +import org.appdevforall.codeonthego.shortcuts.ShortcutManager +import org.appdevforall.codeonthego.templates.ITemplateProvider +import org.appdevforall.codeonthego.utils.DeepLinkProjectLookup +import org.appdevforall.codeonthego.utils.DialogUtils +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.FeatureFlags +import org.appdevforall.codeonthego.utils.MainScreenActions +import org.appdevforall.codeonthego.utils.UrlManager +import org.appdevforall.codeonthego.utils.applyBottomWindowInsetsPadding +import org.appdevforall.codeonthego.utils.findValidProjects +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashInfo +import org.appdevforall.codeonthego.utils.hasVisibleDialog +import org.appdevforall.codeonthego.utils.recordProjectOpenedBookkeeping +import org.appdevforall.codeonthego.utils.resolveDeepLinkProject +import org.appdevforall.codeonthego.viewmodel.MainViewModel +import org.appdevforall.codeonthego.viewmodel.MainViewModel.Companion.SCREEN_CLONE_REPO +import org.appdevforall.codeonthego.viewmodel.MainViewModel.Companion.SCREEN_DELETE_PROJECTS +import org.appdevforall.codeonthego.viewmodel.MainViewModel.Companion.SCREEN_MAIN +import org.appdevforall.codeonthego.viewmodel.MainViewModel.Companion.SCREEN_SAVED_PROJECTS +import org.appdevforall.codeonthego.viewmodel.MainViewModel.Companion.SCREEN_TEMPLATE_DETAILS +import org.appdevforall.codeonthego.viewmodel.MainViewModel.Companion.SCREEN_TEMPLATE_LIST +import org.appdevforall.codeonthego.viewmodel.MainViewModel.Companion.TOOLTIPS_WEB_VIEW import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext diff --git a/app/src/main/java/com/itsaky/androidide/activities/OnboardingActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/OnboardingActivity.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/activities/OnboardingActivity.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/OnboardingActivity.kt index 104ff5a066..5a99e4536d 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/OnboardingActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/OnboardingActivity.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.activities +package org.appdevforall.codeonthego.activities import android.content.Intent import android.os.Bundle @@ -34,24 +34,24 @@ import androidx.lifecycle.lifecycleScope import com.github.appintro.AppIntro2 import com.github.appintro.AppIntroPageTransformerType import com.google.android.material.floatingactionbutton.FloatingActionButton -import com.itsaky.androidide.FeedbackButtonManager +import org.appdevforall.codeonthego.FeedbackButtonManager import com.itsaky.androidide.R import com.itsaky.androidide.R.string -import com.itsaky.androidide.app.configuration.IDEBuildConfigProvider -import com.itsaky.androidide.app.configuration.IJdkDistributionProvider -import com.itsaky.androidide.fragments.onboarding.GreetingFragment -import com.itsaky.androidide.fragments.onboarding.OnboardingInfoFragment -import com.itsaky.androidide.fragments.onboarding.PermissionsFragment -import com.itsaky.androidide.models.JdkDistribution -import com.itsaky.androidide.preferences.internal.prefManager -import com.itsaky.androidide.tasks.doAsyncWithProgress -import com.itsaky.androidide.ui.themes.IThemeManager -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.PermissionsHelper -import com.itsaky.androidide.utils.isAtLeastV -import com.itsaky.androidide.utils.isSystemInDarkMode -import com.itsaky.androidide.utils.isTestMode -import com.itsaky.androidide.utils.resolveAttr +import org.appdevforall.codeonthego.app.configuration.IDEBuildConfigProvider +import org.appdevforall.codeonthego.app.configuration.IJdkDistributionProvider +import org.appdevforall.codeonthego.fragments.onboarding.GreetingFragment +import org.appdevforall.codeonthego.fragments.onboarding.OnboardingInfoFragment +import org.appdevforall.codeonthego.fragments.onboarding.PermissionsFragment +import org.appdevforall.codeonthego.models.JdkDistribution +import org.appdevforall.codeonthego.preferences.internal.prefManager +import org.appdevforall.codeonthego.tasks.doAsyncWithProgress +import org.appdevforall.codeonthego.ui.themes.IThemeManager +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.PermissionsHelper +import org.appdevforall.codeonthego.utils.isAtLeastV +import org.appdevforall.codeonthego.utils.isSystemInDarkMode +import org.appdevforall.codeonthego.utils.isTestMode +import org.appdevforall.codeonthego.utils.resolveAttr import com.termux.shared.android.PackageUtils import com.termux.shared.markdown.MarkdownUtils import com.termux.shared.termux.TermuxConstants diff --git a/app/src/main/java/com/itsaky/androidide/activities/PluginManagerActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/PluginManagerActivity.kt similarity index 88% rename from app/src/main/java/com/itsaky/androidide/activities/PluginManagerActivity.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/PluginManagerActivity.kt index 9dcc09bbbe..39b1d19b55 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/PluginManagerActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/PluginManagerActivity.kt @@ -1,19 +1,19 @@ -package com.itsaky.androidide.activities +package org.appdevforall.codeonthego.activities import android.content.Intent import android.os.Bundle import android.view.View import androidx.core.graphics.Insets -import com.itsaky.androidide.FeedbackButtonManager +import org.appdevforall.codeonthego.FeedbackButtonManager import com.itsaky.androidide.R -import com.itsaky.androidide.app.EdgeToEdgeIDEActivity +import org.appdevforall.codeonthego.app.EdgeToEdgeIDEActivity import com.itsaky.androidide.databinding.ActivityPluginManagerBinding -import com.itsaky.androidide.ui.compose.ManagerScreen -import com.itsaky.androidide.ui.compose.theme.ManagerTheme -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.viewmodels.ExternalFileInstallViewModel -import com.itsaky.androidide.viewmodels.PluginManagerViewModel -import com.itsaky.androidide.viewmodels.TemplateManagerViewModel +import org.appdevforall.codeonthego.ui.compose.ManagerScreen +import org.appdevforall.codeonthego.ui.compose.theme.ManagerTheme +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.viewmodels.ExternalFileInstallViewModel +import org.appdevforall.codeonthego.viewmodels.PluginManagerViewModel +import org.appdevforall.codeonthego.viewmodels.TemplateManagerViewModel import org.koin.androidx.viewmodel.ext.android.viewModel class PluginManagerActivity : EdgeToEdgeIDEActivity() { diff --git a/app/src/main/java/com/itsaky/androidide/activities/PluginScreenActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/PluginScreenActivity.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/activities/PluginScreenActivity.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/PluginScreenActivity.kt index 925da53c76..790a683a68 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/PluginScreenActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/PluginScreenActivity.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.activities +package org.appdevforall.codeonthego.activities import android.content.Context import android.content.Intent @@ -7,10 +7,10 @@ import android.util.Log import android.view.View import android.widget.FrameLayout import com.itsaky.androidide.R -import com.itsaky.androidide.app.IDEActivity -import com.itsaky.androidide.app.IDEApplication -import com.itsaky.androidide.plugins.manager.fragment.PluginFragmentFactory -import com.itsaky.androidide.plugins.services.IdeUIService +import org.appdevforall.codeonthego.app.IDEActivity +import org.appdevforall.codeonthego.app.IDEApplication +import org.appdevforall.codeonthego.plugins.manager.fragment.PluginFragmentFactory +import org.appdevforall.codeonthego.plugins.services.IdeUIService class PluginScreenActivity : IDEActivity() { private var pluginId: String? = null diff --git a/app/src/main/java/com/itsaky/androidide/activities/PluginScreenNavigator.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/PluginScreenNavigator.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/activities/PluginScreenNavigator.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/PluginScreenNavigator.kt index 75494781c6..4fac34f20f 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/PluginScreenNavigator.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/PluginScreenNavigator.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.activities +package org.appdevforall.codeonthego.activities import android.content.Context import org.slf4j.LoggerFactory diff --git a/app/src/main/java/com/itsaky/androidide/activities/PreferencesActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/PreferencesActivity.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/activities/PreferencesActivity.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/PreferencesActivity.kt index f1fa5a5b14..e68ee17fe5 100755 --- a/app/src/main/java/com/itsaky/androidide/activities/PreferencesActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/PreferencesActivity.kt @@ -14,25 +14,25 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.activities +package org.appdevforall.codeonthego.activities import android.os.Bundle import android.view.View import androidx.core.graphics.Insets import androidx.core.os.BundleCompat import androidx.fragment.app.Fragment -import com.itsaky.androidide.FeedbackButtonManager +import org.appdevforall.codeonthego.FeedbackButtonManager import com.itsaky.androidide.R -import com.itsaky.androidide.app.EdgeToEdgeIDEActivity +import org.appdevforall.codeonthego.app.EdgeToEdgeIDEActivity import com.itsaky.androidide.databinding.ActivityPreferencesBinding -import com.itsaky.androidide.fragments.IDEPreferencesFragment -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.preferences.PluginSettingsEntryPreference -import com.itsaky.androidide.preferences.addRootPreferences -import com.itsaky.androidide.preferences.pluginSettingsPreferences -import com.itsaky.androidide.utils.onLongPress -import com.itsaky.androidide.utils.showIdeCategoryTooltipIfPresent -import com.itsaky.androidide.preferences.IDEPreferences as prefs +import org.appdevforall.codeonthego.fragments.IDEPreferencesFragment +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.preferences.PluginSettingsEntryPreference +import org.appdevforall.codeonthego.preferences.addRootPreferences +import org.appdevforall.codeonthego.preferences.pluginSettingsPreferences +import org.appdevforall.codeonthego.utils.onLongPress +import org.appdevforall.codeonthego.utils.showIdeCategoryTooltipIfPresent +import org.appdevforall.codeonthego.preferences.IDEPreferences as prefs class PreferencesActivity : EdgeToEdgeIDEActivity() { @Suppress("ktlint:standard:backing-property-naming") diff --git a/app/src/main/java/com/itsaky/androidide/activities/SetupState.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/SetupState.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/activities/SetupState.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/SetupState.kt index ae26481dab..9f9dd9662c 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/SetupState.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/SetupState.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.activities +package org.appdevforall.codeonthego.activities import android.content.Context import androidx.annotation.VisibleForTesting -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.FileUtil -import com.itsaky.androidide.utils.PermissionsHelper +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.FileUtil +import org.appdevforall.codeonthego.utils.PermissionsHelper import java.io.File /** diff --git a/app/src/main/java/com/itsaky/androidide/activities/SplashActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/SplashActivity.kt similarity index 79% rename from app/src/main/java/com/itsaky/androidide/activities/SplashActivity.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/SplashActivity.kt index d5d8dc48ad..aff63d59ed 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/SplashActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/SplashActivity.kt @@ -15,17 +15,17 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.activities +package org.appdevforall.codeonthego.activities import android.app.Activity import android.content.Intent import android.os.Build import android.os.Bundle -import com.itsaky.androidide.app.configuration.CpuArch -import com.itsaky.androidide.app.configuration.IDEBuildConfigProvider -import com.itsaky.androidide.ui.showLowStorageDialog -import com.itsaky.androidide.utils.FeatureFlags -import com.itsaky.androidide.utils.hasEnoughStorageAvailable +import org.appdevforall.codeonthego.app.configuration.CpuArch +import org.appdevforall.codeonthego.app.configuration.IDEBuildConfigProvider +import org.appdevforall.codeonthego.ui.showLowStorageDialog +import org.appdevforall.codeonthego.utils.FeatureFlags +import org.appdevforall.codeonthego.utils.hasEnoughStorageAvailable import kotlin.system.exitProcess /** diff --git a/app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/BaseEditorActivity.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/editor/BaseEditorActivity.kt index a9a33c1e87..67e056960a 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/BaseEditorActivity.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.activities.editor +package org.appdevforall.codeonthego.activities.editor import android.content.ComponentName import android.content.Intent @@ -72,96 +72,96 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_COLLAPS import com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_HIDDEN import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayout.Tab -import com.itsaky.androidide.FeedbackButtonManager +import org.appdevforall.codeonthego.FeedbackButtonManager import com.itsaky.androidide.R import com.itsaky.androidide.R.string -import com.itsaky.androidide.actions.build.DebugAction -import com.itsaky.androidide.activities.MainActivity -import com.itsaky.androidide.activities.projectsRoot -import com.itsaky.androidide.adapters.DiagnosticsAdapter -import com.itsaky.androidide.adapters.SearchListAdapter -import com.itsaky.androidide.api.BuildOutputProvider -import com.itsaky.androidide.api.LogsProvider -import com.itsaky.androidide.app.EdgeToEdgeIDEActivity -import com.itsaky.androidide.app.IDEApplication +import org.appdevforall.codeonthego.actions.build.DebugAction +import org.appdevforall.codeonthego.activities.MainActivity +import org.appdevforall.codeonthego.activities.projectsRoot +import org.appdevforall.codeonthego.adapters.DiagnosticsAdapter +import org.appdevforall.codeonthego.adapters.SearchListAdapter +import org.appdevforall.codeonthego.api.BuildOutputProvider +import org.appdevforall.codeonthego.api.LogsProvider +import org.appdevforall.codeonthego.app.EdgeToEdgeIDEActivity +import org.appdevforall.codeonthego.app.IDEApplication import com.itsaky.androidide.databinding.ActivityEditorBinding import com.itsaky.androidide.databinding.ContentEditorBinding import com.itsaky.androidide.databinding.LayoutDiagnosticInfoBinding -import com.itsaky.androidide.deeplink.ConsumedRequests -import com.itsaky.androidide.events.InstallationEvent -import com.itsaky.androidide.fragments.debug.DebuggerFragment -import com.itsaky.androidide.fragments.output.ShareableOutputFragment -import com.itsaky.androidide.fragments.sidebar.FileTreeFragment -import com.itsaky.androidide.handlers.EditorActivityLifecyclerObserver -import com.itsaky.androidide.handlers.LspHandler.registerLanguageServers -import com.itsaky.androidide.handlers.SnippetHandler.loadPluginSnippets -import com.itsaky.androidide.handlers.SnippetHandler.loadUserSnippets -import com.itsaky.androidide.handlers.SnippetHandler.refreshPluginSnippets -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.interfaces.DiagnosticClickListener -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.models.DiagnosticItem -import com.itsaky.androidide.models.DeepLinkRequest -import com.itsaky.androidide.models.DiagnosticGroup -import com.itsaky.androidide.models.EditorIntentExtras -import com.itsaky.androidide.models.OpenedFile -import com.itsaky.androidide.models.PendingFileRequest -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.models.SearchResult -import com.itsaky.androidide.plugins.extensions.FileTabMenuItem -import com.itsaky.androidide.plugins.manager.ui.PluginEditorTabManager -import com.itsaky.androidide.preferences.internal.BuildPreferences -import com.itsaky.androidide.preferences.internal.GeneralPreferences -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.services.debug.DebuggerService -import com.itsaky.androidide.tasks.cancelIfActive -import com.itsaky.androidide.tasks.mainThreadHandler -import com.itsaky.androidide.ui.CodeEditorView -import com.itsaky.androidide.ui.ContentTranslatingDrawerLayout -import com.itsaky.androidide.ui.MetricsCarouselController -import com.itsaky.androidide.ui.SwipeRevealLayout -import com.itsaky.androidide.uidesigner.UIDesignerActivity -import com.itsaky.androidide.utils.ActionMenuUtils.showPopupWindow -import com.itsaky.androidide.utils.DialogUtils.newMaterialDialogBuilder -import com.itsaky.androidide.utils.FileUtils -import com.itsaky.androidide.utils.FlashType -import com.itsaky.androidide.utils.InstallationResultHandler.onResult -import com.itsaky.androidide.utils.IntentUtils -import com.itsaky.androidide.utils.MemoryUsageWatcher -import com.itsaky.androidide.utils.MetricsAnnotationStore -import com.itsaky.androidide.utils.MetricsCsv -import com.itsaky.androidide.utils.MetricsCsvFile -import com.itsaky.androidide.utils.MetricsSnapshotAssembler -import com.itsaky.androidide.utils.StringsInjectionException -import com.itsaky.androidide.utils.StringsXmlInjector -import com.itsaky.androidide.utils.applyBottomSheetAnchorForOrientation -import com.itsaky.androidide.utils.applyImmersiveModeInsets -import com.itsaky.androidide.utils.applyResponsiveAppBarInsets -import com.itsaky.androidide.utils.applyRootSystemInsetsAsPadding -import com.itsaky.androidide.utils.dpToPx -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashMessage -import com.itsaky.androidide.utils.getOrStoreInitialPadding -import com.itsaky.androidide.utils.isAtLeastR -import com.itsaky.androidide.utils.isDeepLinkTargetOfOpenProject -import com.itsaky.androidide.viewmodel.ApkInstallationViewModel -import com.itsaky.androidide.viewmodel.AppLogsCoordinator -import com.itsaky.androidide.viewmodel.AppLogsViewModel -import com.itsaky.androidide.viewmodel.BottomSheetViewModel -import com.itsaky.androidide.viewmodel.DebuggerConnectionState -import com.itsaky.androidide.viewmodel.DebuggerViewModel -import com.itsaky.androidide.viewmodel.EditorViewModel -import com.itsaky.androidide.viewmodel.FileManagerViewModel -import com.itsaky.androidide.viewmodel.FileOpResult -import com.itsaky.androidide.viewmodel.IDELogsViewModel -import com.itsaky.androidide.viewmodel.MetricsViewModel -import com.itsaky.androidide.viewmodel.RecentProjectsViewModel -import com.itsaky.androidide.viewmodel.WADBConnectionViewModel -import com.itsaky.androidide.xml.resources.ResourceTableRegistry -import com.itsaky.androidide.xml.versions.ApiVersionsRegistry -import com.itsaky.androidide.xml.widgets.WidgetTableRegistry +import org.appdevforall.codeonthego.deeplink.ConsumedRequests +import org.appdevforall.codeonthego.events.InstallationEvent +import org.appdevforall.codeonthego.fragments.debug.DebuggerFragment +import org.appdevforall.codeonthego.fragments.output.ShareableOutputFragment +import org.appdevforall.codeonthego.fragments.sidebar.FileTreeFragment +import org.appdevforall.codeonthego.handlers.EditorActivityLifecyclerObserver +import org.appdevforall.codeonthego.handlers.LspHandler.registerLanguageServers +import org.appdevforall.codeonthego.handlers.SnippetHandler.loadPluginSnippets +import org.appdevforall.codeonthego.handlers.SnippetHandler.loadUserSnippets +import org.appdevforall.codeonthego.handlers.SnippetHandler.refreshPluginSnippets +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.interfaces.DiagnosticClickListener +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem +import org.appdevforall.codeonthego.models.DeepLinkRequest +import org.appdevforall.codeonthego.models.DiagnosticGroup +import org.appdevforall.codeonthego.models.EditorIntentExtras +import org.appdevforall.codeonthego.models.OpenedFile +import org.appdevforall.codeonthego.models.PendingFileRequest +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.models.SearchResult +import org.appdevforall.codeonthego.plugins.extensions.FileTabMenuItem +import org.appdevforall.codeonthego.plugins.manager.ui.PluginEditorTabManager +import org.appdevforall.codeonthego.preferences.internal.BuildPreferences +import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.services.debug.DebuggerService +import org.appdevforall.codeonthego.tasks.cancelIfActive +import org.appdevforall.codeonthego.tasks.mainThreadHandler +import org.appdevforall.codeonthego.ui.CodeEditorView +import org.appdevforall.codeonthego.ui.ContentTranslatingDrawerLayout +import org.appdevforall.codeonthego.ui.MetricsCarouselController +import org.appdevforall.codeonthego.ui.SwipeRevealLayout +import org.appdevforall.codeonthego.uidesigner.UIDesignerActivity +import org.appdevforall.codeonthego.utils.ActionMenuUtils.showPopupWindow +import org.appdevforall.codeonthego.utils.DialogUtils.newMaterialDialogBuilder +import org.appdevforall.codeonthego.utils.FileUtils +import org.appdevforall.codeonthego.utils.FlashType +import org.appdevforall.codeonthego.utils.InstallationResultHandler.onResult +import org.appdevforall.codeonthego.utils.IntentUtils +import org.appdevforall.codeonthego.utils.MemoryUsageWatcher +import org.appdevforall.codeonthego.utils.MetricsAnnotationStore +import org.appdevforall.codeonthego.utils.MetricsCsv +import org.appdevforall.codeonthego.utils.MetricsCsvFile +import org.appdevforall.codeonthego.utils.MetricsSnapshotAssembler +import org.appdevforall.codeonthego.utils.StringsInjectionException +import org.appdevforall.codeonthego.utils.StringsXmlInjector +import org.appdevforall.codeonthego.utils.applyBottomSheetAnchorForOrientation +import org.appdevforall.codeonthego.utils.applyImmersiveModeInsets +import org.appdevforall.codeonthego.utils.applyResponsiveAppBarInsets +import org.appdevforall.codeonthego.utils.applyRootSystemInsetsAsPadding +import org.appdevforall.codeonthego.utils.dpToPx +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashMessage +import org.appdevforall.codeonthego.utils.getOrStoreInitialPadding +import org.appdevforall.codeonthego.utils.isAtLeastR +import org.appdevforall.codeonthego.utils.isDeepLinkTargetOfOpenProject +import org.appdevforall.codeonthego.viewmodel.ApkInstallationViewModel +import org.appdevforall.codeonthego.viewmodel.AppLogsCoordinator +import org.appdevforall.codeonthego.viewmodel.AppLogsViewModel +import org.appdevforall.codeonthego.viewmodel.BottomSheetViewModel +import org.appdevforall.codeonthego.viewmodel.DebuggerConnectionState +import org.appdevforall.codeonthego.viewmodel.DebuggerViewModel +import org.appdevforall.codeonthego.viewmodel.EditorViewModel +import org.appdevforall.codeonthego.viewmodel.FileManagerViewModel +import org.appdevforall.codeonthego.viewmodel.FileOpResult +import org.appdevforall.codeonthego.viewmodel.IDELogsViewModel +import org.appdevforall.codeonthego.viewmodel.MetricsViewModel +import org.appdevforall.codeonthego.viewmodel.RecentProjectsViewModel +import org.appdevforall.codeonthego.viewmodel.WADBConnectionViewModel +import org.appdevforall.codeonthego.xml.resources.ResourceTableRegistry +import org.appdevforall.codeonthego.xml.versions.ApiVersionsRegistry +import org.appdevforall.codeonthego.xml.widgets.WidgetTableRegistry import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.collectLatest diff --git a/app/src/main/java/com/itsaky/androidide/activities/editor/EditorActivityKt.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/EditorActivityKt.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/activities/editor/EditorActivityKt.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/editor/EditorActivityKt.kt index 9e2845b589..bc3a0497d0 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/editor/EditorActivityKt.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/EditorActivityKt.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.activities.editor +package org.appdevforall.codeonthego.activities.editor /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/EditorHandlerActivity.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/editor/EditorHandlerActivity.kt index f4f2f92e9b..5d2717d499 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/EditorHandlerActivity.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.activities.editor +package org.appdevforall.codeonthego.activities.editor import android.app.Dialog import android.content.ClipData @@ -46,98 +46,98 @@ import com.google.gson.Gson import com.google.gson.JsonSyntaxException import com.itsaky.androidide.R import com.itsaky.androidide.R.string -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.ActionItem.Location.EDITOR_TOOLBAR -import com.itsaky.androidide.actions.ActionsRegistry.Companion.getInstance -import com.itsaky.androidide.actions.build.QuickBuildAction -import com.itsaky.androidide.actions.build.QuickRunAction -import com.itsaky.androidide.actions.internal.DefaultActionsRegistry -import com.itsaky.androidide.activities.PluginManagerActivity -import com.itsaky.androidide.activities.projectsRoot -import com.itsaky.androidide.analytics.DeepLinkMetric -import com.itsaky.androidide.analytics.DeepLinkOutcome -import com.itsaky.androidide.analytics.IAnalyticsManager -import com.itsaky.androidide.analytics.depth -import com.itsaky.androidide.api.ActionContextProvider -import com.itsaky.androidide.app.BaseApplication -import com.itsaky.androidide.app.EditorEvents -import com.itsaky.androidide.app.EditorProviderImpl -import com.itsaky.androidide.app.IDEApplication +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionItem.Location.EDITOR_TOOLBAR +import org.appdevforall.codeonthego.actions.ActionsRegistry.Companion.getInstance +import org.appdevforall.codeonthego.actions.build.QuickBuildAction +import org.appdevforall.codeonthego.actions.build.QuickRunAction +import org.appdevforall.codeonthego.actions.internal.DefaultActionsRegistry +import org.appdevforall.codeonthego.activities.PluginManagerActivity +import org.appdevforall.codeonthego.activities.projectsRoot +import org.appdevforall.codeonthego.analytics.DeepLinkMetric +import org.appdevforall.codeonthego.analytics.DeepLinkOutcome +import org.appdevforall.codeonthego.analytics.IAnalyticsManager +import org.appdevforall.codeonthego.analytics.depth +import org.appdevforall.codeonthego.api.ActionContextProvider +import org.appdevforall.codeonthego.app.BaseApplication +import org.appdevforall.codeonthego.app.EditorEvents +import org.appdevforall.codeonthego.app.EditorProviderImpl +import org.appdevforall.codeonthego.app.IDEApplication import com.itsaky.androidide.databinding.FileActionPopupWindowBinding import com.itsaky.androidide.databinding.FileActionPopupWindowItemBinding -import com.itsaky.androidide.deeplink.PendingDeepLinkOpen -import com.itsaky.androidide.di.APPLICATION_SCOPE -import com.itsaky.androidide.editor.floating.MetricsCarouselDockableContent -import com.itsaky.androidide.editor.language.treesitter.JavaLanguage -import com.itsaky.androidide.editor.language.treesitter.JsonLanguage -import com.itsaky.androidide.editor.language.treesitter.KotlinLanguage -import com.itsaky.androidide.editor.language.treesitter.LogLanguage -import com.itsaky.androidide.editor.language.treesitter.TSLanguageRegistry -import com.itsaky.androidide.editor.language.treesitter.XMLLanguage -import com.itsaky.androidide.editor.schemes.IDEColorSchemeProvider -import com.itsaky.androidide.editor.ui.IDEEditor -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent -import com.itsaky.androidide.eventbus.events.file.FileRenameEvent -import com.itsaky.androidide.eventbus.events.plugin.PluginCrashedEvent -import com.itsaky.androidide.eventbus.events.preferences.PreferenceChangeEvent -import com.itsaky.androidide.events.PluginLanguagesChangedEvent -import com.itsaky.androidide.floating.model.DockingManager -import com.itsaky.androidide.floating.window.OverlayDialogs -import com.itsaky.androidide.fragments.sidebar.EditorSidebarFragment -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.interfaces.IEditorHandler -import com.itsaky.androidide.lsp.PluginLanguageSupport -import com.itsaky.androidide.models.DeepLinkOpenRequest -import com.itsaky.androidide.models.DeepLinkRequest -import com.itsaky.androidide.models.EditorIntentExtras -import com.itsaky.androidide.models.FileExtension -import com.itsaky.androidide.models.OpenedFile -import com.itsaky.androidide.models.OpenedFilesCache -import com.itsaky.androidide.models.PendingFileRequest -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.models.SaveResult -import com.itsaky.androidide.plugins.manager.build.PluginBuildActionManager -import com.itsaky.androidide.plugins.manager.fragment.PluginFragmentFactory -import com.itsaky.androidide.plugins.manager.ui.PluginDrawableResolver -import com.itsaky.androidide.plugins.manager.ui.PluginEditorTabManager -import com.itsaky.androidide.plugins.manager.ui.PluginToolbarHost -import com.itsaky.androidide.plugins.manager.ui.PluginUiActionManager -import com.itsaky.androidide.preferences.internal.EditorPreferences -import com.itsaky.androidide.preferences.internal.GeneralPreferences -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.projects.builder.BuildResult -import com.itsaky.androidide.quickbuild.GenerateSourcesDeferral -import com.itsaky.androidide.repositories.RecentProjectRepository -import com.itsaky.androidide.shortcuts.IdeShortcutActions -import com.itsaky.androidide.shortcuts.ShortcutContext -import com.itsaky.androidide.shortcuts.ShortcutExecutionContext -import com.itsaky.androidide.shortcuts.ShortcutManager -import com.itsaky.androidide.tasks.executeAsync -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult -import com.itsaky.androidide.ui.ARCHIVE_EXTENSIONS -import com.itsaky.androidide.ui.CodeEditorView -import com.itsaky.androidide.utils.DeepLinkProjectLookup -import com.itsaky.androidide.utils.DialogUtils.newMaterialDialogBuilder -import com.itsaky.androidide.utils.DialogUtils.showConfirmationDialog -import com.itsaky.androidide.utils.EditorActivityActions -import com.itsaky.androidide.utils.EditorSidebarActions -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.ImageUtils -import com.itsaky.androidide.utils.IntentUtils.openImage -import com.itsaky.androidide.utils.UniqueNameBuilder -import com.itsaky.androidide.utils.capHeightToSpaceBelow -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashSuccess -import com.itsaky.androidide.utils.forEachViewRecursively -import com.itsaky.androidide.utils.hasVisibleDialog -import com.itsaky.androidide.utils.isDeepLinkTargetOfOpenProject -import com.itsaky.androidide.utils.recordProjectOpenedBookkeeping -import com.itsaky.androidide.utils.resolveDeepLinkProject -import com.itsaky.androidide.utils.resolveWithinDirectory +import org.appdevforall.codeonthego.deeplink.PendingDeepLinkOpen +import org.appdevforall.codeonthego.di.APPLICATION_SCOPE +import org.appdevforall.codeonthego.editor.floating.MetricsCarouselDockableContent +import org.appdevforall.codeonthego.editor.language.treesitter.JavaLanguage +import org.appdevforall.codeonthego.editor.language.treesitter.JsonLanguage +import org.appdevforall.codeonthego.editor.language.treesitter.KotlinLanguage +import org.appdevforall.codeonthego.editor.language.treesitter.LogLanguage +import org.appdevforall.codeonthego.editor.language.treesitter.TSLanguageRegistry +import org.appdevforall.codeonthego.editor.language.treesitter.XMLLanguage +import org.appdevforall.codeonthego.editor.schemes.IDEColorSchemeProvider +import org.appdevforall.codeonthego.editor.ui.IDEEditor +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileRenameEvent +import org.appdevforall.codeonthego.eventbus.events.plugin.PluginCrashedEvent +import org.appdevforall.codeonthego.eventbus.events.preferences.PreferenceChangeEvent +import org.appdevforall.codeonthego.events.PluginLanguagesChangedEvent +import org.appdevforall.codeonthego.floating.model.DockingManager +import org.appdevforall.codeonthego.floating.window.OverlayDialogs +import org.appdevforall.codeonthego.fragments.sidebar.EditorSidebarFragment +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.interfaces.IEditorHandler +import org.appdevforall.codeonthego.lsp.PluginLanguageSupport +import org.appdevforall.codeonthego.models.DeepLinkOpenRequest +import org.appdevforall.codeonthego.models.DeepLinkRequest +import org.appdevforall.codeonthego.models.EditorIntentExtras +import org.appdevforall.codeonthego.models.FileExtension +import org.appdevforall.codeonthego.models.OpenedFile +import org.appdevforall.codeonthego.models.OpenedFilesCache +import org.appdevforall.codeonthego.models.PendingFileRequest +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.models.SaveResult +import org.appdevforall.codeonthego.plugins.manager.build.PluginBuildActionManager +import org.appdevforall.codeonthego.plugins.manager.fragment.PluginFragmentFactory +import org.appdevforall.codeonthego.plugins.manager.ui.PluginDrawableResolver +import org.appdevforall.codeonthego.plugins.manager.ui.PluginEditorTabManager +import org.appdevforall.codeonthego.plugins.manager.ui.PluginToolbarHost +import org.appdevforall.codeonthego.plugins.manager.ui.PluginUiActionManager +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.projects.builder.BuildResult +import org.appdevforall.codeonthego.quickbuild.GenerateSourcesDeferral +import org.appdevforall.codeonthego.repositories.RecentProjectRepository +import org.appdevforall.codeonthego.shortcuts.IdeShortcutActions +import org.appdevforall.codeonthego.shortcuts.ShortcutContext +import org.appdevforall.codeonthego.shortcuts.ShortcutExecutionContext +import org.appdevforall.codeonthego.shortcuts.ShortcutManager +import org.appdevforall.codeonthego.tasks.executeAsync +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult +import org.appdevforall.codeonthego.ui.ARCHIVE_EXTENSIONS +import org.appdevforall.codeonthego.ui.CodeEditorView +import org.appdevforall.codeonthego.utils.DeepLinkProjectLookup +import org.appdevforall.codeonthego.utils.DialogUtils.newMaterialDialogBuilder +import org.appdevforall.codeonthego.utils.DialogUtils.showConfirmationDialog +import org.appdevforall.codeonthego.utils.EditorActivityActions +import org.appdevforall.codeonthego.utils.EditorSidebarActions +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.ImageUtils +import org.appdevforall.codeonthego.utils.IntentUtils.openImage +import org.appdevforall.codeonthego.utils.UniqueNameBuilder +import org.appdevforall.codeonthego.utils.capHeightToSpaceBelow +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashSuccess +import org.appdevforall.codeonthego.utils.forEachViewRecursively +import org.appdevforall.codeonthego.utils.hasVisibleDialog +import org.appdevforall.codeonthego.utils.isDeepLinkTargetOfOpenProject +import org.appdevforall.codeonthego.utils.recordProjectOpenedBookkeeping +import org.appdevforall.codeonthego.utils.resolveDeepLinkProject +import org.appdevforall.codeonthego.utils.resolveWithinDirectory import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -289,7 +289,7 @@ open class EditorHandlerActivity : private val crashDialogsAboveFloatingWindows = mutableListOf() private val floatingTabController by lazy { - com.itsaky.androidide.editor.floating + org.appdevforall.codeonthego.editor.floating .IdeFloatingTabController(this) } @@ -741,7 +741,7 @@ open class EditorHandlerActivity : /** * [PluginToolbarHost] entry point. Lets plugin services (via IdeUIService) request a - * toolbar rebuild so dynamic [com.itsaky.androidide.plugins.extensions.ToolbarAction] + * toolbar rebuild so dynamic [org.appdevforall.codeonthego.plugins.extensions.ToolbarAction] * providers (icon/enabled/visible) are re-evaluated. Marshalled to the UI thread. */ override fun refreshPluginToolbarActions() { @@ -833,7 +833,7 @@ open class EditorHandlerActivity : * "Help" looks up the Quick Build entry in `documentation.db`. That database is a prebuilt * asset owned by the documentation repository, not written here, so the item opens the * no-tooltip fallback until a row for - * [com.itsaky.androidide.idetooltips.TooltipTag.EDITOR_TOOLBAR_QUICK_BUILD] ships in it. + * [org.appdevforall.codeonthego.idetooltips.TooltipTag.EDITOR_TOOLBAR_QUICK_BUILD] ships in it. */ private fun showQuickBuildDropdownMenu( anchor: View, @@ -909,7 +909,7 @@ open class EditorHandlerActivity : data: ActionData, ): String { val buildInProgress = - with(com.itsaky.androidide.actions.build.AbstractCancellableRunAction) { + with(org.appdevforall.codeonthego.actions.build.AbstractCancellableRunAction) { this@EditorHandlerActivity.isBuildInProgress() } if (action.id == QuickRunAction.ID && buildInProgress) { diff --git a/app/src/main/java/com/itsaky/androidide/activities/editor/FAQActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/FAQActivity.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/activities/editor/FAQActivity.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/editor/FAQActivity.kt index dc3ac5d914..5c3c5e1c2e 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/editor/FAQActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/FAQActivity.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.activities.editor +package org.appdevforall.codeonthego.activities.editor import android.os.Bundle import android.view.View @@ -25,9 +25,9 @@ import android.webkit.WebView import android.webkit.WebViewClient import androidx.core.graphics.Insets import com.itsaky.androidide.R -import com.itsaky.androidide.app.EdgeToEdgeIDEActivity +import org.appdevforall.codeonthego.app.EdgeToEdgeIDEActivity import com.itsaky.androidide.databinding.ActivityFaqBinding -import com.itsaky.androidide.documentation.DocumentationRequestInterceptor +import org.appdevforall.codeonthego.documentation.DocumentationRequestInterceptor import org.adfa.constants.CONTENT_KEY class FAQActivity : EdgeToEdgeIDEActivity() { diff --git a/app/src/main/java/com/itsaky/androidide/activities/editor/FileSaveOutcome.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/FileSaveOutcome.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/activities/editor/FileSaveOutcome.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/editor/FileSaveOutcome.kt index 6c13aba1ed..3ab87be28e 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/editor/FileSaveOutcome.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/FileSaveOutcome.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.activities.editor +package org.appdevforall.codeonthego.activities.editor /** * How one file's save ended. diff --git a/app/src/main/java/com/itsaky/androidide/activities/editor/FullscreenManager.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/FullscreenManager.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/activities/editor/FullscreenManager.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/editor/FullscreenManager.kt index 20d2fff1e0..c2cfcbd570 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/editor/FullscreenManager.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/FullscreenManager.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.activities.editor +package org.appdevforall.codeonthego.activities.editor import android.app.Activity import android.content.ContextWrapper @@ -9,7 +9,7 @@ import com.google.android.material.appbar.AppBarLayout import com.google.android.material.bottomsheet.BottomSheetBehavior import com.itsaky.androidide.R import com.itsaky.androidide.databinding.ContentEditorBinding -import com.itsaky.androidide.utils.isSoftInputVisible +import org.appdevforall.codeonthego.utils.isSoftInputVisible import kotlin.math.abs class FullscreenManager( diff --git a/app/src/main/java/com/itsaky/androidide/activities/editor/IDELogcatReader.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/IDELogcatReader.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/activities/editor/IDELogcatReader.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/editor/IDELogcatReader.kt index 79f7dd2bf7..e017f91324 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/editor/IDELogcatReader.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/IDELogcatReader.kt @@ -14,11 +14,11 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.activities.editor +package org.appdevforall.codeonthego.activities.editor import android.os.Process -import com.itsaky.androidide.preferences.internal.GeneralPreferences -import com.itsaky.androidide.utils.Environment +import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences +import org.appdevforall.codeonthego.utils.Environment import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job diff --git a/app/src/main/java/com/itsaky/androidide/activities/editor/PeerCursorOverlayManager.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/PeerCursorOverlayManager.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/activities/editor/PeerCursorOverlayManager.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/editor/PeerCursorOverlayManager.kt index fdd9f4c4b9..4c6f4870d3 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/editor/PeerCursorOverlayManager.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/PeerCursorOverlayManager.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.activities.editor +package org.appdevforall.codeonthego.activities.editor import android.graphics.Color import android.graphics.drawable.GradientDrawable diff --git a/app/src/main/java/com/itsaky/androidide/activities/editor/ProjectHandlerActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/ProjectHandlerActivity.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/activities/editor/ProjectHandlerActivity.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/editor/ProjectHandlerActivity.kt index fd3f3f2376..3f36eb274e 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/editor/ProjectHandlerActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/ProjectHandlerActivity.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.activities.editor +package org.appdevforall.codeonthego.activities.editor import android.content.Intent import android.os.Bundle @@ -39,105 +39,105 @@ import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import com.google.android.material.bottomsheet.BottomSheetBehavior import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem.Location.EDITOR_FIND_ACTION_MENU -import com.itsaky.androidide.actions.ActionsRegistry.Companion.getInstance -import com.itsaky.androidide.actions.build.QuickBuildAction -import com.itsaky.androidide.actions.etc.FindInFileAction -import com.itsaky.androidide.actions.etc.FindInProjectAction -import com.itsaky.androidide.actions.etc.ReplaceInProjectAction -import com.itsaky.androidide.actions.internal.DefaultActionsRegistry -import com.itsaky.androidide.activities.MainActivity -import com.itsaky.androidide.app.IDEApplication +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem.Location.EDITOR_FIND_ACTION_MENU +import org.appdevforall.codeonthego.actions.ActionsRegistry.Companion.getInstance +import org.appdevforall.codeonthego.actions.build.QuickBuildAction +import org.appdevforall.codeonthego.actions.etc.FindInFileAction +import org.appdevforall.codeonthego.actions.etc.FindInProjectAction +import org.appdevforall.codeonthego.actions.etc.ReplaceInProjectAction +import org.appdevforall.codeonthego.actions.internal.DefaultActionsRegistry +import org.appdevforall.codeonthego.activities.MainActivity +import org.appdevforall.codeonthego.app.IDEApplication import com.itsaky.androidide.databinding.LayoutSearchProjectBinding -import com.itsaky.androidide.flashbar.Flashbar -import com.itsaky.androidide.fragments.FindActionDialog -import com.itsaky.androidide.fragments.SearchFieldToolbar -import com.itsaky.androidide.fragments.sheets.ProgressSheet -import com.itsaky.androidide.handlers.EditorBuildEventListener -import com.itsaky.androidide.handlers.LspHandler.connectClient -import com.itsaky.androidide.handlers.LspHandler.connectDebugClient -import com.itsaky.androidide.handlers.LspHandler.destroyLanguageServers -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.IDELanguageClientImpl -import com.itsaky.androidide.lsp.debug.DebugClientConnectionResult -import com.itsaky.androidide.lsp.java.utils.CancelChecker -import com.itsaky.androidide.models.EditorIntentExtras -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.models.SearchResult -import com.itsaky.androidide.plugins.extensions.ProjectSearchExtension -import com.itsaky.androidide.plugins.extensions.ProjectSearchRequest -import com.itsaky.androidide.plugins.extensions.ProjectSearchResult -import com.itsaky.androidide.plugins.extensions.ProjectSearchSection -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.projects.builder.BuildService -import com.itsaky.androidide.projects.models.projectDir -import com.itsaky.androidide.quickbuild.AutostartBuild -import com.itsaky.androidide.quickbuild.GenerateSourcesDeferral -import com.itsaky.androidide.quickbuild.GradleQuickBuildProvisioner -import com.itsaky.androidide.quickbuild.QuickBuildBenchHooks -import com.itsaky.androidide.quickbuild.QuickBuildFlash -import com.itsaky.androidide.quickbuild.QuickBuildFlashes -import com.itsaky.androidide.quickbuild.QuickBuildGraphWarmUp -import com.itsaky.androidide.quickbuild.QuickBuildOutputNarrator -import com.itsaky.androidide.quickbuild.QuickBuildPrebuildStagger -import com.itsaky.androidide.quickbuild.QuickBuildStatusBarUpdate -import com.itsaky.androidide.quickbuild.QuickBuildStatusTracker -import com.itsaky.androidide.quickbuild.QuickBuildWontStayUpRestart -import com.itsaky.androidide.quickbuild.quickBuildStatusBarUpdate -import com.itsaky.androidide.quickbuild.resolve -import com.itsaky.androidide.repositories.PluginRepository +import org.appdevforall.codeonthego.flashbar.Flashbar +import org.appdevforall.codeonthego.fragments.FindActionDialog +import org.appdevforall.codeonthego.fragments.SearchFieldToolbar +import org.appdevforall.codeonthego.fragments.sheets.ProgressSheet +import org.appdevforall.codeonthego.handlers.EditorBuildEventListener +import org.appdevforall.codeonthego.handlers.LspHandler.connectClient +import org.appdevforall.codeonthego.handlers.LspHandler.connectDebugClient +import org.appdevforall.codeonthego.handlers.LspHandler.destroyLanguageServers +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.IDELanguageClientImpl +import org.appdevforall.codeonthego.lsp.debug.DebugClientConnectionResult +import org.appdevforall.codeonthego.lsp.java.utils.CancelChecker +import org.appdevforall.codeonthego.models.EditorIntentExtras +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.models.SearchResult +import org.appdevforall.codeonthego.plugins.extensions.ProjectSearchExtension +import org.appdevforall.codeonthego.plugins.extensions.ProjectSearchRequest +import org.appdevforall.codeonthego.plugins.extensions.ProjectSearchResult +import org.appdevforall.codeonthego.plugins.extensions.ProjectSearchSection +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.projects.builder.BuildService +import org.appdevforall.codeonthego.projects.models.projectDir +import org.appdevforall.codeonthego.quickbuild.AutostartBuild +import org.appdevforall.codeonthego.quickbuild.GenerateSourcesDeferral +import org.appdevforall.codeonthego.quickbuild.GradleQuickBuildProvisioner +import org.appdevforall.codeonthego.quickbuild.QuickBuildBenchHooks +import org.appdevforall.codeonthego.quickbuild.QuickBuildFlash +import org.appdevforall.codeonthego.quickbuild.QuickBuildFlashes +import org.appdevforall.codeonthego.quickbuild.QuickBuildGraphWarmUp +import org.appdevforall.codeonthego.quickbuild.QuickBuildOutputNarrator +import org.appdevforall.codeonthego.quickbuild.QuickBuildPrebuildStagger +import org.appdevforall.codeonthego.quickbuild.QuickBuildStatusBarUpdate +import org.appdevforall.codeonthego.quickbuild.QuickBuildStatusTracker +import org.appdevforall.codeonthego.quickbuild.QuickBuildWontStayUpRestart +import org.appdevforall.codeonthego.quickbuild.quickBuildStatusBarUpdate +import org.appdevforall.codeonthego.quickbuild.resolve +import org.appdevforall.codeonthego.repositories.PluginRepository import com.itsaky.androidide.resources.R.string -import com.itsaky.androidide.search.replace.ReplaceCoordinator -import com.itsaky.androidide.search.replace.ReplaceHost -import com.itsaky.androidide.search.replace.ReplaceSession -import com.itsaky.androidide.search.replace.SkipReason -import com.itsaky.androidide.services.builder.GradleBuildService -import com.itsaky.androidide.services.builder.GradleBuildServiceConnnection -import com.itsaky.androidide.services.builder.gradleDistributionParams -import com.itsaky.androidide.tooling.api.messages.AndroidInitializationParams -import com.itsaky.androidide.tooling.api.messages.BuildId -import com.itsaky.androidide.tooling.api.messages.BuildRunType -import com.itsaky.androidide.tooling.api.messages.InitializeProjectParams -import com.itsaky.androidide.tooling.api.messages.result.InitializeResult -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure.BUILD_CANCELLED -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure.CACHE_READ_ERROR -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure.PROJECT_DIRECTORY_INACCESSIBLE -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure.PROJECT_NOT_DIRECTORY -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure.PROJECT_NOT_FOUND -import com.itsaky.androidide.tooling.api.messages.result.failure -import com.itsaky.androidide.tooling.api.messages.result.isSuccessful -import com.itsaky.androidide.tooling.api.models.BuildVariantInfo -import com.itsaky.androidide.tooling.api.models.mapToSelectedVariants -import com.itsaky.androidide.tooling.api.sync.ProjectSyncHelper -import com.itsaky.androidide.ui.CodeEditorView -import com.itsaky.androidide.utils.DURATION_INDEFINITE -import com.itsaky.androidide.utils.DURATION_LONG -import com.itsaky.androidide.utils.DialogUtils.newMaterialDialogBuilder -import com.itsaky.androidide.utils.DialogUtils.showRestartPrompt -import com.itsaky.androidide.utils.FeatureFlags -import com.itsaky.androidide.utils.ProjectSearchOptions -import com.itsaky.androidide.utils.RecursiveFileSearcher -import com.itsaky.androidide.utils.dpToPx -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashInfo -import com.itsaky.androidide.utils.flashInfoLong -import com.itsaky.androidide.utils.flashSuccess -import com.itsaky.androidide.utils.flashbarBuilder -import com.itsaky.androidide.utils.onLongPress -import com.itsaky.androidide.utils.resolveAttr -import com.itsaky.androidide.utils.showOnUiThread -import com.itsaky.androidide.utils.withIcon -import com.itsaky.androidide.viewmodel.BottomSheetViewModel -import com.itsaky.androidide.viewmodel.BuildState -import com.itsaky.androidide.viewmodel.BuildVariantsViewModel -import com.itsaky.androidide.viewmodel.BuildViewModel -import com.itsaky.androidide.viewmodel.EditorViewModel.SearchResultSection +import org.appdevforall.codeonthego.search.replace.ReplaceCoordinator +import org.appdevforall.codeonthego.search.replace.ReplaceHost +import org.appdevforall.codeonthego.search.replace.ReplaceSession +import org.appdevforall.codeonthego.search.replace.SkipReason +import org.appdevforall.codeonthego.services.builder.GradleBuildService +import org.appdevforall.codeonthego.services.builder.GradleBuildServiceConnnection +import org.appdevforall.codeonthego.services.builder.gradleDistributionParams +import org.appdevforall.codeonthego.tooling.api.messages.AndroidInitializationParams +import org.appdevforall.codeonthego.tooling.api.messages.BuildId +import org.appdevforall.codeonthego.tooling.api.messages.BuildRunType +import org.appdevforall.codeonthego.tooling.api.messages.InitializeProjectParams +import org.appdevforall.codeonthego.tooling.api.messages.result.InitializeResult +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure.BUILD_CANCELLED +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure.CACHE_READ_ERROR +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure.PROJECT_DIRECTORY_INACCESSIBLE +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure.PROJECT_NOT_DIRECTORY +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure.PROJECT_NOT_FOUND +import org.appdevforall.codeonthego.tooling.api.messages.result.failure +import org.appdevforall.codeonthego.tooling.api.messages.result.isSuccessful +import org.appdevforall.codeonthego.tooling.api.models.BuildVariantInfo +import org.appdevforall.codeonthego.tooling.api.models.mapToSelectedVariants +import org.appdevforall.codeonthego.tooling.api.sync.ProjectSyncHelper +import org.appdevforall.codeonthego.ui.CodeEditorView +import org.appdevforall.codeonthego.utils.DURATION_INDEFINITE +import org.appdevforall.codeonthego.utils.DURATION_LONG +import org.appdevforall.codeonthego.utils.DialogUtils.newMaterialDialogBuilder +import org.appdevforall.codeonthego.utils.DialogUtils.showRestartPrompt +import org.appdevforall.codeonthego.utils.FeatureFlags +import org.appdevforall.codeonthego.utils.ProjectSearchOptions +import org.appdevforall.codeonthego.utils.RecursiveFileSearcher +import org.appdevforall.codeonthego.utils.dpToPx +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashInfo +import org.appdevforall.codeonthego.utils.flashInfoLong +import org.appdevforall.codeonthego.utils.flashSuccess +import org.appdevforall.codeonthego.utils.flashbarBuilder +import org.appdevforall.codeonthego.utils.onLongPress +import org.appdevforall.codeonthego.utils.resolveAttr +import org.appdevforall.codeonthego.utils.showOnUiThread +import org.appdevforall.codeonthego.utils.withIcon +import org.appdevforall.codeonthego.viewmodel.BottomSheetViewModel +import org.appdevforall.codeonthego.viewmodel.BuildState +import org.appdevforall.codeonthego.viewmodel.BuildVariantsViewModel +import org.appdevforall.codeonthego.viewmodel.BuildViewModel +import org.appdevforall.codeonthego.viewmodel.EditorViewModel.SearchResultSection import io.github.rosemoe.sora.text.ICUUtils import io.github.rosemoe.sora.util.IntPair import io.sentry.Sentry @@ -1769,7 +1769,7 @@ abstract class ProjectHandlerActivity : private fun updateBuildVariants(buildVariants: Map) { // avoid using the 'runOnUiThread' method defined in the activity - com.itsaky.androidide.tasks.runOnUiThread { + org.appdevforall.codeonthego.tasks.runOnUiThread { buildVariantsViewModel.buildVariants = buildVariants buildVariantsViewModel.resetUpdatedSelections() } @@ -2111,7 +2111,7 @@ abstract class ProjectHandlerActivity : val futures = plugins.mapNotNull { plugin -> val pluginId = - pluginManager.getPluginIdForInstance(plugin as com.itsaky.androidide.plugins.IPlugin) + pluginManager.getPluginIdForInstance(plugin as org.appdevforall.codeonthego.plugins.IPlugin) ?: plugin.javaClass.name try { plugin diff --git a/app/src/main/java/com/itsaky/androidide/activities/editor/QuickBuildClobberConfirmation.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/QuickBuildClobberConfirmation.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/activities/editor/QuickBuildClobberConfirmation.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/editor/QuickBuildClobberConfirmation.kt index 71dd01f2cc..5fce43dde5 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/editor/QuickBuildClobberConfirmation.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/QuickBuildClobberConfirmation.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.activities.editor +package org.appdevforall.codeonthego.activities.editor /** * Whether switching build type has to ask the user first (ADFA-4128). Both Quick Build and diff --git a/app/src/main/java/com/itsaky/androidide/activities/editor/SaveResultFlags.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/SaveResultFlags.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/activities/editor/SaveResultFlags.kt rename to app/src/main/java/org/appdevforall/codeonthego/activities/editor/SaveResultFlags.kt index 3ee752a94c..0ae2d69c5a 100644 --- a/app/src/main/java/com/itsaky/androidide/activities/editor/SaveResultFlags.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/SaveResultFlags.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.activities.editor +package org.appdevforall.codeonthego.activities.editor -import com.itsaky.androidide.models.SaveResult +import org.appdevforall.codeonthego.models.SaveResult /** * Folds one saved file into [result]'s flags. diff --git a/app/src/main/java/com/itsaky/androidide/adapters/BuildVariantsAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/BuildVariantsAdapter.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/adapters/BuildVariantsAdapter.kt rename to app/src/main/java/org/appdevforall/codeonthego/adapters/BuildVariantsAdapter.kt index 7aa7b67a09..2209417a66 100644 --- a/app/src/main/java/com/itsaky/androidide/adapters/BuildVariantsAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/BuildVariantsAdapter.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.adapters +package org.appdevforall.codeonthego.adapters import android.view.LayoutInflater import android.view.ViewGroup @@ -24,10 +24,10 @@ import androidx.core.widget.addTextChangedListener import androidx.recyclerview.widget.RecyclerView import com.itsaky.androidide.R import com.itsaky.androidide.databinding.LayoutBuildVariantItemBinding -import com.itsaky.androidide.tooling.api.IAndroidProject -import com.itsaky.androidide.tooling.api.models.BuildVariantInfo -import com.itsaky.androidide.tooling.api.models.BuildVariantInfo.Companion.withSelection -import com.itsaky.androidide.viewmodel.BuildVariantsViewModel +import org.appdevforall.codeonthego.tooling.api.IAndroidProject +import org.appdevforall.codeonthego.tooling.api.models.BuildVariantInfo +import org.appdevforall.codeonthego.tooling.api.models.BuildVariantInfo.Companion.withSelection +import org.appdevforall.codeonthego.viewmodel.BuildVariantsViewModel import java.util.Objects /** diff --git a/app/src/main/java/com/itsaky/androidide/adapters/DeleteProjectListAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/DeleteProjectListAdapter.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/adapters/DeleteProjectListAdapter.kt rename to app/src/main/java/org/appdevforall/codeonthego/adapters/DeleteProjectListAdapter.kt index aedcc2b2e0..2230d3daba 100644 --- a/app/src/main/java/com/itsaky/androidide/adapters/DeleteProjectListAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/DeleteProjectListAdapter.kt @@ -1,12 +1,12 @@ -package com.itsaky.androidide.adapters +package org.appdevforall.codeonthego.adapters import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.itsaky.androidide.databinding.DeleteProjectsItemBinding -import com.itsaky.androidide.models.Checkable -import com.itsaky.androidide.models.ProjectFile +import org.appdevforall.codeonthego.models.Checkable +import org.appdevforall.codeonthego.models.ProjectFile class DeleteProjectListAdapter( private var projects: List>, diff --git a/app/src/main/java/com/itsaky/androidide/adapters/DiagnosticItemAdapter.java b/app/src/main/java/org/appdevforall/codeonthego/adapters/DiagnosticItemAdapter.java similarity index 93% rename from app/src/main/java/com/itsaky/androidide/adapters/DiagnosticItemAdapter.java rename to app/src/main/java/org/appdevforall/codeonthego/adapters/DiagnosticItemAdapter.java index 330220c26b..5f41614158 100644 --- a/app/src/main/java/com/itsaky/androidide/adapters/DiagnosticItemAdapter.java +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/DiagnosticItemAdapter.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . * */ -package com.itsaky.androidide.adapters; +package org.appdevforall.codeonthego.adapters; import android.graphics.PorterDuff; import android.view.LayoutInflater; @@ -24,9 +24,9 @@ import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.RecyclerView; import com.itsaky.androidide.databinding.LayoutDiagnosticItemBinding; -import com.itsaky.androidide.interfaces.DiagnosticClickListener; -import com.itsaky.androidide.lsp.models.DiagnosticItem; -import com.itsaky.androidide.lsp.models.DiagnosticSeverity; +import org.appdevforall.codeonthego.interfaces.DiagnosticClickListener; +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem; +import org.appdevforall.codeonthego.lsp.models.DiagnosticSeverity; import com.itsaky.androidide.resources.R; import java.io.File; import java.util.List; diff --git a/app/src/main/java/com/itsaky/androidide/adapters/DiagnosticsAdapter.java b/app/src/main/java/org/appdevforall/codeonthego/adapters/DiagnosticsAdapter.java similarity index 93% rename from app/src/main/java/com/itsaky/androidide/adapters/DiagnosticsAdapter.java rename to app/src/main/java/org/appdevforall/codeonthego/adapters/DiagnosticsAdapter.java index 8581065eb5..6fed19aed3 100755 --- a/app/src/main/java/com/itsaky/androidide/adapters/DiagnosticsAdapter.java +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/DiagnosticsAdapter.java @@ -16,7 +16,7 @@ * */ -package com.itsaky.androidide.adapters; +package org.appdevforall.codeonthego.adapters; import android.view.LayoutInflater; import android.view.ViewGroup; @@ -24,8 +24,8 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.itsaky.androidide.databinding.LayoutDiagnosticGroupBinding; -import com.itsaky.androidide.interfaces.DiagnosticClickListener; -import com.itsaky.androidide.models.DiagnosticGroup; +import org.appdevforall.codeonthego.interfaces.DiagnosticClickListener; +import org.appdevforall.codeonthego.models.DiagnosticGroup; import java.util.List; import java.util.Objects; diff --git a/app/src/main/java/com/itsaky/androidide/adapters/EditorBottomSheetTabAdapter.java b/app/src/main/java/org/appdevforall/codeonthego/adapters/EditorBottomSheetTabAdapter.java similarity index 100% rename from app/src/main/java/com/itsaky/androidide/adapters/EditorBottomSheetTabAdapter.java rename to app/src/main/java/org/appdevforall/codeonthego/adapters/EditorBottomSheetTabAdapter.java diff --git a/app/src/main/java/com/itsaky/androidide/adapters/EditorBottomSheetTabAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/EditorBottomSheetTabAdapter.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/adapters/EditorBottomSheetTabAdapter.kt rename to app/src/main/java/org/appdevforall/codeonthego/adapters/EditorBottomSheetTabAdapter.kt index c20baf317c..dbff9d06bc 100644 --- a/app/src/main/java/com/itsaky/androidide/adapters/EditorBottomSheetTabAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/EditorBottomSheetTabAdapter.kt @@ -14,29 +14,29 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.adapters +package org.appdevforall.codeonthego.adapters import androidx.collection.LongSparseArray import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity import androidx.viewpager2.adapter.FragmentStateAdapter -import com.itsaky.androidide.app.IDEApplication.Companion.getPluginManager -import com.itsaky.androidide.fragments.DiagnosticsListFragment -import com.itsaky.androidide.fragments.SearchResultFragment -import com.itsaky.androidide.fragments.debug.DebuggerFragment -import com.itsaky.androidide.fragments.git.GitBottomSheetFragment -import com.itsaky.androidide.fragments.output.AppLogFragment -import com.itsaky.androidide.fragments.output.BuildOutputFragment -import com.itsaky.androidide.fragments.output.IDELogFragment -import com.itsaky.androidide.idetooltips.TooltipCategory -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.plugins.extensions.TabItem -import com.itsaky.androidide.plugins.extensions.UIExtension -import com.itsaky.androidide.plugins.manager.fragment.PluginFragmentFactory -import com.itsaky.androidide.plugins.manager.pluginCategory -import com.itsaky.androidide.plugins.manager.pluginTooltipTag +import org.appdevforall.codeonthego.app.IDEApplication.Companion.getPluginManager +import org.appdevforall.codeonthego.fragments.DiagnosticsListFragment +import org.appdevforall.codeonthego.fragments.SearchResultFragment +import org.appdevforall.codeonthego.fragments.debug.DebuggerFragment +import org.appdevforall.codeonthego.fragments.git.GitBottomSheetFragment +import org.appdevforall.codeonthego.fragments.output.AppLogFragment +import org.appdevforall.codeonthego.fragments.output.BuildOutputFragment +import org.appdevforall.codeonthego.fragments.output.IDELogFragment +import org.appdevforall.codeonthego.idetooltips.TooltipCategory +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.plugins.extensions.TabItem +import org.appdevforall.codeonthego.plugins.extensions.UIExtension +import org.appdevforall.codeonthego.plugins.manager.fragment.PluginFragmentFactory +import org.appdevforall.codeonthego.plugins.manager.pluginCategory +import org.appdevforall.codeonthego.plugins.manager.pluginTooltipTag import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.FeatureFlags +import org.appdevforall.codeonthego.utils.FeatureFlags import org.appdevforall.cotg.profiler.ProfilerFragment import org.slf4j.LoggerFactory import java.lang.reflect.Constructor diff --git a/app/src/main/java/com/itsaky/androidide/adapters/FilterableRecyclerViewAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/FilterableRecyclerViewAdapter.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/adapters/FilterableRecyclerViewAdapter.kt rename to app/src/main/java/org/appdevforall/codeonthego/adapters/FilterableRecyclerViewAdapter.kt index 07f8d44928..d5c4d615d5 100644 --- a/app/src/main/java/com/itsaky/androidide/adapters/FilterableRecyclerViewAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/FilterableRecyclerViewAdapter.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.adapters +package org.appdevforall.codeonthego.adapters import android.annotation.SuppressLint import androidx.recyclerview.widget.DiffUtil diff --git a/app/src/main/java/com/itsaky/androidide/adapters/MainActionsListAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/MainActionsListAdapter.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/adapters/MainActionsListAdapter.kt rename to app/src/main/java/org/appdevforall/codeonthego/adapters/MainActionsListAdapter.kt index 620cb53b6b..7944b8ab97 100644 --- a/app/src/main/java/com/itsaky/androidide/adapters/MainActionsListAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/MainActionsListAdapter.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.adapters +package org.appdevforall.codeonthego.adapters import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.google.android.material.button.MaterialButton -import com.itsaky.androidide.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionItem import com.itsaky.androidide.databinding.LayoutMainActionItemBinding /** diff --git a/app/src/main/java/com/itsaky/androidide/adapters/OptionsSheetAdapter.java b/app/src/main/java/org/appdevforall/codeonthego/adapters/OptionsSheetAdapter.java similarity index 96% rename from app/src/main/java/com/itsaky/androidide/adapters/OptionsSheetAdapter.java rename to app/src/main/java/org/appdevforall/codeonthego/adapters/OptionsSheetAdapter.java index 955c07384b..2eab49eeda 100755 --- a/app/src/main/java/com/itsaky/androidide/adapters/OptionsSheetAdapter.java +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/OptionsSheetAdapter.java @@ -18,7 +18,7 @@ * **************************************************************************************/ -package com.itsaky.androidide.adapters; +package org.appdevforall.codeonthego.adapters; import android.view.LayoutInflater; import android.view.ViewGroup; @@ -26,7 +26,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.itsaky.androidide.databinding.LayoutOptionssheetItemBinding; -import com.itsaky.androidide.models.SheetOption; +import org.appdevforall.codeonthego.models.SheetOption; import java.util.List; diff --git a/app/src/main/java/com/itsaky/androidide/adapters/RecentProjectsAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/RecentProjectsAdapter.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/adapters/RecentProjectsAdapter.kt rename to app/src/main/java/org/appdevforall/codeonthego/adapters/RecentProjectsAdapter.kt index 1f861e899a..68fe5aaf5a 100644 --- a/app/src/main/java/com/itsaky/androidide/adapters/RecentProjectsAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/RecentProjectsAdapter.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.adapters +package org.appdevforall.codeonthego.adapters import android.content.Context import android.text.Editable @@ -17,20 +17,20 @@ import com.google.android.material.textfield.TextInputLayout import com.itsaky.androidide.R import com.itsaky.androidide.databinding.RenameProjectTextinputBinding import com.itsaky.androidide.databinding.SavedRecentProjectItemBinding -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag.DELETE_PROJECT -import com.itsaky.androidide.idetooltips.TooltipTag.DELETE_PROJECT_DIALOG -import com.itsaky.androidide.idetooltips.TooltipTag.PROJECT_INFO_TOOLTIP -import com.itsaky.androidide.idetooltips.TooltipTag.PROJECT_RECENT_RENAME -import com.itsaky.androidide.idetooltips.TooltipTag.PROJECT_RECENT_TOP -import com.itsaky.androidide.idetooltips.TooltipTag.PROJECT_RENAME_DIALOG -import com.itsaky.androidide.models.ProjectFile -import com.itsaky.androidide.tasks.executeAsync -import com.itsaky.androidide.tasks.executeAsyncProvideError -import com.itsaky.androidide.utils.FileUtils -import com.itsaky.androidide.utils.applyLongPressRecursively -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashSuccess +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag.DELETE_PROJECT +import org.appdevforall.codeonthego.idetooltips.TooltipTag.DELETE_PROJECT_DIALOG +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PROJECT_INFO_TOOLTIP +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PROJECT_RECENT_RENAME +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PROJECT_RECENT_TOP +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PROJECT_RENAME_DIALOG +import org.appdevforall.codeonthego.models.ProjectFile +import org.appdevforall.codeonthego.tasks.executeAsync +import org.appdevforall.codeonthego.tasks.executeAsyncProvideError +import org.appdevforall.codeonthego.utils.FileUtils +import org.appdevforall.codeonthego.utils.applyLongPressRecursively +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashSuccess import org.slf4j.LoggerFactory import java.io.File import java.io.IOException diff --git a/app/src/main/java/com/itsaky/androidide/adapters/RunTasksListAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/RunTasksListAdapter.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/adapters/RunTasksListAdapter.kt rename to app/src/main/java/org/appdevforall/codeonthego/adapters/RunTasksListAdapter.kt index d4653f5d81..a260af140f 100644 --- a/app/src/main/java/com/itsaky/androidide/adapters/RunTasksListAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/RunTasksListAdapter.kt @@ -15,21 +15,21 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.adapters +package org.appdevforall.codeonthego.adapters import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import com.itsaky.androidide.adapters.RunTasksListAdapter.VH +import org.appdevforall.codeonthego.adapters.RunTasksListAdapter.VH import com.itsaky.androidide.databinding.LayoutRunTaskItemBinding -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.models.Checkable -import com.itsaky.androidide.project.GradleModels +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.models.Checkable +import org.appdevforall.codeonthego.project.GradleModels /** * Adapter for showing tasks list in [RunTaskDialogFragment] - * [com.itsaky.androidide.fragments.RunTasksDialogFragment]. + * [org.appdevforall.codeonthego.fragments.RunTasksDialogFragment]. * * @author Akash Yadav */ diff --git a/app/src/main/java/com/itsaky/androidide/adapters/SearchListAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/SearchListAdapter.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/adapters/SearchListAdapter.kt rename to app/src/main/java/org/appdevforall/codeonthego/adapters/SearchListAdapter.kt index 1a7a326bfc..d49a0394df 100755 --- a/app/src/main/java/com/itsaky/androidide/adapters/SearchListAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/SearchListAdapter.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.adapters +package org.appdevforall.codeonthego.adapters import android.content.Context import android.graphics.PorterDuff.Mode.SRC_ATOP @@ -17,15 +17,15 @@ import com.itsaky.androidide.R import com.itsaky.androidide.databinding.LayoutSearchResultGroupBinding import com.itsaky.androidide.databinding.LayoutSearchResultItemBinding import com.itsaky.androidide.databinding.LayoutSearchResultSectionBinding -import com.itsaky.androidide.models.FileExtension -import com.itsaky.androidide.models.SearchResult -import com.itsaky.androidide.search.replace.FileCheckState -import com.itsaky.androidide.search.replace.ReplaceSession -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE -import com.itsaky.androidide.syntax.highlighters.JavaHighlighter -import com.itsaky.androidide.tasks.runOnUiThread -import com.itsaky.androidide.utils.resolveAttr -import com.itsaky.androidide.viewmodel.EditorViewModel.SearchResultSection +import org.appdevforall.codeonthego.models.FileExtension +import org.appdevforall.codeonthego.models.SearchResult +import org.appdevforall.codeonthego.search.replace.FileCheckState +import org.appdevforall.codeonthego.search.replace.ReplaceSession +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE +import org.appdevforall.codeonthego.syntax.highlighters.JavaHighlighter +import org.appdevforall.codeonthego.tasks.runOnUiThread +import org.appdevforall.codeonthego.utils.resolveAttr +import org.appdevforall.codeonthego.viewmodel.EditorViewModel.SearchResultSection import org.slf4j.LoggerFactory import java.io.File import java.util.concurrent.CompletableFuture diff --git a/app/src/main/java/com/itsaky/androidide/adapters/SymbolInputAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/SymbolInputAdapter.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/adapters/SymbolInputAdapter.kt rename to app/src/main/java/org/appdevforall/codeonthego/adapters/SymbolInputAdapter.kt index 5ccb4c420a..8a535fc59c 100755 --- a/app/src/main/java/com/itsaky/androidide/adapters/SymbolInputAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/SymbolInputAdapter.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . * */ -package com.itsaky.androidide.adapters +package org.appdevforall.codeonthego.adapters import android.annotation.SuppressLint import android.view.LayoutInflater @@ -25,11 +25,11 @@ import androidx.appcompat.widget.TooltipCompat import androidx.recyclerview.widget.RecyclerView import com.itsaky.androidide.R import com.itsaky.androidide.databinding.LayoutSymbolItemBinding -import com.itsaky.androidide.editor.ui.IDEEditor -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.models.Symbol -import com.itsaky.androidide.utils.resolveAttr +import org.appdevforall.codeonthego.editor.ui.IDEEditor +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.models.Symbol +import org.appdevforall.codeonthego.utils.resolveAttr import io.github.rosemoe.sora.widget.SelectionMovement import java.util.Objects diff --git a/app/src/main/java/com/itsaky/androidide/adapters/TemplateListAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/TemplateListAdapter.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/adapters/TemplateListAdapter.kt rename to app/src/main/java/org/appdevforall/codeonthego/adapters/TemplateListAdapter.kt index 4d8323bc1b..f82355b31d 100644 --- a/app/src/main/java/com/itsaky/androidide/adapters/TemplateListAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/TemplateListAdapter.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.adapters +package org.appdevforall.codeonthego.adapters import android.view.LayoutInflater import android.view.View @@ -24,10 +24,10 @@ import android.widget.ImageView import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.google.android.material.shape.CornerFamily -import com.itsaky.androidide.adapters.TemplateListAdapter.ViewHolder +import org.appdevforall.codeonthego.adapters.TemplateListAdapter.ViewHolder import com.itsaky.androidide.databinding.LayoutTemplateListItemBinding -import com.itsaky.androidide.templates.Template -import com.itsaky.androidide.utils.dpToPx +import org.appdevforall.codeonthego.templates.Template +import org.appdevforall.codeonthego.utils.dpToPx /** * [RecyclerView.Adapter] for showing templates in a [RecyclerView]. diff --git a/app/src/main/java/com/itsaky/androidide/adapters/TemplateWidgetsListAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/TemplateWidgetsListAdapter.kt similarity index 87% rename from app/src/main/java/com/itsaky/androidide/adapters/TemplateWidgetsListAdapter.kt rename to app/src/main/java/org/appdevforall/codeonthego/adapters/TemplateWidgetsListAdapter.kt index 35884489fa..98ff204e07 100644 --- a/app/src/main/java/com/itsaky/androidide/adapters/TemplateWidgetsListAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/TemplateWidgetsListAdapter.kt @@ -15,17 +15,17 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.adapters +package org.appdevforall.codeonthego.adapters import android.view.LayoutInflater import android.view.ViewGroup import android.widget.LinearLayout import androidx.recyclerview.widget.RecyclerView -import com.itsaky.androidide.adapters.TemplateWidgetsListAdapter.WidgetViewHolder +import org.appdevforall.codeonthego.adapters.TemplateWidgetsListAdapter.WidgetViewHolder import com.itsaky.androidide.databinding.LayoutTemplateWidgetlistItemBinding -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.templates.ITemplateWidgetViewProvider -import com.itsaky.androidide.templates.Widget +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.templates.ITemplateWidgetViewProvider +import org.appdevforall.codeonthego.templates.Widget /** * A [RecyclerView.Adapter] that is used to show the widgets from templates. diff --git a/app/src/main/java/com/itsaky/androidide/adapters/onboarding/DefaultOnboardingItemAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/onboarding/DefaultOnboardingItemAdapter.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/adapters/onboarding/DefaultOnboardingItemAdapter.kt rename to app/src/main/java/org/appdevforall/codeonthego/adapters/onboarding/DefaultOnboardingItemAdapter.kt index c4a54daa3a..5713be4a0f 100644 --- a/app/src/main/java/com/itsaky/androidide/adapters/onboarding/DefaultOnboardingItemAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/onboarding/DefaultOnboardingItemAdapter.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.adapters.onboarding +package org.appdevforall.codeonthego.adapters.onboarding import android.content.res.ColorStateList import android.view.LayoutInflater @@ -23,7 +23,7 @@ import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.itsaky.androidide.databinding.LayoutOnboardingItemBinding -import com.itsaky.androidide.models.OnboardingItem +import org.appdevforall.codeonthego.models.OnboardingItem /** * Default implmentation of [RecyclerView.Adapter] for showing [OnboardingItem]s. diff --git a/app/src/main/java/com/itsaky/androidide/adapters/onboarding/OnboardingPermissionsAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/onboarding/OnboardingPermissionsAdapter.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/adapters/onboarding/OnboardingPermissionsAdapter.kt rename to app/src/main/java/org/appdevforall/codeonthego/adapters/onboarding/OnboardingPermissionsAdapter.kt index 3a2418731f..9e548baaa7 100644 --- a/app/src/main/java/com/itsaky/androidide/adapters/onboarding/OnboardingPermissionsAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/onboarding/OnboardingPermissionsAdapter.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.adapters.onboarding +package org.appdevforall.codeonthego.adapters.onboarding import android.content.res.ColorStateList import android.view.LayoutInflater @@ -27,8 +27,8 @@ import com.google.android.material.button.MaterialButton import com.google.android.material.color.MaterialColors import com.itsaky.androidide.R import com.itsaky.androidide.databinding.LayoutOnboardingPermissionItemBinding -import com.itsaky.androidide.models.OnboardingPermissionItem -import com.itsaky.androidide.utils.dpToPx +import org.appdevforall.codeonthego.models.OnboardingPermissionItem +import org.appdevforall.codeonthego.utils.dpToPx /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/adapters/viewholders/FileTreeViewHolder.java b/app/src/main/java/org/appdevforall/codeonthego/adapters/viewholders/FileTreeViewHolder.java similarity index 95% rename from app/src/main/java/com/itsaky/androidide/adapters/viewholders/FileTreeViewHolder.java rename to app/src/main/java/org/appdevforall/codeonthego/adapters/viewholders/FileTreeViewHolder.java index a7a9bdbf69..62f67448c2 100755 --- a/app/src/main/java/com/itsaky/androidide/adapters/viewholders/FileTreeViewHolder.java +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/viewholders/FileTreeViewHolder.java @@ -18,7 +18,7 @@ * **************************************************************************************/ -package com.itsaky.androidide.adapters.viewholders; +package org.appdevforall.codeonthego.adapters.viewholders; import android.content.Context; import android.view.LayoutInflater; @@ -29,9 +29,9 @@ import androidx.transition.TransitionManager; import com.itsaky.androidide.databinding.LayoutFiletreeItemBinding; -import com.itsaky.androidide.models.FileExtension; +import org.appdevforall.codeonthego.models.FileExtension; import com.itsaky.androidide.resources.R; -import com.itsaky.androidide.utils.ContextUtilsKt; +import org.appdevforall.codeonthego.utils.ContextUtilsKt; import com.unnamed.b.atv.model.TreeNode; import java.io.File; diff --git a/app/src/main/java/com/itsaky/androidide/adapters/viewholders/MultiSelectFileTreeViewHolder.java b/app/src/main/java/org/appdevforall/codeonthego/adapters/viewholders/MultiSelectFileTreeViewHolder.java similarity index 97% rename from app/src/main/java/com/itsaky/androidide/adapters/viewholders/MultiSelectFileTreeViewHolder.java rename to app/src/main/java/org/appdevforall/codeonthego/adapters/viewholders/MultiSelectFileTreeViewHolder.java index 586a204230..d3df4d6e20 100644 --- a/app/src/main/java/com/itsaky/androidide/adapters/viewholders/MultiSelectFileTreeViewHolder.java +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/viewholders/MultiSelectFileTreeViewHolder.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.adapters.viewholders; +package org.appdevforall.codeonthego.adapters.viewholders; import android.content.Context; import android.view.LayoutInflater; @@ -6,7 +6,7 @@ import com.itsaky.androidide.R; import com.itsaky.androidide.databinding.LayoutFiletreeItemSelectableBinding; -import com.itsaky.androidide.models.FileExtension; +import org.appdevforall.codeonthego.models.FileExtension; import com.unnamed.b.atv.model.TreeNode; import java.io.File; diff --git a/app/src/main/java/com/itsaky/androidide/agent/model/ModelLoadResult.kt b/app/src/main/java/org/appdevforall/codeonthego/agent/model/ModelLoadResult.kt similarity index 86% rename from app/src/main/java/com/itsaky/androidide/agent/model/ModelLoadResult.kt rename to app/src/main/java/org/appdevforall/codeonthego/agent/model/ModelLoadResult.kt index e68e6f043f..3e99dc239f 100644 --- a/app/src/main/java/com/itsaky/androidide/agent/model/ModelLoadResult.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/agent/model/ModelLoadResult.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.agent.model +package org.appdevforall.codeonthego.agent.model sealed interface ModelLoadResult { data class Loaded( diff --git a/app/src/main/java/com/itsaky/androidide/analytics/AnalyticsManager.kt b/app/src/main/java/org/appdevforall/codeonthego/analytics/AnalyticsManager.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/analytics/AnalyticsManager.kt rename to app/src/main/java/org/appdevforall/codeonthego/analytics/AnalyticsManager.kt index 4f7eae9306..19af1cb1dd 100644 --- a/app/src/main/java/com/itsaky/androidide/analytics/AnalyticsManager.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/analytics/AnalyticsManager.kt @@ -1,12 +1,12 @@ -package com.itsaky.androidide.analytics +package org.appdevforall.codeonthego.analytics import android.os.Bundle import com.google.firebase.analytics.FirebaseAnalytics import com.google.firebase.analytics.ktx.analytics import com.google.firebase.ktx.Firebase -import com.itsaky.androidide.analytics.gradle.BuildCompletedMetric -import com.itsaky.androidide.analytics.gradle.BuildStartedMetric -import com.itsaky.androidide.analytics.gradle.StrategySelectedMetric +import org.appdevforall.codeonthego.analytics.gradle.BuildCompletedMetric +import org.appdevforall.codeonthego.analytics.gradle.BuildStartedMetric +import org.appdevforall.codeonthego.analytics.gradle.StrategySelectedMetric import org.slf4j.LoggerFactory import java.util.concurrent.TimeUnit diff --git a/app/src/main/java/com/itsaky/androidide/analytics/AttachedDevicesCollector.kt b/app/src/main/java/org/appdevforall/codeonthego/analytics/AttachedDevicesCollector.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/analytics/AttachedDevicesCollector.kt rename to app/src/main/java/org/appdevforall/codeonthego/analytics/AttachedDevicesCollector.kt index dd3409ad8b..7ecfbc8889 100644 --- a/app/src/main/java/com/itsaky/androidide/analytics/AttachedDevicesCollector.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/analytics/AttachedDevicesCollector.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.analytics +package org.appdevforall.codeonthego.analytics import android.content.Context import android.hardware.display.DisplayManager diff --git a/app/src/main/java/com/itsaky/androidide/analytics/AttachedDevicesMetric.kt b/app/src/main/java/org/appdevforall/codeonthego/analytics/AttachedDevicesMetric.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/analytics/AttachedDevicesMetric.kt rename to app/src/main/java/org/appdevforall/codeonthego/analytics/AttachedDevicesMetric.kt index 820f88c212..d9e3ffd56e 100644 --- a/app/src/main/java/com/itsaky/androidide/analytics/AttachedDevicesMetric.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/analytics/AttachedDevicesMetric.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.analytics +package org.appdevforall.codeonthego.analytics import android.os.Bundle diff --git a/app/src/main/java/com/itsaky/androidide/analytics/DeepLinkMetric.kt b/app/src/main/java/org/appdevforall/codeonthego/analytics/DeepLinkMetric.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/analytics/DeepLinkMetric.kt rename to app/src/main/java/org/appdevforall/codeonthego/analytics/DeepLinkMetric.kt index 16c8bed7e0..4c271ce181 100644 --- a/app/src/main/java/com/itsaky/androidide/analytics/DeepLinkMetric.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/analytics/DeepLinkMetric.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.analytics +package org.appdevforall.codeonthego.analytics import android.os.Bundle -import com.itsaky.androidide.models.DeepLinkRequest +import org.appdevforall.codeonthego.models.DeepLinkRequest /** * How specific an incoming deep link was -- how far down diff --git a/app/src/main/java/com/itsaky/androidide/analytics/Metric.kt b/app/src/main/java/org/appdevforall/codeonthego/analytics/Metric.kt similarity index 85% rename from app/src/main/java/com/itsaky/androidide/analytics/Metric.kt rename to app/src/main/java/org/appdevforall/codeonthego/analytics/Metric.kt index c14ef44f25..e99813f626 100644 --- a/app/src/main/java/com/itsaky/androidide/analytics/Metric.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/analytics/Metric.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.analytics +package org.appdevforall.codeonthego.analytics import android.os.Bundle diff --git a/app/src/main/java/com/itsaky/androidide/analytics/gradle/BuildCompletedMetric.kt b/app/src/main/java/org/appdevforall/codeonthego/analytics/gradle/BuildCompletedMetric.kt similarity index 82% rename from app/src/main/java/com/itsaky/androidide/analytics/gradle/BuildCompletedMetric.kt rename to app/src/main/java/org/appdevforall/codeonthego/analytics/gradle/BuildCompletedMetric.kt index f216a7e0ac..5c7d9a8d3b 100644 --- a/app/src/main/java/com/itsaky/androidide/analytics/gradle/BuildCompletedMetric.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/analytics/gradle/BuildCompletedMetric.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.analytics.gradle +package org.appdevforall.codeonthego.analytics.gradle import android.os.Bundle -import com.itsaky.androidide.tooling.api.messages.BuildId -import com.itsaky.androidide.tooling.api.messages.result.BuildResult +import org.appdevforall.codeonthego.tooling.api.messages.BuildId +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildResult /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/analytics/gradle/BuildMetric.kt b/app/src/main/java/org/appdevforall/codeonthego/analytics/gradle/BuildMetric.kt similarity index 70% rename from app/src/main/java/com/itsaky/androidide/analytics/gradle/BuildMetric.kt rename to app/src/main/java/org/appdevforall/codeonthego/analytics/gradle/BuildMetric.kt index 06a6b43372..0127013d0a 100644 --- a/app/src/main/java/com/itsaky/androidide/analytics/gradle/BuildMetric.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/analytics/gradle/BuildMetric.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.analytics.gradle +package org.appdevforall.codeonthego.analytics.gradle import android.os.Bundle -import com.itsaky.androidide.analytics.Metric -import com.itsaky.androidide.tooling.api.messages.BuildId +import org.appdevforall.codeonthego.analytics.Metric +import org.appdevforall.codeonthego.tooling.api.messages.BuildId /** * Metric about a build event. diff --git a/app/src/main/java/com/itsaky/androidide/analytics/gradle/BuildStartedMetric.kt b/app/src/main/java/org/appdevforall/codeonthego/analytics/gradle/BuildStartedMetric.kt similarity index 82% rename from app/src/main/java/com/itsaky/androidide/analytics/gradle/BuildStartedMetric.kt rename to app/src/main/java/org/appdevforall/codeonthego/analytics/gradle/BuildStartedMetric.kt index 114418af6b..c451b96081 100644 --- a/app/src/main/java/com/itsaky/androidide/analytics/gradle/BuildStartedMetric.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/analytics/gradle/BuildStartedMetric.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.analytics.gradle +package org.appdevforall.codeonthego.analytics.gradle import android.os.Bundle -import com.itsaky.androidide.services.builder.GcType -import com.itsaky.androidide.services.builder.GradleTuningConfig -import com.itsaky.androidide.services.builder.JvmConfig -import com.itsaky.androidide.services.builder.KotlinCompilerExecution -import com.itsaky.androidide.tooling.api.messages.BuildId +import org.appdevforall.codeonthego.services.builder.GcType +import org.appdevforall.codeonthego.services.builder.GradleTuningConfig +import org.appdevforall.codeonthego.services.builder.JvmConfig +import org.appdevforall.codeonthego.services.builder.KotlinCompilerExecution +import org.appdevforall.codeonthego.tooling.api.messages.BuildId /** * Information about a build event. diff --git a/app/src/main/java/com/itsaky/androidide/analytics/gradle/StrategySelectedMetric.kt b/app/src/main/java/org/appdevforall/codeonthego/analytics/gradle/StrategySelectedMetric.kt similarity index 81% rename from app/src/main/java/com/itsaky/androidide/analytics/gradle/StrategySelectedMetric.kt rename to app/src/main/java/org/appdevforall/codeonthego/analytics/gradle/StrategySelectedMetric.kt index 68003abd20..15e4e9d8ab 100644 --- a/app/src/main/java/com/itsaky/androidide/analytics/gradle/StrategySelectedMetric.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/analytics/gradle/StrategySelectedMetric.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.analytics.gradle +package org.appdevforall.codeonthego.analytics.gradle import android.os.Bundle -import com.itsaky.androidide.services.builder.GradleBuildTuner -import com.itsaky.androidide.services.builder.GradleTuningStrategy -import com.itsaky.androidide.tooling.api.messages.BuildId +import org.appdevforall.codeonthego.services.builder.GradleBuildTuner +import org.appdevforall.codeonthego.services.builder.GradleTuningStrategy +import org.appdevforall.codeonthego.tooling.api.messages.BuildId /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/analytics/quickbuild/AnalyticsQuickBuildMetricsSink.kt b/app/src/main/java/org/appdevforall/codeonthego/analytics/quickbuild/AnalyticsQuickBuildMetricsSink.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/analytics/quickbuild/AnalyticsQuickBuildMetricsSink.kt rename to app/src/main/java/org/appdevforall/codeonthego/analytics/quickbuild/AnalyticsQuickBuildMetricsSink.kt index dddb968ecf..3d026efe81 100644 --- a/app/src/main/java/com/itsaky/androidide/analytics/quickbuild/AnalyticsQuickBuildMetricsSink.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/analytics/quickbuild/AnalyticsQuickBuildMetricsSink.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.analytics.quickbuild +package org.appdevforall.codeonthego.analytics.quickbuild -import com.itsaky.androidide.analytics.IAnalyticsManager +import org.appdevforall.codeonthego.analytics.IAnalyticsManager import org.appdevforall.cotg.quickbuild.domain.ChangedFiles import org.appdevforall.cotg.quickbuild.domain.classify.BuildRoute import org.appdevforall.cotg.quickbuild.domain.classify.InvalidationReason diff --git a/app/src/main/java/com/itsaky/androidide/analytics/quickbuild/QuickBuildMetrics.kt b/app/src/main/java/org/appdevforall/codeonthego/analytics/quickbuild/QuickBuildMetrics.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/analytics/quickbuild/QuickBuildMetrics.kt rename to app/src/main/java/org/appdevforall/codeonthego/analytics/quickbuild/QuickBuildMetrics.kt index b6504813fb..7d5c1b0222 100644 --- a/app/src/main/java/com/itsaky/androidide/analytics/quickbuild/QuickBuildMetrics.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/analytics/quickbuild/QuickBuildMetrics.kt @@ -1,13 +1,13 @@ -package com.itsaky.androidide.analytics.quickbuild +package org.appdevforall.codeonthego.analytics.quickbuild import android.os.Bundle -import com.itsaky.androidide.analytics.Metric +import org.appdevforall.codeonthego.analytics.Metric /** * Firebase metrics for the Quick Build live reload path (ADFA-4128), mirroring the Gradle * build metric family: started/completed pair + the live-reload-specific invalidation and * proxy-app-rebuild events. Payloads are low-cardinality - routes and reasons are enum-derived - * strings, projects are hashed like [com.itsaky.androidide.analytics.gradle.BuildStartedMetric], + * strings, projects are hashed like [org.appdevforall.codeonthego.analytics.gradle.BuildStartedMetric], * no paths or file names ever leave the device. */ data class QuickBuildStartedMetric( @@ -98,7 +98,7 @@ data class QuickBuildCompletedMetric( * waiting behind another build, not build work, and must not be read as build cost. * * Bundle size is deliberate. Firebase caps a custom event at [MAX_EVENT_PARAMS] - * parameters, and [com.itsaky.androidide.analytics.AnalyticsManager.trackMetric] adds a + * parameters, and [org.appdevforall.codeonthego.analytics.AnalyticsManager.trackMetric] adds a * `timestamp` on top of these, so the worst-case route must stay under that cap - a test * enforces it, and with [queueMs] there is no headroom left: another field means dropping * one. The finer daemon-internal timings (the aapt2 pair, the two walks separately) live in diff --git a/app/src/main/java/com/itsaky/androidide/api/ActionContextProvider.kt b/app/src/main/java/org/appdevforall/codeonthego/api/ActionContextProvider.kt similarity index 89% rename from app/src/main/java/com/itsaky/androidide/api/ActionContextProvider.kt rename to app/src/main/java/org/appdevforall/codeonthego/api/ActionContextProvider.kt index 9e836e22ae..55dc21c0bc 100644 --- a/app/src/main/java/com/itsaky/androidide/api/ActionContextProvider.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/api/ActionContextProvider.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.api +package org.appdevforall.codeonthego.api -import com.itsaky.androidide.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity import java.lang.ref.WeakReference /** @@ -45,11 +45,11 @@ object ActionContextProvider { * Android delivers `singleTask` intents to a finishing instance's [android.app.Activity.onNewIntent] * inconsistently (a genuinely new instance can be created instead), so callers that route based * on "is there a live editor to hand this off to" -- the deep-link routing in - * [com.itsaky.androidide.activities.DeepLinkActivity] -- need this distinction, not just non-null. + * [org.appdevforall.codeonthego.activities.DeepLinkActivity] -- need this distinction, not just non-null. * * [setActivity] is called from both `onCreate` and `onResume`: `onCreate` closes the blind window * between `onCreate` and `onResume` where a caller like - * [com.itsaky.androidide.activities.DeepLinkActivity] would otherwise see `null` for a live + * [org.appdevforall.codeonthego.activities.DeepLinkActivity] would otherwise see `null` for a live * instance and start a second, redundant open flow via `MainActivity`; `onResume` lets an instance * reclaim this registration whenever it becomes foreground-active again, in case a different, * stale-duplicate instance briefly registered over it and was destroyed without anything else diff --git a/app/src/main/java/com/itsaky/androidide/api/BuildOutputProvider.kt b/app/src/main/java/org/appdevforall/codeonthego/api/BuildOutputProvider.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/api/BuildOutputProvider.kt rename to app/src/main/java/org/appdevforall/codeonthego/api/BuildOutputProvider.kt index 681bf5f32d..e6bba720aa 100644 --- a/app/src/main/java/com/itsaky/androidide/api/BuildOutputProvider.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/api/BuildOutputProvider.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.api +package org.appdevforall.codeonthego.api import android.os.Looper import androidx.annotation.VisibleForTesting -import com.itsaky.androidide.app.IDEApplication -import com.itsaky.androidide.ui.EditorBottomSheet -import com.itsaky.androidide.viewmodel.BuildOutputViewModel +import org.appdevforall.codeonthego.app.IDEApplication +import org.appdevforall.codeonthego.ui.EditorBottomSheet +import org.appdevforall.codeonthego.viewmodel.BuildOutputViewModel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.runBlocking import kotlinx.coroutines.withContext @@ -44,7 +44,7 @@ object BuildOutputProvider { * cannot tell one from a log, and a plausible non-empty answer is worse than nothing. * * Reads the live bottom-sheet content first, then the session file on disk. The fallback must - * trigger on blank, not just null: [com.itsaky.androidide.fragments.output.BuildOutputFragment.getShareableContent] + * trigger on blank, not just null: [org.appdevforall.codeonthego.fragments.output.BuildOutputFragment.getShareableContent] * returns `""` while detached, and the file is still there after a crashed build -- exactly when * the log matters most. * diff --git a/app/src/main/java/com/itsaky/androidide/api/IDEApiFacade.kt b/app/src/main/java/org/appdevforall/codeonthego/api/IDEApiFacade.kt similarity index 88% rename from app/src/main/java/com/itsaky/androidide/api/IDEApiFacade.kt rename to app/src/main/java/org/appdevforall/codeonthego/api/IDEApiFacade.kt index 9309400b32..56288d8747 100644 --- a/app/src/main/java/com/itsaky/androidide/api/IDEApiFacade.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/api/IDEApiFacade.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.api +package org.appdevforall.codeonthego.api -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.ActionsRegistry -import com.itsaky.androidide.actions.internal.DefaultActionsRegistry -import com.itsaky.androidide.projects.builder.BuildResult +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionsRegistry +import org.appdevforall.codeonthego.actions.internal.DefaultActionsRegistry +import org.appdevforall.codeonthego.projects.builder.BuildResult import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.suspendCancellableCoroutine import kotlinx.coroutines.withContext diff --git a/app/src/main/java/com/itsaky/androidide/api/LogsProvider.kt b/app/src/main/java/org/appdevforall/codeonthego/api/LogsProvider.kt similarity index 85% rename from app/src/main/java/com/itsaky/androidide/api/LogsProvider.kt rename to app/src/main/java/org/appdevforall/codeonthego/api/LogsProvider.kt index b0d8d28c72..b271d4e5e0 100644 --- a/app/src/main/java/com/itsaky/androidide/api/LogsProvider.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/api/LogsProvider.kt @@ -1,20 +1,20 @@ -package com.itsaky.androidide.api +package org.appdevforall.codeonthego.api import androidx.annotation.VisibleForTesting -import com.itsaky.androidide.logs.LogBuffer -import com.itsaky.androidide.models.LogFilter -import com.itsaky.androidide.plugins.services.LogEntry -import com.itsaky.androidide.plugins.services.LogLevel -import com.itsaky.androidide.plugins.services.LogQuery -import com.itsaky.androidide.plugins.services.LogReadResult -import com.itsaky.androidide.plugins.services.LogSource -import com.itsaky.androidide.utils.ILogger -import com.itsaky.androidide.viewmodel.LogViewModel +import org.appdevforall.codeonthego.logs.LogBuffer +import org.appdevforall.codeonthego.models.LogFilter +import org.appdevforall.codeonthego.plugins.services.LogEntry +import org.appdevforall.codeonthego.plugins.services.LogLevel +import org.appdevforall.codeonthego.plugins.services.LogQuery +import org.appdevforall.codeonthego.plugins.services.LogReadResult +import org.appdevforall.codeonthego.plugins.services.LogSource +import org.appdevforall.codeonthego.utils.ILogger +import org.appdevforall.codeonthego.viewmodel.LogViewModel import java.lang.ref.WeakReference /** * Serves the App Logs and IDE Logs tabs' retained history to plugins - * ([com.itsaky.androidide.plugins.services.IdeLogService]). The history lives in the editor + * ([org.appdevforall.codeonthego.plugins.services.IdeLogService]). The history lives in the editor * activity's view models, so the activity attaches them here; with none attached, reads are empty. */ object LogsProvider { diff --git a/app/src/main/java/com/itsaky/androidide/app/ActivityLifecycleCallbacksDelegate.kt b/app/src/main/java/org/appdevforall/codeonthego/app/ActivityLifecycleCallbacksDelegate.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/app/ActivityLifecycleCallbacksDelegate.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/ActivityLifecycleCallbacksDelegate.kt index 57fa12fe56..125324641c 100644 --- a/app/src/main/java/com/itsaky/androidide/app/ActivityLifecycleCallbacksDelegate.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/ActivityLifecycleCallbacksDelegate.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.app +package org.appdevforall.codeonthego.app import android.app.Activity import android.app.Application diff --git a/app/src/main/java/com/itsaky/androidide/app/ApplicationLoader.kt b/app/src/main/java/org/appdevforall/codeonthego/app/ApplicationLoader.kt similarity index 89% rename from app/src/main/java/com/itsaky/androidide/app/ApplicationLoader.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/ApplicationLoader.kt index 70d792ea51..91fbd9f6d9 100644 --- a/app/src/main/java/com/itsaky/androidide/app/ApplicationLoader.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/ApplicationLoader.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.app +package org.appdevforall.codeonthego.app /** * An application loader is responsible for loading an application diff --git a/app/src/main/java/com/itsaky/androidide/app/CredentialProtectedApplicationLoader.kt b/app/src/main/java/org/appdevforall/codeonthego/app/CredentialProtectedApplicationLoader.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/app/CredentialProtectedApplicationLoader.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/CredentialProtectedApplicationLoader.kt index f0680aee59..0e7f79d0b7 100644 --- a/app/src/main/java/com/itsaky/androidide/app/CredentialProtectedApplicationLoader.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/CredentialProtectedApplicationLoader.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.app +package org.appdevforall.codeonthego.app import android.content.Intent import android.os.Handler @@ -8,30 +8,30 @@ import androidx.appcompat.app.AppCompatDelegate import androidx.core.os.LocaleListCompat import androidx.work.WorkManager import com.google.android.material.color.DynamicColors -import com.itsaky.androidide.activities.CrashHandlerActivity -import com.itsaky.androidide.activities.editor.IDELogcatReader -import com.itsaky.androidide.api.BuildOutputProvider -import com.itsaky.androidide.api.LogsProvider -import com.itsaky.androidide.editor.schemes.IDEColorSchemeProvider -import com.itsaky.androidide.eventbus.events.plugin.PluginCrashedEvent -import com.itsaky.androidide.eventbus.events.preferences.PreferenceChangeEvent -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.PluginLanguageSupport -import com.itsaky.androidide.managers.ToolsManager -import com.itsaky.androidide.plugins.PluginLogger -import com.itsaky.androidide.plugins.base.PluginFragmentHelper -import com.itsaky.androidide.plugins.manager.core.PluginManager -import com.itsaky.androidide.plugins.manager.services.IdeLogServiceImpl -import com.itsaky.androidide.preferences.internal.DevOpsPreferences -import com.itsaky.androidide.preferences.internal.GeneralPreferences -import com.itsaky.androidide.resources.localization.LocaleProvider -import com.itsaky.androidide.ui.themes.IDETheme -import com.itsaky.androidide.ui.themes.IThemeManager -import com.itsaky.androidide.utils.EditorDecorationBridge -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.FeatureFlags -import com.itsaky.androidide.utils.FileUtil -import com.itsaky.androidide.utils.VMUtils +import org.appdevforall.codeonthego.activities.CrashHandlerActivity +import org.appdevforall.codeonthego.activities.editor.IDELogcatReader +import org.appdevforall.codeonthego.api.BuildOutputProvider +import org.appdevforall.codeonthego.api.LogsProvider +import org.appdevforall.codeonthego.editor.schemes.IDEColorSchemeProvider +import org.appdevforall.codeonthego.eventbus.events.plugin.PluginCrashedEvent +import org.appdevforall.codeonthego.eventbus.events.preferences.PreferenceChangeEvent +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.PluginLanguageSupport +import org.appdevforall.codeonthego.managers.ToolsManager +import org.appdevforall.codeonthego.plugins.PluginLogger +import org.appdevforall.codeonthego.plugins.base.PluginFragmentHelper +import org.appdevforall.codeonthego.plugins.manager.core.PluginManager +import org.appdevforall.codeonthego.plugins.manager.services.IdeLogServiceImpl +import org.appdevforall.codeonthego.preferences.internal.DevOpsPreferences +import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences +import org.appdevforall.codeonthego.resources.localization.LocaleProvider +import org.appdevforall.codeonthego.ui.themes.IDETheme +import org.appdevforall.codeonthego.ui.themes.IThemeManager +import org.appdevforall.codeonthego.utils.EditorDecorationBridge +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.FeatureFlags +import org.appdevforall.codeonthego.utils.FileUtil +import org.appdevforall.codeonthego.utils.VMUtils import io.sentry.Sentry import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.Dispatchers @@ -400,7 +400,7 @@ internal object CredentialProtectedApplicationLoader : ApplicationLoader { @OptIn(DelicateCoroutinesApi::class) private fun setupBuildServiceProviders() { val buildServiceImpl = - com.itsaky.androidide.plugins.manager.services.IdeBuildServiceImpl + org.appdevforall.codeonthego.plugins.manager.services.IdeBuildServiceImpl .getInstance() // Provide runApp functionality @@ -413,7 +413,7 @@ internal object CredentialProtectedApplicationLoader : ApplicationLoader { buildServiceImpl.setGradleSyncProvider { callback -> GlobalScope.launch(Dispatchers.IO) { try { - val buildService = Lookup.getDefault().lookup(com.itsaky.androidide.projects.builder.BuildService.KEY_BUILD_SERVICE) + val buildService = Lookup.getDefault().lookup(org.appdevforall.codeonthego.projects.builder.BuildService.KEY_BUILD_SERVICE) if (buildService == null) { callback.onComplete(false, "Build service not available") return@launch @@ -453,7 +453,7 @@ internal object CredentialProtectedApplicationLoader : ApplicationLoader { private fun setupProjectManipulationProviders() { val manipulationServiceImpl = - com.itsaky.androidide.plugins.manager.services.IdeProjectManipulationServiceImpl + org.appdevforall.codeonthego.plugins.manager.services.IdeProjectManipulationServiceImpl .getInstance() // Provide dependency addition diff --git a/app/src/main/java/com/itsaky/androidide/app/DeviceProtectedApplicationLoader.kt b/app/src/main/java/org/appdevforall/codeonthego/app/DeviceProtectedApplicationLoader.kt similarity index 86% rename from app/src/main/java/com/itsaky/androidide/app/DeviceProtectedApplicationLoader.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/DeviceProtectedApplicationLoader.kt index 96c4430352..0be9b5e15c 100644 --- a/app/src/main/java/com/itsaky/androidide/app/DeviceProtectedApplicationLoader.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/DeviceProtectedApplicationLoader.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.app +package org.appdevforall.codeonthego.app import android.os.Build import android.provider.Settings @@ -6,27 +6,27 @@ import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.ProcessLifecycleOwner import com.itsaky.androidide.BuildConfig -import com.itsaky.androidide.analytics.AttachedDevicesCollector -import com.itsaky.androidide.analytics.AttachedDevicesMetric -import com.itsaky.androidide.analytics.IAnalyticsManager -import com.itsaky.androidide.app.strictmode.StrictModeConfig -import com.itsaky.androidide.app.strictmode.StrictModeManager +import org.appdevforall.codeonthego.analytics.AttachedDevicesCollector +import org.appdevforall.codeonthego.analytics.AttachedDevicesMetric +import org.appdevforall.codeonthego.analytics.IAnalyticsManager +import org.appdevforall.codeonthego.app.strictmode.StrictModeConfig +import org.appdevforall.codeonthego.app.strictmode.StrictModeManager import com.itsaky.androidide.events.AppEventsIndex import com.itsaky.androidide.events.EditorEventsIndex import com.itsaky.androidide.events.LspApiEventsIndex import com.itsaky.androidide.events.LspJavaEventsIndex import com.itsaky.androidide.events.ProjectsApiEventsIndex -import com.itsaky.androidide.handlers.CrashEventSubscriber -import com.itsaky.androidide.handlers.GlitchTipDiagnosticsContext -import com.itsaky.androidide.handlers.MetricsCrashAttachment -import com.itsaky.androidide.logging.provider.IdeLogRouter -import com.itsaky.androidide.preferences.internal.StatPreferences -import com.itsaky.androidide.preferences.internal.TelemetryConsent -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE -import com.itsaky.androidide.ui.themes.IThemeManager -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.FeatureFlags -import com.itsaky.androidide.utils.MetricsScratch +import org.appdevforall.codeonthego.handlers.CrashEventSubscriber +import org.appdevforall.codeonthego.handlers.GlitchTipDiagnosticsContext +import org.appdevforall.codeonthego.handlers.MetricsCrashAttachment +import org.appdevforall.codeonthego.logging.provider.IdeLogRouter +import org.appdevforall.codeonthego.preferences.internal.StatPreferences +import org.appdevforall.codeonthego.preferences.internal.TelemetryConsent +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE +import org.appdevforall.codeonthego.ui.themes.IThemeManager +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.FeatureFlags +import org.appdevforall.codeonthego.utils.MetricsScratch import com.termux.shared.reflection.ReflectionUtils import io.github.rosemoe.sora.widget.schemes.EditorColorScheme import io.sentry.Breadcrumb diff --git a/app/src/main/java/com/itsaky/androidide/app/EdgeToEdgeIDEActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/app/EdgeToEdgeIDEActivity.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/app/EdgeToEdgeIDEActivity.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/EdgeToEdgeIDEActivity.kt index 140f74727a..c2b88a14bd 100644 --- a/app/src/main/java/com/itsaky/androidide/app/EdgeToEdgeIDEActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/EdgeToEdgeIDEActivity.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.app +package org.appdevforall.codeonthego.app import android.annotation.SuppressLint import android.content.Context @@ -35,8 +35,8 @@ import androidx.core.view.OnApplyWindowInsetsListener import androidx.core.view.ViewCompat import androidx.core.view.WindowInsetsCompat import androidx.core.view.doOnAttach -import com.itsaky.androidide.utils.EdgeToEdgeUtils -import com.itsaky.androidide.utils.getSystemBarInsets +import org.appdevforall.codeonthego.utils.EdgeToEdgeUtils +import org.appdevforall.codeonthego.utils.getSystemBarInsets import org.slf4j.LoggerFactory /** diff --git a/app/src/main/java/com/itsaky/androidide/app/EditorEvents.kt b/app/src/main/java/org/appdevforall/codeonthego/app/EditorEvents.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/app/EditorEvents.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/EditorEvents.kt index 295df1d391..ef55e1674f 100644 --- a/app/src/main/java/com/itsaky/androidide/app/EditorEvents.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/EditorEvents.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.app +package org.appdevforall.codeonthego.app import android.util.Log import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/app/EditorProviderImpl.kt b/app/src/main/java/org/appdevforall/codeonthego/app/EditorProviderImpl.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/app/EditorProviderImpl.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/EditorProviderImpl.kt index a2906f6c11..268aa4acb5 100644 --- a/app/src/main/java/com/itsaky/androidide/app/EditorProviderImpl.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/EditorProviderImpl.kt @@ -1,19 +1,19 @@ -package com.itsaky.androidide.app +package org.appdevforall.codeonthego.app import android.os.Handler import android.os.Looper import androidx.lifecycle.lifecycleScope -import com.itsaky.androidide.activities.editor.EditorHandlerActivity -import com.itsaky.androidide.activities.editor.FileSaveOutcome -import com.itsaky.androidide.activities.editor.PeerCursorOverlayManager -import com.itsaky.androidide.editor.ui.IDEEditor -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.models.SaveResult -import com.itsaky.androidide.plugins.manager.services.IdeEditorServiceImpl -import com.itsaky.androidide.plugins.services.CursorPosition -import com.itsaky.androidide.plugins.services.SelectionRange +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.activities.editor.FileSaveOutcome +import org.appdevforall.codeonthego.activities.editor.PeerCursorOverlayManager +import org.appdevforall.codeonthego.editor.ui.IDEEditor +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.models.SaveResult +import org.appdevforall.codeonthego.plugins.manager.services.IdeEditorServiceImpl +import org.appdevforall.codeonthego.plugins.services.CursorPosition +import org.appdevforall.codeonthego.plugins.services.SelectionRange import io.github.rosemoe.sora.text.Content import io.github.rosemoe.sora.widget.CodeEditor import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/itsaky/androidide/app/IDEActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/app/IDEActivity.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/app/IDEActivity.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/IDEActivity.kt index 89fe5707f9..63bea2c879 100644 --- a/app/src/main/java/com/itsaky/androidide/app/IDEActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/IDEActivity.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.app +package org.appdevforall.codeonthego.app abstract class IDEActivity : BaseIDEActivity() { diff --git a/app/src/main/java/com/itsaky/androidide/app/IDEActivityDelegate.kt b/app/src/main/java/org/appdevforall/codeonthego/app/IDEActivityDelegate.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/app/IDEActivityDelegate.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/IDEActivityDelegate.kt index d108fddaf9..f0a4465c7c 100644 --- a/app/src/main/java/com/itsaky/androidide/app/IDEActivityDelegate.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/IDEActivityDelegate.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.app +package org.appdevforall.codeonthego.app import androidx.lifecycle.DefaultLifecycleObserver diff --git a/app/src/main/java/com/itsaky/androidide/app/IDEApplication.kt b/app/src/main/java/org/appdevforall/codeonthego/app/IDEApplication.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/app/IDEApplication.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/IDEApplication.kt index cc65bc39aa..4bd6daa234 100755 --- a/app/src/main/java/com/itsaky/androidide/app/IDEApplication.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/IDEApplication.kt @@ -16,7 +16,7 @@ * */ -package com.itsaky.androidide.app +package org.appdevforall.codeonthego.app import android.annotation.SuppressLint import android.app.Activity @@ -27,17 +27,17 @@ import android.content.Intent import android.content.IntentFilter import androidx.work.Configuration import com.itsaky.androidide.BuildConfig -import com.itsaky.androidide.di.coreModule -import com.itsaky.androidide.di.pluginModule -import com.itsaky.androidide.di.quickBuildModule -import com.itsaky.androidide.di.templateModule -import com.itsaky.androidide.handlers.GlitchTipDiagnosticsContext -import com.itsaky.androidide.plugins.manager.core.PluginManager +import org.appdevforall.codeonthego.di.coreModule +import org.appdevforall.codeonthego.di.pluginModule +import org.appdevforall.codeonthego.di.quickBuildModule +import org.appdevforall.codeonthego.di.templateModule +import org.appdevforall.codeonthego.handlers.GlitchTipDiagnosticsContext +import org.appdevforall.codeonthego.plugins.manager.core.PluginManager import com.itsaky.androidide.treesitter.TreeSitter -import com.itsaky.androidide.utils.RecyclableObjectPool -import com.itsaky.androidide.utils.VMUtils -import com.itsaky.androidide.utils.isAtLeastR -import com.itsaky.androidide.utils.isTestMode +import org.appdevforall.codeonthego.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.VMUtils +import org.appdevforall.codeonthego.utils.isAtLeastR +import org.appdevforall.codeonthego.utils.isTestMode import com.topjohnwu.superuser.Shell import io.sentry.Sentry import kotlinx.coroutines.CoroutineName diff --git a/app/src/main/java/com/itsaky/androidide/app/PluginRunAppCoordinator.kt b/app/src/main/java/org/appdevforall/codeonthego/app/PluginRunAppCoordinator.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/app/PluginRunAppCoordinator.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/PluginRunAppCoordinator.kt index 1073d28f4e..4f78b57c92 100644 --- a/app/src/main/java/com/itsaky/androidide/app/PluginRunAppCoordinator.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/PluginRunAppCoordinator.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.app +package org.appdevforall.codeonthego.app import android.app.Activity import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.lifecycleScope -import com.itsaky.androidide.activities.editor.ProjectHandlerActivity -import com.itsaky.androidide.interfaces.IEditorHandler -import com.itsaky.androidide.plugins.services.BuildAndLaunchCallback -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.isPluginProject -import com.itsaky.androidide.viewmodel.BuildState -import com.itsaky.androidide.viewmodel.BuildViewModel +import org.appdevforall.codeonthego.activities.editor.ProjectHandlerActivity +import org.appdevforall.codeonthego.interfaces.IEditorHandler +import org.appdevforall.codeonthego.plugins.services.BuildAndLaunchCallback +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.isPluginProject +import org.appdevforall.codeonthego.viewmodel.BuildState +import org.appdevforall.codeonthego.viewmodel.BuildViewModel import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/itsaky/androidide/app/TermuxApplicationLoader.kt b/app/src/main/java/org/appdevforall/codeonthego/app/TermuxApplicationLoader.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/app/TermuxApplicationLoader.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/TermuxApplicationLoader.kt index ea71a95c8b..316d1a15fe 100644 --- a/app/src/main/java/com/itsaky/androidide/app/TermuxApplicationLoader.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/TermuxApplicationLoader.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.app +package org.appdevforall.codeonthego.app import android.content.Context import com.termux.shared.logger.Logger diff --git a/app/src/main/java/com/itsaky/androidide/app/configuration/IDEBuildConfigProviderImpl.kt b/app/src/main/java/org/appdevforall/codeonthego/app/configuration/IDEBuildConfigProviderImpl.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/app/configuration/IDEBuildConfigProviderImpl.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/configuration/IDEBuildConfigProviderImpl.kt index db965b4812..d4adb5adc4 100644 --- a/app/src/main/java/com/itsaky/androidide/app/configuration/IDEBuildConfigProviderImpl.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/configuration/IDEBuildConfigProviderImpl.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.app.configuration +package org.appdevforall.codeonthego.app.configuration import android.os.Build import com.google.auto.service.AutoService import com.itsaky.androidide.BuildConfig -import com.itsaky.androidide.app.BaseApplication +import org.appdevforall.codeonthego.app.BaseApplication /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/app/configuration/JdkDistributionProviderImpl.kt b/app/src/main/java/org/appdevforall/codeonthego/app/configuration/JdkDistributionProviderImpl.kt similarity index 89% rename from app/src/main/java/com/itsaky/androidide/app/configuration/JdkDistributionProviderImpl.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/configuration/JdkDistributionProviderImpl.kt index f84f7faf27..17a0e294b5 100644 --- a/app/src/main/java/com/itsaky/androidide/app/configuration/JdkDistributionProviderImpl.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/configuration/JdkDistributionProviderImpl.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.app.configuration +package org.appdevforall.codeonthego.app.configuration import com.google.auto.service.AutoService -import com.itsaky.androidide.models.JdkDistribution -import com.itsaky.androidide.preferences.internal.BuildPreferences -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.JdkUtils +import org.appdevforall.codeonthego.models.JdkDistribution +import org.appdevforall.codeonthego.preferences.internal.BuildPreferences +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.JdkUtils import org.slf4j.LoggerFactory import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/app/strictmode/FrameMatcher.kt b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/FrameMatcher.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/app/strictmode/FrameMatcher.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/strictmode/FrameMatcher.kt index 988e71c40f..51a3def757 100644 --- a/app/src/main/java/com/itsaky/androidide/app/strictmode/FrameMatcher.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/FrameMatcher.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.app.strictmode +package org.appdevforall.codeonthego.app.strictmode /** * Matcher for a single stack frame. diff --git a/app/src/main/java/com/itsaky/androidide/app/strictmode/StackMatcher.kt b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/StackMatcher.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/app/strictmode/StackMatcher.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/strictmode/StackMatcher.kt index fb3804952c..f8623435be 100644 --- a/app/src/main/java/com/itsaky/androidide/app/strictmode/StackMatcher.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/StackMatcher.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.app.strictmode +package org.appdevforall.codeonthego.app.strictmode /** * A matcher for matching stack frames. diff --git a/app/src/main/java/com/itsaky/androidide/app/strictmode/StrictModeConfig.kt b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/StrictModeConfig.kt similarity index 86% rename from app/src/main/java/com/itsaky/androidide/app/strictmode/StrictModeConfig.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/strictmode/StrictModeConfig.kt index 92fba16788..a019432a87 100644 --- a/app/src/main/java/com/itsaky/androidide/app/strictmode/StrictModeConfig.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/StrictModeConfig.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.app.strictmode +package org.appdevforall.codeonthego.app.strictmode -import com.itsaky.androidide.utils.FeatureFlags +import org.appdevforall.codeonthego.utils.FeatureFlags import java.util.concurrent.ExecutorService import java.util.concurrent.Executors diff --git a/app/src/main/java/com/itsaky/androidide/app/strictmode/StrictModeManager.kt b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/StrictModeManager.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/app/strictmode/StrictModeManager.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/strictmode/StrictModeManager.kt index c848891e88..8596187af2 100644 --- a/app/src/main/java/com/itsaky/androidide/app/strictmode/StrictModeManager.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/StrictModeManager.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.app.strictmode +package org.appdevforall.codeonthego.app.strictmode import android.os.StrictMode import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/itsaky/androidide/app/strictmode/ViolationDispatcher.kt b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/ViolationDispatcher.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/app/strictmode/ViolationDispatcher.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/strictmode/ViolationDispatcher.kt index 3d1f73a125..bd7676761f 100644 --- a/app/src/main/java/com/itsaky/androidide/app/strictmode/ViolationDispatcher.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/ViolationDispatcher.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.app.strictmode +package org.appdevforall.codeonthego.app.strictmode import androidx.annotation.Keep import android.os.strictmode.Violation as StrictModeViolation diff --git a/app/src/main/java/com/itsaky/androidide/app/strictmode/ViolationHandler.kt b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/ViolationHandler.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/app/strictmode/ViolationHandler.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/strictmode/ViolationHandler.kt index ded11d7808..e03628639b 100644 --- a/app/src/main/java/com/itsaky/androidide/app/strictmode/ViolationHandler.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/ViolationHandler.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.app.strictmode +package org.appdevforall.codeonthego.app.strictmode -import com.itsaky.androidide.tasks.runOnUiThread +import org.appdevforall.codeonthego.tasks.runOnUiThread import org.slf4j.LoggerFactory /** diff --git a/app/src/main/java/com/itsaky/androidide/app/strictmode/ViolationListener.kt b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/ViolationListener.kt similarity index 87% rename from app/src/main/java/com/itsaky/androidide/app/strictmode/ViolationListener.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/strictmode/ViolationListener.kt index 6be823d397..5de1cd9146 100644 --- a/app/src/main/java/com/itsaky/androidide/app/strictmode/ViolationListener.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/ViolationListener.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.app.strictmode +package org.appdevforall.codeonthego.app.strictmode import android.os.StrictMode import android.os.strictmode.Violation diff --git a/app/src/main/java/com/itsaky/androidide/app/strictmode/WhitelistBuilder.kt b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/WhitelistBuilder.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/app/strictmode/WhitelistBuilder.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/strictmode/WhitelistBuilder.kt index 18e0e1ccf6..7ec7acf953 100644 --- a/app/src/main/java/com/itsaky/androidide/app/strictmode/WhitelistBuilder.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/WhitelistBuilder.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.app.strictmode +package org.appdevforall.codeonthego.app.strictmode import android.os.strictmode.Violation import com.google.common.collect.ImmutableList diff --git a/app/src/main/java/com/itsaky/androidide/app/strictmode/WhitelistEngine.kt b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/WhitelistEngine.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/app/strictmode/WhitelistEngine.kt rename to app/src/main/java/org/appdevforall/codeonthego/app/strictmode/WhitelistEngine.kt index a20049ea8e..6cce53a596 100644 --- a/app/src/main/java/com/itsaky/androidide/app/strictmode/WhitelistEngine.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/WhitelistEngine.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.app.strictmode +package org.appdevforall.codeonthego.app.strictmode import android.os.strictmode.DiskReadViolation import android.os.strictmode.DiskWriteViolation import androidx.annotation.VisibleForTesting -import com.itsaky.androidide.app.strictmode.FrameMatcher.Companion.anyOf -import com.itsaky.androidide.app.strictmode.FrameMatcher.Companion.classAndMethod +import org.appdevforall.codeonthego.app.strictmode.FrameMatcher.Companion.anyOf +import org.appdevforall.codeonthego.app.strictmode.FrameMatcher.Companion.classAndMethod import android.os.strictmode.Violation as StrictModeViolation /** @@ -202,8 +202,8 @@ object WhitelistEngine { ) matchFramesInOrder( - classAndMethod("com.itsaky.androidide.utils.ServiceLoader", "parse"), - classAndMethod("com.itsaky.androidide.app.configuration.IJdkDistributionProvider\$Companion", "_instance_delegate\$lambda\$0"), + classAndMethod("org.appdevforall.codeonthego.utils.ServiceLoader", "parse"), + classAndMethod("org.appdevforall.codeonthego.app.configuration.IJdkDistributionProvider\$Companion", "_instance_delegate\$lambda\$0"), ) } @@ -219,7 +219,7 @@ object WhitelistEngine { matchFramesInOrder( classAndMethod("java.io.File", "exists"), - classAndMethod("com.itsaky.androidide.activities.OnboardingActivity", "checkToolsIsInstalled"), + classAndMethod("org.appdevforall.codeonthego.activities.OnboardingActivity", "checkToolsIsInstalled"), ) } diff --git a/app/src/main/java/com/itsaky/androidide/assets/AssetsInstallExceptions.kt b/app/src/main/java/org/appdevforall/codeonthego/assets/AssetsInstallExceptions.kt similarity index 62% rename from app/src/main/java/com/itsaky/androidide/assets/AssetsInstallExceptions.kt rename to app/src/main/java/org/appdevforall/codeonthego/assets/AssetsInstallExceptions.kt index c3e9e8ff71..e030b1c031 100644 --- a/app/src/main/java/com/itsaky/androidide/assets/AssetsInstallExceptions.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/assets/AssetsInstallExceptions.kt @@ -1,3 +1,3 @@ -package com.itsaky.androidide.assets +package org.appdevforall.codeonthego.assets class MissingAssetsEntryException(cause: Throwable) : Exception(cause) diff --git a/app/src/main/java/com/itsaky/androidide/assets/AssetsInstallationHelper.kt b/app/src/main/java/org/appdevforall/codeonthego/assets/AssetsInstallationHelper.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/assets/AssetsInstallationHelper.kt rename to app/src/main/java/org/appdevforall/codeonthego/assets/AssetsInstallationHelper.kt index 8f64bc5a7e..bd70b69f36 100644 --- a/app/src/main/java/com/itsaky/androidide/assets/AssetsInstallationHelper.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/assets/AssetsInstallationHelper.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.assets +package org.appdevforall.codeonthego.assets import android.content.Context import android.os.StatFs import androidx.annotation.WorkerThread import com.aayushatharva.brotli4j.Brotli4jLoader -import com.itsaky.androidide.app.configuration.IDEBuildConfigProvider +import org.appdevforall.codeonthego.app.configuration.IDEBuildConfigProvider import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.ContainedPathResolver -import com.itsaky.androidide.utils.ContainedPathResolver.Resolution -import com.itsaky.androidide.utils.Environment.DEFAULT_ROOT -import com.itsaky.androidide.utils.useEntriesEach +import org.appdevforall.codeonthego.utils.ContainedPathResolver +import org.appdevforall.codeonthego.utils.ContainedPathResolver.Resolution +import org.appdevforall.codeonthego.utils.Environment.DEFAULT_ROOT +import org.appdevforall.codeonthego.utils.useEntriesEach import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.NonCancellable import kotlinx.coroutines.async diff --git a/app/src/main/java/com/itsaky/androidide/assets/AssetsInstaller.kt b/app/src/main/java/org/appdevforall/codeonthego/assets/AssetsInstaller.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/assets/AssetsInstaller.kt rename to app/src/main/java/org/appdevforall/codeonthego/assets/AssetsInstaller.kt index 422cb543cd..e3c4ab216f 100644 --- a/app/src/main/java/com/itsaky/androidide/assets/AssetsInstaller.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/assets/AssetsInstaller.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.assets +package org.appdevforall.codeonthego.assets import android.content.Context import androidx.annotation.WorkerThread import com.itsaky.androidide.BuildConfig -import com.itsaky.androidide.app.configuration.CpuArch +import org.appdevforall.codeonthego.app.configuration.CpuArch import java.nio.file.Path /** diff --git a/app/src/main/java/com/itsaky/androidide/assets/BaseAssetsInstaller.kt b/app/src/main/java/org/appdevforall/codeonthego/assets/BaseAssetsInstaller.kt similarity index 82% rename from app/src/main/java/com/itsaky/androidide/assets/BaseAssetsInstaller.kt rename to app/src/main/java/org/appdevforall/codeonthego/assets/BaseAssetsInstaller.kt index 455606c22d..9d0e3460c8 100644 --- a/app/src/main/java/com/itsaky/androidide/assets/BaseAssetsInstaller.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/assets/BaseAssetsInstaller.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.assets +package org.appdevforall.codeonthego.assets import android.content.Context -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.FeatureFlags +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.FeatureFlags import com.termux.shared.termux.TermuxConstants import org.slf4j.LoggerFactory import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/assets/BundledAssetsInstaller.kt b/app/src/main/java/org/appdevforall/codeonthego/assets/BundledAssetsInstaller.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/assets/BundledAssetsInstaller.kt rename to app/src/main/java/org/appdevforall/codeonthego/assets/BundledAssetsInstaller.kt index a01d15a636..741c4e1fec 100644 --- a/app/src/main/java/com/itsaky/androidide/assets/BundledAssetsInstaller.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/assets/BundledAssetsInstaller.kt @@ -1,17 +1,17 @@ -package com.itsaky.androidide.assets +package org.appdevforall.codeonthego.assets import android.content.Context import androidx.annotation.WorkerThread import com.aayushatharva.brotli4j.decoder.BrotliInputStream -import com.itsaky.androidide.app.configuration.CpuArch -import com.itsaky.androidide.managers.ToolsManager +import org.appdevforall.codeonthego.app.configuration.CpuArch +import org.appdevforall.codeonthego.managers.ToolsManager import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.TerminalInstaller -import com.itsaky.androidide.utils.retryOnceOnNoSuchFile -import com.itsaky.androidide.utils.throwIfNotSuccess -import com.itsaky.androidide.utils.withTempZipChannel -import com.itsaky.androidide.utils.writeBrotliAssetToPath +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.TerminalInstaller +import org.appdevforall.codeonthego.utils.retryOnceOnNoSuchFile +import org.appdevforall.codeonthego.utils.throwIfNotSuccess +import org.appdevforall.codeonthego.utils.withTempZipChannel +import org.appdevforall.codeonthego.utils.writeBrotliAssetToPath import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.adfa.constants.ANDROID_SDK_ZIP diff --git a/app/src/main/java/com/itsaky/androidide/assets/SplitAssetsInstaller.kt b/app/src/main/java/org/appdevforall/codeonthego/assets/SplitAssetsInstaller.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/assets/SplitAssetsInstaller.kt rename to app/src/main/java/org/appdevforall/codeonthego/assets/SplitAssetsInstaller.kt index f178ba7201..badd510b16 100644 --- a/app/src/main/java/com/itsaky/androidide/assets/SplitAssetsInstaller.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/assets/SplitAssetsInstaller.kt @@ -1,14 +1,14 @@ -package com.itsaky.androidide.assets +package org.appdevforall.codeonthego.assets import android.content.Context import androidx.annotation.WorkerThread -import com.itsaky.androidide.app.configuration.CpuArch +import org.appdevforall.codeonthego.app.configuration.CpuArch import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.TerminalInstaller -import com.itsaky.androidide.utils.retryOnceOnNoSuchFile -import com.itsaky.androidide.utils.throwIfNotSuccess -import com.itsaky.androidide.utils.withTempZipChannel +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.TerminalInstaller +import org.appdevforall.codeonthego.utils.retryOnceOnNoSuchFile +import org.appdevforall.codeonthego.utils.throwIfNotSuccess +import org.appdevforall.codeonthego.utils.withTempZipChannel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.adfa.constants.ANDROID_SDK_ZIP diff --git a/app/src/main/java/com/itsaky/androidide/deeplink/ConsumedRequests.kt b/app/src/main/java/org/appdevforall/codeonthego/deeplink/ConsumedRequests.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/deeplink/ConsumedRequests.kt rename to app/src/main/java/org/appdevforall/codeonthego/deeplink/ConsumedRequests.kt index 7c8e114c65..1e71f5be92 100644 --- a/app/src/main/java/com/itsaky/androidide/deeplink/ConsumedRequests.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/deeplink/ConsumedRequests.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.deeplink +package org.appdevforall.codeonthego.deeplink import android.os.Parcelable /** - * The deep-link-style requests (e.g. [com.itsaky.androidide.models.DeepLinkRequest], - * [com.itsaky.androidide.models.PendingFileRequest]) this task has already acted on, so a + * The deep-link-style requests (e.g. [org.appdevforall.codeonthego.models.DeepLinkRequest], + * [org.appdevforall.codeonthego.models.PendingFileRequest]) this task has already acted on, so a * redelivered Intent carrying one of them does not force its navigation a second time (ADFA-5067). * `Intent.removeExtra` alone cannot provide this: it mutates only this process's Intent object, * while a recreate after process death is handed the system's *parceled* copy, extras intact -- diff --git a/app/src/main/java/com/itsaky/androidide/deeplink/PendingDeepLinkOpen.kt b/app/src/main/java/org/appdevforall/codeonthego/deeplink/PendingDeepLinkOpen.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/deeplink/PendingDeepLinkOpen.kt rename to app/src/main/java/org/appdevforall/codeonthego/deeplink/PendingDeepLinkOpen.kt index ef82fa390b..1cd6973756 100644 --- a/app/src/main/java/com/itsaky/androidide/deeplink/PendingDeepLinkOpen.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/deeplink/PendingDeepLinkOpen.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.deeplink +package org.appdevforall.codeonthego.deeplink -import com.itsaky.androidide.models.DeepLinkOpenRequest +import org.appdevforall.codeonthego.models.DeepLinkOpenRequest /** * In-memory, process-lifetime handoff for "the user confirmed closing the current project via a * deep link; once this activity instance is actually destroyed, open the requested project." * * Deliberately not acted on synchronously inside the close-confirmation dialog's button callback -- - * see [com.itsaky.androidide.activities.editor.EditorHandlerActivity.onDestroy] for why the hand-off + * see [org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity.onDestroy] for why the hand-off * must wait until the old, `singleTask` activity instance is guaranteed torn down. * * Koin-provided (`single` in `di/AppModule.kt`) rather than a Kotlin `object`, per ADR 0006 -- diff --git a/app/src/main/java/com/itsaky/androidide/di/AppModule.kt b/app/src/main/java/org/appdevforall/codeonthego/di/AppModule.kt similarity index 62% rename from app/src/main/java/com/itsaky/androidide/di/AppModule.kt rename to app/src/main/java/org/appdevforall/codeonthego/di/AppModule.kt index a9c1a7a8fb..e94eb40398 100644 --- a/app/src/main/java/com/itsaky/androidide/di/AppModule.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/di/AppModule.kt @@ -1,19 +1,19 @@ -package com.itsaky.androidide.di +package org.appdevforall.codeonthego.di -import com.itsaky.androidide.actions.FileActionManager -import com.itsaky.androidide.analytics.AnalyticsManager -import com.itsaky.androidide.analytics.IAnalyticsManager -import com.itsaky.androidide.deeplink.PendingDeepLinkOpen -import com.itsaky.androidide.editor.language.outline.OutlineProvider -import com.itsaky.androidide.editor.language.outline.TreeSitterOutlineProvider -import com.itsaky.androidide.git.core.GitCredentialsManager -import com.itsaky.androidide.repositories.RecentProjectRepository -import com.itsaky.androidide.repositories.RecentProjectRepositoryImpl -import com.itsaky.androidide.roomData.recentproject.RecentProjectRoomDatabase -import com.itsaky.androidide.viewmodel.CloneRepositoryViewModel -import com.itsaky.androidide.viewmodel.GitBottomSheetViewModel -import com.itsaky.androidide.viewmodel.MainViewModel -import com.itsaky.androidide.viewmodel.OutlineViewModel +import org.appdevforall.codeonthego.actions.FileActionManager +import org.appdevforall.codeonthego.analytics.AnalyticsManager +import org.appdevforall.codeonthego.analytics.IAnalyticsManager +import org.appdevforall.codeonthego.deeplink.PendingDeepLinkOpen +import org.appdevforall.codeonthego.editor.language.outline.OutlineProvider +import org.appdevforall.codeonthego.editor.language.outline.TreeSitterOutlineProvider +import org.appdevforall.codeonthego.git.core.GitCredentialsManager +import org.appdevforall.codeonthego.repositories.RecentProjectRepository +import org.appdevforall.codeonthego.repositories.RecentProjectRepositoryImpl +import org.appdevforall.codeonthego.roomData.recentproject.RecentProjectRoomDatabase +import org.appdevforall.codeonthego.viewmodel.CloneRepositoryViewModel +import org.appdevforall.codeonthego.viewmodel.GitBottomSheetViewModel +import org.appdevforall.codeonthego.viewmodel.MainViewModel +import org.appdevforall.codeonthego.viewmodel.OutlineViewModel import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob diff --git a/app/src/main/java/com/itsaky/androidide/di/PluginModule.kt b/app/src/main/java/org/appdevforall/codeonthego/di/PluginModule.kt similarity index 64% rename from app/src/main/java/com/itsaky/androidide/di/PluginModule.kt rename to app/src/main/java/org/appdevforall/codeonthego/di/PluginModule.kt index abc42ee177..dceec66219 100644 --- a/app/src/main/java/com/itsaky/androidide/di/PluginModule.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/di/PluginModule.kt @@ -1,12 +1,12 @@ -package com.itsaky.androidide.di +package org.appdevforall.codeonthego.di -import com.itsaky.androidide.app.IDEApplication -import com.itsaky.androidide.repositories.PluginRepository -import com.itsaky.androidide.repositories.PluginRepositoryImpl -import com.itsaky.androidide.repositories.TemplateCollectionRepository -import com.itsaky.androidide.repositories.TemplateCollectionRepositoryImpl -import com.itsaky.androidide.viewmodels.ExternalFileInstallViewModel -import com.itsaky.androidide.viewmodels.PluginManagerViewModel +import org.appdevforall.codeonthego.app.IDEApplication +import org.appdevforall.codeonthego.repositories.PluginRepository +import org.appdevforall.codeonthego.repositories.PluginRepositoryImpl +import org.appdevforall.codeonthego.repositories.TemplateCollectionRepository +import org.appdevforall.codeonthego.repositories.TemplateCollectionRepositoryImpl +import org.appdevforall.codeonthego.viewmodels.ExternalFileInstallViewModel +import org.appdevforall.codeonthego.viewmodels.PluginManagerViewModel import org.koin.android.ext.koin.androidContext import org.koin.androidx.viewmodel.dsl.viewModel import org.koin.dsl.module diff --git a/app/src/main/java/com/itsaky/androidide/di/QuickBuildModule.kt b/app/src/main/java/org/appdevforall/codeonthego/di/QuickBuildModule.kt similarity index 89% rename from app/src/main/java/com/itsaky/androidide/di/QuickBuildModule.kt rename to app/src/main/java/org/appdevforall/codeonthego/di/QuickBuildModule.kt index 4da92adb91..eda890d54e 100644 --- a/app/src/main/java/com/itsaky/androidide/di/QuickBuildModule.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/di/QuickBuildModule.kt @@ -1,25 +1,25 @@ -package com.itsaky.androidide.di +package org.appdevforall.codeonthego.di import android.os.Build import android.os.SystemClock import androidx.lifecycle.Lifecycle import androidx.lifecycle.ProcessLifecycleOwner -import com.itsaky.androidide.analytics.quickbuild.AnalyticsQuickBuildMetricsSink -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.quickbuild.AndroidInstalledPackages -import com.itsaky.androidide.quickbuild.AndroidProxyAppLauncher -import com.itsaky.androidide.quickbuild.ApkSigningCert -import com.itsaky.androidide.quickbuild.CompositeQuickBuildMetricsSink -import com.itsaky.androidide.quickbuild.EnvironmentQuickBuildPaths -import com.itsaky.androidide.quickbuild.GenerateSourcesDeferral -import com.itsaky.androidide.quickbuild.GradleQuickBuildProvisioner -import com.itsaky.androidide.quickbuild.InstallationEventFlow -import com.itsaky.androidide.quickbuild.PreferencesQuickBuildHistoryStore -import com.itsaky.androidide.quickbuild.QuickBuildBenchHooks -import com.itsaky.androidide.quickbuild.QuickBuildOutputMetricsSink -import com.itsaky.androidide.quickbuild.QuickBuildOutputNarrator -import com.itsaky.androidide.utils.ApkInstaller +import org.appdevforall.codeonthego.analytics.quickbuild.AnalyticsQuickBuildMetricsSink +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.quickbuild.AndroidInstalledPackages +import org.appdevforall.codeonthego.quickbuild.AndroidProxyAppLauncher +import org.appdevforall.codeonthego.quickbuild.ApkSigningCert +import org.appdevforall.codeonthego.quickbuild.CompositeQuickBuildMetricsSink +import org.appdevforall.codeonthego.quickbuild.EnvironmentQuickBuildPaths +import org.appdevforall.codeonthego.quickbuild.GenerateSourcesDeferral +import org.appdevforall.codeonthego.quickbuild.GradleQuickBuildProvisioner +import org.appdevforall.codeonthego.quickbuild.InstallationEventFlow +import org.appdevforall.codeonthego.quickbuild.PreferencesQuickBuildHistoryStore +import org.appdevforall.codeonthego.quickbuild.QuickBuildBenchHooks +import org.appdevforall.codeonthego.quickbuild.QuickBuildOutputMetricsSink +import org.appdevforall.codeonthego.quickbuild.QuickBuildOutputNarrator +import org.appdevforall.codeonthego.utils.ApkInstaller import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob diff --git a/app/src/main/java/com/itsaky/androidide/di/TemplateModule.kt b/app/src/main/java/org/appdevforall/codeonthego/di/TemplateModule.kt similarity index 59% rename from app/src/main/java/com/itsaky/androidide/di/TemplateModule.kt rename to app/src/main/java/org/appdevforall/codeonthego/di/TemplateModule.kt index efddd25b84..42592317b7 100644 --- a/app/src/main/java/com/itsaky/androidide/di/TemplateModule.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/di/TemplateModule.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.di +package org.appdevforall.codeonthego.di -import com.itsaky.androidide.repositories.TemplateRepository -import com.itsaky.androidide.repositories.TemplateRepositoryImpl -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.viewmodels.TemplateManagerViewModel +import org.appdevforall.codeonthego.repositories.TemplateRepository +import org.appdevforall.codeonthego.repositories.TemplateRepositoryImpl +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.viewmodels.TemplateManagerViewModel import org.koin.androidx.viewmodel.dsl.viewModel import org.koin.dsl.module diff --git a/app/src/main/java/com/itsaky/androidide/dnd/DragAndDropExtensions.kt b/app/src/main/java/org/appdevforall/codeonthego/dnd/DragAndDropExtensions.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/dnd/DragAndDropExtensions.kt rename to app/src/main/java/org/appdevforall/codeonthego/dnd/DragAndDropExtensions.kt index 1fa28ebf90..3493b36193 100644 --- a/app/src/main/java/com/itsaky/androidide/dnd/DragAndDropExtensions.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/dnd/DragAndDropExtensions.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.dnd +package org.appdevforall.codeonthego.dnd import android.content.ClipData import android.content.ClipDescription @@ -7,7 +7,7 @@ import android.content.Context import android.net.Uri import android.view.DragEvent import androidx.core.net.toUri -import com.itsaky.androidide.utils.fileProviderAuthority +import org.appdevforall.codeonthego.utils.fileProviderAuthority /** * Checks if the [DragEvent] contains any URIs that can be imported into the project. diff --git a/app/src/main/java/com/itsaky/androidide/dnd/DragEventRouter.kt b/app/src/main/java/org/appdevforall/codeonthego/dnd/DragEventRouter.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/dnd/DragEventRouter.kt rename to app/src/main/java/org/appdevforall/codeonthego/dnd/DragEventRouter.kt index a991cca0f8..2ec958dfa9 100644 --- a/app/src/main/java/com/itsaky/androidide/dnd/DragEventRouter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/dnd/DragEventRouter.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.dnd +package org.appdevforall.codeonthego.dnd import android.view.DragEvent import android.view.View diff --git a/app/src/main/java/com/itsaky/androidide/dnd/DropTargetCallback.kt b/app/src/main/java/org/appdevforall/codeonthego/dnd/DropTargetCallback.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/dnd/DropTargetCallback.kt rename to app/src/main/java/org/appdevforall/codeonthego/dnd/DropTargetCallback.kt index ba39ff0173..e0eaa5abef 100644 --- a/app/src/main/java/com/itsaky/androidide/dnd/DropTargetCallback.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/dnd/DropTargetCallback.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.dnd +package org.appdevforall.codeonthego.dnd import android.view.DragEvent import android.view.View diff --git a/app/src/main/java/com/itsaky/androidide/dnd/FileDragStarter.kt b/app/src/main/java/org/appdevforall/codeonthego/dnd/FileDragStarter.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/dnd/FileDragStarter.kt rename to app/src/main/java/org/appdevforall/codeonthego/dnd/FileDragStarter.kt index 7498137eb0..d412faea5f 100644 --- a/app/src/main/java/com/itsaky/androidide/dnd/FileDragStarter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/dnd/FileDragStarter.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.dnd +package org.appdevforall.codeonthego.dnd import android.content.ClipData import android.content.Context @@ -6,7 +6,7 @@ import android.net.Uri import android.view.View import android.webkit.MimeTypeMap import androidx.core.view.ViewCompat -import com.itsaky.androidide.utils.fileProviderUriFor +import org.appdevforall.codeonthego.utils.fileProviderUriFor import java.io.File import java.util.Locale diff --git a/app/src/main/java/com/itsaky/androidide/dnd/GitUrlDropExtensions.kt b/app/src/main/java/org/appdevforall/codeonthego/dnd/GitUrlDropExtensions.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/dnd/GitUrlDropExtensions.kt rename to app/src/main/java/org/appdevforall/codeonthego/dnd/GitUrlDropExtensions.kt index a6fdb6e018..5010d02ae2 100644 --- a/app/src/main/java/com/itsaky/androidide/dnd/GitUrlDropExtensions.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/dnd/GitUrlDropExtensions.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.dnd +package org.appdevforall.codeonthego.dnd import android.view.View import androidx.fragment.app.Fragment diff --git a/app/src/main/java/com/itsaky/androidide/dnd/GitUrlDropTarget.kt b/app/src/main/java/org/appdevforall/codeonthego/dnd/GitUrlDropTarget.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/dnd/GitUrlDropTarget.kt rename to app/src/main/java/org/appdevforall/codeonthego/dnd/GitUrlDropTarget.kt index bd8b1b1aa9..78a1b978bf 100644 --- a/app/src/main/java/com/itsaky/androidide/dnd/GitUrlDropTarget.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/dnd/GitUrlDropTarget.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.dnd +package org.appdevforall.codeonthego.dnd import android.content.ClipDescription import android.content.Context @@ -6,8 +6,8 @@ import android.view.DragEvent import android.view.View import androidx.core.view.ContentInfoCompat import androidx.core.view.ViewCompat -import com.itsaky.androidide.git.core.parseGitRepositoryUrl -import com.itsaky.androidide.utils.DropHighlighter +import org.appdevforall.codeonthego.git.core.parseGitRepositoryUrl +import org.appdevforall.codeonthego.utils.DropHighlighter internal class GitUrlDropTarget( private val context: Context, diff --git a/app/src/main/java/com/itsaky/androidide/editor/floating/ChromeControlTooltips.kt b/app/src/main/java/org/appdevforall/codeonthego/editor/floating/ChromeControlTooltips.kt similarity index 64% rename from app/src/main/java/com/itsaky/androidide/editor/floating/ChromeControlTooltips.kt rename to app/src/main/java/org/appdevforall/codeonthego/editor/floating/ChromeControlTooltips.kt index 43a32c64c8..c293f25d6f 100644 --- a/app/src/main/java/com/itsaky/androidide/editor/floating/ChromeControlTooltips.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/editor/floating/ChromeControlTooltips.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.editor.floating +package org.appdevforall.codeonthego.editor.floating import android.view.View -import com.itsaky.androidide.floating.model.ChromeControl -import com.itsaky.androidide.idetooltips.TooltipCategory -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.floating.model.ChromeControl +import org.appdevforall.codeonthego.idetooltips.TooltipCategory +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag object ChromeControlTooltips { val handler: (ChromeControl, View) -> Unit = { control, anchor -> diff --git a/app/src/main/java/com/itsaky/androidide/editor/floating/EditorPanelDockableContent.kt b/app/src/main/java/org/appdevforall/codeonthego/editor/floating/EditorPanelDockableContent.kt similarity index 78% rename from app/src/main/java/com/itsaky/androidide/editor/floating/EditorPanelDockableContent.kt rename to app/src/main/java/org/appdevforall/codeonthego/editor/floating/EditorPanelDockableContent.kt index 918a2ef2f2..d63dbd8c7e 100644 --- a/app/src/main/java/com/itsaky/androidide/editor/floating/EditorPanelDockableContent.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/editor/floating/EditorPanelDockableContent.kt @@ -1,25 +1,25 @@ -package com.itsaky.androidide.editor.floating +package org.appdevforall.codeonthego.editor.floating import android.content.Context import android.content.Intent import android.view.View import android.widget.Toast import com.itsaky.androidide.R -import com.itsaky.androidide.api.ActionContextProvider -import com.itsaky.androidide.api.IDEApiFacade -import com.itsaky.androidide.floating.model.ChromeControl -import com.itsaky.androidide.floating.model.DockAction -import com.itsaky.androidide.floating.model.DockableContent -import com.itsaky.androidide.floating.window.FloatingWindowHost -import com.itsaky.androidide.idetooltips.TooltipCategory -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.projects.builder.BuildService -import com.itsaky.androidide.ui.CodeEditorView -import com.itsaky.androidide.utils.requestBuildCancellation +import org.appdevforall.codeonthego.api.ActionContextProvider +import org.appdevforall.codeonthego.api.IDEApiFacade +import org.appdevforall.codeonthego.floating.model.ChromeControl +import org.appdevforall.codeonthego.floating.model.DockAction +import org.appdevforall.codeonthego.floating.model.DockableContent +import org.appdevforall.codeonthego.floating.window.FloatingWindowHost +import org.appdevforall.codeonthego.idetooltips.TooltipCategory +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.projects.builder.BuildService +import org.appdevforall.codeonthego.ui.CodeEditorView +import org.appdevforall.codeonthego.utils.requestBuildCancellation import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow diff --git a/app/src/main/java/com/itsaky/androidide/editor/floating/IdeFloatingTabController.kt b/app/src/main/java/org/appdevforall/codeonthego/editor/floating/IdeFloatingTabController.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/editor/floating/IdeFloatingTabController.kt rename to app/src/main/java/org/appdevforall/codeonthego/editor/floating/IdeFloatingTabController.kt index c1ddf8c648..3bc13b66f3 100644 --- a/app/src/main/java/com/itsaky/androidide/editor/floating/IdeFloatingTabController.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/editor/floating/IdeFloatingTabController.kt @@ -1,18 +1,18 @@ -package com.itsaky.androidide.editor.floating +package org.appdevforall.codeonthego.editor.floating import android.content.Intent import android.widget.Toast import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope -import com.itsaky.androidide.activities.editor.EditorHandlerActivity -import com.itsaky.androidide.floating.model.DockingEvent -import com.itsaky.androidide.floating.model.DockingManager -import com.itsaky.androidide.floating.permission.OverlayPermission -import com.itsaky.androidide.floating.service.FloatingTabService -import com.itsaky.androidide.floating.window.InitialBounds +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.floating.model.DockingEvent +import org.appdevforall.codeonthego.floating.model.DockingManager +import org.appdevforall.codeonthego.floating.permission.OverlayPermission +import org.appdevforall.codeonthego.floating.service.FloatingTabService +import org.appdevforall.codeonthego.floating.window.InitialBounds import com.itsaky.androidide.resources.R -import com.itsaky.androidide.ui.MetricsCarouselController +import org.appdevforall.codeonthego.ui.MetricsCarouselController import kotlinx.coroutines.CancellationException import kotlinx.coroutines.launch import org.slf4j.LoggerFactory diff --git a/app/src/main/java/com/itsaky/androidide/editor/floating/MetricsCarouselDockableContent.kt b/app/src/main/java/org/appdevforall/codeonthego/editor/floating/MetricsCarouselDockableContent.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/editor/floating/MetricsCarouselDockableContent.kt rename to app/src/main/java/org/appdevforall/codeonthego/editor/floating/MetricsCarouselDockableContent.kt index 85d8ebd386..23675a8e52 100644 --- a/app/src/main/java/com/itsaky/androidide/editor/floating/MetricsCarouselDockableContent.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/editor/floating/MetricsCarouselDockableContent.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.floating +package org.appdevforall.codeonthego.editor.floating import android.content.Context import android.view.LayoutInflater @@ -24,11 +24,11 @@ import android.view.ViewGroup import android.view.inputmethod.InputMethodManager import androidx.core.view.updateLayoutParams import com.itsaky.androidide.databinding.LayoutMemUsageBinding -import com.itsaky.androidide.floating.model.ChromeControl -import com.itsaky.androidide.floating.model.DockableContent -import com.itsaky.androidide.floating.window.FloatingWindowHost +import org.appdevforall.codeonthego.floating.model.ChromeControl +import org.appdevforall.codeonthego.floating.model.DockableContent +import org.appdevforall.codeonthego.floating.window.FloatingWindowHost import com.itsaky.androidide.resources.R -import com.itsaky.androidide.ui.MetricsCarouselController +import org.appdevforall.codeonthego.ui.MetricsCarouselController /** * Adapts the editor's metrics carousel to [DockableContent] so it can float over other apps diff --git a/app/src/main/java/com/itsaky/androidide/editor/floating/PluginTabDockableContent.kt b/app/src/main/java/org/appdevforall/codeonthego/editor/floating/PluginTabDockableContent.kt similarity index 78% rename from app/src/main/java/com/itsaky/androidide/editor/floating/PluginTabDockableContent.kt rename to app/src/main/java/org/appdevforall/codeonthego/editor/floating/PluginTabDockableContent.kt index 76e92e9e16..a904ce3858 100644 --- a/app/src/main/java/com/itsaky/androidide/editor/floating/PluginTabDockableContent.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/editor/floating/PluginTabDockableContent.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.editor.floating +package org.appdevforall.codeonthego.editor.floating import android.content.Context import android.util.Log @@ -8,17 +8,17 @@ import android.view.View import android.widget.TextView import androidx.fragment.app.FragmentFactory import com.itsaky.androidide.R -import com.itsaky.androidide.floating.fragment.OverlayFragmentHost -import com.itsaky.androidide.floating.model.ChromeControl -import com.itsaky.androidide.floating.model.DockableContent -import com.itsaky.androidide.floating.window.FloatingWindowHost -import com.itsaky.androidide.plugins.base.InternalPluginApi -import com.itsaky.androidide.plugins.base.PluginWindows -import com.itsaky.androidide.plugins.manager.fragment.PluginFragmentFactory -import com.itsaky.androidide.plugins.manager.ui.PluginEditorTabManager +import org.appdevforall.codeonthego.floating.fragment.OverlayFragmentHost +import org.appdevforall.codeonthego.floating.model.ChromeControl +import org.appdevforall.codeonthego.floating.model.DockableContent +import org.appdevforall.codeonthego.floating.window.FloatingWindowHost +import org.appdevforall.codeonthego.plugins.base.InternalPluginApi +import org.appdevforall.codeonthego.plugins.base.PluginWindows +import org.appdevforall.codeonthego.plugins.manager.fragment.PluginFragmentFactory +import org.appdevforall.codeonthego.plugins.manager.ui.PluginEditorTabManager /** - * Adapts a plugin editor tab (an [com.itsaky.androidide.plugins.extensions.EditorTabExtension] + * Adapts a plugin editor tab (an [org.appdevforall.codeonthego.plugins.extensions.EditorTabExtension] * Fragment) to [DockableContent]. The Fragment is re-instantiated through the plugin's factory and * hosted in an [OverlayFragmentHost] (a FragmentManager with no Activity), so it can run over other * apps. A [PluginFragmentFactory] is installed so the plugin's classloader resolves on recreation. diff --git a/app/src/main/java/com/itsaky/androidide/events/FileTree.kt b/app/src/main/java/org/appdevforall/codeonthego/events/FileTree.kt similarity index 87% rename from app/src/main/java/com/itsaky/androidide/events/FileTree.kt rename to app/src/main/java/org/appdevforall/codeonthego/events/FileTree.kt index 3b4a5e9141..b740200b39 100644 --- a/app/src/main/java/com/itsaky/androidide/events/FileTree.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/events/FileTree.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.events +package org.appdevforall.codeonthego.events -import com.itsaky.androidide.eventbus.events.Event -import com.itsaky.androidide.models.SheetOption +import org.appdevforall.codeonthego.eventbus.events.Event +import org.appdevforall.codeonthego.models.SheetOption import com.unnamed.b.atv.model.TreeNode internal data class FileContextMenuItemClickEvent(val option: SheetOption) : Event() diff --git a/app/src/main/java/com/itsaky/androidide/events/InstallationResultEvent.kt b/app/src/main/java/org/appdevforall/codeonthego/events/InstallationResultEvent.kt similarity index 86% rename from app/src/main/java/com/itsaky/androidide/events/InstallationResultEvent.kt rename to app/src/main/java/org/appdevforall/codeonthego/events/InstallationResultEvent.kt index 3cfd58aea9..ee6f152dae 100644 --- a/app/src/main/java/com/itsaky/androidide/events/InstallationResultEvent.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/events/InstallationResultEvent.kt @@ -14,12 +14,12 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.events +package org.appdevforall.codeonthego.events import android.content.Intent /** - * Event posted by [com.itsaky.androidide.services.InstallationResultReceiver] when an event is + * Event posted by [org.appdevforall.codeonthego.services.InstallationResultReceiver] when an event is * received. * * @author Akash Yadav diff --git a/app/src/main/java/org/appdevforall/codeonthego/events/PluginLanguagesChangedEvent.kt b/app/src/main/java/org/appdevforall/codeonthego/events/PluginLanguagesChangedEvent.kt new file mode 100644 index 0000000000..1a6958c29c --- /dev/null +++ b/app/src/main/java/org/appdevforall/codeonthego/events/PluginLanguagesChangedEvent.kt @@ -0,0 +1,5 @@ +package org.appdevforall.codeonthego.events + +import org.appdevforall.codeonthego.eventbus.events.Event + +class PluginLanguagesChangedEvent : Event() diff --git a/app/src/main/java/com/itsaky/androidide/fragments/BasePreferenceFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/BasePreferenceFragment.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/fragments/BasePreferenceFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/BasePreferenceFragment.kt index ceeb71a01a..0aafd426ae 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/BasePreferenceFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/BasePreferenceFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.os.Bundle import androidx.preference.PreferenceFragmentCompat diff --git a/app/src/main/java/com/itsaky/androidide/fragments/CloneRepositoryFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/CloneRepositoryFragment.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/fragments/CloneRepositoryFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/CloneRepositoryFragment.kt index 1446e3586e..e6b34fb93e 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/CloneRepositoryFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/CloneRepositoryFragment.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.os.Bundle import android.view.LayoutInflater @@ -12,18 +12,18 @@ import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import com.google.android.material.button.MaterialButton import com.google.android.material.textfield.TextInputLayout -import com.itsaky.androidide.activities.MainActivity +import org.appdevforall.codeonthego.activities.MainActivity import com.itsaky.androidide.databinding.FragmentCloneRepositoryBinding -import com.itsaky.androidide.viewmodel.CloneRepositoryViewModel -import com.itsaky.androidide.viewmodel.MainViewModel -import com.itsaky.androidide.git.core.models.CloneRepoUiState +import org.appdevforall.codeonthego.viewmodel.CloneRepositoryViewModel +import org.appdevforall.codeonthego.viewmodel.MainViewModel +import org.appdevforall.codeonthego.git.core.models.CloneRepoUiState import com.itsaky.androidide.R -import com.itsaky.androidide.dnd.handleGitUrlDrop -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashInfo -import com.itsaky.androidide.utils.forEachViewRecursively +import org.appdevforall.codeonthego.dnd.handleGitUrlDrop +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashInfo +import org.appdevforall.codeonthego.utils.forEachViewRecursively import kotlinx.coroutines.launch import org.koin.androidx.viewmodel.ext.android.viewModel import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/fragments/CrashReportFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/CrashReportFragment.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/fragments/CrashReportFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/CrashReportFragment.kt index 2799800418..ce749d37c2 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/CrashReportFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/CrashReportFragment.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.content.Context import android.content.Intent @@ -35,8 +35,8 @@ import androidx.core.net.toUri import androidx.fragment.app.Fragment import com.itsaky.androidide.databinding.LayoutCrashReportBinding import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.BasicBuildInfo -import com.itsaky.androidide.utils.resolveAttr +import org.appdevforall.codeonthego.utils.BasicBuildInfo +import org.appdevforall.codeonthego.utils.resolveAttr class CrashReportFragment : Fragment() { diff --git a/app/src/main/java/com/itsaky/androidide/fragments/DeleteProjectFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/DeleteProjectFragment.kt similarity index 83% rename from app/src/main/java/com/itsaky/androidide/fragments/DeleteProjectFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/DeleteProjectFragment.kt index b2886e1054..ccffd4740b 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/DeleteProjectFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/DeleteProjectFragment.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.os.Bundle import android.view.LayoutInflater @@ -10,22 +10,22 @@ import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.LinearLayoutManager import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.itsaky.androidide.R -import com.itsaky.androidide.adapters.DeleteProjectListAdapter +import org.appdevforall.codeonthego.adapters.DeleteProjectListAdapter import com.itsaky.androidide.databinding.FragmentDeleteProjectBinding -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag.DELETE_PROJECT -import com.itsaky.androidide.idetooltips.TooltipTag.DELETE_PROJECT_BUTTON -import com.itsaky.androidide.idetooltips.TooltipTag.DELETE_PROJECT_CONFIRM -import com.itsaky.androidide.idetooltips.TooltipTag.DELETE_PROJECT_DIALOG -import com.itsaky.androidide.idetooltips.TooltipTag.DELETE_PROJECT_SELECT -import com.itsaky.androidide.idetooltips.TooltipTag.EXIT_TO_MAIN -import com.itsaky.androidide.idetooltips.TooltipTag.PROJECT_NEW -import com.itsaky.androidide.models.Checkable -import com.itsaky.androidide.ui.CustomDividerItemDecoration -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashSuccess -import com.itsaky.androidide.viewmodel.MainViewModel -import com.itsaky.androidide.viewmodel.RecentProjectsViewModel +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag.DELETE_PROJECT +import org.appdevforall.codeonthego.idetooltips.TooltipTag.DELETE_PROJECT_BUTTON +import org.appdevforall.codeonthego.idetooltips.TooltipTag.DELETE_PROJECT_CONFIRM +import org.appdevforall.codeonthego.idetooltips.TooltipTag.DELETE_PROJECT_DIALOG +import org.appdevforall.codeonthego.idetooltips.TooltipTag.DELETE_PROJECT_SELECT +import org.appdevforall.codeonthego.idetooltips.TooltipTag.EXIT_TO_MAIN +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PROJECT_NEW +import org.appdevforall.codeonthego.models.Checkable +import org.appdevforall.codeonthego.ui.CustomDividerItemDecoration +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashSuccess +import org.appdevforall.codeonthego.viewmodel.MainViewModel +import org.appdevforall.codeonthego.viewmodel.RecentProjectsViewModel import kotlinx.coroutines.launch import org.koin.androidx.viewmodel.ext.android.activityViewModel diff --git a/app/src/main/java/com/itsaky/androidide/fragments/DiagnosticsListFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/DiagnosticsListFragment.kt similarity index 83% rename from app/src/main/java/com/itsaky/androidide/fragments/DiagnosticsListFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/DiagnosticsListFragment.kt index ea26d0d43c..a7e49acc5a 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/DiagnosticsListFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/DiagnosticsListFragment.kt @@ -14,15 +14,15 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.os.Bundle import android.view.View import androidx.recyclerview.widget.RecyclerView import com.itsaky.androidide.R -import com.itsaky.androidide.adapters.DiagnosticsAdapter -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.IDELanguageClientImpl +import org.appdevforall.codeonthego.adapters.DiagnosticsAdapter +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.IDELanguageClientImpl class DiagnosticsListFragment : RecyclerViewFragment() { override val fragmentTooltipTag: String? = TooltipTag.PROJECT_DIAGNOSTICS @@ -51,7 +51,7 @@ class DiagnosticsListFragment : RecyclerViewFragment() { val client = IDELanguageClientImpl.getInstance() val activity = activity ?: return - if (activity is com.itsaky.androidide.interfaces.DiagnosticClickListener) { + if (activity is org.appdevforall.codeonthego.interfaces.DiagnosticClickListener) { setAdapter(client.newDiagnosticsAdapter()) } } diff --git a/app/src/main/java/com/itsaky/androidide/fragments/EmptyStateFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/EmptyStateFragment.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/fragments/EmptyStateFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/EmptyStateFragment.kt index 26ff153b19..0f8ec03135 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/EmptyStateFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/EmptyStateFragment.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.annotation.SuppressLint import android.os.Bundle @@ -12,10 +12,10 @@ import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import androidx.viewbinding.ViewBinding import com.itsaky.androidide.databinding.FragmentEmptyStateBinding -import com.itsaky.androidide.editor.ui.IDEEditor -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.utils.viewLifecycleScope -import com.itsaky.androidide.viewmodel.EmptyStateFragmentViewModel +import org.appdevforall.codeonthego.editor.ui.IDEEditor +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.utils.viewLifecycleScope +import org.appdevforall.codeonthego.viewmodel.EmptyStateFragmentViewModel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.collectLatest diff --git a/app/src/main/java/com/itsaky/androidide/fragments/FindActionDialog.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/FindActionDialog.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/fragments/FindActionDialog.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/FindActionDialog.kt index fe2a18882a..4fa1cddf8e 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/FindActionDialog.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/FindActionDialog.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.content.Context import android.content.res.Resources @@ -9,9 +9,9 @@ import android.view.ViewGroup import android.widget.PopupWindow import android.widget.TextView import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag class FindActionDialog( private val anchor: View, diff --git a/app/src/main/java/com/itsaky/androidide/fragments/IDEPreferencesFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/IDEPreferencesFragment.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/fragments/IDEPreferencesFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/IDEPreferencesFragment.kt index cee349056b..2ee370d213 100755 --- a/app/src/main/java/com/itsaky/androidide/fragments/IDEPreferencesFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/IDEPreferencesFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.os.Bundle import android.view.LayoutInflater @@ -26,12 +26,12 @@ import androidx.preference.PreferenceGroup import androidx.preference.PreferenceGroupAdapter import androidx.recyclerview.widget.RecyclerView import com.google.android.material.transition.MaterialSharedAxis -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_TOP -import com.itsaky.androidide.preferences.IPreference -import com.itsaky.androidide.preferences.IPreferenceGroup -import com.itsaky.androidide.preferences.IPreferenceScreen -import com.itsaky.androidide.utils.onLongPress -import com.itsaky.androidide.utils.showIdeCategoryTooltipIfPresent +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_TOP +import org.appdevforall.codeonthego.preferences.IPreference +import org.appdevforall.codeonthego.preferences.IPreferenceGroup +import org.appdevforall.codeonthego.preferences.IPreferenceScreen +import org.appdevforall.codeonthego.utils.onLongPress +import org.appdevforall.codeonthego.utils.showIdeCategoryTooltipIfPresent import org.slf4j.LoggerFactory class IDEPreferencesFragment : BasePreferenceFragment() { @@ -41,7 +41,7 @@ class IDEPreferencesFragment : BasePreferenceFragment() { /** * This screen's own tag - the fallback for a long-press that lands on empty RecyclerView * space (no row under the touch point) or on a row with no tooltipTag of its own. Also read - * by [com.itsaky.androidide.activities.PreferencesActivity] to resolve the toolbar's and the + * by [org.appdevforall.codeonthego.activities.PreferencesActivity] to resolve the toolbar's and the * scroll container's long-press tooltip to whichever screen is currently showing. */ internal var screenTooltipTag: String = PREFS_TOP diff --git a/app/src/main/java/com/itsaky/androidide/fragments/IDETooltipWebViewFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/IDETooltipWebViewFragment.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/fragments/IDETooltipWebViewFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/IDETooltipWebViewFragment.kt index f55f943328..2fff428ce5 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/IDETooltipWebViewFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/IDETooltipWebViewFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.annotation.SuppressLint import android.os.Bundle @@ -32,7 +32,7 @@ import androidx.appcompat.view.ContextThemeWrapper import androidx.core.view.isVisible import androidx.fragment.app.Fragment import com.itsaky.androidide.R -import com.itsaky.androidide.documentation.DocumentationRequestInterceptor +import org.appdevforall.codeonthego.documentation.DocumentationRequestInterceptor class IDETooltipWebviewFragment : Fragment() { private lateinit var webView: WebView diff --git a/app/src/main/java/com/itsaky/androidide/fragments/MainFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/MainFragment.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/fragments/MainFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/MainFragment.kt index 4aad4c4fb6..a2c5a5efa9 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/MainFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/MainFragment.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.content.Intent import android.os.Bundle @@ -7,18 +7,18 @@ import android.view.View import android.view.ViewGroup import androidx.core.view.isVisible import com.itsaky.androidide.R -import com.itsaky.androidide.utils.BasicBuildInfo -import com.itsaky.androidide.activities.editor.HelpActivity -import com.itsaky.androidide.adapters.MainActionsListAdapter -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.ActionsRegistry -import com.itsaky.androidide.actions.internal.DefaultActionsRegistry +import org.appdevforall.codeonthego.utils.BasicBuildInfo +import org.appdevforall.codeonthego.activities.editor.HelpActivity +import org.appdevforall.codeonthego.adapters.MainActionsListAdapter +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionsRegistry +import org.appdevforall.codeonthego.actions.internal.DefaultActionsRegistry import com.itsaky.androidide.databinding.FragmentMainBinding -import com.itsaky.androidide.dnd.handleGitUrlDrop -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag.MAIN_GET_STARTED -import com.itsaky.androidide.viewmodel.MainViewModel +import org.appdevforall.codeonthego.dnd.handleGitUrlDrop +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag.MAIN_GET_STARTED +import org.appdevforall.codeonthego.viewmodel.MainViewModel import org.adfa.constants.CONTENT_KEY import org.adfa.constants.CONTENT_TITLE_KEY import org.koin.androidx.viewmodel.ext.android.activityViewModel diff --git a/app/src/main/java/com/itsaky/androidide/fragments/RecentProjectsFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/RecentProjectsFragment.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/fragments/RecentProjectsFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/RecentProjectsFragment.kt index 97eda99ff1..08991b6960 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/RecentProjectsFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/RecentProjectsFragment.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.animation.ValueAnimator import android.os.Bundle @@ -20,29 +20,29 @@ import com.google.android.material.button.MaterialButton import com.google.android.material.chip.Chip import com.google.android.material.textfield.MaterialAutoCompleteTextView import com.itsaky.androidide.R -import com.itsaky.androidide.activities.MainActivity -import com.itsaky.androidide.adapters.RecentProjectsAdapter +import org.appdevforall.codeonthego.activities.MainActivity +import org.appdevforall.codeonthego.adapters.RecentProjectsAdapter import com.itsaky.androidide.databinding.FragmentSavedProjectsBinding -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag.EXIT_TO_MAIN -import com.itsaky.androidide.idetooltips.TooltipTag.PROJECT_NEW -import com.itsaky.androidide.idetooltips.TooltipTag.PROJECT_OPEN_FOLDER -import com.itsaky.androidide.idetooltips.TooltipTag.PROJECT_RECENT_TOP -import com.itsaky.androidide.models.ProjectFile -import com.itsaky.androidide.ui.CustomDividerItemDecoration -import com.itsaky.androidide.ui.ProjectInfoBottomSheet -import com.itsaky.androidide.utils.Environment.PROJECTS_DIR -import com.itsaky.androidide.utils.findValidProjects -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashSuccess -import com.itsaky.androidide.utils.isProjectCandidateDir -import com.itsaky.androidide.utils.isValidProjectDirectory -import com.itsaky.androidide.utils.isValidProjectOrContainerDirectory -import com.itsaky.androidide.utils.viewLifecycleScope -import com.itsaky.androidide.viewmodel.FilterState -import com.itsaky.androidide.viewmodel.MainViewModel -import com.itsaky.androidide.viewmodel.RecentProjectsViewModel -import com.itsaky.androidide.viewmodel.SortCriteria +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag.EXIT_TO_MAIN +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PROJECT_NEW +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PROJECT_OPEN_FOLDER +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PROJECT_RECENT_TOP +import org.appdevforall.codeonthego.models.ProjectFile +import org.appdevforall.codeonthego.ui.CustomDividerItemDecoration +import org.appdevforall.codeonthego.ui.ProjectInfoBottomSheet +import org.appdevforall.codeonthego.utils.Environment.PROJECTS_DIR +import org.appdevforall.codeonthego.utils.findValidProjects +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashSuccess +import org.appdevforall.codeonthego.utils.isProjectCandidateDir +import org.appdevforall.codeonthego.utils.isValidProjectDirectory +import org.appdevforall.codeonthego.utils.isValidProjectOrContainerDirectory +import org.appdevforall.codeonthego.utils.viewLifecycleScope +import org.appdevforall.codeonthego.viewmodel.FilterState +import org.appdevforall.codeonthego.viewmodel.MainViewModel +import org.appdevforall.codeonthego.viewmodel.RecentProjectsViewModel +import org.appdevforall.codeonthego.viewmodel.SortCriteria import io.sentry.Sentry import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.MutableStateFlow diff --git a/app/src/main/java/com/itsaky/androidide/fragments/RecyclerViewFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/RecyclerViewFragment.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/fragments/RecyclerViewFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/RecyclerViewFragment.kt index e14260035f..9a102e3fc1 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/RecyclerViewFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/RecyclerViewFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.annotation.SuppressLint import android.os.Bundle @@ -29,7 +29,7 @@ import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView.LayoutManager import androidx.viewbinding.ViewBinding import com.itsaky.androidide.R -import com.itsaky.androidide.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipManager /** * A fragment which shows a [RecyclerView]. diff --git a/app/src/main/java/com/itsaky/androidide/fragments/RunTasksDialogFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/RunTasksDialogFragment.kt similarity index 87% rename from app/src/main/java/com/itsaky/androidide/fragments/RunTasksDialogFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/RunTasksDialogFragment.kt index b1385d4db4..3c2686b6b8 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/RunTasksDialogFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/RunTasksDialogFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.app.Dialog import android.content.Intent @@ -39,27 +39,27 @@ import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.google.android.material.transition.MaterialSharedAxis import com.itsaky.androidide.R.string -import com.itsaky.androidide.activities.editor.HelpActivity -import com.itsaky.androidide.adapters.RunTasksListAdapter +import org.appdevforall.codeonthego.activities.editor.HelpActivity +import org.appdevforall.codeonthego.adapters.RunTasksListAdapter import com.itsaky.androidide.databinding.LayoutRunTaskBinding import com.itsaky.androidide.databinding.LayoutRunTaskDialogBinding -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.models.Checkable -import com.itsaky.androidide.project.GradleModels -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.builder.BuildService +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.models.Checkable +import org.appdevforall.codeonthego.project.GradleModels +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.builder.BuildService import com.itsaky.androidide.resources.R -import com.itsaky.androidide.tasks.executeAsync -import com.itsaky.androidide.tasks.mainThreadHandler -import com.itsaky.androidide.utils.SingleTextWatcher -import com.itsaky.androidide.utils.applyLongPressRecursively -import com.itsaky.androidide.utils.doOnApplyWindowInsets -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashInfo -import com.itsaky.androidide.viewmodel.BuildViewModel -import com.itsaky.androidide.viewmodel.RunTasksViewModel +import org.appdevforall.codeonthego.tasks.executeAsync +import org.appdevforall.codeonthego.tasks.mainThreadHandler +import org.appdevforall.codeonthego.utils.SingleTextWatcher +import org.appdevforall.codeonthego.utils.applyLongPressRecursively +import org.appdevforall.codeonthego.utils.doOnApplyWindowInsets +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashInfo +import org.appdevforall.codeonthego.viewmodel.BuildViewModel +import org.appdevforall.codeonthego.viewmodel.RunTasksViewModel import org.slf4j.LoggerFactory /** diff --git a/app/src/main/java/com/itsaky/androidide/fragments/SearchFieldToolbar.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/SearchFieldToolbar.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/fragments/SearchFieldToolbar.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/SearchFieldToolbar.kt index 92509c13b8..5be1c49763 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/SearchFieldToolbar.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/SearchFieldToolbar.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.content.Context import android.content.res.ColorStateList @@ -11,22 +11,22 @@ import android.widget.EditText import android.widget.LinearLayout import android.widget.PopupWindow import androidx.core.graphics.drawable.toDrawable -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.ActionsRegistry -import com.itsaky.androidide.actions.BaseEditorAction -import com.itsaky.androidide.actions.EditTextAdapter -import com.itsaky.androidide.actions.MutableTextTarget -import com.itsaky.androidide.actions.editor.CopyAction -import com.itsaky.androidide.actions.editor.CutAction -import com.itsaky.androidide.actions.editor.PasteAction -import com.itsaky.androidide.actions.editor.SelectAllAction -import com.itsaky.androidide.actions.file.ShowTooltipAction -import com.itsaky.androidide.actions.internal.DefaultActionsRegistry +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionsRegistry +import org.appdevforall.codeonthego.actions.BaseEditorAction +import org.appdevforall.codeonthego.actions.EditTextAdapter +import org.appdevforall.codeonthego.actions.MutableTextTarget +import org.appdevforall.codeonthego.actions.editor.CopyAction +import org.appdevforall.codeonthego.actions.editor.CutAction +import org.appdevforall.codeonthego.actions.editor.PasteAction +import org.appdevforall.codeonthego.actions.editor.SelectAllAction +import org.appdevforall.codeonthego.actions.file.ShowTooltipAction +import org.appdevforall.codeonthego.actions.internal.DefaultActionsRegistry import com.itsaky.androidide.common.R import com.itsaky.androidide.editor.databinding.LayoutPopupMenuItemBinding -import com.itsaky.androidide.utils.dpToPx -import com.itsaky.androidide.utils.resolveAttr +import org.appdevforall.codeonthego.utils.dpToPx +import org.appdevforall.codeonthego.utils.resolveAttr import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob diff --git a/app/src/main/java/com/itsaky/androidide/fragments/SearchResultFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/SearchResultFragment.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/fragments/SearchResultFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/SearchResultFragment.kt index 63e6ab4930..0ab2f2981c 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/SearchResultFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/SearchResultFragment.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.os.Bundle import android.view.LayoutInflater @@ -28,14 +28,14 @@ import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import androidx.recyclerview.widget.RecyclerView -import com.itsaky.androidide.activities.editor.BaseEditorActivity -import com.itsaky.androidide.adapters.SearchListAdapter +import org.appdevforall.codeonthego.activities.editor.BaseEditorActivity +import org.appdevforall.codeonthego.adapters.SearchListAdapter import com.itsaky.androidide.databinding.FragmentSearchResultsReplaceBarBinding -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.models.SearchResult -import com.itsaky.androidide.search.replace.ReplaceHost -import com.itsaky.androidide.search.replace.ReplaceSession -import com.itsaky.androidide.viewmodel.EditorViewModel +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.models.SearchResult +import org.appdevforall.codeonthego.search.replace.ReplaceHost +import org.appdevforall.codeonthego.search.replace.ReplaceSession +import org.appdevforall.codeonthego.viewmodel.EditorViewModel import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.combine import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/itsaky/androidide/fragments/TemplateDetailsFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/TemplateDetailsFragment.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/fragments/TemplateDetailsFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/TemplateDetailsFragment.kt index 8fd4fe0ced..372f799231 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/TemplateDetailsFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/TemplateDetailsFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.animation.ObjectAnimator import android.os.Bundle @@ -30,20 +30,20 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.transition.TransitionManager import com.itsaky.androidide.R import com.itsaky.androidide.R.string -import com.itsaky.androidide.activities.MainActivity -import com.itsaky.androidide.adapters.TemplateWidgetsListAdapter +import org.appdevforall.codeonthego.activities.MainActivity +import org.appdevforall.codeonthego.adapters.TemplateWidgetsListAdapter import com.itsaky.androidide.databinding.FragmentTemplateDetailsBinding -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag.SETUP_CREATE_PROJECT -import com.itsaky.androidide.idetooltips.TooltipTag.SETUP_OVERVIEW -import com.itsaky.androidide.idetooltips.TooltipTag.SETUP_PREVIOUS -import com.itsaky.androidide.templates.ParameterWidget -import com.itsaky.androidide.templates.Template -import com.itsaky.androidide.utils.ProjectCreationManager -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashSuccess -import com.itsaky.androidide.utils.ui.TemplateScrollGateKeeper -import com.itsaky.androidide.viewmodel.MainViewModel +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag.SETUP_CREATE_PROJECT +import org.appdevforall.codeonthego.idetooltips.TooltipTag.SETUP_OVERVIEW +import org.appdevforall.codeonthego.idetooltips.TooltipTag.SETUP_PREVIOUS +import org.appdevforall.codeonthego.templates.ParameterWidget +import org.appdevforall.codeonthego.templates.Template +import org.appdevforall.codeonthego.utils.ProjectCreationManager +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashSuccess +import org.appdevforall.codeonthego.utils.ui.TemplateScrollGateKeeper +import org.appdevforall.codeonthego.viewmodel.MainViewModel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/itsaky/androidide/fragments/TemplateListFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/TemplateListFragment.kt similarity index 87% rename from app/src/main/java/com/itsaky/androidide/fragments/TemplateListFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/TemplateListFragment.kt index d2e3c3b50f..f194f03d17 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/TemplateListFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/TemplateListFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.os.Bundle import android.view.View @@ -24,16 +24,16 @@ import androidx.lifecycle.lifecycleScope import org.koin.androidx.viewmodel.ext.android.activityViewModel import androidx.recyclerview.widget.GridLayoutManager import com.itsaky.androidide.R -import com.itsaky.androidide.adapters.TemplateListAdapter +import org.appdevforall.codeonthego.adapters.TemplateListAdapter import com.itsaky.androidide.databinding.FragmentTemplateListBinding -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag.EXIT_TO_MAIN -import com.itsaky.androidide.templates.ITemplateProvider -import com.itsaky.androidide.templates.ITemplateWidgetViewProvider -import com.itsaky.androidide.templates.ProjectTemplate -import com.itsaky.androidide.templates.impl.TemplateProviderImpl -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.viewmodel.MainViewModel +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag.EXIT_TO_MAIN +import org.appdevforall.codeonthego.templates.ITemplateProvider +import org.appdevforall.codeonthego.templates.ITemplateWidgetViewProvider +import org.appdevforall.codeonthego.templates.ProjectTemplate +import org.appdevforall.codeonthego.templates.impl.TemplateProviderImpl +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.viewmodel.MainViewModel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/itsaky/androidide/fragments/debug/CallStackFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/CallStackFragment.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/fragments/debug/CallStackFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/debug/CallStackFragment.kt index d18aa76227..3596be8047 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/debug/CallStackFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/CallStackFragment.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments.debug +package org.appdevforall.codeonthego.fragments.debug import android.annotation.SuppressLint import android.os.Bundle @@ -13,12 +13,12 @@ import androidx.lifecycle.repeatOnLifecycle import androidx.recyclerview.widget.RecyclerView import com.itsaky.androidide.R import com.itsaky.androidide.databinding.DebuggerCallstackItemBinding -import com.itsaky.androidide.fragments.RecyclerViewFragment -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag.DEBUG_OUTPUT_CALLSTACK -import com.itsaky.androidide.utils.resolveAttr -import com.itsaky.androidide.utils.viewLifecycleScope -import com.itsaky.androidide.viewmodel.DebuggerViewModel +import org.appdevforall.codeonthego.fragments.RecyclerViewFragment +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag.DEBUG_OUTPUT_CALLSTACK +import org.appdevforall.codeonthego.utils.resolveAttr +import org.appdevforall.codeonthego.utils.viewLifecycleScope +import org.appdevforall.codeonthego.viewmodel.DebuggerViewModel import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/itsaky/androidide/fragments/debug/DebuggerFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/DebuggerFragment.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/fragments/debug/DebuggerFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/debug/DebuggerFragment.kt index 4df5333c01..de29998f84 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/debug/DebuggerFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/DebuggerFragment.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments.debug +package org.appdevforall.codeonthego.fragments.debug import android.annotation.SuppressLint import android.content.Context @@ -20,19 +20,19 @@ import androidx.viewpager2.adapter.FragmentStateAdapter import com.google.android.material.tabs.TabLayoutMediator import com.itsaky.androidide.R import com.itsaky.androidide.databinding.FragmentDebuggerBinding -import com.itsaky.androidide.fragments.EmptyStateFragment -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag.DEBUG_NOT_CONNECTED -import com.itsaky.androidide.idetooltips.TooltipTag.DEBUG_OUTPUT_CALLSTACK -import com.itsaky.androidide.idetooltips.TooltipTag.DEBUG_OUTPUT_VARIABLES -import com.itsaky.androidide.idetooltips.TooltipTag.DEBUG_THREAD_SELECTOR -import com.itsaky.androidide.lsp.debug.model.ThreadDescriptor -import com.itsaky.androidide.lsp.debug.model.ThreadState -import com.itsaky.androidide.utils.isAtLeastR -import com.itsaky.androidide.utils.viewLifecycleScope -import com.itsaky.androidide.viewmodel.DebuggerConnectionState -import com.itsaky.androidide.viewmodel.DebuggerViewModel -import com.itsaky.androidide.viewmodel.WADBConnectionViewModel +import org.appdevforall.codeonthego.fragments.EmptyStateFragment +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag.DEBUG_NOT_CONNECTED +import org.appdevforall.codeonthego.idetooltips.TooltipTag.DEBUG_OUTPUT_CALLSTACK +import org.appdevforall.codeonthego.idetooltips.TooltipTag.DEBUG_OUTPUT_VARIABLES +import org.appdevforall.codeonthego.idetooltips.TooltipTag.DEBUG_THREAD_SELECTOR +import org.appdevforall.codeonthego.lsp.debug.model.ThreadDescriptor +import org.appdevforall.codeonthego.lsp.debug.model.ThreadState +import org.appdevforall.codeonthego.utils.isAtLeastR +import org.appdevforall.codeonthego.utils.viewLifecycleScope +import org.appdevforall.codeonthego.viewmodel.DebuggerConnectionState +import org.appdevforall.codeonthego.viewmodel.DebuggerViewModel +import org.appdevforall.codeonthego.viewmodel.WADBConnectionViewModel import io.sentry.Sentry import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.async diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/DisplayableUtils.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/DisplayableUtils.kt new file mode 100644 index 0000000000..6dabe9f6e2 --- /dev/null +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/DisplayableUtils.kt @@ -0,0 +1,8 @@ +package org.appdevforall.codeonthego.fragments.debug + +import org.appdevforall.codeonthego.lsp.debug.model.StackFrameDescriptor +import org.appdevforall.codeonthego.lsp.debug.model.ThreadDescriptor + +fun ThreadDescriptor.displayText(): String = toString() + +fun StackFrameDescriptor.displayText(): String = method diff --git a/app/src/main/java/com/itsaky/androidide/fragments/debug/Resolvable.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/Resolvable.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/fragments/debug/Resolvable.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/debug/Resolvable.kt index 46cf9f1972..6d0d1a54a0 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/debug/Resolvable.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/Resolvable.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.fragments.debug - -import com.itsaky.androidide.lsp.debug.model.StackFrame -import com.itsaky.androidide.lsp.debug.model.StackFrameDescriptor -import com.itsaky.androidide.lsp.debug.model.ThreadDescriptor -import com.itsaky.androidide.lsp.debug.model.ThreadInfo -import com.itsaky.androidide.lsp.debug.model.Value -import com.itsaky.androidide.lsp.debug.model.Variable -import com.itsaky.androidide.lsp.debug.model.VariableDescriptor -import com.itsaky.androidide.lsp.debug.model.VariableKind -import com.itsaky.androidide.lsp.java.utils.completedOrNull -import com.itsaky.androidide.lsp.java.utils.getValue +package org.appdevforall.codeonthego.fragments.debug + +import org.appdevforall.codeonthego.lsp.debug.model.StackFrame +import org.appdevforall.codeonthego.lsp.debug.model.StackFrameDescriptor +import org.appdevforall.codeonthego.lsp.debug.model.ThreadDescriptor +import org.appdevforall.codeonthego.lsp.debug.model.ThreadInfo +import org.appdevforall.codeonthego.lsp.debug.model.Value +import org.appdevforall.codeonthego.lsp.debug.model.Variable +import org.appdevforall.codeonthego.lsp.debug.model.VariableDescriptor +import org.appdevforall.codeonthego.lsp.debug.model.VariableKind +import org.appdevforall.codeonthego.lsp.java.utils.completedOrNull +import org.appdevforall.codeonthego.lsp.java.utils.getValue import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Deferred diff --git a/app/src/main/java/com/itsaky/androidide/fragments/debug/VariableIcon.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableIcon.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/fragments/debug/VariableIcon.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableIcon.kt index 57c57b461c..631d997fe2 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/debug/VariableIcon.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableIcon.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments.debug +package org.appdevforall.codeonthego.fragments.debug import android.content.res.Resources import android.graphics.Canvas diff --git a/app/src/main/java/com/itsaky/androidide/fragments/debug/VariableListBinder.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableListBinder.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/fragments/debug/VariableListBinder.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableListBinder.kt index 0a06d37787..a8da8c714f 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/debug/VariableListBinder.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableListBinder.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments.debug +package org.appdevforall.codeonthego.fragments.debug import android.content.Context import android.text.InputType @@ -11,15 +11,15 @@ import androidx.core.text.PrecomputedTextCompat import androidx.core.widget.TextViewCompat import com.itsaky.androidide.databinding.DebuggerSetVariableValueBinding import com.itsaky.androidide.databinding.DebuggerVariableItemBinding -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag.DEBUG_OUTPUT_VARIABLES -import com.itsaky.androidide.lsp.debug.model.VariableDescriptor -import com.itsaky.androidide.lsp.debug.model.VariableKind +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag.DEBUG_OUTPUT_VARIABLES +import org.appdevforall.codeonthego.lsp.debug.model.VariableDescriptor +import org.appdevforall.codeonthego.lsp.debug.model.VariableKind import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.DialogUtils -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.isSystemInDarkMode -import com.itsaky.androidide.viewmodel.DebuggerViewModel +import org.appdevforall.codeonthego.utils.DialogUtils +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.isSystemInDarkMode +import org.appdevforall.codeonthego.viewmodel.DebuggerViewModel import io.github.dingyi222666.view.treeview.TreeNode import io.github.dingyi222666.view.treeview.TreeNodeEventListener import io.github.dingyi222666.view.treeview.TreeView diff --git a/app/src/main/java/com/itsaky/androidide/fragments/debug/VariableListFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableListFragment.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/fragments/debug/VariableListFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableListFragment.kt index 121c221e7c..f83f85edcf 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/debug/VariableListFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableListFragment.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments.debug +package org.appdevforall.codeonthego.fragments.debug import android.annotation.SuppressLint import android.os.Bundle @@ -12,9 +12,9 @@ import androidx.fragment.app.activityViewModels import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag.DEBUG_OUTPUT_VARIABLES -import com.itsaky.androidide.viewmodel.DebuggerViewModel +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag.DEBUG_OUTPUT_VARIABLES +import org.appdevforall.codeonthego.viewmodel.DebuggerViewModel import io.github.dingyi222666.view.treeview.TreeView import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/itsaky/androidide/fragments/debug/VariableTreeNodeGenerator.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableTreeNodeGenerator.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/fragments/debug/VariableTreeNodeGenerator.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableTreeNodeGenerator.kt index 8f1e632cc7..c92bf457a8 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/debug/VariableTreeNodeGenerator.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableTreeNodeGenerator.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments.debug +package org.appdevforall.codeonthego.fragments.debug import io.github.dingyi222666.view.treeview.AbstractTree import io.github.dingyi222666.view.treeview.Tree diff --git a/app/src/main/java/com/itsaky/androidide/fragments/debug/WADBPermissionFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/WADBPermissionFragment.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/fragments/debug/WADBPermissionFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/debug/WADBPermissionFragment.kt index 7c7ce260e5..bc4114d790 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/debug/WADBPermissionFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/WADBPermissionFragment.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments.debug +package org.appdevforall.codeonthego.fragments.debug import android.os.Build import android.os.Bundle @@ -9,9 +9,9 @@ import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import com.itsaky.androidide.R import com.itsaky.androidide.databinding.FragmentWadbConnectionBinding -import com.itsaky.androidide.fragments.FragmentWithBinding -import com.itsaky.androidide.utils.viewLifecycleScope -import com.itsaky.androidide.viewmodel.WADBConnectionViewModel +import org.appdevforall.codeonthego.fragments.FragmentWithBinding +import org.appdevforall.codeonthego.utils.viewLifecycleScope +import org.appdevforall.codeonthego.viewmodel.WADBConnectionViewModel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/itsaky/androidide/fragments/git/GitBottomSheetFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitBottomSheetFragment.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/fragments/git/GitBottomSheetFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitBottomSheetFragment.kt index bd8181040c..74f3cff7e0 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/git/GitBottomSheetFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitBottomSheetFragment.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments.git +package org.appdevforall.codeonthego.fragments.git import android.content.Intent import android.os.Bundle @@ -20,28 +20,28 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.textfield.TextInputEditText import com.google.android.material.textfield.TextInputLayout import com.itsaky.androidide.R -import com.itsaky.androidide.activities.PreferencesActivity -import com.itsaky.androidide.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.activities.PreferencesActivity +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity import com.itsaky.androidide.databinding.FragmentGitBottomSheetBinding -import com.itsaky.androidide.events.ListProjectFilesRequestEvent -import com.itsaky.androidide.fragments.git.adapter.GitFileChangeAdapter -import com.itsaky.androidide.git.core.GitCredentialsManager -import com.itsaky.androidide.git.core.models.ChangeType -import com.itsaky.androidide.git.core.models.FileChange -import com.itsaky.androidide.git.core.models.GitBranch -import com.itsaky.androidide.git.core.models.GitStatus -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.idetooltips.attachTooltip -import com.itsaky.androidide.interfaces.IEditorHandler -import com.itsaky.androidide.preferences.internal.GitPreferences -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashSuccess -import com.itsaky.androidide.utils.onLongPress -import com.itsaky.androidide.viewmodel.BottomSheetViewModel -import com.itsaky.androidide.viewmodel.GitBottomSheetViewModel -import com.itsaky.androidide.viewmodel.GitBottomSheetViewModel.BranchesUiState -import com.itsaky.androidide.viewmodel.GitBottomSheetViewModel.PullUiState +import org.appdevforall.codeonthego.events.ListProjectFilesRequestEvent +import org.appdevforall.codeonthego.fragments.git.adapter.GitFileChangeAdapter +import org.appdevforall.codeonthego.git.core.GitCredentialsManager +import org.appdevforall.codeonthego.git.core.models.ChangeType +import org.appdevforall.codeonthego.git.core.models.FileChange +import org.appdevforall.codeonthego.git.core.models.GitBranch +import org.appdevforall.codeonthego.git.core.models.GitStatus +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.idetooltips.attachTooltip +import org.appdevforall.codeonthego.interfaces.IEditorHandler +import org.appdevforall.codeonthego.preferences.internal.GitPreferences +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashSuccess +import org.appdevforall.codeonthego.utils.onLongPress +import org.appdevforall.codeonthego.viewmodel.BottomSheetViewModel +import org.appdevforall.codeonthego.viewmodel.GitBottomSheetViewModel +import org.appdevforall.codeonthego.viewmodel.GitBottomSheetViewModel.BranchesUiState +import org.appdevforall.codeonthego.viewmodel.GitBottomSheetViewModel.PullUiState import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.combine import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/itsaky/androidide/fragments/git/GitBranchPopupWindow.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitBranchPopupWindow.kt similarity index 89% rename from app/src/main/java/com/itsaky/androidide/fragments/git/GitBranchPopupWindow.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitBranchPopupWindow.kt index e0b6c68385..56285fb218 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/git/GitBranchPopupWindow.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitBranchPopupWindow.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments.git +package org.appdevforall.codeonthego.fragments.git import android.content.Context import android.graphics.Color @@ -11,17 +11,17 @@ import androidx.core.widget.doAfterTextChanged import androidx.recyclerview.widget.LinearLayoutManager import com.itsaky.androidide.R import com.itsaky.androidide.databinding.PopupGitBranchesBinding -import com.itsaky.androidide.fragments.git.adapter.GitBranchAdapter -import com.itsaky.androidide.fragments.git.adapter.GitBranchListItem -import com.itsaky.androidide.git.core.models.GitBranch -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.utils.applyLongPressRecursively -import com.itsaky.androidide.utils.findActivity -import com.itsaky.androidide.utils.onLongPress -import com.itsaky.androidide.utils.showIdeCategoryTooltipIfPresent -import com.itsaky.androidide.viewmodel.GitBottomSheetViewModel -import com.itsaky.androidide.viewmodel.GitBottomSheetViewModel.BranchesUiState +import org.appdevforall.codeonthego.fragments.git.adapter.GitBranchAdapter +import org.appdevforall.codeonthego.fragments.git.adapter.GitBranchListItem +import org.appdevforall.codeonthego.git.core.models.GitBranch +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.utils.applyLongPressRecursively +import org.appdevforall.codeonthego.utils.findActivity +import org.appdevforall.codeonthego.utils.onLongPress +import org.appdevforall.codeonthego.utils.showIdeCategoryTooltipIfPresent +import org.appdevforall.codeonthego.viewmodel.GitBottomSheetViewModel +import org.appdevforall.codeonthego.viewmodel.GitBottomSheetViewModel.BranchesUiState /** * Popup window that displays the list of local and remote branches with search, diff --git a/app/src/main/java/com/itsaky/androidide/fragments/git/GitCommitHistoryDialog.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitCommitHistoryDialog.kt similarity index 89% rename from app/src/main/java/com/itsaky/androidide/fragments/git/GitCommitHistoryDialog.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitCommitHistoryDialog.kt index fa541943fb..b807b30143 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/git/GitCommitHistoryDialog.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitCommitHistoryDialog.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments.git +package org.appdevforall.codeonthego.fragments.git import android.os.Bundle import android.view.LayoutInflater @@ -11,16 +11,16 @@ import androidx.recyclerview.widget.LinearLayoutManager import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.itsaky.androidide.R import com.itsaky.androidide.databinding.DialogGitCommitHistoryBinding -import com.itsaky.androidide.fragments.git.adapter.GitCommitHistoryAdapter -import com.itsaky.androidide.git.core.GitCredentialsManager -import com.itsaky.androidide.git.core.models.CommitHistoryUiState -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.idetooltips.attachTooltip -import com.itsaky.androidide.utils.applyLongPressRecursively -import com.itsaky.androidide.utils.flashSuccess -import com.itsaky.androidide.utils.onLongPress -import com.itsaky.androidide.viewmodel.GitBottomSheetViewModel +import org.appdevforall.codeonthego.fragments.git.adapter.GitCommitHistoryAdapter +import org.appdevforall.codeonthego.git.core.GitCredentialsManager +import org.appdevforall.codeonthego.git.core.models.CommitHistoryUiState +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.idetooltips.attachTooltip +import org.appdevforall.codeonthego.utils.applyLongPressRecursively +import org.appdevforall.codeonthego.utils.flashSuccess +import org.appdevforall.codeonthego.utils.onLongPress +import org.appdevforall.codeonthego.viewmodel.GitBottomSheetViewModel import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch import org.koin.android.ext.android.inject diff --git a/app/src/main/java/com/itsaky/androidide/fragments/git/GitDialogUtils.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitDialogUtils.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/fragments/git/GitDialogUtils.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitDialogUtils.kt index 990aa38b69..37bc6eee93 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/git/GitDialogUtils.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitDialogUtils.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments.git +package org.appdevforall.codeonthego.fragments.git import androidx.appcompat.app.AlertDialog import androidx.core.widget.doAfterTextChanged @@ -6,7 +6,7 @@ import androidx.fragment.app.Fragment import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.itsaky.androidide.R import com.itsaky.androidide.databinding.DialogGitCredentialsBinding -import com.itsaky.androidide.git.core.GitCredentialsManager +import org.appdevforall.codeonthego.git.core.GitCredentialsManager fun Fragment.showGitCredentialsDialog( credentialsManager: GitCredentialsManager, diff --git a/app/src/main/java/com/itsaky/androidide/fragments/git/GitDiffViewerDialog.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitDiffViewerDialog.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/fragments/git/GitDiffViewerDialog.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitDiffViewerDialog.kt index 48ab7bb8de..621d4dc1e5 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/git/GitDiffViewerDialog.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitDiffViewerDialog.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments.git +package org.appdevforall.codeonthego.fragments.git import android.graphics.Canvas import android.graphics.Paint @@ -15,7 +15,7 @@ import androidx.fragment.app.DialogFragment import androidx.lifecycle.lifecycleScope import com.itsaky.androidide.R import com.itsaky.androidide.databinding.DialogGitDiffBinding -import com.itsaky.androidide.viewmodel.GitBottomSheetViewModel +import org.appdevforall.codeonthego.viewmodel.GitBottomSheetViewModel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext diff --git a/app/src/main/java/com/itsaky/androidide/fragments/git/adapter/GitBranchAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/adapter/GitBranchAdapter.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/fragments/git/adapter/GitBranchAdapter.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/git/adapter/GitBranchAdapter.kt index 1325adfd40..7e7c174d1d 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/git/adapter/GitBranchAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/adapter/GitBranchAdapter.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments.git.adapter +package org.appdevforall.codeonthego.fragments.git.adapter import android.view.LayoutInflater import android.view.View @@ -9,7 +9,7 @@ import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView import com.itsaky.androidide.R import com.itsaky.androidide.databinding.ItemGitBranchBinding -import com.itsaky.androidide.git.core.models.GitBranch +import org.appdevforall.codeonthego.git.core.models.GitBranch /** * Represents items rendered in the Git branch selection list. diff --git a/app/src/main/java/com/itsaky/androidide/fragments/git/adapter/GitCommitHistoryAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/adapter/GitCommitHistoryAdapter.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/fragments/git/adapter/GitCommitHistoryAdapter.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/git/adapter/GitCommitHistoryAdapter.kt index 55aeb1108c..c74e92da1f 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/git/adapter/GitCommitHistoryAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/adapter/GitCommitHistoryAdapter.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments.git.adapter +package org.appdevforall.codeonthego.fragments.git.adapter import android.view.LayoutInflater import android.view.View @@ -8,7 +8,7 @@ import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView import com.itsaky.androidide.R import com.itsaky.androidide.databinding.ItemGitCommitBinding -import com.itsaky.androidide.git.core.models.GitCommit +import org.appdevforall.codeonthego.git.core.models.GitCommit import java.text.SimpleDateFormat import java.util.Date import java.util.Locale diff --git a/app/src/main/java/com/itsaky/androidide/fragments/git/adapter/GitFileChangeAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/adapter/GitFileChangeAdapter.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/fragments/git/adapter/GitFileChangeAdapter.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/git/adapter/GitFileChangeAdapter.kt index 940f91fa95..54e0b58d3a 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/git/adapter/GitFileChangeAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/adapter/GitFileChangeAdapter.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments.git.adapter +package org.appdevforall.codeonthego.fragments.git.adapter import android.view.LayoutInflater import android.view.View @@ -8,8 +8,8 @@ import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView import com.itsaky.androidide.R import com.itsaky.androidide.databinding.ItemGitFileChangeBinding -import com.itsaky.androidide.git.core.models.ChangeType -import com.itsaky.androidide.git.core.models.FileChange +import org.appdevforall.codeonthego.git.core.models.ChangeType +import org.appdevforall.codeonthego.git.core.models.FileChange class GitFileChangeAdapter( private val onFileClicked: (FileChange) -> Unit, diff --git a/app/src/main/java/com/itsaky/androidide/fragments/onboarding/GreetingFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/GreetingFragment.kt similarity index 88% rename from app/src/main/java/com/itsaky/androidide/fragments/onboarding/GreetingFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/GreetingFragment.kt index d23817e9c9..4bac0016e1 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/onboarding/GreetingFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/GreetingFragment.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.onboarding +package org.appdevforall.codeonthego.fragments.onboarding import android.os.Bundle import android.view.View import com.itsaky.androidide.databinding.FragmentOnboardingGreetingBinding -import com.itsaky.androidide.fragments.FragmentWithBinding -import com.itsaky.androidide.utils.FeatureFlags +import org.appdevforall.codeonthego.fragments.FragmentWithBinding +import org.appdevforall.codeonthego.utils.FeatureFlags /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/fragments/onboarding/IdeSetupConfigurationFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/IdeSetupConfigurationFragment.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/fragments/onboarding/IdeSetupConfigurationFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/IdeSetupConfigurationFragment.kt index 7833257df3..71f686f7fd 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/onboarding/IdeSetupConfigurationFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/IdeSetupConfigurationFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.onboarding +package org.appdevforall.codeonthego.fragments.onboarding import android.annotation.SuppressLint import android.content.BroadcastReceiver @@ -44,13 +44,13 @@ import org.adfa.constants.V8_KEY import com.github.appintro.SlidePolicy import com.itsaky.androidide.R import com.itsaky.androidide.databinding.LayoutOnboardngSetupConfigBinding -import com.itsaky.androidide.models.IdeSetupArgument +import org.appdevforall.codeonthego.models.IdeSetupArgument import com.itsaky.androidide.resources.R.string -import com.itsaky.androidide.tasks.runOnUiThread -import com.itsaky.androidide.utils.ConnectionInfo -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.getConnectionInfo +import org.appdevforall.codeonthego.tasks.runOnUiThread +import org.appdevforall.codeonthego.utils.ConnectionInfo +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.getConnectionInfo /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/fragments/onboarding/OnboardingFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingFragment.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/fragments/onboarding/OnboardingFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingFragment.kt index 20d5f65a10..8908c92ba9 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/onboarding/OnboardingFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.onboarding +package org.appdevforall.codeonthego.fragments.onboarding import android.os.Bundle import android.view.View @@ -23,7 +23,7 @@ import android.view.ViewGroup import androidx.core.text.method.LinkMovementMethodCompat import androidx.core.view.updateLayoutParams import com.itsaky.androidide.databinding.FragmentOnboardingBinding -import com.itsaky.androidide.fragments.FragmentWithBinding +import org.appdevforall.codeonthego.fragments.FragmentWithBinding open class OnboardingFragment : FragmentWithBinding(FragmentOnboardingBinding::inflate) { diff --git a/app/src/main/java/com/itsaky/androidide/fragments/onboarding/OnboardingInfoFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingInfoFragment.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/fragments/onboarding/OnboardingInfoFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingInfoFragment.kt index 42c15baa42..e70511b8b1 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/onboarding/OnboardingInfoFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingInfoFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.onboarding +package org.appdevforall.codeonthego.fragments.onboarding import android.content.res.ColorStateList import android.os.Bundle @@ -24,7 +24,7 @@ import androidx.annotation.ColorInt import androidx.annotation.DrawableRes import androidx.core.widget.ImageViewCompat import com.itsaky.androidide.databinding.FragmentOnboardingInfoBinding -import com.itsaky.androidide.fragments.FragmentWithBinding +import org.appdevforall.codeonthego.fragments.FragmentWithBinding /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/fragments/onboarding/OnboardingMultiActionFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingMultiActionFragment.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/fragments/onboarding/OnboardingMultiActionFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingMultiActionFragment.kt index 465c5196eb..ce6e392a27 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/onboarding/OnboardingMultiActionFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingMultiActionFragment.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.onboarding +package org.appdevforall.codeonthego.fragments.onboarding import android.os.Build import android.os.Bundle import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import com.itsaky.androidide.adapters.onboarding.DefaultOnboardingItemAdapter +import org.appdevforall.codeonthego.adapters.onboarding.DefaultOnboardingItemAdapter import com.itsaky.androidide.databinding.LayoutOnboardingMultiactionBinding -import com.itsaky.androidide.models.OnboardingItem -import com.itsaky.androidide.utils.uncheckedCast +import org.appdevforall.codeonthego.models.OnboardingItem +import org.appdevforall.codeonthego.utils.uncheckedCast /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/fragments/onboarding/PermissionsFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/PermissionsFragment.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/fragments/onboarding/PermissionsFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/PermissionsFragment.kt index 577d77529f..899b143581 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/onboarding/PermissionsFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/PermissionsFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.onboarding +package org.appdevforall.codeonthego.fragments.onboarding import android.Manifest import android.content.Context @@ -39,28 +39,28 @@ import com.github.appintro.SlidePolicy import com.github.appintro.SlideSelectionListener import com.google.android.material.button.MaterialButton import com.itsaky.androidide.R -import com.itsaky.androidide.activities.OnboardingActivity -import com.itsaky.androidide.adapters.onboarding.OnboardingPermissionsAdapter -import com.itsaky.androidide.app.DeviceProtectedApplicationLoader -import com.itsaky.androidide.app.IDEApplication +import org.appdevforall.codeonthego.activities.OnboardingActivity +import org.appdevforall.codeonthego.adapters.onboarding.OnboardingPermissionsAdapter +import org.appdevforall.codeonthego.app.DeviceProtectedApplicationLoader +import org.appdevforall.codeonthego.app.IDEApplication import com.itsaky.androidide.buildinfo.BuildInfo import com.itsaky.androidide.databinding.LayoutDialogPrivacyConsentBinding import com.itsaky.androidide.databinding.LayoutOnboardingPermissionsBinding -import com.itsaky.androidide.events.InstallationEvent -import com.itsaky.androidide.preferences.internal.StatPreferences -import com.itsaky.androidide.preferences.internal.TelemetryConsent -import com.itsaky.androidide.tasks.doAsyncWithProgress -import com.itsaky.androidide.utils.DialogUtils -import com.itsaky.androidide.utils.OverlayPermissionGuide -import com.itsaky.androidide.utils.PermissionsHelper -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashSuccess -import com.itsaky.androidide.utils.isAtLeastR -import com.itsaky.androidide.utils.isTestMode -import com.itsaky.androidide.utils.viewLifecycleScope -import com.itsaky.androidide.utils.viewLifecycleScopeOrNull -import com.itsaky.androidide.viewmodel.InstallationState -import com.itsaky.androidide.viewmodel.InstallationViewModel +import org.appdevforall.codeonthego.events.InstallationEvent +import org.appdevforall.codeonthego.preferences.internal.StatPreferences +import org.appdevforall.codeonthego.preferences.internal.TelemetryConsent +import org.appdevforall.codeonthego.tasks.doAsyncWithProgress +import org.appdevforall.codeonthego.utils.DialogUtils +import org.appdevforall.codeonthego.utils.OverlayPermissionGuide +import org.appdevforall.codeonthego.utils.PermissionsHelper +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashSuccess +import org.appdevforall.codeonthego.utils.isAtLeastR +import org.appdevforall.codeonthego.utils.isTestMode +import org.appdevforall.codeonthego.utils.viewLifecycleScope +import org.appdevforall.codeonthego.utils.viewLifecycleScopeOrNull +import org.appdevforall.codeonthego.viewmodel.InstallationState +import org.appdevforall.codeonthego.viewmodel.InstallationViewModel import io.sentry.Sentry import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job diff --git a/app/src/main/java/com/itsaky/androidide/fragments/onboarding/ideSetupConfig.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/ideSetupConfig.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/fragments/onboarding/ideSetupConfig.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/ideSetupConfig.kt index 0ff8bb2eaf..b914f3dc81 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/onboarding/ideSetupConfig.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/ideSetupConfig.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.onboarding +package org.appdevforall.codeonthego.fragments.onboarding -import com.itsaky.androidide.app.configuration.CpuArch +import org.appdevforall.codeonthego.app.configuration.CpuArch private val ARM_ONLY = arrayOf(CpuArch.AARCH64, CpuArch.ARM) private val ALL = arrayOf(CpuArch.AARCH64, CpuArch.ARM, CpuArch.X86_64) diff --git a/app/src/main/java/com/itsaky/androidide/fragments/output/AppLogFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/AppLogFragment.kt similarity index 85% rename from app/src/main/java/com/itsaky/androidide/fragments/output/AppLogFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/output/AppLogFragment.kt index 35bc0d6554..5aba51e955 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/output/AppLogFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/AppLogFragment.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.output +package org.appdevforall.codeonthego.fragments.output import android.os.Bundle import android.view.View import androidx.fragment.app.activityViewModels import com.itsaky.androidide.R -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.preferences.internal.DevOpsPreferences -import com.itsaky.androidide.viewmodel.AppLogsViewModel +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.preferences.internal.DevOpsPreferences +import org.appdevforall.codeonthego.viewmodel.AppLogsViewModel /** * Fragment to show application logs. diff --git a/app/src/main/java/com/itsaky/androidide/fragments/output/BuildOutputFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/BuildOutputFragment.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/fragments/output/BuildOutputFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/output/BuildOutputFragment.kt index ae07474ca4..d4eb15d77a 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/output/BuildOutputFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/BuildOutputFragment.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.output +package org.appdevforall.codeonthego.fragments.output import android.os.Bundle import android.view.View @@ -27,15 +27,15 @@ import androidx.fragment.app.activityViewModels import androidx.lifecycle.lifecycleScope import com.itsaky.androidide.R import com.itsaky.androidide.databinding.LayoutLogFilterBarBinding -import com.itsaky.androidide.editor.ui.EditorSearchLayout -import com.itsaky.androidide.editor.ui.IDEEditor -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.models.LogFilter -import com.itsaky.androidide.preferences.internal.EditorPreferences -import com.itsaky.androidide.utils.BasicBuildInfo -import com.itsaky.androidide.utils.dpToPx -import com.itsaky.androidide.utils.flashInfo -import com.itsaky.androidide.viewmodel.BuildOutputViewModel +import org.appdevforall.codeonthego.editor.ui.EditorSearchLayout +import org.appdevforall.codeonthego.editor.ui.IDEEditor +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.models.LogFilter +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.utils.BasicBuildInfo +import org.appdevforall.codeonthego.utils.dpToPx +import org.appdevforall.codeonthego.utils.flashInfo +import org.appdevforall.codeonthego.viewmodel.BuildOutputViewModel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.ReceiveChannel @@ -431,7 +431,7 @@ class BuildOutputFragment : * Performs the safe UI update on the Main Thread. * * Display only: the session file is written independently by - * [com.itsaky.androidide.ui.EditorBottomSheet.appendBuildOut], which sees every line whether or + * [org.appdevforall.codeonthego.ui.EditorBottomSheet.appendBuildOut], which sees every line whether or * not this fragment exists. * * Uses [IDEEditor.awaitLayout] to guarantee the editor has physical dimensions (width > 0) diff --git a/app/src/main/java/com/itsaky/androidide/fragments/output/FilterNoMatchTracker.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/FilterNoMatchTracker.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/fragments/output/FilterNoMatchTracker.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/output/FilterNoMatchTracker.kt index 9c547c5cce..6682db9c8b 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/output/FilterNoMatchTracker.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/FilterNoMatchTracker.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.output +package org.appdevforall.codeonthego.fragments.output /** * Decides when a filtered re-render deserves a "no matches" flash: only on a fresh diff --git a/app/src/main/java/com/itsaky/androidide/fragments/output/IDELogFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/IDELogFragment.kt similarity index 89% rename from app/src/main/java/com/itsaky/androidide/fragments/output/IDELogFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/output/IDELogFragment.kt index c21d4023fa..e901a3fcae 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/output/IDELogFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/IDELogFragment.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.output +package org.appdevforall.codeonthego.fragments.output import android.os.Bundle import android.view.View import androidx.fragment.app.activityViewModels import com.itsaky.androidide.R -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.viewmodel.IDELogsViewModel +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.viewmodel.IDELogsViewModel /** * Fragment to show IDE logs. Log consumption happens in [IDELogsViewModel]. diff --git a/app/src/main/java/com/itsaky/androidide/fragments/output/LogFilterBarController.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/LogFilterBarController.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/fragments/output/LogFilterBarController.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/output/LogFilterBarController.kt index 4b0945758d..c82986fe6a 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/output/LogFilterBarController.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/LogFilterBarController.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.output +package org.appdevforall.codeonthego.fragments.output import androidx.core.view.isVisible import androidx.core.widget.doAfterTextChanged import com.itsaky.androidide.databinding.LayoutLogFilterBarBinding -import com.itsaky.androidide.utils.ILogger -import com.itsaky.androidide.utils.KeyboardUtils +import org.appdevforall.codeonthego.utils.ILogger +import org.appdevforall.codeonthego.utils.KeyboardUtils import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job import kotlinx.coroutines.delay diff --git a/app/src/main/java/com/itsaky/androidide/fragments/output/LogViewFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/LogViewFragment.kt similarity index 87% rename from app/src/main/java/com/itsaky/androidide/fragments/output/LogViewFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/output/LogViewFragment.kt index 95b6150f74..f60017a85b 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/output/LogViewFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/LogViewFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.output +package org.appdevforall.codeonthego.fragments.output import android.os.Bundle import android.view.View @@ -24,33 +24,33 @@ import androidx.annotation.UiThread import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import com.itsaky.androidide.R -import com.itsaky.androidide.activities.editor.BaseEditorActivity +import org.appdevforall.codeonthego.activities.editor.BaseEditorActivity import com.itsaky.androidide.databinding.FragmentLogBinding import com.itsaky.androidide.databinding.LayoutLogFilterBarBinding -import com.itsaky.androidide.editor.language.treesitter.LogLanguage -import com.itsaky.androidide.editor.language.treesitter.TreeSitterLanguageProvider -import com.itsaky.androidide.editor.schemes.IDEColorScheme -import com.itsaky.androidide.editor.schemes.IDEColorSchemeProvider -import com.itsaky.androidide.editor.ui.EditorSearchLayout -import com.itsaky.androidide.editor.ui.IDEEditor -import com.itsaky.androidide.eventbus.events.preferences.PreferenceChangeEvent -import com.itsaky.androidide.fragments.EmptyStateFragment -import com.itsaky.androidide.models.LogFilter -import com.itsaky.androidide.models.LogLine -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.preferences.internal.EditorPreferences -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.api.ModuleProject -import com.itsaky.androidide.utils.BasicBuildInfo -import com.itsaky.androidide.utils.StackFrame -import com.itsaky.androidide.utils.StackFrameLocator -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashInfo -import com.itsaky.androidide.utils.isTestMode -import com.itsaky.androidide.utils.jetbrainsMono -import com.itsaky.androidide.utils.viewLifecycleScope -import com.itsaky.androidide.viewmodel.LogViewModel +import org.appdevforall.codeonthego.editor.language.treesitter.LogLanguage +import org.appdevforall.codeonthego.editor.language.treesitter.TreeSitterLanguageProvider +import org.appdevforall.codeonthego.editor.schemes.IDEColorScheme +import org.appdevforall.codeonthego.editor.schemes.IDEColorSchemeProvider +import org.appdevforall.codeonthego.editor.ui.EditorSearchLayout +import org.appdevforall.codeonthego.editor.ui.IDEEditor +import org.appdevforall.codeonthego.eventbus.events.preferences.PreferenceChangeEvent +import org.appdevforall.codeonthego.fragments.EmptyStateFragment +import org.appdevforall.codeonthego.models.LogFilter +import org.appdevforall.codeonthego.models.LogLine +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.api.ModuleProject +import org.appdevforall.codeonthego.utils.BasicBuildInfo +import org.appdevforall.codeonthego.utils.StackFrame +import org.appdevforall.codeonthego.utils.StackFrameLocator +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashInfo +import org.appdevforall.codeonthego.utils.isTestMode +import org.appdevforall.codeonthego.utils.jetbrainsMono +import org.appdevforall.codeonthego.utils.viewLifecycleScope +import org.appdevforall.codeonthego.viewmodel.LogViewModel import io.github.rosemoe.sora.event.ClickEvent import io.github.rosemoe.sora.util.IntPair import io.github.rosemoe.sora.widget.REGION_TEXT diff --git a/app/src/main/java/com/itsaky/androidide/fragments/output/NonEditableEditorFragment.java b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/NonEditableEditorFragment.java similarity index 87% rename from app/src/main/java/com/itsaky/androidide/fragments/output/NonEditableEditorFragment.java rename to app/src/main/java/org/appdevforall/codeonthego/fragments/output/NonEditableEditorFragment.java index fcea20667e..b3ac4c4ad5 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/output/NonEditableEditorFragment.java +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/NonEditableEditorFragment.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.output; +package org.appdevforall.codeonthego.fragments.output; import android.os.Bundle; import android.view.View; @@ -23,13 +23,13 @@ import androidx.annotation.Nullable; import com.itsaky.androidide.R; import com.itsaky.androidide.databinding.FragmentNonEditableEditorBinding; -import com.itsaky.androidide.editor.ui.IDEEditor; -import com.itsaky.androidide.eventbus.events.preferences.PreferenceChangeEvent; -import com.itsaky.androidide.fragments.EmptyStateFragment; -import com.itsaky.androidide.preferences.internal.EditorPreferences; -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE; -import com.itsaky.androidide.utils.BasicBuildInfo; -import com.itsaky.androidide.utils.TypefaceUtilsKt; +import org.appdevforall.codeonthego.editor.ui.IDEEditor; +import org.appdevforall.codeonthego.eventbus.events.preferences.PreferenceChangeEvent; +import org.appdevforall.codeonthego.fragments.EmptyStateFragment; +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences; +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE; +import org.appdevforall.codeonthego.utils.BasicBuildInfo; +import org.appdevforall.codeonthego.utils.TypefaceUtilsKt; import io.github.rosemoe.sora.lang.EmptyLanguage; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; diff --git a/app/src/main/java/com/itsaky/androidide/fragments/output/SearchableOutputFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/SearchableOutputFragment.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/fragments/output/SearchableOutputFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/output/SearchableOutputFragment.kt index a659d08d11..bb916006fc 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/output/SearchableOutputFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/SearchableOutputFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.output +package org.appdevforall.codeonthego.fragments.output /** * An output fragment whose content can be searched and filtered from the diff --git a/app/src/main/java/com/itsaky/androidide/fragments/output/ShareableOutputFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/ShareableOutputFragment.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/fragments/output/ShareableOutputFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/output/ShareableOutputFragment.kt index fd12a850b4..c30c3c4707 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/output/ShareableOutputFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/ShareableOutputFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.output +package org.appdevforall.codeonthego.fragments.output /** * Any fragment that allows to share it's content. diff --git a/app/src/main/java/com/itsaky/androidide/fragments/output/ViewOptionsOutputFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/ViewOptionsOutputFragment.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/fragments/output/ViewOptionsOutputFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/output/ViewOptionsOutputFragment.kt index 196424bd07..175c2df84c 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/output/ViewOptionsOutputFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/ViewOptionsOutputFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.output +package org.appdevforall.codeonthego.fragments.output import android.view.View diff --git a/app/src/main/java/com/itsaky/androidide/fragments/output/WrappableOutputFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/WrappableOutputFragment.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/fragments/output/WrappableOutputFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/output/WrappableOutputFragment.kt index 30d2b6f224..51fe08b625 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/output/WrappableOutputFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/WrappableOutputFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.output +package org.appdevforall.codeonthego.fragments.output /** * Interface for output fragments that support toggling word wrap. diff --git a/app/src/main/java/com/itsaky/androidide/fragments/sheets/BaseBottomSheetFragment.java b/app/src/main/java/org/appdevforall/codeonthego/fragments/sheets/BaseBottomSheetFragment.java similarity index 95% rename from app/src/main/java/com/itsaky/androidide/fragments/sheets/BaseBottomSheetFragment.java rename to app/src/main/java/org/appdevforall/codeonthego/fragments/sheets/BaseBottomSheetFragment.java index 311073b417..d608abce35 100755 --- a/app/src/main/java/com/itsaky/androidide/fragments/sheets/BaseBottomSheetFragment.java +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/sheets/BaseBottomSheetFragment.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . * */ -package com.itsaky.androidide.fragments.sheets; +package org.appdevforall.codeonthego.fragments.sheets; import android.app.Dialog; import android.os.Bundle; diff --git a/app/src/main/java/com/itsaky/androidide/fragments/sheets/OptionsListFragment.java b/app/src/main/java/org/appdevforall/codeonthego/fragments/sheets/OptionsListFragment.java similarity index 89% rename from app/src/main/java/com/itsaky/androidide/fragments/sheets/OptionsListFragment.java rename to app/src/main/java/org/appdevforall/codeonthego/fragments/sheets/OptionsListFragment.java index 53c1f26040..ccc8cc75c5 100755 --- a/app/src/main/java/com/itsaky/androidide/fragments/sheets/OptionsListFragment.java +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/sheets/OptionsListFragment.java @@ -16,7 +16,7 @@ * */ -package com.itsaky.androidide.fragments.sheets; +package org.appdevforall.codeonthego.fragments.sheets; import android.content.Context; import android.os.Bundle; @@ -28,11 +28,11 @@ import androidx.annotation.Nullable; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.itsaky.androidide.adapters.OptionsSheetAdapter; -import com.itsaky.androidide.events.FileContextMenuItemClickEvent; -import com.itsaky.androidide.events.FileContextMenuItemLongClickEvent; -import com.itsaky.androidide.models.SheetOption; -import com.itsaky.androidide.utils.ContextUtilsKt; +import org.appdevforall.codeonthego.adapters.OptionsSheetAdapter; +import org.appdevforall.codeonthego.events.FileContextMenuItemClickEvent; +import org.appdevforall.codeonthego.events.FileContextMenuItemLongClickEvent; +import org.appdevforall.codeonthego.models.SheetOption; +import org.appdevforall.codeonthego.utils.ContextUtilsKt; import java.util.ArrayList; import java.util.List; import org.greenrobot.eventbus.EventBus; diff --git a/app/src/main/java/com/itsaky/androidide/fragments/sheets/ProgressSheet.java b/app/src/main/java/org/appdevforall/codeonthego/fragments/sheets/ProgressSheet.java similarity index 98% rename from app/src/main/java/com/itsaky/androidide/fragments/sheets/ProgressSheet.java rename to app/src/main/java/org/appdevforall/codeonthego/fragments/sheets/ProgressSheet.java index a8cd39da12..17b6f0bd93 100755 --- a/app/src/main/java/com/itsaky/androidide/fragments/sheets/ProgressSheet.java +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/sheets/ProgressSheet.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.sheets; +package org.appdevforall.codeonthego.fragments.sheets; import android.graphics.drawable.Drawable; import android.os.Bundle; diff --git a/app/src/main/java/com/itsaky/androidide/fragments/sidebar/BuildVariantsFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/BuildVariantsFragment.kt similarity index 88% rename from app/src/main/java/com/itsaky/androidide/fragments/sidebar/BuildVariantsFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/BuildVariantsFragment.kt index 338a34bab5..f87249e016 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/sidebar/BuildVariantsFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/BuildVariantsFragment.kt @@ -15,19 +15,19 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.sidebar +package org.appdevforall.codeonthego.fragments.sidebar import android.os.Bundle import android.view.View import androidx.fragment.app.viewModels import androidx.recyclerview.widget.DividerItemDecoration -import com.itsaky.androidide.activities.editor.ProjectHandlerActivity -import com.itsaky.androidide.adapters.BuildVariantsAdapter +import org.appdevforall.codeonthego.activities.editor.ProjectHandlerActivity +import org.appdevforall.codeonthego.adapters.BuildVariantsAdapter import com.itsaky.androidide.databinding.FragmentBuildVariantsBinding -import com.itsaky.androidide.fragments.EmptyStateFragment -import com.itsaky.androidide.tooling.api.models.BuildVariantInfo -import com.itsaky.androidide.viewmodel.BuildVariantsViewModel -import com.itsaky.androidide.viewmodel.EditorViewModel +import org.appdevforall.codeonthego.fragments.EmptyStateFragment +import org.appdevforall.codeonthego.tooling.api.models.BuildVariantInfo +import org.appdevforall.codeonthego.viewmodel.BuildVariantsViewModel +import org.appdevforall.codeonthego.viewmodel.EditorViewModel /** * A fragment to show the list of Android modules and its build variants. diff --git a/app/src/main/java/com/itsaky/androidide/fragments/sidebar/EditorSidebarFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/EditorSidebarFragment.kt similarity index 82% rename from app/src/main/java/com/itsaky/androidide/fragments/sidebar/EditorSidebarFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/EditorSidebarFragment.kt index 84d61b1764..91bd8685fc 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/sidebar/EditorSidebarFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/EditorSidebarFragment.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.sidebar +package org.appdevforall.codeonthego.fragments.sidebar import android.os.Bundle import android.view.View -import com.itsaky.androidide.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity import com.itsaky.androidide.databinding.FragmentEditorSidebarBinding -import com.itsaky.androidide.fragments.FragmentWithBinding -import com.itsaky.androidide.idetooltips.TooltipCategory -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.utils.EditorSidebarActions +import org.appdevforall.codeonthego.fragments.FragmentWithBinding +import org.appdevforall.codeonthego.idetooltips.TooltipCategory +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.utils.EditorSidebarActions /** * Fragment for showing the default items in the editor activity's sidebar. diff --git a/app/src/main/java/com/itsaky/androidide/fragments/sidebar/FileTreeDropController.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeDropController.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/fragments/sidebar/FileTreeDropController.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeDropController.kt index 43a182626a..8010e242ff 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/sidebar/FileTreeDropController.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeDropController.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments.sidebar +package org.appdevforall.codeonthego.fragments.sidebar import android.app.Activity import android.view.DragEvent @@ -6,12 +6,12 @@ import android.view.View import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.lifecycleScope import com.itsaky.androidide.R -import com.itsaky.androidide.adapters.viewholders.FileTreeViewHolder -import com.itsaky.androidide.dnd.DragEventRouter -import com.itsaky.androidide.dnd.DropTargetCallback -import com.itsaky.androidide.dnd.hasImportableContent -import com.itsaky.androidide.utils.DropHighlighter -import com.itsaky.androidide.utils.FileImporter +import org.appdevforall.codeonthego.adapters.viewholders.FileTreeViewHolder +import org.appdevforall.codeonthego.dnd.DragEventRouter +import org.appdevforall.codeonthego.dnd.DropTargetCallback +import org.appdevforall.codeonthego.dnd.hasImportableContent +import org.appdevforall.codeonthego.utils.DropHighlighter +import org.appdevforall.codeonthego.utils.FileImporter import com.unnamed.b.atv.model.TreeNode import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/itsaky/androidide/fragments/sidebar/FileTreeFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeFragment.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/fragments/sidebar/FileTreeFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeFragment.kt index 27f520d3a1..276356812d 100755 --- a/app/src/main/java/com/itsaky/androidide/fragments/sidebar/FileTreeFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeFragment.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments.sidebar +package org.appdevforall.codeonthego.fragments.sidebar import android.content.Context import android.os.Bundle @@ -29,28 +29,28 @@ import androidx.transition.ChangeBounds import androidx.transition.TransitionManager import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.itsaky.androidide.R -import com.itsaky.androidide.adapters.viewholders.FileTreeViewHolder +import org.appdevforall.codeonthego.adapters.viewholders.FileTreeViewHolder import com.itsaky.androidide.databinding.LayoutEditorFileTreeBinding -import com.itsaky.androidide.dnd.FileDragError -import com.itsaky.androidide.dnd.FileDragResult -import com.itsaky.androidide.dnd.FileDragStarter -import com.itsaky.androidide.eventbus.events.filetree.FileClickEvent -import com.itsaky.androidide.eventbus.events.filetree.FileLongClickEvent -import com.itsaky.androidide.eventbus.events.filetree.PluginFilesChangedEvent -import com.itsaky.androidide.events.CollapseTreeNodeRequestEvent -import com.itsaky.androidide.events.ExpandTreeNodeRequestEvent -import com.itsaky.androidide.events.ListProjectFilesRequestEvent -import com.itsaky.androidide.projects.IProjectManager +import org.appdevforall.codeonthego.dnd.FileDragError +import org.appdevforall.codeonthego.dnd.FileDragResult +import org.appdevforall.codeonthego.dnd.FileDragStarter +import org.appdevforall.codeonthego.eventbus.events.filetree.FileClickEvent +import org.appdevforall.codeonthego.eventbus.events.filetree.FileLongClickEvent +import org.appdevforall.codeonthego.eventbus.events.filetree.PluginFilesChangedEvent +import org.appdevforall.codeonthego.events.CollapseTreeNodeRequestEvent +import org.appdevforall.codeonthego.events.ExpandTreeNodeRequestEvent +import org.appdevforall.codeonthego.events.ListProjectFilesRequestEvent +import org.appdevforall.codeonthego.projects.IProjectManager import com.itsaky.androidide.resources.R.drawable -import com.itsaky.androidide.tasks.TaskExecutor.executeAsync -import com.itsaky.androidide.tasks.callables.FileTreeCallable -import com.itsaky.androidide.tasks.callables.FileTreeCallable.SortFileName -import com.itsaky.androidide.tasks.callables.FileTreeCallable.SortFolder -import com.itsaky.androidide.utils.doOnApplyWindowInsets -import com.itsaky.androidide.utils.dpToPx -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashSuccess -import com.itsaky.androidide.viewmodel.FileTreeViewModel +import org.appdevforall.codeonthego.tasks.TaskExecutor.executeAsync +import org.appdevforall.codeonthego.tasks.callables.FileTreeCallable +import org.appdevforall.codeonthego.tasks.callables.FileTreeCallable.SortFileName +import org.appdevforall.codeonthego.tasks.callables.FileTreeCallable.SortFolder +import org.appdevforall.codeonthego.utils.doOnApplyWindowInsets +import org.appdevforall.codeonthego.utils.dpToPx +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashSuccess +import org.appdevforall.codeonthego.viewmodel.FileTreeViewModel import com.unnamed.b.atv.model.TreeNode import com.unnamed.b.atv.model.TreeNode.TreeNodeClickListener import com.unnamed.b.atv.model.TreeNode.TreeNodeLongClickListener diff --git a/app/src/main/java/com/itsaky/androidide/fragments/sidebar/FileTreeSelectionFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeSelectionFragment.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/fragments/sidebar/FileTreeSelectionFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeSelectionFragment.kt index c86a087361..54c8c28559 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/sidebar/FileTreeSelectionFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeSelectionFragment.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments.sidebar +package org.appdevforall.codeonthego.fragments.sidebar import android.content.Context import android.os.Bundle @@ -9,9 +9,9 @@ import androidx.fragment.app.setFragmentResult import androidx.lifecycle.lifecycleScope import androidx.navigation.fragment.findNavController import com.itsaky.androidide.R -import com.itsaky.androidide.adapters.viewholders.MultiSelectFileTreeViewHolder +import org.appdevforall.codeonthego.adapters.viewholders.MultiSelectFileTreeViewHolder import com.itsaky.androidide.databinding.FragmentFileTreeSelectionBinding -import com.itsaky.androidide.projects.IProjectManager +import org.appdevforall.codeonthego.projects.IProjectManager import com.unnamed.b.atv.model.TreeNode import com.unnamed.b.atv.view.AndroidTreeView import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/itsaky/androidide/fragments/sidebar/OutlineFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/OutlineFragment.kt similarity index 88% rename from app/src/main/java/com/itsaky/androidide/fragments/sidebar/OutlineFragment.kt rename to app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/OutlineFragment.kt index 8d5094cb4a..0e1474294d 100644 --- a/app/src/main/java/com/itsaky/androidide/fragments/sidebar/OutlineFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/OutlineFragment.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.fragments.sidebar +package org.appdevforall.codeonthego.fragments.sidebar import android.os.Bundle import android.view.LayoutInflater @@ -13,16 +13,16 @@ import androidx.fragment.app.activityViewModels import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle -import com.itsaky.androidide.activities.editor.EditorHandlerActivity -import com.itsaky.androidide.common.compose.IdeTheme -import com.itsaky.androidide.editor.ui.IDEEditor -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentOpenEvent -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.ui.models.OutlineUiEffect -import com.itsaky.androidide.ui.outline.OutlinePanel -import com.itsaky.androidide.viewmodel.EditorViewModel -import com.itsaky.androidide.viewmodel.OutlineViewModel +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.common.compose.IdeTheme +import org.appdevforall.codeonthego.editor.ui.IDEEditor +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentOpenEvent +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.ui.models.OutlineUiEffect +import org.appdevforall.codeonthego.ui.outline.OutlinePanel +import org.appdevforall.codeonthego.viewmodel.EditorViewModel +import org.appdevforall.codeonthego.viewmodel.OutlineViewModel import kotlinx.coroutines.launch import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.Subscribe diff --git a/app/src/main/java/com/itsaky/androidide/handlers/BaseEventHandler.kt b/app/src/main/java/org/appdevforall/codeonthego/handlers/BaseEventHandler.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/handlers/BaseEventHandler.kt rename to app/src/main/java/org/appdevforall/codeonthego/handlers/BaseEventHandler.kt index 6686719bbb..534f36a653 100644 --- a/app/src/main/java/com/itsaky/androidide/handlers/BaseEventHandler.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/handlers/BaseEventHandler.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.handlers +package org.appdevforall.codeonthego.handlers import android.content.Context -import com.itsaky.androidide.activities.editor.EditorHandlerActivity -import com.itsaky.androidide.eventbus.events.Event -import com.itsaky.androidide.eventbus.events.EventReceiver +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.eventbus.events.Event +import org.appdevforall.codeonthego.eventbus.events.EventReceiver import org.slf4j.Logger import org.slf4j.LoggerFactory diff --git a/app/src/main/java/com/itsaky/androidide/handlers/CrashEventSubscriber.kt b/app/src/main/java/org/appdevforall/codeonthego/handlers/CrashEventSubscriber.kt similarity index 82% rename from app/src/main/java/com/itsaky/androidide/handlers/CrashEventSubscriber.kt rename to app/src/main/java/org/appdevforall/codeonthego/handlers/CrashEventSubscriber.kt index 16851126bf..d439722edf 100644 --- a/app/src/main/java/com/itsaky/androidide/handlers/CrashEventSubscriber.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/handlers/CrashEventSubscriber.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.handlers +package org.appdevforall.codeonthego.handlers import android.content.Intent -import com.itsaky.androidide.activities.CrashHandlerActivity -import com.itsaky.androidide.app.IDEApplication -import com.itsaky.androidide.eventbus.events.editor.ReportCaughtExceptionEvent +import org.appdevforall.codeonthego.activities.CrashHandlerActivity +import org.appdevforall.codeonthego.app.IDEApplication +import org.appdevforall.codeonthego.eventbus.events.editor.ReportCaughtExceptionEvent import io.sentry.Sentry import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode diff --git a/app/src/main/java/com/itsaky/androidide/handlers/EditorActivityLifecyclerObserver.kt b/app/src/main/java/org/appdevforall/codeonthego/handlers/EditorActivityLifecyclerObserver.kt similarity index 70% rename from app/src/main/java/com/itsaky/androidide/handlers/EditorActivityLifecyclerObserver.kt rename to app/src/main/java/org/appdevforall/codeonthego/handlers/EditorActivityLifecyclerObserver.kt index a3cdef7088..e00f8e6192 100644 --- a/app/src/main/java/com/itsaky/androidide/handlers/EditorActivityLifecyclerObserver.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/handlers/EditorActivityLifecyclerObserver.kt @@ -15,29 +15,29 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.handlers +package org.appdevforall.codeonthego.handlers import android.content.Context import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.LifecycleOwner -import com.itsaky.androidide.eventbus.events.Event -import com.itsaky.androidide.eventbus.events.EventReceiver -import com.itsaky.androidide.eventbus.events.editor.OnCreateEvent -import com.itsaky.androidide.eventbus.events.editor.OnDestroyEvent -import com.itsaky.androidide.eventbus.events.editor.OnPauseEvent -import com.itsaky.androidide.eventbus.events.editor.OnResumeEvent -import com.itsaky.androidide.eventbus.events.editor.OnStartEvent -import com.itsaky.androidide.eventbus.events.editor.OnStopEvent -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.projects.util.BootClasspathProvider -import com.itsaky.androidide.utils.EditorActivityActions -import com.itsaky.androidide.utils.EditorSidebarActions -import com.itsaky.androidide.utils.Environment +import org.appdevforall.codeonthego.eventbus.events.Event +import org.appdevforall.codeonthego.eventbus.events.EventReceiver +import org.appdevforall.codeonthego.eventbus.events.editor.OnCreateEvent +import org.appdevforall.codeonthego.eventbus.events.editor.OnDestroyEvent +import org.appdevforall.codeonthego.eventbus.events.editor.OnPauseEvent +import org.appdevforall.codeonthego.eventbus.events.editor.OnResumeEvent +import org.appdevforall.codeonthego.eventbus.events.editor.OnStartEvent +import org.appdevforall.codeonthego.eventbus.events.editor.OnStopEvent +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.projects.util.BootClasspathProvider +import org.appdevforall.codeonthego.utils.EditorActivityActions +import org.appdevforall.codeonthego.utils.EditorSidebarActions +import org.appdevforall.codeonthego.utils.Environment import org.greenrobot.eventbus.EventBus import java.util.concurrent.CompletableFuture /** - * Observes lifecycle events if [com.itsaky.androidide.EditorActivityKt]. + * Observes lifecycle events if [org.appdevforall.codeonthego.EditorActivityKt]. * * @author Akash Yadav */ diff --git a/app/src/main/java/com/itsaky/androidide/handlers/EditorBuildEventListener.kt b/app/src/main/java/org/appdevforall/codeonthego/handlers/EditorBuildEventListener.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/handlers/EditorBuildEventListener.kt rename to app/src/main/java/org/appdevforall/codeonthego/handlers/EditorBuildEventListener.kt index 91e0955700..c01856071b 100644 --- a/app/src/main/java/com/itsaky/androidide/handlers/EditorBuildEventListener.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/handlers/EditorBuildEventListener.kt @@ -15,31 +15,31 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.handlers +package org.appdevforall.codeonthego.handlers import android.os.SystemClock import androidx.annotation.VisibleForTesting import com.itsaky.androidide.R -import com.itsaky.androidide.activities.editor.EditorHandlerActivity -import com.itsaky.androidide.preferences.internal.GeneralPreferences -import com.itsaky.androidide.projects.builder.BuildResult -import com.itsaky.androidide.projects.builder.LaunchResult +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences +import org.appdevforall.codeonthego.projects.builder.BuildResult +import org.appdevforall.codeonthego.projects.builder.LaunchResult import com.itsaky.androidide.resources.R.string -import com.itsaky.androidide.services.builder.GradleBuildService -import com.itsaky.androidide.tooling.api.messages.result.BuildInfo -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult -import com.itsaky.androidide.tooling.events.ProgressEvent -import com.itsaky.androidide.tooling.events.configuration.ProjectConfigurationStartEvent -import com.itsaky.androidide.tooling.events.task.TaskFinishEvent -import com.itsaky.androidide.tooling.events.task.TaskStartEvent -import com.itsaky.androidide.utils.MetricsAnnotationStore -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashInfo -import com.itsaky.androidide.utils.flashSuccess -import com.itsaky.androidide.viewmodel.BuildOutputViewModel +import org.appdevforall.codeonthego.services.builder.GradleBuildService +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildInfo +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult +import org.appdevforall.codeonthego.tooling.events.ProgressEvent +import org.appdevforall.codeonthego.tooling.events.configuration.ProjectConfigurationStartEvent +import org.appdevforall.codeonthego.tooling.events.task.TaskFinishEvent +import org.appdevforall.codeonthego.tooling.events.task.TaskStartEvent +import org.appdevforall.codeonthego.utils.MetricsAnnotationStore +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashInfo +import org.appdevforall.codeonthego.utils.flashSuccess +import org.appdevforall.codeonthego.viewmodel.BuildOutputViewModel import org.slf4j.LoggerFactory import java.lang.ref.WeakReference -import com.itsaky.androidide.plugins.manager.services.IdeBuildServiceImpl as IdeBuildService +import org.appdevforall.codeonthego.plugins.manager.services.IdeBuildServiceImpl as IdeBuildService /** * Handles events received from [GradleBuildService] updates [EditorHandlerActivity]. diff --git a/app/src/main/java/com/itsaky/androidide/handlers/FileTreeActionHandler.kt b/app/src/main/java/org/appdevforall/codeonthego/handlers/FileTreeActionHandler.kt similarity index 81% rename from app/src/main/java/com/itsaky/androidide/handlers/FileTreeActionHandler.kt rename to app/src/main/java/org/appdevforall/codeonthego/handlers/FileTreeActionHandler.kt index 690aa71373..63711bcd87 100644 --- a/app/src/main/java/com/itsaky/androidide/handlers/FileTreeActionHandler.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/handlers/FileTreeActionHandler.kt @@ -15,29 +15,29 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.handlers +package org.appdevforall.codeonthego.handlers import android.content.Context import androidx.core.view.GravityCompat import androidx.lifecycle.lifecycleScope -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem.Location.EDITOR_FILE_TREE -import com.itsaky.androidide.actions.ActionMenu -import com.itsaky.androidide.actions.ActionsRegistry -import com.itsaky.androidide.actions.internal.DefaultActionsRegistry -import com.itsaky.androidide.activities.editor.EditorHandlerActivity -import com.itsaky.androidide.app.IDEApplication -import com.itsaky.androidide.eventbus.events.filetree.FileClickEvent -import com.itsaky.androidide.eventbus.events.filetree.FileLongClickEvent -import com.itsaky.androidide.events.CollapseTreeNodeRequestEvent -import com.itsaky.androidide.events.ExpandTreeNodeRequestEvent -import com.itsaky.androidide.events.FileContextMenuItemClickEvent -import com.itsaky.androidide.events.FileContextMenuItemLongClickEvent -import com.itsaky.androidide.fragments.sheets.OptionsListFragment -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.models.SheetOption -import com.itsaky.androidide.plugins.extensions.FileTabMenuItem -import com.itsaky.androidide.utils.flashError +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem.Location.EDITOR_FILE_TREE +import org.appdevforall.codeonthego.actions.ActionMenu +import org.appdevforall.codeonthego.actions.ActionsRegistry +import org.appdevforall.codeonthego.actions.internal.DefaultActionsRegistry +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.app.IDEApplication +import org.appdevforall.codeonthego.eventbus.events.filetree.FileClickEvent +import org.appdevforall.codeonthego.eventbus.events.filetree.FileLongClickEvent +import org.appdevforall.codeonthego.events.CollapseTreeNodeRequestEvent +import org.appdevforall.codeonthego.events.ExpandTreeNodeRequestEvent +import org.appdevforall.codeonthego.events.FileContextMenuItemClickEvent +import org.appdevforall.codeonthego.events.FileContextMenuItemLongClickEvent +import org.appdevforall.codeonthego.fragments.sheets.OptionsListFragment +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.models.SheetOption +import org.appdevforall.codeonthego.plugins.extensions.FileTabMenuItem +import org.appdevforall.codeonthego.utils.flashError import com.unnamed.b.atv.model.TreeNode import kotlinx.coroutines.launch import org.adfa.constants.PLUGIN_ARCHIVE_EXTENSION diff --git a/app/src/main/java/com/itsaky/androidide/handlers/GlitchTipDiagnosticsContext.kt b/app/src/main/java/org/appdevforall/codeonthego/handlers/GlitchTipDiagnosticsContext.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/handlers/GlitchTipDiagnosticsContext.kt rename to app/src/main/java/org/appdevforall/codeonthego/handlers/GlitchTipDiagnosticsContext.kt index 27cf7f914c..d1ef0d775b 100644 --- a/app/src/main/java/com/itsaky/androidide/handlers/GlitchTipDiagnosticsContext.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/handlers/GlitchTipDiagnosticsContext.kt @@ -16,18 +16,18 @@ * */ -package com.itsaky.androidide.handlers +package org.appdevforall.codeonthego.handlers import android.content.pm.ApplicationInfo import android.os.SystemClock -import com.itsaky.androidide.analytics.AttachedDevicesCollector -import com.itsaky.androidide.app.IDEApplication -import com.itsaky.androidide.app.configuration.IDEBuildConfigProvider +import org.appdevforall.codeonthego.analytics.AttachedDevicesCollector +import org.appdevforall.codeonthego.app.IDEApplication +import org.appdevforall.codeonthego.app.configuration.IDEBuildConfigProvider import com.itsaky.androidide.buildinfo.BuildInfo -import com.itsaky.androidide.plugins.manager.core.PluginManager -import com.itsaky.androidide.utils.BuildInfoUtils -import com.itsaky.androidide.utils.DeviceUtils -import com.itsaky.androidide.utils.getAppVersionCode +import org.appdevforall.codeonthego.plugins.manager.core.PluginManager +import org.appdevforall.codeonthego.utils.BuildInfoUtils +import org.appdevforall.codeonthego.utils.DeviceUtils +import org.appdevforall.codeonthego.utils.getAppVersionCode import com.termux.shared.android.PackageUtils import com.termux.shared.android.SELinuxUtils import io.sentry.EventProcessor diff --git a/app/src/main/java/com/itsaky/androidide/handlers/LspHandler.kt b/app/src/main/java/org/appdevforall/codeonthego/handlers/LspHandler.kt similarity index 73% rename from app/src/main/java/com/itsaky/androidide/handlers/LspHandler.kt rename to app/src/main/java/org/appdevforall/codeonthego/handlers/LspHandler.kt index 79f3428544..cf859dfa22 100644 --- a/app/src/main/java/com/itsaky/androidide/handlers/LspHandler.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/handlers/LspHandler.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.handlers +package org.appdevforall.codeonthego.handlers -import com.itsaky.androidide.lsp.PluginLanguageSupport -import com.itsaky.androidide.lsp.api.ILanguageClient -import com.itsaky.androidide.lsp.api.ILanguageServerRegistry -import com.itsaky.androidide.lsp.debug.IDebugClient -import com.itsaky.androidide.lsp.java.JavaLanguageServer -import com.itsaky.androidide.lsp.kotlin.KotlinLanguageServer -import com.itsaky.androidide.lsp.xml.XMLLanguageServer -import com.itsaky.androidide.utils.FeatureFlags +import org.appdevforall.codeonthego.lsp.PluginLanguageSupport +import org.appdevforall.codeonthego.lsp.api.ILanguageClient +import org.appdevforall.codeonthego.lsp.api.ILanguageServerRegistry +import org.appdevforall.codeonthego.lsp.debug.IDebugClient +import org.appdevforall.codeonthego.lsp.java.JavaLanguageServer +import org.appdevforall.codeonthego.lsp.kotlin.KotlinLanguageServer +import org.appdevforall.codeonthego.lsp.xml.XMLLanguageServer +import org.appdevforall.codeonthego.utils.FeatureFlags /** * diff --git a/app/src/main/java/com/itsaky/androidide/handlers/MetricsCrashAttachment.kt b/app/src/main/java/org/appdevforall/codeonthego/handlers/MetricsCrashAttachment.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/handlers/MetricsCrashAttachment.kt rename to app/src/main/java/org/appdevforall/codeonthego/handlers/MetricsCrashAttachment.kt index e5c1796db9..ef460a2c05 100644 --- a/app/src/main/java/com/itsaky/androidide/handlers/MetricsCrashAttachment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/handlers/MetricsCrashAttachment.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.handlers +package org.appdevforall.codeonthego.handlers import android.content.Context import android.os.SystemClock -import com.itsaky.androidide.utils.MetricsCsv -import com.itsaky.androidide.utils.MetricsCsvFile -import com.itsaky.androidide.utils.MetricsSnapshotAssembler -import com.itsaky.androidide.utils.MetricsSource +import org.appdevforall.codeonthego.utils.MetricsCsv +import org.appdevforall.codeonthego.utils.MetricsCsvFile +import org.appdevforall.codeonthego.utils.MetricsSnapshotAssembler +import org.appdevforall.codeonthego.utils.MetricsSource import io.sentry.Attachment import io.sentry.EventProcessor import io.sentry.Hint diff --git a/app/src/main/java/com/itsaky/androidide/handlers/SnippetHandler.kt b/app/src/main/java/org/appdevforall/codeonthego/handlers/SnippetHandler.kt similarity index 73% rename from app/src/main/java/com/itsaky/androidide/handlers/SnippetHandler.kt rename to app/src/main/java/org/appdevforall/codeonthego/handlers/SnippetHandler.kt index ca1f789d53..b6b81c6a25 100644 --- a/app/src/main/java/com/itsaky/androidide/handlers/SnippetHandler.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/handlers/SnippetHandler.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.handlers +package org.appdevforall.codeonthego.handlers -import com.itsaky.androidide.lsp.java.providers.snippet.JavaSnippetScope -import com.itsaky.androidide.lsp.kotlin.completion.KotlinSnippetScope -import com.itsaky.androidide.lsp.snippets.DefaultSnippet -import com.itsaky.androidide.lsp.snippets.ISnippetScope -import com.itsaky.androidide.lsp.snippets.SnippetLanguage -import com.itsaky.androidide.lsp.snippets.SnippetRegistry -import com.itsaky.androidide.lsp.snippets.UserSnippetLoader -import com.itsaky.androidide.lsp.xml.providers.snippet.XML_SNIPPET_SCOPES -import com.itsaky.androidide.plugins.extensions.SnippetContribution -import com.itsaky.androidide.plugins.manager.snippets.PluginSnippetManager +import org.appdevforall.codeonthego.lsp.java.providers.snippet.JavaSnippetScope +import org.appdevforall.codeonthego.lsp.kotlin.completion.KotlinSnippetScope +import org.appdevforall.codeonthego.lsp.snippets.DefaultSnippet +import org.appdevforall.codeonthego.lsp.snippets.ISnippetScope +import org.appdevforall.codeonthego.lsp.snippets.SnippetLanguage +import org.appdevforall.codeonthego.lsp.snippets.SnippetRegistry +import org.appdevforall.codeonthego.lsp.snippets.UserSnippetLoader +import org.appdevforall.codeonthego.lsp.xml.providers.snippet.XML_SNIPPET_SCOPES +import org.appdevforall.codeonthego.plugins.extensions.SnippetContribution +import org.appdevforall.codeonthego.plugins.manager.snippets.PluginSnippetManager import org.slf4j.LoggerFactory object SnippetHandler { diff --git a/app/src/main/java/com/itsaky/androidide/interfaces/DiagnosticClickListener.java b/app/src/main/java/org/appdevforall/codeonthego/interfaces/DiagnosticClickListener.java similarity index 85% rename from app/src/main/java/com/itsaky/androidide/interfaces/DiagnosticClickListener.java rename to app/src/main/java/org/appdevforall/codeonthego/interfaces/DiagnosticClickListener.java index 09fbbe35e3..64729205e1 100755 --- a/app/src/main/java/com/itsaky/androidide/interfaces/DiagnosticClickListener.java +++ b/app/src/main/java/org/appdevforall/codeonthego/interfaces/DiagnosticClickListener.java @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . * **************************************************************************************/ -package com.itsaky.androidide.interfaces; +package org.appdevforall.codeonthego.interfaces; -import com.itsaky.androidide.lsp.models.DiagnosticItem; -import com.itsaky.androidide.models.DiagnosticGroup; +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem; +import org.appdevforall.codeonthego.models.DiagnosticGroup; import java.io.File; public interface DiagnosticClickListener { diff --git a/app/src/main/java/com/itsaky/androidide/interfaces/IEditorHandler.kt b/app/src/main/java/org/appdevforall/codeonthego/interfaces/IEditorHandler.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/interfaces/IEditorHandler.kt rename to app/src/main/java/org/appdevforall/codeonthego/interfaces/IEditorHandler.kt index 2a02ba5b6f..afc0fd2707 100644 --- a/app/src/main/java/com/itsaky/androidide/interfaces/IEditorHandler.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/interfaces/IEditorHandler.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.interfaces +package org.appdevforall.codeonthego.interfaces -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.models.SaveResult -import com.itsaky.androidide.ui.CodeEditorView +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.models.SaveResult +import org.appdevforall.codeonthego.ui.CodeEditorView import java.io.File /** diff --git a/app/src/main/java/com/itsaky/androidide/localWebServer/WebServer.kt b/app/src/main/java/org/appdevforall/codeonthego/localWebServer/WebServer.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/localWebServer/WebServer.kt rename to app/src/main/java/org/appdevforall/codeonthego/localWebServer/WebServer.kt index aa83dd2355..8fec3f3d2d 100644 --- a/app/src/main/java/com/itsaky/androidide/localWebServer/WebServer.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/localWebServer/WebServer.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.localWebServer +package org.appdevforall.codeonthego.localWebServer import android.database.sqlite.SQLiteDatabase import android.net.TrafficStats @@ -6,13 +6,13 @@ import android.os.Environment.getExternalStorageDirectory import com.google.gson.Gson import com.google.gson.GsonBuilder import com.google.gson.annotations.SerializedName -import com.itsaky.androidide.documentation.DocumentationContent -import com.itsaky.androidide.documentation.DocumentationContentSource -import com.itsaky.androidide.documentation.DocumentationLookup -import com.itsaky.androidide.documentation.DocumentationRequestInterceptor -import com.itsaky.androidide.documentation.TemplateRenderException -import com.itsaky.androidide.utils.ContentTypeHeaders -import com.itsaky.androidide.utils.DatabaseVersionResolver +import org.appdevforall.codeonthego.documentation.DocumentationContent +import org.appdevforall.codeonthego.documentation.DocumentationContentSource +import org.appdevforall.codeonthego.documentation.DocumentationLookup +import org.appdevforall.codeonthego.documentation.DocumentationRequestInterceptor +import org.appdevforall.codeonthego.documentation.TemplateRenderException +import org.appdevforall.codeonthego.utils.ContentTypeHeaders +import org.appdevforall.codeonthego.utils.DatabaseVersionResolver import org.slf4j.LoggerFactory import java.io.ByteArrayOutputStream import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/logs/LogBuffer.kt b/app/src/main/java/org/appdevforall/codeonthego/logs/LogBuffer.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/logs/LogBuffer.kt rename to app/src/main/java/org/appdevforall/codeonthego/logs/LogBuffer.kt index 4f839bd658..5d3fa70f92 100644 --- a/app/src/main/java/com/itsaky/androidide/logs/LogBuffer.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/logs/LogBuffer.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logs +package org.appdevforall.codeonthego.logs -import com.itsaky.androidide.models.LogFilter -import com.itsaky.androidide.utils.ILogger +import org.appdevforall.codeonthego.models.LogFilter +import org.appdevforall.codeonthego.utils.ILogger /** * A bounded, thread-safe history of log entries. Retains the level metadata that is diff --git a/app/src/main/java/com/itsaky/androidide/lsp/BreakpointHandler.kt b/app/src/main/java/org/appdevforall/codeonthego/lsp/BreakpointHandler.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/lsp/BreakpointHandler.kt rename to app/src/main/java/org/appdevforall/codeonthego/lsp/BreakpointHandler.kt index a82ec8b618..26f9d4d339 100644 --- a/app/src/main/java/com/itsaky/androidide/lsp/BreakpointHandler.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/lsp/BreakpointHandler.kt @@ -1,20 +1,20 @@ -package com.itsaky.androidide.lsp +package org.appdevforall.codeonthego.lsp import androidx.annotation.VisibleForTesting import com.google.common.collect.HashBasedTable import com.google.common.collect.ImmutableTable import com.google.common.collect.Table import com.google.common.collect.TreeBasedTable -import com.itsaky.androidide.eventbus.events.editor.ChangeType -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent -import com.itsaky.androidide.lsp.debug.model.BreakpointDefinition -import com.itsaky.androidide.lsp.debug.model.MethodBreakpoint -import com.itsaky.androidide.lsp.debug.model.PositionalBreakpoint -import com.itsaky.androidide.lsp.debug.model.Source -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.repositories.BreakpointRepository -import com.itsaky.androidide.repositories.StoredBreakpointsType +import org.appdevforall.codeonthego.eventbus.events.editor.ChangeType +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent +import org.appdevforall.codeonthego.lsp.debug.model.BreakpointDefinition +import org.appdevforall.codeonthego.lsp.debug.model.MethodBreakpoint +import org.appdevforall.codeonthego.lsp.debug.model.PositionalBreakpoint +import org.appdevforall.codeonthego.lsp.debug.model.Source +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.repositories.BreakpointRepository +import org.appdevforall.codeonthego.repositories.StoredBreakpointsType import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/itsaky/androidide/lsp/IDEDebugClientImpl.kt b/app/src/main/java/org/appdevforall/codeonthego/lsp/IDEDebugClientImpl.kt similarity index 89% rename from app/src/main/java/com/itsaky/androidide/lsp/IDEDebugClientImpl.kt rename to app/src/main/java/org/appdevforall/codeonthego/lsp/IDEDebugClientImpl.kt index 83f35c74a0..70ed763a7c 100644 --- a/app/src/main/java/com/itsaky/androidide/lsp/IDEDebugClientImpl.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/lsp/IDEDebugClientImpl.kt @@ -1,26 +1,26 @@ -package com.itsaky.androidide.lsp +package org.appdevforall.codeonthego.lsp import android.annotation.SuppressLint import android.widget.RemoteViews.RemoteView -import com.itsaky.androidide.eventbus.events.EventReceiver -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.debug.IDebugClient -import com.itsaky.androidide.lsp.debug.IDebugEventHandler -import com.itsaky.androidide.lsp.debug.RemoteClient -import com.itsaky.androidide.lsp.debug.events.BreakpointHitEvent -import com.itsaky.androidide.lsp.debug.events.StepEvent -import com.itsaky.androidide.lsp.debug.model.BreakpointRequest -import com.itsaky.androidide.lsp.debug.model.LocatableEvent -import com.itsaky.androidide.lsp.debug.model.Location -import com.itsaky.androidide.lsp.debug.model.StepRequestParams -import com.itsaky.androidide.lsp.debug.model.StepResult -import com.itsaky.androidide.lsp.debug.model.StepType -import com.itsaky.androidide.lsp.debug.model.ThreadListRequestParams -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.viewmodel.DebuggerConnectionState -import com.itsaky.androidide.viewmodel.DebuggerViewModel +import org.appdevforall.codeonthego.eventbus.events.EventReceiver +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.debug.IDebugClient +import org.appdevforall.codeonthego.lsp.debug.IDebugEventHandler +import org.appdevforall.codeonthego.lsp.debug.RemoteClient +import org.appdevforall.codeonthego.lsp.debug.events.BreakpointHitEvent +import org.appdevforall.codeonthego.lsp.debug.events.StepEvent +import org.appdevforall.codeonthego.lsp.debug.model.BreakpointRequest +import org.appdevforall.codeonthego.lsp.debug.model.LocatableEvent +import org.appdevforall.codeonthego.lsp.debug.model.Location +import org.appdevforall.codeonthego.lsp.debug.model.StepRequestParams +import org.appdevforall.codeonthego.lsp.debug.model.StepResult +import org.appdevforall.codeonthego.lsp.debug.model.StepType +import org.appdevforall.codeonthego.lsp.debug.model.ThreadListRequestParams +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.viewmodel.DebuggerConnectionState +import org.appdevforall.codeonthego.viewmodel.DebuggerViewModel import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/itsaky/androidide/lsp/IDELanguageClientImpl.java b/app/src/main/java/org/appdevforall/codeonthego/lsp/IDELanguageClientImpl.java similarity index 91% rename from app/src/main/java/com/itsaky/androidide/lsp/IDELanguageClientImpl.java rename to app/src/main/java/org/appdevforall/codeonthego/lsp/IDELanguageClientImpl.java index 449386aebd..b71a22b901 100755 --- a/app/src/main/java/com/itsaky/androidide/lsp/IDELanguageClientImpl.java +++ b/app/src/main/java/org/appdevforall/codeonthego/lsp/IDELanguageClientImpl.java @@ -17,37 +17,37 @@ * along with AndroidIDE. If not, see . * */ -package com.itsaky.androidide.lsp; +package org.appdevforall.codeonthego.lsp; import static com.itsaky.androidide.resources.R.drawable; import static com.itsaky.androidide.resources.R.string; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.itsaky.androidide.activities.editor.EditorHandlerActivity; -import com.itsaky.androidide.adapters.DiagnosticsAdapter; -import com.itsaky.androidide.adapters.SearchListAdapter; -import com.itsaky.androidide.editor.ui.IDEEditor; -import com.itsaky.androidide.fragments.sheets.ProgressSheet; -import com.itsaky.androidide.lsp.api.ILanguageClient; -import com.itsaky.androidide.lsp.models.CodeActionItem; -import com.itsaky.androidide.lsp.models.DiagnosticItem; -import com.itsaky.androidide.lsp.models.DiagnosticResult; -import com.itsaky.androidide.lsp.models.PerformCodeActionParams; -import com.itsaky.androidide.lsp.models.ShowDocumentParams; -import com.itsaky.androidide.lsp.models.ShowDocumentResult; -import com.itsaky.androidide.lsp.models.TextEdit; -import com.itsaky.androidide.lsp.util.DiagnosticUtil; -import com.itsaky.androidide.models.DiagnosticGroup; -import com.itsaky.androidide.models.Location; -import com.itsaky.androidide.models.Range; -import com.itsaky.androidide.models.SearchResult; -import com.itsaky.androidide.tasks.TaskExecutor; -import com.itsaky.androidide.ui.CodeEditorView; -import com.itsaky.androidide.utils.FileUtils; -import com.itsaky.androidide.utils.FlashbarActivityUtilsKt; -import com.itsaky.androidide.utils.FlashbarUtilsKt; -import com.itsaky.androidide.utils.LSPUtils; +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity; +import org.appdevforall.codeonthego.adapters.DiagnosticsAdapter; +import org.appdevforall.codeonthego.adapters.SearchListAdapter; +import org.appdevforall.codeonthego.editor.ui.IDEEditor; +import org.appdevforall.codeonthego.fragments.sheets.ProgressSheet; +import org.appdevforall.codeonthego.lsp.api.ILanguageClient; +import org.appdevforall.codeonthego.lsp.models.CodeActionItem; +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem; +import org.appdevforall.codeonthego.lsp.models.DiagnosticResult; +import org.appdevforall.codeonthego.lsp.models.PerformCodeActionParams; +import org.appdevforall.codeonthego.lsp.models.ShowDocumentParams; +import org.appdevforall.codeonthego.lsp.models.ShowDocumentResult; +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import org.appdevforall.codeonthego.lsp.util.DiagnosticUtil; +import org.appdevforall.codeonthego.models.DiagnosticGroup; +import org.appdevforall.codeonthego.models.Location; +import org.appdevforall.codeonthego.models.Range; +import org.appdevforall.codeonthego.models.SearchResult; +import org.appdevforall.codeonthego.tasks.TaskExecutor; +import org.appdevforall.codeonthego.ui.CodeEditorView; +import org.appdevforall.codeonthego.utils.FileUtils; +import org.appdevforall.codeonthego.utils.FlashbarActivityUtilsKt; +import org.appdevforall.codeonthego.utils.FlashbarUtilsKt; +import org.appdevforall.codeonthego.utils.LSPUtils; import io.github.rosemoe.sora.lang.diagnostic.DiagnosticsContainer; import java.io.File; import java.util.ArrayList; diff --git a/app/src/main/java/com/itsaky/androidide/lsp/PluginLanguageSupport.kt b/app/src/main/java/org/appdevforall/codeonthego/lsp/PluginLanguageSupport.kt similarity index 85% rename from app/src/main/java/com/itsaky/androidide/lsp/PluginLanguageSupport.kt rename to app/src/main/java/org/appdevforall/codeonthego/lsp/PluginLanguageSupport.kt index 2f97d22482..06c9b9071a 100644 --- a/app/src/main/java/com/itsaky/androidide/lsp/PluginLanguageSupport.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/lsp/PluginLanguageSupport.kt @@ -1,20 +1,20 @@ -package com.itsaky.androidide.lsp +package org.appdevforall.codeonthego.lsp import android.os.Handler import android.os.Looper -import com.itsaky.androidide.app.IDEApplication -import com.itsaky.androidide.editor.language.treesitter.PluginGrammars -import com.itsaky.androidide.editor.language.treesitter.PluginTreeSitterLanguage -import com.itsaky.androidide.editor.language.treesitter.TSLanguageRegistry -import com.itsaky.androidide.editor.language.treesitter.TreeSitterLanguage -import com.itsaky.androidide.events.PluginLanguagesChangedEvent -import com.itsaky.androidide.lsp.api.ILanguageServerRegistry -import com.itsaky.androidide.lsp.external.ExternalLanguageServer -import com.itsaky.androidide.plugins.extensions.LanguageServerDefinition -import com.itsaky.androidide.plugins.manager.language.PluginLanguageContribution -import com.itsaky.androidide.preferences.internal.EditorPreferences -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.TermuxProcessEnvironment +import org.appdevforall.codeonthego.app.IDEApplication +import org.appdevforall.codeonthego.editor.language.treesitter.PluginGrammars +import org.appdevforall.codeonthego.editor.language.treesitter.PluginTreeSitterLanguage +import org.appdevforall.codeonthego.editor.language.treesitter.TSLanguageRegistry +import org.appdevforall.codeonthego.editor.language.treesitter.TreeSitterLanguage +import org.appdevforall.codeonthego.events.PluginLanguagesChangedEvent +import org.appdevforall.codeonthego.lsp.api.ILanguageServerRegistry +import org.appdevforall.codeonthego.lsp.external.ExternalLanguageServer +import org.appdevforall.codeonthego.plugins.extensions.LanguageServerDefinition +import org.appdevforall.codeonthego.plugins.manager.language.PluginLanguageContribution +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.TermuxProcessEnvironment import org.greenrobot.eventbus.EventBus import org.slf4j.LoggerFactory import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/lsp/SearchResultGrouping.kt b/app/src/main/java/org/appdevforall/codeonthego/lsp/SearchResultGrouping.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/lsp/SearchResultGrouping.kt rename to app/src/main/java/org/appdevforall/codeonthego/lsp/SearchResultGrouping.kt index 797113bf90..4e2dfec056 100644 --- a/app/src/main/java/com/itsaky/androidide/lsp/SearchResultGrouping.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/lsp/SearchResultGrouping.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.lsp +package org.appdevforall.codeonthego.lsp -import com.itsaky.androidide.models.Location -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.models.SearchResult +import org.appdevforall.codeonthego.models.Location +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.models.SearchResult import io.github.rosemoe.sora.text.Content import org.slf4j.LoggerFactory import java.io.BufferedReader diff --git a/app/src/main/java/com/itsaky/androidide/models/ApkMetadata.kt b/app/src/main/java/org/appdevforall/codeonthego/models/ApkMetadata.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/models/ApkMetadata.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/ApkMetadata.kt index 63fdb46d86..35bdecbc09 100755 --- a/app/src/main/java/com/itsaky/androidide/models/ApkMetadata.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/ApkMetadata.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . * */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models import com.google.gson.annotations.SerializedName -import com.itsaky.androidide.utils.JSONUtility.gson -import com.itsaky.androidide.utils.ListingFileRedirect.getListingFile +import org.appdevforall.codeonthego.utils.JSONUtility.gson +import org.appdevforall.codeonthego.utils.ListingFileRedirect.getListingFile import org.slf4j.LoggerFactory import java.io.File import java.io.FileNotFoundException diff --git a/app/src/main/java/com/itsaky/androidide/models/ArtifactType.kt b/app/src/main/java/org/appdevforall/codeonthego/models/ArtifactType.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/models/ArtifactType.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/ArtifactType.kt index ee843f4b77..9639d1c524 100644 --- a/app/src/main/java/com/itsaky/androidide/models/ArtifactType.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/ArtifactType.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/com/itsaky/androidide/models/Checkable.kt b/app/src/main/java/org/appdevforall/codeonthego/models/Checkable.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/models/Checkable.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/Checkable.kt index ee9408857a..984b704631 100644 --- a/app/src/main/java/com/itsaky/androidide/models/Checkable.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/Checkable.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models /** * Holds data that can be checked/unchecked. diff --git a/app/src/main/java/com/itsaky/androidide/models/ContextListItem.kt b/app/src/main/java/org/appdevforall/codeonthego/models/ContextListItem.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/models/ContextListItem.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/ContextListItem.kt index b6267809a8..1e094248d7 100644 --- a/app/src/main/java/com/itsaky/androidide/models/ContextListItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/ContextListItem.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models import androidx.annotation.DrawableRes diff --git a/app/src/main/java/com/itsaky/androidide/models/DeepLinkRequest.kt b/app/src/main/java/org/appdevforall/codeonthego/models/DeepLinkRequest.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/models/DeepLinkRequest.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/DeepLinkRequest.kt index 53d312cf20..d76dd3da74 100644 --- a/app/src/main/java/com/itsaky/androidide/models/DeepLinkRequest.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/DeepLinkRequest.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models import android.net.Uri import android.os.Parcelable -import com.itsaky.androidide.utils.ContainedPathResolver +import org.appdevforall.codeonthego.utils.ContainedPathResolver import kotlinx.parcelize.Parcelize import java.nio.file.Paths @@ -39,7 +39,7 @@ data class PendingFileRequest( val columnRaw: String?, ) : Parcelable { companion object { - const val EXTRA_KEY = "com.itsaky.androidide.PENDING_FILE_REQUEST" + const val EXTRA_KEY = "org.appdevforall.codeonthego.PENDING_FILE_REQUEST" } } @@ -54,7 +54,7 @@ data class DeepLinkRequest( val fileRequest: PendingFileRequest? = null, ) : Parcelable { companion object { - const val EXTRA_KEY = "com.itsaky.androidide.DEEP_LINK_REQUEST" + const val EXTRA_KEY = "org.appdevforall.codeonthego.DEEP_LINK_REQUEST" private const val SCHEME = "https" @@ -145,7 +145,7 @@ data class DeepLinkRequest( * followed by a name -- i.e. it isn't a deep link this app understands, not merely a deep link * with missing optional parts. * - * [DeepLinkActivity][com.itsaky.androidide.activities.DeepLinkActivity] is `exported="true"` (a + * [DeepLinkActivity][org.appdevforall.codeonthego.activities.DeepLinkActivity] is `exported="true"` (a * requirement for App Links), which means its `` data scoping only constrains * *implicit* intent matching -- any co-installed app can still target it directly with an * explicit intent carrying an arbitrary [Uri]. Re-checking scheme/host/path prefix here, rather @@ -277,23 +277,23 @@ data class DeepLinkRequest( * * [line] and [column] are ONE-BASED, matching the URL scheme rather than the editor. The * editor's own cursor is zero-based and - * [EditorHandlerActivity][com.itsaky.androidide.activities.editor.EditorHandlerActivity] + * [EditorHandlerActivity][org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity] * subtracts one again when it reads a link back, so a caller holding a cursor passes * `cursor.leftLine + 1`. * * Returns `null` rather than a URL that [parse] would reject or read back as something other * than what was asked for. Each rejection below mirrors one of the *static* checks in [parse] - * or in [lookupValidProjectByName][com.itsaky.androidide.utils.lookupValidProjectByName]: + * or in [lookupValidProjectByName][org.appdevforall.codeonthego.utils.lookupValidProjectByName]: * there is nothing to be gained by handing someone a link this same app refuses to open. * * Three of the reader's checks are deliberately NOT mirrored, because none of them can be * answered without a filesystem call or a fact that outlives the link: - * [ContainedPathResolver][com.itsaky.androidide.utils.ContainedPathResolver]'s real-path + * [ContainedPathResolver][org.appdevforall.codeonthego.utils.ContainedPathResolver]'s real-path * containment (a file reached through a symlink inside the project relativises to a clean path * here and resolves outside the project there), the reader's NFC/NFD candidate matching -- * which it applies to the project NAME only, so an intermediary that normalizes the URL breaks * the FILE half of a link even though the project half survives -- and that reader's - * [isValidProjectDirectory][com.itsaky.androidide.utils.isValidProjectDirectory] requirement, + * [isValidProjectDirectory][org.appdevforall.codeonthego.utils.isValidProjectDirectory] requirement, * which is a fact about the project at *open* time -- one that stops looking like an Android * project after the link is sent (its `app/build.gradle` renamed, say) invalidates an * already-sent link no matter what was verified here. @@ -419,7 +419,7 @@ data class DeepLinkRequest( /** * The resolved-path counterpart to [DeepLinkRequest], used once the project name has been resolved to * an absolute directory -- e.g. when handing a pending "close current project, then open this one" off - * across activities via [com.itsaky.androidide.deeplink.PendingDeepLinkOpen]. + * across activities via [org.appdevforall.codeonthego.deeplink.PendingDeepLinkOpen]. */ @Parcelize data class DeepLinkOpenRequest( diff --git a/app/src/main/java/com/itsaky/androidide/models/DefaultOnboardingItem.kt b/app/src/main/java/org/appdevforall/codeonthego/models/DefaultOnboardingItem.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/models/DefaultOnboardingItem.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/DefaultOnboardingItem.kt index 02c886f4fa..2cecb56206 100644 --- a/app/src/main/java/com/itsaky/androidide/models/DefaultOnboardingItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/DefaultOnboardingItem.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/itsaky/androidide/models/DiagnosticGroup.java b/app/src/main/java/org/appdevforall/codeonthego/models/DiagnosticGroup.java similarity index 91% rename from app/src/main/java/com/itsaky/androidide/models/DiagnosticGroup.java rename to app/src/main/java/org/appdevforall/codeonthego/models/DiagnosticGroup.java index 963ac0cb77..fef09f9b05 100755 --- a/app/src/main/java/com/itsaky/androidide/models/DiagnosticGroup.java +++ b/app/src/main/java/org/appdevforall/codeonthego/models/DiagnosticGroup.java @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . * **************************************************************************************/ -package com.itsaky.androidide.models; +package org.appdevforall.codeonthego.models; -import com.itsaky.androidide.lsp.models.DiagnosticItem; +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem; import java.io.File; import java.util.List; diff --git a/app/src/main/java/com/itsaky/androidide/models/EditorIntentExtras.kt b/app/src/main/java/org/appdevforall/codeonthego/models/EditorIntentExtras.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/models/EditorIntentExtras.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/EditorIntentExtras.kt index 4030b60648..5aee402eb2 100644 --- a/app/src/main/java/com/itsaky/androidide/models/EditorIntentExtras.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/EditorIntentExtras.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models /** * The Intent extras MainActivity and the editor activities pass between themselves. @@ -41,7 +41,7 @@ object EditorIntentExtras { const val EXTRA_PREVIOUS_PROJECT_PATH = "PREVIOUS_PROJECT_PATH" /** - * Set only on the Intent [com.itsaky.androidide.activities.editor.BaseEditorActivity] sends back to + * Set only on the Intent [org.appdevforall.codeonthego.activities.editor.BaseEditorActivity] sends back to * MainActivity when a deep link names a project other than the one it holds. * * That is a programmatic re-delivery of a request the user tapped once, so MainActivity must apply diff --git a/app/src/main/java/com/itsaky/androidide/models/FileExtension.kt b/app/src/main/java/org/appdevforall/codeonthego/models/FileExtension.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/models/FileExtension.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/FileExtension.kt index 000ea7681a..e558ef5049 100644 --- a/app/src/main/java/com/itsaky/androidide/models/FileExtension.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/FileExtension.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models import androidx.annotation.DrawableRes import com.itsaky.androidide.resources.R diff --git a/app/src/main/java/com/itsaky/androidide/models/HyperlinkedOnboardingItem.kt b/app/src/main/java/org/appdevforall/codeonthego/models/HyperlinkedOnboardingItem.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/models/HyperlinkedOnboardingItem.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/HyperlinkedOnboardingItem.kt index 3137ca4b7b..0eaef30cff 100644 --- a/app/src/main/java/com/itsaky/androidide/models/HyperlinkedOnboardingItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/HyperlinkedOnboardingItem.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/itsaky/androidide/models/IdeSetupArguments.kt b/app/src/main/java/org/appdevforall/codeonthego/models/IdeSetupArguments.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/models/IdeSetupArguments.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/IdeSetupArguments.kt index 14d9aa31b3..7484a1ee2c 100644 --- a/app/src/main/java/com/itsaky/androidide/models/IdeSetupArguments.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/IdeSetupArguments.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models /** * Configuration options for IDESetup diff --git a/app/src/main/java/com/itsaky/androidide/models/InstallTaskRequest.kt b/app/src/main/java/org/appdevforall/codeonthego/models/InstallTaskRequest.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/models/InstallTaskRequest.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/InstallTaskRequest.kt index 0d6d6143da..dc4c12c61b 100644 --- a/app/src/main/java/com/itsaky/androidide/models/InstallTaskRequest.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/InstallTaskRequest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models data class InstallTaskRequest( val modulePath: String?, diff --git a/app/src/main/java/com/itsaky/androidide/models/LogFilter.kt b/app/src/main/java/org/appdevforall/codeonthego/models/LogFilter.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/models/LogFilter.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/LogFilter.kt index a104e16f16..851ea9cec3 100644 --- a/app/src/main/java/com/itsaky/androidide/models/LogFilter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/LogFilter.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models -import com.itsaky.androidide.utils.ILogger +import org.appdevforall.codeonthego.utils.ILogger import java.util.EnumSet /** diff --git a/app/src/main/java/com/itsaky/androidide/models/MetadataElement.kt b/app/src/main/java/org/appdevforall/codeonthego/models/MetadataElement.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/models/MetadataElement.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/MetadataElement.kt index 3b2ff125c3..a6d86bdc17 100644 --- a/app/src/main/java/com/itsaky/androidide/models/MetadataElement.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/MetadataElement.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/com/itsaky/androidide/models/NewProjectDetails.java b/app/src/main/java/org/appdevforall/codeonthego/models/NewProjectDetails.java similarity index 98% rename from app/src/main/java/com/itsaky/androidide/models/NewProjectDetails.java rename to app/src/main/java/org/appdevforall/codeonthego/models/NewProjectDetails.java index 5f747284cf..d7013d37d0 100755 --- a/app/src/main/java/com/itsaky/androidide/models/NewProjectDetails.java +++ b/app/src/main/java/org/appdevforall/codeonthego/models/NewProjectDetails.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . * **************************************************************************************/ -package com.itsaky.androidide.models; +package org.appdevforall.codeonthego.models; public class NewProjectDetails { diff --git a/app/src/main/java/com/itsaky/androidide/models/OnboardingItem.kt b/app/src/main/java/org/appdevforall/codeonthego/models/OnboardingItem.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/models/OnboardingItem.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/OnboardingItem.kt index 49cdd665f7..04b04306de 100644 --- a/app/src/main/java/com/itsaky/androidide/models/OnboardingItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/OnboardingItem.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models import android.os.Parcelable import androidx.annotation.ColorInt diff --git a/app/src/main/java/com/itsaky/androidide/models/OnboardingPermissionItem.kt b/app/src/main/java/org/appdevforall/codeonthego/models/OnboardingPermissionItem.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/models/OnboardingPermissionItem.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/OnboardingPermissionItem.kt index d0c86b8d1c..5488300481 100644 --- a/app/src/main/java/com/itsaky/androidide/models/OnboardingPermissionItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/OnboardingPermissionItem.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models import androidx.annotation.StringRes diff --git a/app/src/main/java/com/itsaky/androidide/models/OpenedFile.kt b/app/src/main/java/org/appdevforall/codeonthego/models/OpenedFile.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/models/OpenedFile.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/OpenedFile.kt index 51ef805219..5265432b44 100644 --- a/app/src/main/java/com/itsaky/androidide/models/OpenedFile.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/OpenedFile.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models import com.google.gson.Gson import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/com/itsaky/androidide/models/OpenedFilesCache.kt b/app/src/main/java/org/appdevforall/codeonthego/models/OpenedFilesCache.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/models/OpenedFilesCache.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/OpenedFilesCache.kt index 859db88a1b..a03f8b4aea 100644 --- a/app/src/main/java/com/itsaky/androidide/models/OpenedFilesCache.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/OpenedFilesCache.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models import com.google.gson.Gson import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/com/itsaky/androidide/models/ProjectFile.kt b/app/src/main/java/org/appdevforall/codeonthego/models/ProjectFile.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/models/ProjectFile.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/ProjectFile.kt index 9a172cfe9f..c504ef3a1c 100644 --- a/app/src/main/java/com/itsaky/androidide/models/ProjectFile.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/ProjectFile.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models import android.content.Context import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.formatDate +import org.appdevforall.codeonthego.utils.formatDate import java.io.File import java.util.UUID diff --git a/app/src/main/java/com/itsaky/androidide/models/ProjectTemplate.java b/app/src/main/java/org/appdevforall/codeonthego/models/ProjectTemplate.java similarity index 98% rename from app/src/main/java/com/itsaky/androidide/models/ProjectTemplate.java rename to app/src/main/java/org/appdevforall/codeonthego/models/ProjectTemplate.java index 053b957feb..edd5c48734 100755 --- a/app/src/main/java/com/itsaky/androidide/models/ProjectTemplate.java +++ b/app/src/main/java/org/appdevforall/codeonthego/models/ProjectTemplate.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . * **************************************************************************************/ -package com.itsaky.androidide.models; +package org.appdevforall.codeonthego.models; import android.content.Context; import androidx.annotation.DrawableRes; diff --git a/app/src/main/java/com/itsaky/androidide/models/RunTasksCategory.kt b/app/src/main/java/org/appdevforall/codeonthego/models/RunTasksCategory.kt similarity index 88% rename from app/src/main/java/com/itsaky/androidide/models/RunTasksCategory.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/RunTasksCategory.kt index 63f3758ce6..f50dfec78c 100644 --- a/app/src/main/java/com/itsaky/androidide/models/RunTasksCategory.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/RunTasksCategory.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models import androidx.annotation.StringRes -import com.itsaky.androidide.tooling.api.models.GradleTask +import org.appdevforall.codeonthego.tooling.api.models.GradleTask /** @author Akash Yadav */ data class RunTasksCategory(@StringRes val title: Int, val tasks: List>) diff --git a/app/src/main/java/com/itsaky/androidide/models/SearchResult.java b/app/src/main/java/org/appdevforall/codeonthego/models/SearchResult.java similarity index 96% rename from app/src/main/java/com/itsaky/androidide/models/SearchResult.java rename to app/src/main/java/org/appdevforall/codeonthego/models/SearchResult.java index d58f6cd94c..6041bb6b89 100755 --- a/app/src/main/java/com/itsaky/androidide/models/SearchResult.java +++ b/app/src/main/java/org/appdevforall/codeonthego/models/SearchResult.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . * **************************************************************************************/ -package com.itsaky.androidide.models; +package org.appdevforall.codeonthego.models; import java.io.File; diff --git a/app/src/main/java/com/itsaky/androidide/models/StepResult.kt b/app/src/main/java/org/appdevforall/codeonthego/models/StepResult.kt similarity index 75% rename from app/src/main/java/com/itsaky/androidide/models/StepResult.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/StepResult.kt index 8f9d165454..fc201c9f23 100644 --- a/app/src/main/java/com/itsaky/androidide/models/StepResult.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/StepResult.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models data class StepResult( val stepId: Int, diff --git a/app/src/main/java/com/itsaky/androidide/models/StorageInfo.kt b/app/src/main/java/org/appdevforall/codeonthego/models/StorageInfo.kt similarity index 73% rename from app/src/main/java/com/itsaky/androidide/models/StorageInfo.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/StorageInfo.kt index d721704ce4..d4016f04e4 100644 --- a/app/src/main/java/com/itsaky/androidide/models/StorageInfo.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/StorageInfo.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models data class StorageInfo( val isLowStorage: Boolean, diff --git a/app/src/main/java/com/itsaky/androidide/models/Symbol.kt b/app/src/main/java/org/appdevforall/codeonthego/models/Symbol.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/models/Symbol.kt rename to app/src/main/java/org/appdevforall/codeonthego/models/Symbol.kt index 663cd27b7d..0bc03a7d56 100644 --- a/app/src/main/java/com/itsaky/androidide/models/Symbol.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/Symbol.kt @@ -14,10 +14,10 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models /** - * A symbol that is shown in the [SymbolInputView][com.itsaky.androidide.ui.SymbolInputView]. + * A symbol that is shown in the [SymbolInputView][org.appdevforall.codeonthego.ui.SymbolInputView]. * * @author Akash Yadav */ diff --git a/app/src/main/java/com/itsaky/androidide/preferences/aboutPrefExts.kt b/app/src/main/java/org/appdevforall/codeonthego/preferences/aboutPrefExts.kt similarity index 85% rename from app/src/main/java/com/itsaky/androidide/preferences/aboutPrefExts.kt rename to app/src/main/java/org/appdevforall/codeonthego/preferences/aboutPrefExts.kt index 0d5a654cd6..c588f62d69 100644 --- a/app/src/main/java/com/itsaky/androidide/preferences/aboutPrefExts.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/preferences/aboutPrefExts.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import android.content.Intent -import com.itsaky.androidide.activities.AboutActivity -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_ABOUT +import org.appdevforall.codeonthego.activities.AboutActivity +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_ABOUT import com.itsaky.androidide.resources.R private const val KEY_ABOUT = "idepref_about" diff --git a/app/src/main/java/com/itsaky/androidide/preferences/buildAndRunPrefExts.kt b/app/src/main/java/org/appdevforall/codeonthego/preferences/buildAndRunPrefExts.kt similarity index 64% rename from app/src/main/java/com/itsaky/androidide/preferences/buildAndRunPrefExts.kt rename to app/src/main/java/org/appdevforall/codeonthego/preferences/buildAndRunPrefExts.kt index 47c7614ee1..3e8030feb9 100644 --- a/app/src/main/java/com/itsaky/androidide/preferences/buildAndRunPrefExts.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/preferences/buildAndRunPrefExts.kt @@ -15,29 +15,29 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import com.itsaky.androidide.R -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_BUILDRUN_AUTOLAUNCH -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_BUILDRUN_FLAGS -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_BUILDRUN_FLAGS_BUILDCACHE -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_BUILDRUN_FLAGS_DEBUG -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_BUILDRUN_FLAGS_INFO -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_BUILDRUN_FLAGS_OFFLINE -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_BUILDRUN_FLAGS_SCAN -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_BUILDRUN_FLAGS_STACKTRACE -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_BUILDRUN_FLAGS_WARNINGMODEALL -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_BUILD_RUN -import com.itsaky.androidide.preferences.internal.BuildPreferences.GRADLE_COMMANDS -import com.itsaky.androidide.preferences.internal.BuildPreferences.LAUNCH_APP_AFTER_INSTALL -import com.itsaky.androidide.preferences.internal.BuildPreferences.isBuildCacheEnabled -import com.itsaky.androidide.preferences.internal.BuildPreferences.isDebugEnabled -import com.itsaky.androidide.preferences.internal.BuildPreferences.isInfoEnabled -import com.itsaky.androidide.preferences.internal.BuildPreferences.isOfflineEnabled -import com.itsaky.androidide.preferences.internal.BuildPreferences.isScanEnabled -import com.itsaky.androidide.preferences.internal.BuildPreferences.isStacktraceEnabled -import com.itsaky.androidide.preferences.internal.BuildPreferences.isWarningModeAllEnabled -import com.itsaky.androidide.preferences.internal.BuildPreferences.launchAppAfterInstall +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_BUILDRUN_AUTOLAUNCH +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_BUILDRUN_FLAGS +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_BUILDRUN_FLAGS_BUILDCACHE +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_BUILDRUN_FLAGS_DEBUG +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_BUILDRUN_FLAGS_INFO +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_BUILDRUN_FLAGS_OFFLINE +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_BUILDRUN_FLAGS_SCAN +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_BUILDRUN_FLAGS_STACKTRACE +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_BUILDRUN_FLAGS_WARNINGMODEALL +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_BUILD_RUN +import org.appdevforall.codeonthego.preferences.internal.BuildPreferences.GRADLE_COMMANDS +import org.appdevforall.codeonthego.preferences.internal.BuildPreferences.LAUNCH_APP_AFTER_INSTALL +import org.appdevforall.codeonthego.preferences.internal.BuildPreferences.isBuildCacheEnabled +import org.appdevforall.codeonthego.preferences.internal.BuildPreferences.isDebugEnabled +import org.appdevforall.codeonthego.preferences.internal.BuildPreferences.isInfoEnabled +import org.appdevforall.codeonthego.preferences.internal.BuildPreferences.isOfflineEnabled +import org.appdevforall.codeonthego.preferences.internal.BuildPreferences.isScanEnabled +import org.appdevforall.codeonthego.preferences.internal.BuildPreferences.isStacktraceEnabled +import org.appdevforall.codeonthego.preferences.internal.BuildPreferences.isWarningModeAllEnabled +import org.appdevforall.codeonthego.preferences.internal.BuildPreferences.launchAppAfterInstall import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/itsaky/androidide/preferences/commonPrefExts.kt b/app/src/main/java/org/appdevforall/codeonthego/preferences/commonPrefExts.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/preferences/commonPrefExts.kt rename to app/src/main/java/org/appdevforall/codeonthego/preferences/commonPrefExts.kt index 6f5512cb9e..7aa87bbdd2 100644 --- a/app/src/main/java/com/itsaky/androidide/preferences/commonPrefExts.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/preferences/commonPrefExts.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import androidx.preference.Preference -import com.itsaky.androidide.utils.uncheckedCast +import org.appdevforall.codeonthego.utils.uncheckedCast import kotlin.reflect.KMutableProperty0 internal abstract class PropertyBasedMultiChoicePreference : MultiChoicePreference() { diff --git a/app/src/main/java/com/itsaky/androidide/preferences/developerOptionsPrefExts.kt b/app/src/main/java/org/appdevforall/codeonthego/preferences/developerOptionsPrefExts.kt similarity index 87% rename from app/src/main/java/com/itsaky/androidide/preferences/developerOptionsPrefExts.kt rename to app/src/main/java/org/appdevforall/codeonthego/preferences/developerOptionsPrefExts.kt index 99eccabe85..36d94d4419 100644 --- a/app/src/main/java/com/itsaky/androidide/preferences/developerOptionsPrefExts.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/preferences/developerOptionsPrefExts.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import com.itsaky.androidide.R -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_DEVOPTIONS -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_DEVOPTIONS_DUMPLOGS -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_DEVOPTIONS_LOGSENDER -import com.itsaky.androidide.preferences.internal.DevOpsPreferences +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_DEVOPTIONS +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_DEVOPTIONS_DUMPLOGS +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_DEVOPTIONS_LOGSENDER +import org.appdevforall.codeonthego.preferences.internal.DevOpsPreferences import kotlinx.parcelize.Parcelize @Parcelize diff --git a/app/src/main/java/com/itsaky/androidide/preferences/editorPrefExts.kt b/app/src/main/java/org/appdevforall/codeonthego/preferences/editorPrefExts.kt similarity index 88% rename from app/src/main/java/com/itsaky/androidide/preferences/editorPrefExts.kt rename to app/src/main/java/org/appdevforall/codeonthego/preferences/editorPrefExts.kt index 9bc1678b3d..d7f873c5a7 100644 --- a/app/src/main/java/com/itsaky/androidide/preferences/editorPrefExts.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/preferences/editorPrefExts.kt @@ -15,27 +15,27 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import android.view.LayoutInflater import androidx.preference.Preference import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.itsaky.androidide.R import com.itsaky.androidide.databinding.LayoutTextSizeSliderBinding -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.preferences.internal.EditorPreferences -import com.itsaky.androidide.preferences.internal.EditorPreferences.COMPLETIONS_MATCH_LOWER -import com.itsaky.androidide.preferences.internal.EditorPreferences.DELETE_EMPTY_LINES -import com.itsaky.androidide.preferences.internal.EditorPreferences.DELETE_TABS_ON_BACKSPACE -import com.itsaky.androidide.preferences.internal.EditorPreferences.FONT_SIZE -import com.itsaky.androidide.preferences.internal.EditorPreferences.PIN_LINE_NUMBERS -import com.itsaky.androidide.preferences.internal.EditorPreferences.PRINTABLE_CHARS -import com.itsaky.androidide.preferences.internal.EditorPreferences.STICKY_SCROLL_ENABLED -import com.itsaky.androidide.preferences.internal.EditorPreferences.TAB_SIZE -import com.itsaky.androidide.preferences.internal.EditorPreferences.USE_ICU -import com.itsaky.androidide.preferences.internal.EditorPreferences.USE_MAGNIFER -import com.itsaky.androidide.preferences.internal.EditorPreferences.USE_SOFT_TAB -import com.itsaky.androidide.preferences.internal.EditorPreferences.WORD_WRAP +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences.COMPLETIONS_MATCH_LOWER +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences.DELETE_EMPTY_LINES +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences.DELETE_TABS_ON_BACKSPACE +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences.FONT_SIZE +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences.PIN_LINE_NUMBERS +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences.PRINTABLE_CHARS +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences.STICKY_SCROLL_ENABLED +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences.TAB_SIZE +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences.USE_ICU +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences.USE_MAGNIFER +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences.USE_SOFT_TAB +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences.WORD_WRAP import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string import kotlinx.parcelize.IgnoredOnParcel diff --git a/app/src/main/java/com/itsaky/androidide/preferences/generalPrefExts.kt b/app/src/main/java/org/appdevforall/codeonthego/preferences/generalPrefExts.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/preferences/generalPrefExts.kt rename to app/src/main/java/org/appdevforall/codeonthego/preferences/generalPrefExts.kt index 3309620dde..8852a5b95a 100644 --- a/app/src/main/java/com/itsaky/androidide/preferences/generalPrefExts.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/preferences/generalPrefExts.kt @@ -15,22 +15,22 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import android.content.Context import androidx.appcompat.app.AppCompatDelegate import androidx.core.content.ContextCompat import androidx.preference.Preference import com.itsaky.androidide.R -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_GENERAL -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_GENERAL_CONFIRMOPEN -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_GENERAL_LANGUAGE -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_GENERAL_OPENLAST -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_GENERAL_UIMODE -import com.itsaky.androidide.preferences.internal.GeneralPreferences +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_GENERAL +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_GENERAL_CONFIRMOPEN +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_GENERAL_LANGUAGE +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_GENERAL_OPENLAST +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_GENERAL_UIMODE +import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string -import com.itsaky.androidide.resources.localization.LocaleProvider +import org.appdevforall.codeonthego.resources.localization.LocaleProvider import kotlinx.parcelize.Parcelize @Parcelize diff --git a/app/src/main/java/com/itsaky/androidide/preferences/gitPrefExts.kt b/app/src/main/java/org/appdevforall/codeonthego/preferences/gitPrefExts.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/preferences/gitPrefExts.kt rename to app/src/main/java/org/appdevforall/codeonthego/preferences/gitPrefExts.kt index 1912f7824f..c42a43f8dd 100644 --- a/app/src/main/java/com/itsaky/androidide/preferences/gitPrefExts.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/preferences/gitPrefExts.kt @@ -1,13 +1,13 @@ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import androidx.preference.Preference import com.google.android.material.textfield.TextInputLayout -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_GIT -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_GIT_USEREMAIL -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_GIT_USERNAME -import com.itsaky.androidide.preferences.internal.GitPreferences +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_GIT +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_GIT_USEREMAIL +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_GIT_USERNAME +import org.appdevforall.codeonthego.preferences.internal.GitPreferences import com.itsaky.androidide.R -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.idetooltips.TooltipTag import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/itsaky/androidide/preferences/javaPrefExts.kt b/app/src/main/java/org/appdevforall/codeonthego/preferences/javaPrefExts.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/preferences/javaPrefExts.kt rename to app/src/main/java/org/appdevforall/codeonthego/preferences/javaPrefExts.kt index f58283c0bd..47bb74ec7a 100644 --- a/app/src/main/java/com/itsaky/androidide/preferences/javaPrefExts.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/preferences/javaPrefExts.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import com.itsaky.androidide.R -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.preferences.internal.JavaPreferences +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.preferences.internal.JavaPreferences import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/itsaky/androidide/preferences/pluginPrefExts.kt b/app/src/main/java/org/appdevforall/codeonthego/preferences/pluginPrefExts.kt similarity index 89% rename from app/src/main/java/com/itsaky/androidide/preferences/pluginPrefExts.kt rename to app/src/main/java/org/appdevforall/codeonthego/preferences/pluginPrefExts.kt index 2dfdad7ac9..2bd10b50f7 100644 --- a/app/src/main/java/com/itsaky/androidide/preferences/pluginPrefExts.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/preferences/pluginPrefExts.kt @@ -1,18 +1,18 @@ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import android.content.Context import android.content.Intent import androidx.preference.Preference -import com.itsaky.androidide.activities.PluginManagerActivity -import com.itsaky.androidide.activities.PluginScreenNavigator -import com.itsaky.androidide.app.IDEApplication -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_PLUGIN_MANAGER -import com.itsaky.androidide.plugins.manager.core.PluginManager +import org.appdevforall.codeonthego.activities.PluginManagerActivity +import org.appdevforall.codeonthego.activities.PluginScreenNavigator +import org.appdevforall.codeonthego.app.IDEApplication +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_PLUGIN_MANAGER +import org.appdevforall.codeonthego.plugins.manager.core.PluginManager import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string -import com.itsaky.androidide.utils.ILogger -import com.itsaky.androidide.utils.flashError +import org.appdevforall.codeonthego.utils.ILogger +import org.appdevforall.codeonthego.utils.flashError import kotlinx.parcelize.Parcelize @Parcelize @@ -39,7 +39,7 @@ class PluginManagerEntry( /** * A Configuration row contributed by a plugin through - * [com.itsaky.androidide.plugins.extensions.SettingsExtension]. Tapping it asks + * [org.appdevforall.codeonthego.plugins.extensions.SettingsExtension]. Tapping it asks * [PluginScreenNavigator] to mount the plugin's own fragment full-screen; the row itself only holds * the data, builds the widget, and reports a failed launch. * diff --git a/app/src/main/java/com/itsaky/androidide/preferences/rootPrefExts.kt b/app/src/main/java/org/appdevforall/codeonthego/preferences/rootPrefExts.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/preferences/rootPrefExts.kt rename to app/src/main/java/org/appdevforall/codeonthego/preferences/rootPrefExts.kt index 2d8ede5c16..ec4079ced4 100644 --- a/app/src/main/java/com/itsaky/androidide/preferences/rootPrefExts.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/preferences/rootPrefExts.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import com.itsaky.androidide.resources.R.string -import com.itsaky.androidide.utils.FeatureFlags +import org.appdevforall.codeonthego.utils.FeatureFlags import kotlinx.parcelize.Parcelize internal fun IDEPreferences.addRootPreferences() { diff --git a/app/src/main/java/com/itsaky/androidide/preferences/termuxPrefsExt.kt b/app/src/main/java/org/appdevforall/codeonthego/preferences/termuxPrefsExt.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/preferences/termuxPrefsExt.kt rename to app/src/main/java/org/appdevforall/codeonthego/preferences/termuxPrefsExt.kt index d7c1180a7b..234185e7c3 100644 --- a/app/src/main/java/com/itsaky/androidide/preferences/termuxPrefsExt.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/preferences/termuxPrefsExt.kt @@ -15,21 +15,21 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import android.content.Context import androidx.annotation.StringRes import androidx.core.content.ContextCompat import androidx.preference.Preference import com.itsaky.androidide.R -import com.itsaky.androidide.app.IDEApplication -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_TERMUX -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_TERMUX_CRASHREPORTS -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_TERMUX_KEYLOGGING -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_TERMUX_LOGLEVEL -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_TERMUX_MARGIN -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_TERMUX_NOHARDKEYBOARD -import com.itsaky.androidide.idetooltips.TooltipTag.PREFS_TERMUX_SOFTKEYBOARD +import org.appdevforall.codeonthego.app.IDEApplication +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_TERMUX +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_TERMUX_CRASHREPORTS +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_TERMUX_KEYLOGGING +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_TERMUX_LOGLEVEL +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_TERMUX_MARGIN +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_TERMUX_NOHARDKEYBOARD +import org.appdevforall.codeonthego.idetooltips.TooltipTag.PREFS_TERMUX_SOFTKEYBOARD import com.termux.shared.logger.Logger import com.termux.shared.termux.settings.preferences.TermuxAppSharedPreferences import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/itsaky/androidide/preferences/xmlPrefExts.kt b/app/src/main/java/org/appdevforall/codeonthego/preferences/xmlPrefExts.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/preferences/xmlPrefExts.kt rename to app/src/main/java/org/appdevforall/codeonthego/preferences/xmlPrefExts.kt index 8947ef437b..6d3e8faa6d 100644 --- a/app/src/main/java/com/itsaky/androidide/preferences/xmlPrefExts.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/preferences/xmlPrefExts.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import androidx.preference.Preference -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.preferences.internal.XmlPreferences +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.preferences.internal.XmlPreferences import com.itsaky.androidide.resources.R.string import kotlinx.parcelize.Parcelize import org.eclipse.lemminx.dom.builder.EmptyElements diff --git a/app/src/main/java/com/itsaky/androidide/projects/builder/BuildResult.kt b/app/src/main/java/org/appdevforall/codeonthego/projects/builder/BuildResult.kt similarity index 69% rename from app/src/main/java/com/itsaky/androidide/projects/builder/BuildResult.kt rename to app/src/main/java/org/appdevforall/codeonthego/projects/builder/BuildResult.kt index 9bda02982c..933652a060 100644 --- a/app/src/main/java/com/itsaky/androidide/projects/builder/BuildResult.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/projects/builder/BuildResult.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.projects.builder +package org.appdevforall.codeonthego.projects.builder data class BuildResult( val isSuccess: Boolean, diff --git a/app/src/main/java/com/itsaky/androidide/projects/builder/LaunchResult.kt b/app/src/main/java/org/appdevforall/codeonthego/projects/builder/LaunchResult.kt similarity index 56% rename from app/src/main/java/com/itsaky/androidide/projects/builder/LaunchResult.kt rename to app/src/main/java/org/appdevforall/codeonthego/projects/builder/LaunchResult.kt index 929908cc66..7205e58f5e 100644 --- a/app/src/main/java/com/itsaky/androidide/projects/builder/LaunchResult.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/projects/builder/LaunchResult.kt @@ -1,3 +1,3 @@ -package com.itsaky.androidide.projects.builder +package org.appdevforall.codeonthego.projects.builder data class LaunchResult(val isSuccess: Boolean, val message: String) \ No newline at end of file diff --git a/app/src/main/java/com/itsaky/androidide/provider/IDEDocumentsProvider.java b/app/src/main/java/org/appdevforall/codeonthego/provider/IDEDocumentsProvider.java similarity index 96% rename from app/src/main/java/com/itsaky/androidide/provider/IDEDocumentsProvider.java rename to app/src/main/java/org/appdevforall/codeonthego/provider/IDEDocumentsProvider.java index ac368a1f4d..12f396abc1 100644 --- a/app/src/main/java/com/itsaky/androidide/provider/IDEDocumentsProvider.java +++ b/app/src/main/java/org/appdevforall/codeonthego/provider/IDEDocumentsProvider.java @@ -1,330 +1,330 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.provider; - -import android.content.res.AssetFileDescriptor; -import android.database.Cursor; -import android.database.MatrixCursor; -import android.graphics.Point; -import android.os.CancellationSignal; -import android.os.ParcelFileDescriptor; -import android.provider.DocumentsContract.Document; -import android.provider.DocumentsContract.Root; -import android.provider.DocumentsProvider; -import android.webkit.MimeTypeMap; -import androidx.annotation.NonNull; -import com.itsaky.androidide.resources.R; -import com.itsaky.androidide.utils.Environment; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Collections; -import java.util.LinkedList; -import java.util.Locale; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A document provider for the Storage Access Framework which exposes the files in the $HOME/ - * directory to other apps. - * - *

Note that this replaces providing an activity matching the ACTION_GET_CONTENT intent: - * - *

"A document provider and ACTION_GET_CONTENT should be considered mutually exclusive. If you - * support both of them simultaneously, your app will appear twice in the system picker UI, offering - * two different ways of accessing your stored data. This would be confusing for users." - - * http://developer.android.com/guide/topics/providers/document-provider.html#43 - * - * @see TermuxDocumentsProvider - */ -public class IDEDocumentsProvider extends DocumentsProvider { - - private static final String ALL_MIME_TYPES = "*/*"; - private static final Logger LOG = LoggerFactory.getLogger(IDEDocumentsProvider.class); - private static final File BASE_DIR = getBaseDir(); - // The default columns to return information about a root if no specific - // columns are requested in a query. - private static final String[] DEFAULT_ROOT_PROJECTION = - new String[]{ - Root.COLUMN_ROOT_ID, - Root.COLUMN_MIME_TYPES, - Root.COLUMN_FLAGS, - Root.COLUMN_ICON, - Root.COLUMN_TITLE, - Root.COLUMN_SUMMARY, - Root.COLUMN_DOCUMENT_ID, - Root.COLUMN_AVAILABLE_BYTES - }; - // The default columns to return information about a document if no specific - // columns are requested in a query. - private static final String[] DEFAULT_DOCUMENT_PROJECTION = - new String[]{ - Document.COLUMN_DOCUMENT_ID, - Document.COLUMN_MIME_TYPE, - Document.COLUMN_DISPLAY_NAME, - Document.COLUMN_LAST_MODIFIED, - Document.COLUMN_FLAGS, - Document.COLUMN_SIZE - }; - - @NonNull - private static File getBaseDir() { - if (Environment.HOME != null) { - return Environment.HOME; - } - - return new File(Environment.DEFAULT_HOME); - } - - @Override - public boolean onCreate() { - return true; - } - - @Override - public boolean isChildDocument(String parentDocumentId, String documentId) { - return documentId.startsWith(parentDocumentId); - } - - @Override - public String createDocument(String parentDocumentId, String mimeType, String displayName) - throws FileNotFoundException { - File newFile = new File(parentDocumentId, displayName); - int noConflictId = 2; - while (newFile.exists()) { - newFile = new File(parentDocumentId, displayName + " (" + noConflictId++ + ")"); - } - try { - boolean succeeded; - if (Document.MIME_TYPE_DIR.equals(mimeType)) { - succeeded = newFile.mkdir(); - } else { - succeeded = newFile.createNewFile(); - } - if (!succeeded) { - throw new FileNotFoundException("Failed to create document with id " + newFile.getPath()); - } - } catch (IOException e) { - throw new FileNotFoundException("Failed to create document with id " + newFile.getPath()); - } - return newFile.getPath(); - } - - @Override - public void deleteDocument(String documentId) throws FileNotFoundException { - File file = getFileForDocId(documentId); - if (!file.delete()) { - throw new FileNotFoundException("Failed to delete document with id " + documentId); - } - } - - @Override - public Cursor queryRoots(String[] projection) { - final MatrixCursor result = - new MatrixCursor(projection != null ? projection : DEFAULT_ROOT_PROJECTION); - final String applicationName = getContext().getString(R.string.app_name); - - final MatrixCursor.RowBuilder row = result.newRow(); - LOG.debug("queryRoots() before all add"); - row.add(Root.COLUMN_ROOT_ID, getDocIdForFile(BASE_DIR)); - LOG.debug("queryRoots() before all add, 1"); - row.add(Root.COLUMN_DOCUMENT_ID, getDocIdForFile(BASE_DIR)); - LOG.debug("queryRoots() before all add, 2"); - row.add(Root.COLUMN_SUMMARY, null); - LOG.debug("queryRoots() before all add, 3"); - row.add( - Root.COLUMN_FLAGS, - Root.FLAG_SUPPORTS_CREATE | Root.FLAG_SUPPORTS_SEARCH | Root.FLAG_SUPPORTS_IS_CHILD); - LOG.debug("queryRoots() before all add, 4"); - row.add(Root.COLUMN_TITLE, applicationName); - LOG.debug("queryRoots() before all add, 5"); - row.add(Root.COLUMN_MIME_TYPES, ALL_MIME_TYPES); - LOG.debug("queryRoots() before all add, 6"); - row.add(Root.COLUMN_AVAILABLE_BYTES, BASE_DIR.getFreeSpace()); - LOG.debug("queryRoots() before all add, 7"); - row.add(Root.COLUMN_ICON, R.drawable.ic_launcher_foreground); - LOG.debug("queryRoots() before all add"); - return result; - } - - /** - * Get the document id given a file. This document id must be consistent across time as other - * applications may save the ID and use it to reference documents later. - * - *

The reverse of @{link #getFileForDocId}. - */ - private static String getDocIdForFile(File file) { - return file.getAbsolutePath(); - } - - @Override - public Cursor queryDocument(String documentId, String[] projection) throws FileNotFoundException { - final MatrixCursor result = - new MatrixCursor(projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION); - includeFile(result, documentId, null); - return result; - } - - @Override - public Cursor queryChildDocuments(String parentDocumentId, String[] projection, String sortOrder) - throws FileNotFoundException { - final MatrixCursor result = - new MatrixCursor(projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION); - final File parent = getFileForDocId(parentDocumentId); - for (File file : parent.listFiles()) { - includeFile(result, null, file); - } - return result; - } - - @Override - public Cursor querySearchDocuments(String rootId, String query, String[] projection) - throws FileNotFoundException { - final MatrixCursor result = - new MatrixCursor(projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION); - final File parent = getFileForDocId(rootId); - - // This example implementation searches file names for the query and doesn't rank search - // results, so we can stop as soon as we find a sufficient number of matches. Other - // implementations might rank results and use other data about files, rather than the file - // name, to produce a match. - final LinkedList pending = new LinkedList<>(); - pending.add(parent); - - final int MAX_SEARCH_RESULTS = 50; - while (!pending.isEmpty() && result.getCount() < MAX_SEARCH_RESULTS) { - final File file = pending.removeFirst(); - // Avoid directories outside the $HOME directory linked with symlinks (to avoid e.g. - // search - // through the whole SD card). - boolean isInsideHome; - try { - isInsideHome = file.getCanonicalPath().startsWith(Environment.HOME.getAbsolutePath()); - } catch (IOException e) { - isInsideHome = true; - } - if (isInsideHome) { - if (file.isDirectory()) { - Collections.addAll(pending, file.listFiles()); - } else { - if (file.getName().toLowerCase(Locale.ROOT).contains(query)) { - includeFile(result, null, file); - } - } - } - } - - return result; - } - - @Override - public String getDocumentType(String documentId) throws FileNotFoundException { - File file = getFileForDocId(documentId); - return getMimeType(file); - } - - @Override - public ParcelFileDescriptor openDocument( - final String documentId, String mode, CancellationSignal signal) - throws FileNotFoundException { - final File file = getFileForDocId(documentId); - final int accessMode = ParcelFileDescriptor.parseMode(mode); - return ParcelFileDescriptor.open(file, accessMode); - } - - @Override - public AssetFileDescriptor openDocumentThumbnail( - String documentId, Point sizeHint, CancellationSignal signal) throws FileNotFoundException { - final File file = getFileForDocId(documentId); - final ParcelFileDescriptor pfd = - ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY); - return new AssetFileDescriptor(pfd, 0, file.length()); - } - - /** - * Add a representation of a file to a cursor. - * - * @param result the cursor to modify - * @param docId the document ID representing the desired file (may be null if given file) - * @param file the File object representing the desired file (may be null if given docID) - */ - private void includeFile(MatrixCursor result, String docId, File file) - throws FileNotFoundException { - if (docId == null) { - docId = getDocIdForFile(file); - } else { - file = getFileForDocId(docId); - } - - int flags = 0; - if (file.isDirectory()) { - if (file.canWrite()) { - flags |= Document.FLAG_DIR_SUPPORTS_CREATE; - } - } else if (file.canWrite()) { - flags |= Document.FLAG_SUPPORTS_WRITE; - } - if (file.getParentFile().canWrite()) { - flags |= Document.FLAG_SUPPORTS_DELETE; - } - - final String displayName = file.getName(); - final String mimeType = getMimeType(file); - if (mimeType.startsWith("image/")) { - flags |= Document.FLAG_SUPPORTS_THUMBNAIL; - } - - final MatrixCursor.RowBuilder row = result.newRow(); - row.add(Document.COLUMN_DOCUMENT_ID, docId); - row.add(Document.COLUMN_DISPLAY_NAME, displayName); - row.add(Document.COLUMN_SIZE, file.length()); - row.add(Document.COLUMN_MIME_TYPE, mimeType); - row.add(Document.COLUMN_LAST_MODIFIED, file.lastModified()); - row.add(Document.COLUMN_FLAGS, flags); - row.add(Document.COLUMN_ICON, R.mipmap.ic_launcher); - } - - /** - * Get the file given a document id (the reverse of {@link #getDocIdForFile(File)}). - */ - private static File getFileForDocId(String docId) throws FileNotFoundException { - final File f = new File(docId); - if (!f.exists()) { - throw new FileNotFoundException(f.getAbsolutePath() + " not found"); - } - return f; - } - - private static String getMimeType(File file) { - if (file.isDirectory()) { - return Document.MIME_TYPE_DIR; - } else { - final String name = file.getName(); - final int lastDot = name.lastIndexOf('.'); - if (lastDot >= 0) { - final String extension = name.substring(lastDot + 1).toLowerCase(Locale.ROOT); - final String mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); - if (mime != null) { - return mime; - } - } - return "application/octet-stream"; - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.provider; + +import android.content.res.AssetFileDescriptor; +import android.database.Cursor; +import android.database.MatrixCursor; +import android.graphics.Point; +import android.os.CancellationSignal; +import android.os.ParcelFileDescriptor; +import android.provider.DocumentsContract.Document; +import android.provider.DocumentsContract.Root; +import android.provider.DocumentsProvider; +import android.webkit.MimeTypeMap; +import androidx.annotation.NonNull; +import com.itsaky.androidide.resources.R; +import org.appdevforall.codeonthego.utils.Environment; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Collections; +import java.util.LinkedList; +import java.util.Locale; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * A document provider for the Storage Access Framework which exposes the files in the $HOME/ + * directory to other apps. + * + *

Note that this replaces providing an activity matching the ACTION_GET_CONTENT intent: + * + *

"A document provider and ACTION_GET_CONTENT should be considered mutually exclusive. If you + * support both of them simultaneously, your app will appear twice in the system picker UI, offering + * two different ways of accessing your stored data. This would be confusing for users." - + * http://developer.android.com/guide/topics/providers/document-provider.html#43 + * + * @see TermuxDocumentsProvider + */ +public class IDEDocumentsProvider extends DocumentsProvider { + + private static final String ALL_MIME_TYPES = "*/*"; + private static final Logger LOG = LoggerFactory.getLogger(IDEDocumentsProvider.class); + private static final File BASE_DIR = getBaseDir(); + // The default columns to return information about a root if no specific + // columns are requested in a query. + private static final String[] DEFAULT_ROOT_PROJECTION = + new String[]{ + Root.COLUMN_ROOT_ID, + Root.COLUMN_MIME_TYPES, + Root.COLUMN_FLAGS, + Root.COLUMN_ICON, + Root.COLUMN_TITLE, + Root.COLUMN_SUMMARY, + Root.COLUMN_DOCUMENT_ID, + Root.COLUMN_AVAILABLE_BYTES + }; + // The default columns to return information about a document if no specific + // columns are requested in a query. + private static final String[] DEFAULT_DOCUMENT_PROJECTION = + new String[]{ + Document.COLUMN_DOCUMENT_ID, + Document.COLUMN_MIME_TYPE, + Document.COLUMN_DISPLAY_NAME, + Document.COLUMN_LAST_MODIFIED, + Document.COLUMN_FLAGS, + Document.COLUMN_SIZE + }; + + @NonNull + private static File getBaseDir() { + if (Environment.HOME != null) { + return Environment.HOME; + } + + return new File(Environment.DEFAULT_HOME); + } + + @Override + public boolean onCreate() { + return true; + } + + @Override + public boolean isChildDocument(String parentDocumentId, String documentId) { + return documentId.startsWith(parentDocumentId); + } + + @Override + public String createDocument(String parentDocumentId, String mimeType, String displayName) + throws FileNotFoundException { + File newFile = new File(parentDocumentId, displayName); + int noConflictId = 2; + while (newFile.exists()) { + newFile = new File(parentDocumentId, displayName + " (" + noConflictId++ + ")"); + } + try { + boolean succeeded; + if (Document.MIME_TYPE_DIR.equals(mimeType)) { + succeeded = newFile.mkdir(); + } else { + succeeded = newFile.createNewFile(); + } + if (!succeeded) { + throw new FileNotFoundException("Failed to create document with id " + newFile.getPath()); + } + } catch (IOException e) { + throw new FileNotFoundException("Failed to create document with id " + newFile.getPath()); + } + return newFile.getPath(); + } + + @Override + public void deleteDocument(String documentId) throws FileNotFoundException { + File file = getFileForDocId(documentId); + if (!file.delete()) { + throw new FileNotFoundException("Failed to delete document with id " + documentId); + } + } + + @Override + public Cursor queryRoots(String[] projection) { + final MatrixCursor result = + new MatrixCursor(projection != null ? projection : DEFAULT_ROOT_PROJECTION); + final String applicationName = getContext().getString(R.string.app_name); + + final MatrixCursor.RowBuilder row = result.newRow(); + LOG.debug("queryRoots() before all add"); + row.add(Root.COLUMN_ROOT_ID, getDocIdForFile(BASE_DIR)); + LOG.debug("queryRoots() before all add, 1"); + row.add(Root.COLUMN_DOCUMENT_ID, getDocIdForFile(BASE_DIR)); + LOG.debug("queryRoots() before all add, 2"); + row.add(Root.COLUMN_SUMMARY, null); + LOG.debug("queryRoots() before all add, 3"); + row.add( + Root.COLUMN_FLAGS, + Root.FLAG_SUPPORTS_CREATE | Root.FLAG_SUPPORTS_SEARCH | Root.FLAG_SUPPORTS_IS_CHILD); + LOG.debug("queryRoots() before all add, 4"); + row.add(Root.COLUMN_TITLE, applicationName); + LOG.debug("queryRoots() before all add, 5"); + row.add(Root.COLUMN_MIME_TYPES, ALL_MIME_TYPES); + LOG.debug("queryRoots() before all add, 6"); + row.add(Root.COLUMN_AVAILABLE_BYTES, BASE_DIR.getFreeSpace()); + LOG.debug("queryRoots() before all add, 7"); + row.add(Root.COLUMN_ICON, R.drawable.ic_launcher_foreground); + LOG.debug("queryRoots() before all add"); + return result; + } + + /** + * Get the document id given a file. This document id must be consistent across time as other + * applications may save the ID and use it to reference documents later. + * + *

The reverse of @{link #getFileForDocId}. + */ + private static String getDocIdForFile(File file) { + return file.getAbsolutePath(); + } + + @Override + public Cursor queryDocument(String documentId, String[] projection) throws FileNotFoundException { + final MatrixCursor result = + new MatrixCursor(projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION); + includeFile(result, documentId, null); + return result; + } + + @Override + public Cursor queryChildDocuments(String parentDocumentId, String[] projection, String sortOrder) + throws FileNotFoundException { + final MatrixCursor result = + new MatrixCursor(projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION); + final File parent = getFileForDocId(parentDocumentId); + for (File file : parent.listFiles()) { + includeFile(result, null, file); + } + return result; + } + + @Override + public Cursor querySearchDocuments(String rootId, String query, String[] projection) + throws FileNotFoundException { + final MatrixCursor result = + new MatrixCursor(projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION); + final File parent = getFileForDocId(rootId); + + // This example implementation searches file names for the query and doesn't rank search + // results, so we can stop as soon as we find a sufficient number of matches. Other + // implementations might rank results and use other data about files, rather than the file + // name, to produce a match. + final LinkedList pending = new LinkedList<>(); + pending.add(parent); + + final int MAX_SEARCH_RESULTS = 50; + while (!pending.isEmpty() && result.getCount() < MAX_SEARCH_RESULTS) { + final File file = pending.removeFirst(); + // Avoid directories outside the $HOME directory linked with symlinks (to avoid e.g. + // search + // through the whole SD card). + boolean isInsideHome; + try { + isInsideHome = file.getCanonicalPath().startsWith(Environment.HOME.getAbsolutePath()); + } catch (IOException e) { + isInsideHome = true; + } + if (isInsideHome) { + if (file.isDirectory()) { + Collections.addAll(pending, file.listFiles()); + } else { + if (file.getName().toLowerCase(Locale.ROOT).contains(query)) { + includeFile(result, null, file); + } + } + } + } + + return result; + } + + @Override + public String getDocumentType(String documentId) throws FileNotFoundException { + File file = getFileForDocId(documentId); + return getMimeType(file); + } + + @Override + public ParcelFileDescriptor openDocument( + final String documentId, String mode, CancellationSignal signal) + throws FileNotFoundException { + final File file = getFileForDocId(documentId); + final int accessMode = ParcelFileDescriptor.parseMode(mode); + return ParcelFileDescriptor.open(file, accessMode); + } + + @Override + public AssetFileDescriptor openDocumentThumbnail( + String documentId, Point sizeHint, CancellationSignal signal) throws FileNotFoundException { + final File file = getFileForDocId(documentId); + final ParcelFileDescriptor pfd = + ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY); + return new AssetFileDescriptor(pfd, 0, file.length()); + } + + /** + * Add a representation of a file to a cursor. + * + * @param result the cursor to modify + * @param docId the document ID representing the desired file (may be null if given file) + * @param file the File object representing the desired file (may be null if given docID) + */ + private void includeFile(MatrixCursor result, String docId, File file) + throws FileNotFoundException { + if (docId == null) { + docId = getDocIdForFile(file); + } else { + file = getFileForDocId(docId); + } + + int flags = 0; + if (file.isDirectory()) { + if (file.canWrite()) { + flags |= Document.FLAG_DIR_SUPPORTS_CREATE; + } + } else if (file.canWrite()) { + flags |= Document.FLAG_SUPPORTS_WRITE; + } + if (file.getParentFile().canWrite()) { + flags |= Document.FLAG_SUPPORTS_DELETE; + } + + final String displayName = file.getName(); + final String mimeType = getMimeType(file); + if (mimeType.startsWith("image/")) { + flags |= Document.FLAG_SUPPORTS_THUMBNAIL; + } + + final MatrixCursor.RowBuilder row = result.newRow(); + row.add(Document.COLUMN_DOCUMENT_ID, docId); + row.add(Document.COLUMN_DISPLAY_NAME, displayName); + row.add(Document.COLUMN_SIZE, file.length()); + row.add(Document.COLUMN_MIME_TYPE, mimeType); + row.add(Document.COLUMN_LAST_MODIFIED, file.lastModified()); + row.add(Document.COLUMN_FLAGS, flags); + row.add(Document.COLUMN_ICON, R.mipmap.ic_launcher); + } + + /** + * Get the file given a document id (the reverse of {@link #getDocIdForFile(File)}). + */ + private static File getFileForDocId(String docId) throws FileNotFoundException { + final File f = new File(docId); + if (!f.exists()) { + throw new FileNotFoundException(f.getAbsolutePath() + " not found"); + } + return f; + } + + private static String getMimeType(File file) { + if (file.isDirectory()) { + return Document.MIME_TYPE_DIR; + } else { + final String name = file.getName(); + final int lastDot = name.lastIndexOf('.'); + if (lastDot >= 0) { + final String extension = name.substring(lastDot + 1).toLowerCase(Locale.ROOT); + final String mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); + if (mime != null) { + return mime; + } + } + return "application/octet-stream"; + } + } +} diff --git a/app/src/main/java/com/itsaky/androidide/provider/IDEFileProvider.kt b/app/src/main/java/org/appdevforall/codeonthego/provider/IDEFileProvider.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/provider/IDEFileProvider.kt rename to app/src/main/java/org/appdevforall/codeonthego/provider/IDEFileProvider.kt index e355b914d7..f8b39fa568 100644 --- a/app/src/main/java/com/itsaky/androidide/provider/IDEFileProvider.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/provider/IDEFileProvider.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.provider +package org.appdevforall.codeonthego.provider import androidx.core.content.FileProvider diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/AndroidProxyAppLauncher.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/AndroidProxyAppLauncher.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/quickbuild/AndroidProxyAppLauncher.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/AndroidProxyAppLauncher.kt index 17c470a0fb..8a4257dc12 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/AndroidProxyAppLauncher.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/AndroidProxyAppLauncher.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import android.content.Context import android.content.Intent diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/AutostartBuild.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/AutostartBuild.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/quickbuild/AutostartBuild.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/AutostartBuild.kt index fb8f978983..122287b9e9 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/AutostartBuild.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/AutostartBuild.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild /** * The build an external harness asked the editor to fire in place of the user's first tap diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/CompositeQuickBuildMetricsSink.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/CompositeQuickBuildMetricsSink.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/quickbuild/CompositeQuickBuildMetricsSink.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/CompositeQuickBuildMetricsSink.kt index f4cd8b62c4..4d5ed635d4 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/CompositeQuickBuildMetricsSink.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/CompositeQuickBuildMetricsSink.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import org.appdevforall.cotg.quickbuild.domain.ChangedFiles import org.appdevforall.cotg.quickbuild.domain.classify.BuildRoute diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/EnvironmentQuickBuildPaths.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/EnvironmentQuickBuildPaths.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/quickbuild/EnvironmentQuickBuildPaths.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/EnvironmentQuickBuildPaths.kt index e15cb9446f..fa88b1c7ea 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/EnvironmentQuickBuildPaths.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/EnvironmentQuickBuildPaths.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import android.content.Context -import com.itsaky.androidide.utils.Environment +import org.appdevforall.codeonthego.utils.Environment import org.appdevforall.cotg.quickbuild.data.QuickBuildPaths import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/GenerateSourcesDeferral.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/GenerateSourcesDeferral.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/quickbuild/GenerateSourcesDeferral.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/GenerateSourcesDeferral.kt index 6b922c0aff..a68e235b84 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/GenerateSourcesDeferral.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/GenerateSourcesDeferral.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild -import com.itsaky.androidide.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.projects.ProjectManagerImpl import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job @@ -171,7 +171,7 @@ class GenerateSourcesDeferral( /** * Claims the Gradle build that just finished as the one this deferral dispatched. * - * The hand-back ([com.itsaky.androidide.activities.editor.ProjectHandlerActivity]) marks a + * The hand-back ([org.appdevforall.codeonthego.activities.editor.ProjectHandlerActivity]) marks a * live session's baseline untrusted after every finished build, because a Standard Run * rewrites outputs the session reads. This deferral's own `generateSources` build does not: * it regenerates the intermediates R.jar and resource outputs for the language server, while diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/GradleQuickBuildProvisioner.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/GradleQuickBuildProvisioner.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/quickbuild/GradleQuickBuildProvisioner.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/GradleQuickBuildProvisioner.kt index 821d86f240..6382cca48d 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/GradleQuickBuildProvisioner.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/GradleQuickBuildProvisioner.kt @@ -1,19 +1,19 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import android.content.Context import androidx.annotation.StringRes -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.api.AndroidModule -import com.itsaky.androidide.projects.builder.BuildService -import com.itsaky.androidide.projects.isPluginProject +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.api.AndroidModule +import org.appdevforall.codeonthego.projects.builder.BuildService +import org.appdevforall.codeonthego.projects.isPluginProject import com.itsaky.androidide.resources.R -import com.itsaky.androidide.services.builder.GradleBuildService -import com.itsaky.androidide.tooling.api.GradlePluginConfig -import com.itsaky.androidide.tooling.api.messages.BuildRunType -import com.itsaky.androidide.tooling.api.messages.GradleBuildParams -import com.itsaky.androidide.tooling.api.messages.TaskExecutionMessage -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult +import org.appdevforall.codeonthego.services.builder.GradleBuildService +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig +import org.appdevforall.codeonthego.tooling.api.messages.BuildRunType +import org.appdevforall.codeonthego.tooling.api.messages.GradleBuildParams +import org.appdevforall.codeonthego.tooling.api.messages.TaskExecutionMessage +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.delay diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/PreferencesQuickBuildHistoryStore.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/PreferencesQuickBuildHistoryStore.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/quickbuild/PreferencesQuickBuildHistoryStore.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/PreferencesQuickBuildHistoryStore.kt index 20534d3772..02ced6daec 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/PreferencesQuickBuildHistoryStore.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/PreferencesQuickBuildHistoryStore.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import android.content.Context import android.content.SharedPreferences diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildArtifactStager.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildArtifactStager.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildArtifactStager.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildArtifactStager.kt index a42fe8ba74..b255d18472 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildArtifactStager.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildArtifactStager.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import android.content.Context import androidx.core.content.pm.PackageInfoCompat -import com.itsaky.androidide.utils.Environment +import org.appdevforall.codeonthego.utils.Environment import org.slf4j.LoggerFactory import java.io.File import java.io.FileNotFoundException diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildFlashes.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildFlashes.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildFlashes.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildFlashes.kt index da325fcb9a..fefca5f0b7 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildFlashes.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildFlashes.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import androidx.annotation.StringRes import com.itsaky.androidide.resources.R diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildGraphWarmUp.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildGraphWarmUp.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildGraphWarmUp.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildGraphWarmUp.kt index b89d01ef5d..25aa1fa53c 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildGraphWarmUp.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildGraphWarmUp.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild -import com.itsaky.androidide.utils.FeatureFlags +import org.appdevforall.codeonthego.utils.FeatureFlags import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.first diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildInstallAdapters.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildInstallAdapters.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildInstallAdapters.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildInstallAdapters.kt index 8d1d3851de..4166af39b9 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildInstallAdapters.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildInstallAdapters.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import android.content.Context import android.content.pm.PackageInfo import android.content.pm.PackageInstaller import android.content.pm.PackageManager -import com.itsaky.androidide.events.InstallationEvent -import com.itsaky.androidide.utils.isAtLeastP +import org.appdevforall.codeonthego.events.InstallationEvent +import org.appdevforall.codeonthego.utils.isAtLeastP import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.SharedFlow import org.appdevforall.cotg.quickbuild.service.provision.InstallBroadcast diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildMessages.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildMessages.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildMessages.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildMessages.kt index 6f5b065d98..fe189b5f7e 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildMessages.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildMessages.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import android.content.Context import com.itsaky.androidide.resources.R diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildOutputLines.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildOutputLines.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildOutputLines.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildOutputLines.kt index 5e73a46d98..62041788cb 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildOutputLines.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildOutputLines.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import org.appdevforall.cotg.quickbuild.domain.classify.InvalidationReason import org.appdevforall.cotg.quickbuild.domain.reload.BuildDiagnostic @@ -168,7 +168,7 @@ private const val MIN_REPORTED_MILLIS = 50L * This is the only route that reason has to the user: the proxy app build runs as an INTERNAL * build, which suppresses the editor's build listener, so Gradle's output never reaches the pane by * itself - and the tooling API's own failure is a bare enum - * ([com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure]) naming the + * ([org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure]) naming the * category, never the cause. So the text below is Gradle's captured output or nothing at all. * * @param output the internal build's captured Gradle output, oldest line first. diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildOutputMetricsSink.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildOutputMetricsSink.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildOutputMetricsSink.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildOutputMetricsSink.kt index 71a12ea694..ab38206b03 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildOutputMetricsSink.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildOutputMetricsSink.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import org.appdevforall.cotg.quickbuild.domain.ChangedFiles import org.appdevforall.cotg.quickbuild.domain.classify.BuildRoute diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildOutputNarrator.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildOutputNarrator.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildOutputNarrator.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildOutputNarrator.kt index f46164194c..976d04baa1 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildOutputNarrator.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildOutputNarrator.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.Flow diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildPrebuildStagger.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildPrebuildStagger.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildPrebuildStagger.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildPrebuildStagger.kt index ebd4867294..2f1a74c4e2 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildPrebuildStagger.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildPrebuildStagger.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildProjectSupport.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildProjectSupport.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildProjectSupport.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildProjectSupport.kt index bdef298fd4..8f65453aca 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildProjectSupport.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildProjectSupport.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import androidx.annotation.StringRes import com.itsaky.androidide.resources.R diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildStatusBar.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildStatusBar.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildStatusBar.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildStatusBar.kt index 0a4e64918e..a7dd260c2f 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildStatusBar.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildStatusBar.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import androidx.annotation.StringRes import com.itsaky.androidide.resources.R diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildTaskPaths.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildTaskPaths.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildTaskPaths.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildTaskPaths.kt index e281c677da..1dfaf28b66 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildTaskPaths.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildTaskPaths.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild /** * Composes the Gradle task path for the quick-build proxy app build's `assemble` task from diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildTransitions.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildTransitions.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildTransitions.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildTransitions.kt index 289192acbc..ca28d86dba 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildTransitions.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildTransitions.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild import org.appdevforall.cotg.quickbuild.domain.classify.InvalidationReason import org.appdevforall.cotg.quickbuild.domain.session.QuickBuildStatus diff --git a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildWontStayUpRestart.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildWontStayUpRestart.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildWontStayUpRestart.kt rename to app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildWontStayUpRestart.kt index fbfeb9f96d..0fa74d5636 100644 --- a/app/src/main/java/com/itsaky/androidide/quickbuild/QuickBuildWontStayUpRestart.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildWontStayUpRestart.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild +package org.appdevforall.codeonthego.quickbuild /** * The Restart action of the "proxy app will not stay up" notice, decided at the tap rather than at @@ -17,7 +17,7 @@ package com.itsaky.androidide.quickbuild * notice a second time. * * @property isBlockedByStandardBuild the live gate, read on every tap - see - * [com.itsaky.androidide.actions.build.QuickBuildAction.isBlockedByStandardBuild]. + * [org.appdevforall.codeonthego.actions.build.QuickBuildAction.isBlockedByStandardBuild]. * @property explainBlocked names the standard build on screen; the tap's only outcome while * blocked. * @property restartAndReprovision rebuilds and reinstalls the proxy app, which is what the notice's diff --git a/app/src/main/java/com/itsaky/androidide/repositories/BreakpointRepository.kt b/app/src/main/java/org/appdevforall/codeonthego/repositories/BreakpointRepository.kt similarity index 88% rename from app/src/main/java/com/itsaky/androidide/repositories/BreakpointRepository.kt rename to app/src/main/java/org/appdevforall/codeonthego/repositories/BreakpointRepository.kt index e361d9f799..faba5feba9 100644 --- a/app/src/main/java/com/itsaky/androidide/repositories/BreakpointRepository.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/repositories/BreakpointRepository.kt @@ -1,14 +1,14 @@ -package com.itsaky.androidide.repositories +package org.appdevforall.codeonthego.repositories import android.util.Log import com.google.gson.Gson import com.google.gson.GsonBuilder import com.google.gson.reflect.TypeToken -import com.itsaky.androidide.lsp.debug.model.BreakpointDefinition -import com.itsaky.androidide.lsp.debug.model.PositionalBreakpoint -import com.itsaky.androidide.lsp.debug.model.MethodBreakpoint -import com.itsaky.androidide.tooling.api.util.RuntimeTypeAdapterFactory -import com.itsaky.androidide.utils.Environment +import org.appdevforall.codeonthego.lsp.debug.model.BreakpointDefinition +import org.appdevforall.codeonthego.lsp.debug.model.PositionalBreakpoint +import org.appdevforall.codeonthego.lsp.debug.model.MethodBreakpoint +import org.appdevforall.codeonthego.tooling.api.util.RuntimeTypeAdapterFactory +import org.appdevforall.codeonthego.utils.Environment import io.sentry.Sentry import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext diff --git a/app/src/main/java/com/itsaky/androidide/repositories/PluginRepository.kt b/app/src/main/java/org/appdevforall/codeonthego/repositories/PluginRepository.kt similarity index 89% rename from app/src/main/java/com/itsaky/androidide/repositories/PluginRepository.kt rename to app/src/main/java/org/appdevforall/codeonthego/repositories/PluginRepository.kt index 88a32ca7e1..3f1dbd9189 100644 --- a/app/src/main/java/com/itsaky/androidide/repositories/PluginRepository.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/repositories/PluginRepository.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.repositories +package org.appdevforall.codeonthego.repositories import android.net.Uri -import com.itsaky.androidide.plugins.PluginInfo -import com.itsaky.androidide.plugins.PluginMetadata +import org.appdevforall.codeonthego.plugins.PluginInfo +import org.appdevforall.codeonthego.plugins.PluginMetadata import java.io.File /** diff --git a/app/src/main/java/com/itsaky/androidide/repositories/PluginRepositoryImpl.kt b/app/src/main/java/org/appdevforall/codeonthego/repositories/PluginRepositoryImpl.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/repositories/PluginRepositoryImpl.kt rename to app/src/main/java/org/appdevforall/codeonthego/repositories/PluginRepositoryImpl.kt index 8c3c29860e..7b8b9d098f 100644 --- a/app/src/main/java/com/itsaky/androidide/repositories/PluginRepositoryImpl.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/repositories/PluginRepositoryImpl.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.repositories +package org.appdevforall.codeonthego.repositories import android.util.Log -import com.itsaky.androidide.plugins.PluginInfo -import com.itsaky.androidide.plugins.PluginMetadata -import com.itsaky.androidide.plugins.manager.core.PluginManager -import com.itsaky.androidide.plugins.manager.loaders.toPluginMetadata +import org.appdevforall.codeonthego.plugins.PluginInfo +import org.appdevforall.codeonthego.plugins.PluginMetadata +import org.appdevforall.codeonthego.plugins.manager.core.PluginManager +import org.appdevforall.codeonthego.plugins.manager.loaders.toPluginMetadata import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.adfa.constants.PLUGIN_ARCHIVE_EXTENSION diff --git a/app/src/main/java/com/itsaky/androidide/repositories/RecentProjectRepository.kt b/app/src/main/java/org/appdevforall/codeonthego/repositories/RecentProjectRepository.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/repositories/RecentProjectRepository.kt rename to app/src/main/java/org/appdevforall/codeonthego/repositories/RecentProjectRepository.kt index 2c863b552b..ecfbcf0616 100644 --- a/app/src/main/java/com/itsaky/androidide/repositories/RecentProjectRepository.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/repositories/RecentProjectRepository.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.repositories +package org.appdevforall.codeonthego.repositories -import com.itsaky.androidide.roomData.recentproject.RecentProject +import org.appdevforall.codeonthego.roomData.recentproject.RecentProject /** * Repository for recording a project's presence in Recents -- keeps [RecentProjectDao] (a Room diff --git a/app/src/main/java/com/itsaky/androidide/repositories/RecentProjectRepositoryImpl.kt b/app/src/main/java/org/appdevforall/codeonthego/repositories/RecentProjectRepositoryImpl.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/repositories/RecentProjectRepositoryImpl.kt rename to app/src/main/java/org/appdevforall/codeonthego/repositories/RecentProjectRepositoryImpl.kt index 617cbec725..65a72f9c13 100644 --- a/app/src/main/java/com/itsaky/androidide/repositories/RecentProjectRepositoryImpl.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/repositories/RecentProjectRepositoryImpl.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.repositories +package org.appdevforall.codeonthego.repositories -import com.itsaky.androidide.roomData.recentproject.RecentProject -import com.itsaky.androidide.roomData.recentproject.RecentProjectDao +import org.appdevforall.codeonthego.roomData.recentproject.RecentProject +import org.appdevforall.codeonthego.roomData.recentproject.RecentProjectDao class RecentProjectRepositoryImpl( private val recentProjectDao: RecentProjectDao, diff --git a/app/src/main/java/com/itsaky/androidide/repositories/TemplateCollectionRepository.kt b/app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateCollectionRepository.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/repositories/TemplateCollectionRepository.kt rename to app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateCollectionRepository.kt index 29cdccc75d..5a7e10499e 100644 --- a/app/src/main/java/com/itsaky/androidide/repositories/TemplateCollectionRepository.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateCollectionRepository.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.repositories +package org.appdevforall.codeonthego.repositories import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/repositories/TemplateCollectionRepositoryImpl.kt b/app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateCollectionRepositoryImpl.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/repositories/TemplateCollectionRepositoryImpl.kt rename to app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateCollectionRepositoryImpl.kt index c3900bbac7..97f0618472 100644 --- a/app/src/main/java/com/itsaky/androidide/repositories/TemplateCollectionRepositoryImpl.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateCollectionRepositoryImpl.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.repositories +package org.appdevforall.codeonthego.repositories -import com.itsaky.androidide.templates.ITemplateProvider -import com.itsaky.androidide.templates.TemplateRecipe -import com.itsaky.androidide.templates.impl.TemplateWarning -import com.itsaky.androidide.templates.impl.zip.ZipTemplateReader -import com.itsaky.androidide.utils.Environment +import org.appdevforall.codeonthego.templates.ITemplateProvider +import org.appdevforall.codeonthego.templates.TemplateRecipe +import org.appdevforall.codeonthego.templates.impl.TemplateWarning +import org.appdevforall.codeonthego.templates.impl.zip.ZipTemplateReader +import org.appdevforall.codeonthego.utils.Environment import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.sync.Mutex diff --git a/app/src/main/java/com/itsaky/androidide/repositories/TemplateRepository.kt b/app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateRepository.kt similarity index 89% rename from app/src/main/java/com/itsaky/androidide/repositories/TemplateRepository.kt rename to app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateRepository.kt index ee497b0106..815876fb43 100644 --- a/app/src/main/java/com/itsaky/androidide/repositories/TemplateRepository.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateRepository.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.repositories +package org.appdevforall.codeonthego.repositories -import com.itsaky.androidide.templates.manager.models.CgtFileItem +import org.appdevforall.codeonthego.templates.manager.models.CgtFileItem /** * Repository interface for template (`.cgt`) file operations. diff --git a/app/src/main/java/com/itsaky/androidide/repositories/TemplateRepositoryImpl.kt b/app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateRepositoryImpl.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/repositories/TemplateRepositoryImpl.kt rename to app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateRepositoryImpl.kt index 21662008d1..3bce8c89d7 100644 --- a/app/src/main/java/com/itsaky/androidide/repositories/TemplateRepositoryImpl.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateRepositoryImpl.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.repositories +package org.appdevforall.codeonthego.repositories -import com.itsaky.androidide.templates.ITemplateProvider -import com.itsaky.androidide.templates.manager.models.CgtFileItem -import com.itsaky.androidide.templates.manager.models.TemplateProvenance -import com.itsaky.androidide.templates.manager.parsing.CgtTemplateReader +import org.appdevforall.codeonthego.templates.ITemplateProvider +import org.appdevforall.codeonthego.templates.manager.models.CgtFileItem +import org.appdevforall.codeonthego.templates.manager.models.TemplateProvenance +import org.appdevforall.codeonthego.templates.manager.parsing.CgtTemplateReader import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext diff --git a/app/src/main/java/com/itsaky/androidide/roomData/recentproject/RecentProject.kt b/app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProject.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/roomData/recentproject/RecentProject.kt rename to app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProject.kt index bed87d9068..8d311c9032 100644 --- a/app/src/main/java/com/itsaky/androidide/roomData/recentproject/RecentProject.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProject.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.roomData.recentproject +package org.appdevforall.codeonthego.roomData.recentproject import androidx.room.ColumnInfo import androidx.room.Entity diff --git a/app/src/main/java/com/itsaky/androidide/roomData/recentproject/RecentProjectDao.kt b/app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProjectDao.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/roomData/recentproject/RecentProjectDao.kt rename to app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProjectDao.kt index f5ad07a492..5d3da4bfc4 100644 --- a/app/src/main/java/com/itsaky/androidide/roomData/recentproject/RecentProjectDao.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProjectDao.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.roomData.recentproject +package org.appdevforall.codeonthego.roomData.recentproject import androidx.room.Dao import androidx.room.Insert diff --git a/app/src/main/java/com/itsaky/androidide/roomData/recentproject/RecentProjectMaintenance.kt b/app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProjectMaintenance.kt similarity index 83% rename from app/src/main/java/com/itsaky/androidide/roomData/recentproject/RecentProjectMaintenance.kt rename to app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProjectMaintenance.kt index 59baa63c9c..70c8d81140 100644 --- a/app/src/main/java/com/itsaky/androidide/roomData/recentproject/RecentProjectMaintenance.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProjectMaintenance.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.roomData.recentproject +package org.appdevforall.codeonthego.roomData.recentproject import androidx.room.ColumnInfo import androidx.room.Entity diff --git a/app/src/main/java/com/itsaky/androidide/roomData/recentproject/RecentProjectMaintenanceDao.kt b/app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProjectMaintenanceDao.kt similarity index 87% rename from app/src/main/java/com/itsaky/androidide/roomData/recentproject/RecentProjectMaintenanceDao.kt rename to app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProjectMaintenanceDao.kt index 569b12517c..ddb7b655e2 100644 --- a/app/src/main/java/com/itsaky/androidide/roomData/recentproject/RecentProjectMaintenanceDao.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProjectMaintenanceDao.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.roomData.recentproject +package org.appdevforall.codeonthego.roomData.recentproject import androidx.room.Dao import androidx.room.Insert diff --git a/app/src/main/java/com/itsaky/androidide/roomData/recentproject/RecentProjectRoomDatabase.kt b/app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProjectRoomDatabase.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/roomData/recentproject/RecentProjectRoomDatabase.kt rename to app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProjectRoomDatabase.kt index 7aaaabfc64..3dfd0a0673 100644 --- a/app/src/main/java/com/itsaky/androidide/roomData/recentproject/RecentProjectRoomDatabase.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProjectRoomDatabase.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.roomData.recentproject +package org.appdevforall.codeonthego.roomData.recentproject import android.content.Context import androidx.room.Database diff --git a/app/src/main/java/com/itsaky/androidide/search/replace/OpenTabUndo.kt b/app/src/main/java/org/appdevforall/codeonthego/search/replace/OpenTabUndo.kt similarity index 84% rename from app/src/main/java/com/itsaky/androidide/search/replace/OpenTabUndo.kt rename to app/src/main/java/org/appdevforall/codeonthego/search/replace/OpenTabUndo.kt index 9d147e7123..a840d884fe 100644 --- a/app/src/main/java/com/itsaky/androidide/search/replace/OpenTabUndo.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/search/replace/OpenTabUndo.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.search.replace +package org.appdevforall.codeonthego.search.replace object OpenTabUndo { enum class Decision { RESTORE, CHANGED, CLOSED } diff --git a/app/src/main/java/com/itsaky/androidide/search/replace/ProjectReplacer.kt b/app/src/main/java/org/appdevforall/codeonthego/search/replace/ProjectReplacer.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/search/replace/ProjectReplacer.kt rename to app/src/main/java/org/appdevforall/codeonthego/search/replace/ProjectReplacer.kt index a79a36db6a..0881b59b02 100644 --- a/app/src/main/java/com/itsaky/androidide/search/replace/ProjectReplacer.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/search/replace/ProjectReplacer.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.search.replace +package org.appdevforall.codeonthego.search.replace -import com.itsaky.androidide.models.SearchResult +import org.appdevforall.codeonthego.models.SearchResult import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext diff --git a/app/src/main/java/com/itsaky/androidide/search/replace/ReplaceCoordinator.kt b/app/src/main/java/org/appdevforall/codeonthego/search/replace/ReplaceCoordinator.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/search/replace/ReplaceCoordinator.kt rename to app/src/main/java/org/appdevforall/codeonthego/search/replace/ReplaceCoordinator.kt index d45e11c093..98e2dabbc5 100644 --- a/app/src/main/java/com/itsaky/androidide/search/replace/ReplaceCoordinator.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/search/replace/ReplaceCoordinator.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.search.replace +package org.appdevforall.codeonthego.search.replace -import com.itsaky.androidide.editor.ui.IDEEditor -import com.itsaky.androidide.eventbus.events.file.FileContentChangedEvent -import com.itsaky.androidide.models.SearchResult +import org.appdevforall.codeonthego.editor.ui.IDEEditor +import org.appdevforall.codeonthego.eventbus.events.file.FileContentChangedEvent +import org.appdevforall.codeonthego.models.SearchResult import io.github.rosemoe.sora.text.Content import org.greenrobot.eventbus.EventBus import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/search/replace/ReplaceSession.kt b/app/src/main/java/org/appdevforall/codeonthego/search/replace/ReplaceSession.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/search/replace/ReplaceSession.kt rename to app/src/main/java/org/appdevforall/codeonthego/search/replace/ReplaceSession.kt index bad288e0d8..5584af912f 100644 --- a/app/src/main/java/com/itsaky/androidide/search/replace/ReplaceSession.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/search/replace/ReplaceSession.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.search.replace +package org.appdevforall.codeonthego.search.replace -import com.itsaky.androidide.models.SearchResult -import com.itsaky.androidide.utils.ProjectSearchOptions +import org.appdevforall.codeonthego.models.SearchResult +import org.appdevforall.codeonthego.utils.ProjectSearchOptions import java.io.File data class MatchKey( diff --git a/app/src/main/java/com/itsaky/androidide/search/replace/TextReplacement.kt b/app/src/main/java/org/appdevforall/codeonthego/search/replace/TextReplacement.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/search/replace/TextReplacement.kt rename to app/src/main/java/org/appdevforall/codeonthego/search/replace/TextReplacement.kt index ad98558bca..fbf4a995c0 100644 --- a/app/src/main/java/com/itsaky/androidide/search/replace/TextReplacement.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/search/replace/TextReplacement.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.search.replace +package org.appdevforall.codeonthego.search.replace -import com.itsaky.androidide.models.SearchResult +import org.appdevforall.codeonthego.models.SearchResult import io.github.rosemoe.sora.text.Content object TextReplacement { diff --git a/app/src/main/java/com/itsaky/androidide/services/InstallationResultReceiver.kt b/app/src/main/java/org/appdevforall/codeonthego/services/InstallationResultReceiver.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/services/InstallationResultReceiver.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/InstallationResultReceiver.kt index a121e32ae1..f303d3e672 100644 --- a/app/src/main/java/com/itsaky/androidide/services/InstallationResultReceiver.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/InstallationResultReceiver.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.services +package org.appdevforall.codeonthego.services import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import com.itsaky.androidide.buildinfo.BuildInfo -import com.itsaky.androidide.events.InstallationEvent.InstallationResultEvent +import org.appdevforall.codeonthego.events.InstallationEvent.InstallationResultEvent import org.greenrobot.eventbus.EventBus /** diff --git a/app/src/main/java/com/itsaky/androidide/services/ToolingServerAlreadyStartedException.java b/app/src/main/java/org/appdevforall/codeonthego/services/ToolingServerAlreadyStartedException.java similarity index 95% rename from app/src/main/java/com/itsaky/androidide/services/ToolingServerAlreadyStartedException.java rename to app/src/main/java/org/appdevforall/codeonthego/services/ToolingServerAlreadyStartedException.java index 08e83b7113..bf585b0993 100644 --- a/app/src/main/java/com/itsaky/androidide/services/ToolingServerAlreadyStartedException.java +++ b/app/src/main/java/org/appdevforall/codeonthego/services/ToolingServerAlreadyStartedException.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.services; +package org.appdevforall.codeonthego.services; /** * Thrown when trying to start Tooling API server but another instance is already running. diff --git a/app/src/main/java/com/itsaky/androidide/services/ToolingServerNotStartedException.java b/app/src/main/java/org/appdevforall/codeonthego/services/ToolingServerNotStartedException.java similarity index 95% rename from app/src/main/java/com/itsaky/androidide/services/ToolingServerNotStartedException.java rename to app/src/main/java/org/appdevforall/codeonthego/services/ToolingServerNotStartedException.java index f4ba918cca..15ba061221 100644 --- a/app/src/main/java/com/itsaky/androidide/services/ToolingServerNotStartedException.java +++ b/app/src/main/java/org/appdevforall/codeonthego/services/ToolingServerNotStartedException.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.services; +package org.appdevforall.codeonthego.services; /** * Thrown when a build is requested but the tooling API server is not started. diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/BalancedStrategy.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/BalancedStrategy.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/services/builder/BalancedStrategy.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/BalancedStrategy.kt index c9f8fc29e3..963544490f 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/BalancedStrategy.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/BalancedStrategy.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder import kotlin.math.min diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/BuildInProgressException.java b/app/src/main/java/org/appdevforall/codeonthego/services/builder/BuildInProgressException.java similarity index 94% rename from app/src/main/java/com/itsaky/androidide/services/builder/BuildInProgressException.java rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/BuildInProgressException.java index ea5a73dff9..8766a64734 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/BuildInProgressException.java +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/BuildInProgressException.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.services.builder; +package org.appdevforall.codeonthego.services.builder; /** * Thrown when a build is requested but another build is already in progress. diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/BuildProfile.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/BuildProfile.kt similarity index 71% rename from app/src/main/java/com/itsaky/androidide/services/builder/BuildProfile.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/BuildProfile.kt index 0e3789b01d..00f927c549 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/BuildProfile.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/BuildProfile.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder /** * A build profile for tuning Gradle builds. diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/CpuInfo.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/CpuInfo.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/services/builder/CpuInfo.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/CpuInfo.kt index b989d33ee7..4c3c185586 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/CpuInfo.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/CpuInfo.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder import androidx.annotation.WorkerThread import org.slf4j.LoggerFactory diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/DeviceInfo.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/DeviceInfo.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/services/builder/DeviceInfo.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/DeviceInfo.kt index 8d967f4fb4..bf9cff83b2 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/DeviceInfo.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/DeviceInfo.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder import android.app.ActivityManager import android.content.Context import android.os.StatFs import androidx.annotation.WorkerThread -import com.itsaky.androidide.utils.Environment +import org.appdevforall.codeonthego.utils.Environment import org.slf4j.LoggerFactory /** diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/DeviceProfile.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/DeviceProfile.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/services/builder/DeviceProfile.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/DeviceProfile.kt index a4541bb6e7..489c26e79f 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/DeviceProfile.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/DeviceProfile.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder /** * Information about a device. diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/GradleBuildService.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleBuildService.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/services/builder/GradleBuildService.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleBuildService.kt index fa0ab32ba1..7d6b49721c 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/GradleBuildService.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleBuildService.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder import android.app.Notification import android.app.NotificationChannel @@ -29,50 +29,50 @@ import androidx.core.app.NotificationManagerCompat import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import com.itsaky.androidide.BuildConfig -import com.itsaky.androidide.analytics.IAnalyticsManager -import com.itsaky.androidide.analytics.gradle.BuildCompletedMetric -import com.itsaky.androidide.analytics.gradle.BuildStartedMetric -import com.itsaky.androidide.app.BaseApplication -import com.itsaky.androidide.app.IDEApplication -import com.itsaky.androidide.eventbus.events.BuildCompletedEvent -import com.itsaky.androidide.eventbus.events.BuildStartedEvent -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.java.debug.JdwpOptions -import com.itsaky.androidide.managers.ToolsManager -import com.itsaky.androidide.preferences.internal.BuildPreferences -import com.itsaky.androidide.preferences.internal.DevOpsPreferences -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.projects.builder.BuildService +import org.appdevforall.codeonthego.analytics.IAnalyticsManager +import org.appdevforall.codeonthego.analytics.gradle.BuildCompletedMetric +import org.appdevforall.codeonthego.analytics.gradle.BuildStartedMetric +import org.appdevforall.codeonthego.app.BaseApplication +import org.appdevforall.codeonthego.app.IDEApplication +import org.appdevforall.codeonthego.eventbus.events.BuildCompletedEvent +import org.appdevforall.codeonthego.eventbus.events.BuildStartedEvent +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.java.debug.JdwpOptions +import org.appdevforall.codeonthego.managers.ToolsManager +import org.appdevforall.codeonthego.preferences.internal.BuildPreferences +import org.appdevforall.codeonthego.preferences.internal.DevOpsPreferences +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.projects.builder.BuildService import com.itsaky.androidide.resources.R -import com.itsaky.androidide.services.ToolingServerNotStartedException -import com.itsaky.androidide.services.builder.ToolingServerRunner.OnServerStartListener -import com.itsaky.androidide.tasks.ifCancelledOrInterrupted -import com.itsaky.androidide.tasks.runOnUiThread -import com.itsaky.androidide.tooling.api.ForwardingToolingApiClient -import com.itsaky.androidide.tooling.api.GradlePluginConfig.PROPERTY_JDWP_ENABLED -import com.itsaky.androidide.tooling.api.GradlePluginConfig.PROPERTY_LOG_SENDER_AAR -import com.itsaky.androidide.tooling.api.GradlePluginConfig.PROPERTY_LOG_SENDER_ENABLED -import com.itsaky.androidide.tooling.api.IToolingApiClient -import com.itsaky.androidide.tooling.api.IToolingApiServer -import com.itsaky.androidide.tooling.api.messages.BuildId -import com.itsaky.androidide.tooling.api.messages.BuildRunType -import com.itsaky.androidide.tooling.api.messages.ClientGradleBuildConfig -import com.itsaky.androidide.tooling.api.messages.GradleBuildParams -import com.itsaky.androidide.tooling.api.messages.InitializeProjectParams -import com.itsaky.androidide.tooling.api.messages.LogMessageParams -import com.itsaky.androidide.tooling.api.messages.TaskExecutionMessage -import com.itsaky.androidide.tooling.api.messages.result.BuildCancellationRequestResult -import com.itsaky.androidide.tooling.api.messages.result.BuildInfo -import com.itsaky.androidide.tooling.api.messages.result.BuildResult -import com.itsaky.androidide.tooling.api.messages.result.GradleWrapperCheckResult -import com.itsaky.androidide.tooling.api.messages.result.InitializeResult -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult -import com.itsaky.androidide.tooling.api.models.ToolingServerMetadata -import com.itsaky.androidide.tooling.events.ProgressEvent -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.FeatureFlags -import com.itsaky.androidide.utils.ResourceUtils -import com.itsaky.androidide.utils.ZipUtils +import org.appdevforall.codeonthego.services.ToolingServerNotStartedException +import org.appdevforall.codeonthego.services.builder.ToolingServerRunner.OnServerStartListener +import org.appdevforall.codeonthego.tasks.ifCancelledOrInterrupted +import org.appdevforall.codeonthego.tasks.runOnUiThread +import org.appdevforall.codeonthego.tooling.api.ForwardingToolingApiClient +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_JDWP_ENABLED +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_LOG_SENDER_AAR +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_LOG_SENDER_ENABLED +import org.appdevforall.codeonthego.tooling.api.IToolingApiClient +import org.appdevforall.codeonthego.tooling.api.IToolingApiServer +import org.appdevforall.codeonthego.tooling.api.messages.BuildId +import org.appdevforall.codeonthego.tooling.api.messages.BuildRunType +import org.appdevforall.codeonthego.tooling.api.messages.ClientGradleBuildConfig +import org.appdevforall.codeonthego.tooling.api.messages.GradleBuildParams +import org.appdevforall.codeonthego.tooling.api.messages.InitializeProjectParams +import org.appdevforall.codeonthego.tooling.api.messages.LogMessageParams +import org.appdevforall.codeonthego.tooling.api.messages.TaskExecutionMessage +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildCancellationRequestResult +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildInfo +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildResult +import org.appdevforall.codeonthego.tooling.api.messages.result.GradleWrapperCheckResult +import org.appdevforall.codeonthego.tooling.api.messages.result.InitializeResult +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult +import org.appdevforall.codeonthego.tooling.api.models.ToolingServerMetadata +import org.appdevforall.codeonthego.tooling.events.ProgressEvent +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.FeatureFlags +import org.appdevforall.codeonthego.utils.ResourceUtils +import org.appdevforall.codeonthego.utils.ZipUtils import com.termux.shared.termux.shell.command.environment.TermuxShellEnvironment import io.sentry.Sentry import kotlinx.coroutines.CoroutineName diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/GradleBuildServiceConnnection.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleBuildServiceConnnection.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/services/builder/GradleBuildServiceConnnection.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleBuildServiceConnnection.kt index eb813b4f5d..71343a68da 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/GradleBuildServiceConnnection.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleBuildServiceConnnection.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder import android.content.ComponentName import android.content.ServiceConnection diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/GradleBuildTuner.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleBuildTuner.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/services/builder/GradleBuildTuner.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleBuildTuner.kt index ec5560c88a..59e5f15aa5 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/GradleBuildTuner.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleBuildTuner.kt @@ -1,13 +1,13 @@ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder import androidx.annotation.VisibleForTesting -import com.itsaky.androidide.analytics.IAnalyticsManager -import com.itsaky.androidide.analytics.gradle.StrategySelectedMetric -import com.itsaky.androidide.services.builder.GradleBuildTuner.HIGH_PERF_MIN_CORE -import com.itsaky.androidide.services.builder.GradleBuildTuner.HIGH_PERF_MIN_MEM_MB -import com.itsaky.androidide.services.builder.GradleBuildTuner.LOW_MEM_THRESHOLD_MB -import com.itsaky.androidide.tooling.api.messages.BuildId -import com.itsaky.androidide.tooling.api.messages.GradleBuildParams +import org.appdevforall.codeonthego.analytics.IAnalyticsManager +import org.appdevforall.codeonthego.analytics.gradle.StrategySelectedMetric +import org.appdevforall.codeonthego.services.builder.GradleBuildTuner.HIGH_PERF_MIN_CORE +import org.appdevforall.codeonthego.services.builder.GradleBuildTuner.HIGH_PERF_MIN_MEM_MB +import org.appdevforall.codeonthego.services.builder.GradleBuildTuner.LOW_MEM_THRESHOLD_MB +import org.appdevforall.codeonthego.tooling.api.messages.BuildId +import org.appdevforall.codeonthego.tooling.api.messages.GradleBuildParams import org.slf4j.LoggerFactory /** diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/GradleServiceBinder.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleServiceBinder.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/services/builder/GradleServiceBinder.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleServiceBinder.kt index c9ef4bf907..cad5deb113 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/GradleServiceBinder.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleServiceBinder.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder import android.os.Binder diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/GradleTuningConfig.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleTuningConfig.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/services/builder/GradleTuningConfig.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleTuningConfig.kt index 2f708c4437..f17274f76a 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/GradleTuningConfig.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleTuningConfig.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder /** * Tuning configuration for Gradle builds. diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/GradleTuningStrategy.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleTuningStrategy.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/services/builder/GradleTuningStrategy.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleTuningStrategy.kt index f22b10a6c9..7a34975258 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/GradleTuningStrategy.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleTuningStrategy.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder /** * Strategy for tuning Gradle builds. diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/HighPerformanceStrategy.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/HighPerformanceStrategy.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/services/builder/HighPerformanceStrategy.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/HighPerformanceStrategy.kt index b49dabce3b..e77d684750 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/HighPerformanceStrategy.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/HighPerformanceStrategy.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder import kotlin.math.min diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/InternalBuildBracket.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/InternalBuildBracket.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/services/builder/InternalBuildBracket.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/InternalBuildBracket.kt index 4b78368d99..840c4939af 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/InternalBuildBracket.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/InternalBuildBracket.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder import org.slf4j.LoggerFactory import java.util.concurrent.atomic.AtomicInteger diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/InternalBuildOutputCapture.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/InternalBuildOutputCapture.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/services/builder/InternalBuildOutputCapture.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/InternalBuildOutputCapture.kt index 226a991684..9467c46fc2 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/InternalBuildOutputCapture.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/InternalBuildOutputCapture.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder import org.slf4j.LoggerFactory diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/LowMemoryStrategy.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/LowMemoryStrategy.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/services/builder/LowMemoryStrategy.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/LowMemoryStrategy.kt index 666ac0e936..47a9ec5c80 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/LowMemoryStrategy.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/LowMemoryStrategy.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder import kotlin.math.min diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/ThermalInfo.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/ThermalInfo.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/services/builder/ThermalInfo.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/ThermalInfo.kt index f258dbee01..14ae168619 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/ThermalInfo.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/ThermalInfo.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder import android.content.Context import android.os.Build diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/ThermalSafeStrategy.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/ThermalSafeStrategy.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/services/builder/ThermalSafeStrategy.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/ThermalSafeStrategy.kt index 34fd5bccf2..0fe4cb24ea 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/ThermalSafeStrategy.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/ThermalSafeStrategy.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder import kotlin.math.max diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/ToolingServerRunner.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/ToolingServerRunner.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/services/builder/ToolingServerRunner.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/ToolingServerRunner.kt index dfbc17f1dd..d646850d94 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/ToolingServerRunner.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/ToolingServerRunner.kt @@ -15,19 +15,19 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder import android.content.Context -import com.itsaky.androidide.logging.provider.IdeLogRouter -import com.itsaky.androidide.managers.ToolsManager -import com.itsaky.androidide.tasks.cancelIfActive -import com.itsaky.androidide.tasks.ifCancelledOrInterrupted -import com.itsaky.androidide.tooling.api.IToolingApiClient -import com.itsaky.androidide.tooling.api.IToolingApiServer -import com.itsaky.androidide.tooling.api.util.ToolingApiLauncher -import com.itsaky.androidide.tooling.api.util.ToolingProps -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.FeatureFlags +import org.appdevforall.codeonthego.logging.provider.IdeLogRouter +import org.appdevforall.codeonthego.managers.ToolsManager +import org.appdevforall.codeonthego.tasks.cancelIfActive +import org.appdevforall.codeonthego.tasks.ifCancelledOrInterrupted +import org.appdevforall.codeonthego.tooling.api.IToolingApiClient +import org.appdevforall.codeonthego.tooling.api.IToolingApiServer +import org.appdevforall.codeonthego.tooling.api.util.ToolingApiLauncher +import org.appdevforall.codeonthego.tooling.api.util.ToolingProps +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.FeatureFlags import com.termux.shared.reflection.ReflectionUtils import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineName diff --git a/app/src/main/java/com/itsaky/androidide/services/builder/util.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/util.kt similarity index 83% rename from app/src/main/java/com/itsaky/androidide/services/builder/util.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/builder/util.kt index 1c012c90cf..d412b5d757 100644 --- a/app/src/main/java/com/itsaky/androidide/services/builder/util.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/util.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.services.builder +package org.appdevforall.codeonthego.services.builder -import com.itsaky.androidide.preferences.internal.BuildPreferences -import com.itsaky.androidide.tooling.api.messages.GradleDistributionParams +import org.appdevforall.codeonthego.preferences.internal.BuildPreferences +import org.appdevforall.codeonthego.tooling.api.messages.GradleDistributionParams /** * The distribution params. This considers [gradleInstallationDir] preference as well. diff --git a/app/src/main/java/com/itsaky/androidide/services/debug/DebugOverlayManager.kt b/app/src/main/java/org/appdevforall/codeonthego/services/debug/DebugOverlayManager.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/services/debug/DebugOverlayManager.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/debug/DebugOverlayManager.kt index 42652f598a..aa252f6d0b 100644 --- a/app/src/main/java/com/itsaky/androidide/services/debug/DebugOverlayManager.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/debug/DebugOverlayManager.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.services.debug +package org.appdevforall.codeonthego.services.debug import android.content.Context import android.graphics.PixelFormat @@ -14,13 +14,13 @@ import android.provider.Settings import androidx.core.content.ContextCompat import androidx.core.hardware.display.DisplayManagerCompat import com.itsaky.androidide.R -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.ActionsRegistry +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionsRegistry import com.itsaky.androidide.databinding.DebuggerActionsWindowBinding -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.utils.PermissionsHelper -import com.itsaky.androidide.utils.isAtLeastR +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.utils.PermissionsHelper +import org.appdevforall.codeonthego.utils.isAtLeastR import org.slf4j.LoggerFactory import kotlin.math.abs diff --git a/app/src/main/java/com/itsaky/androidide/services/debug/DebuggerActionsOverlayAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/services/debug/DebuggerActionsOverlayAdapter.kt similarity index 83% rename from app/src/main/java/com/itsaky/androidide/services/debug/DebuggerActionsOverlayAdapter.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/debug/DebuggerActionsOverlayAdapter.kt index 399e9f6035..8bd9f9257e 100644 --- a/app/src/main/java/com/itsaky/androidide/services/debug/DebuggerActionsOverlayAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/debug/DebuggerActionsOverlayAdapter.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.services.debug +package org.appdevforall.codeonthego.services.debug import android.view.LayoutInflater import android.view.ViewGroup import androidx.appcompat.widget.TooltipCompat import androidx.recyclerview.widget.RecyclerView -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.ActionsRegistry -import com.itsaky.androidide.actions.internal.DefaultActionsRegistry +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionsRegistry +import org.appdevforall.codeonthego.actions.internal.DefaultActionsRegistry import com.itsaky.androidide.editor.databinding.LayoutPopupMenuItemBinding -import com.itsaky.androidide.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipManager /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/services/debug/DebuggerService.kt b/app/src/main/java/org/appdevforall/codeonthego/services/debug/DebuggerService.kt similarity index 85% rename from app/src/main/java/com/itsaky/androidide/services/debug/DebuggerService.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/debug/DebuggerService.kt index 7117ddfd2b..f780f6780b 100644 --- a/app/src/main/java/com/itsaky/androidide/services/debug/DebuggerService.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/debug/DebuggerService.kt @@ -1,22 +1,22 @@ -package com.itsaky.androidide.services.debug +package org.appdevforall.codeonthego.services.debug import android.app.Activity import android.app.Service import android.content.Intent import android.os.IBinder -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.ActionsRegistry -import com.itsaky.androidide.actions.debug.KillVmAction -import com.itsaky.androidide.actions.debug.RestartVmAction -import com.itsaky.androidide.actions.debug.StepIntoAction -import com.itsaky.androidide.actions.debug.StepOutAction -import com.itsaky.androidide.actions.debug.StepOverAction -import com.itsaky.androidide.actions.debug.SuspendResumeVmAction -import com.itsaky.androidide.activities.editor.BaseEditorActivity -import com.itsaky.androidide.app.IDEApplication +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionsRegistry +import org.appdevforall.codeonthego.actions.debug.KillVmAction +import org.appdevforall.codeonthego.actions.debug.RestartVmAction +import org.appdevforall.codeonthego.actions.debug.StepIntoAction +import org.appdevforall.codeonthego.actions.debug.StepOutAction +import org.appdevforall.codeonthego.actions.debug.StepOverAction +import org.appdevforall.codeonthego.actions.debug.SuspendResumeVmAction +import org.appdevforall.codeonthego.activities.editor.BaseEditorActivity +import org.appdevforall.codeonthego.app.IDEApplication import com.itsaky.androidide.buildinfo.BuildInfo -import com.itsaky.androidide.tasks.cancelIfActive -import com.itsaky.androidide.viewmodel.DebuggerConnectionState +import org.appdevforall.codeonthego.tasks.cancelIfActive +import org.appdevforall.codeonthego.viewmodel.DebuggerConnectionState import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.collectLatest diff --git a/app/src/main/java/com/itsaky/androidide/services/debug/ForegroundAppReceiver.kt b/app/src/main/java/org/appdevforall/codeonthego/services/debug/ForegroundAppReceiver.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/services/debug/ForegroundAppReceiver.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/debug/ForegroundAppReceiver.kt index 71c5fdd0a3..b52f41c617 100644 --- a/app/src/main/java/com/itsaky/androidide/services/debug/ForegroundAppReceiver.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/debug/ForegroundAppReceiver.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.services.debug +package org.appdevforall.codeonthego.services.debug import android.content.BroadcastReceiver import android.content.Context diff --git a/app/src/main/java/com/itsaky/androidide/services/log/CachingLogSender.kt b/app/src/main/java/org/appdevforall/codeonthego/services/log/CachingLogSender.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/services/log/CachingLogSender.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/log/CachingLogSender.kt index 5f72c1ecce..bad952c7eb 100644 --- a/app/src/main/java/com/itsaky/androidide/services/log/CachingLogSender.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/log/CachingLogSender.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.services.log +package org.appdevforall.codeonthego.services.log -import com.itsaky.androidide.logsender.ILogSender +import org.appdevforall.codeonthego.logsender.ILogSender /** * An implementation of [ILogSender] which caches the ID, PID and package name from the provided sender. diff --git a/app/src/main/java/com/itsaky/androidide/services/log/ConnectionObserverParams.kt b/app/src/main/java/org/appdevforall/codeonthego/services/log/ConnectionObserverParams.kt similarity index 87% rename from app/src/main/java/com/itsaky/androidide/services/log/ConnectionObserverParams.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/log/ConnectionObserverParams.kt index 49495f2af8..1c8338c63d 100644 --- a/app/src/main/java/com/itsaky/androidide/services/log/ConnectionObserverParams.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/log/ConnectionObserverParams.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.services.log +package org.appdevforall.codeonthego.services.log import android.content.Intent import android.os.Bundle @@ -31,8 +31,8 @@ data class ConnectionObserverParams(val clientId: String, val totalConnections: companion object { - const val KEY_CLIENT_ID = "com.itsaky.androidide.logreceiver.connectedClientId" - const val KEY_CONNECTION_COUNT = "com.itsaky.androidide.logreceiver.connectionCount" + const val KEY_CLIENT_ID = "org.appdevforall.codeonthego.logreceiver.connectedClientId" + const val KEY_CONNECTION_COUNT = "org.appdevforall.codeonthego.logreceiver.connectionCount" @JvmStatic internal fun from(intent: Intent?): ConnectionObserverParams? { diff --git a/app/src/main/java/com/itsaky/androidide/services/log/LogReceiverImpl.kt b/app/src/main/java/org/appdevforall/codeonthego/services/log/LogReceiverImpl.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/services/log/LogReceiverImpl.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/log/LogReceiverImpl.kt index 6ad4969df6..b9aed59470 100644 --- a/app/src/main/java/com/itsaky/androidide/services/log/LogReceiverImpl.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/log/LogReceiverImpl.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.services.log +package org.appdevforall.codeonthego.services.log import android.util.Log -import com.itsaky.androidide.logsender.ILogReceiver -import com.itsaky.androidide.logsender.ILogSender -import com.itsaky.androidide.models.LogLine -import com.itsaky.androidide.tasks.executeAsyncProvideError +import org.appdevforall.codeonthego.logsender.ILogReceiver +import org.appdevforall.codeonthego.logsender.ILogSender +import org.appdevforall.codeonthego.models.LogLine +import org.appdevforall.codeonthego.tasks.executeAsyncProvideError import org.slf4j.LoggerFactory import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.locks.ReentrantLock diff --git a/app/src/main/java/com/itsaky/androidide/services/log/LogReceiverService.kt b/app/src/main/java/org/appdevforall/codeonthego/services/log/LogReceiverService.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/services/log/LogReceiverService.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/log/LogReceiverService.kt index 623cdf7ec3..3764b50b25 100644 --- a/app/src/main/java/com/itsaky/androidide/services/log/LogReceiverService.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/log/LogReceiverService.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.services.log +package org.appdevforall.codeonthego.services.log import android.app.Service import android.content.Intent import android.os.IBinder import androidx.localbroadcastmanager.content.LocalBroadcastManager -import com.itsaky.androidide.logsender.LogSender -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.models.LogLine -import com.itsaky.androidide.preferences.internal.DevOpsPreferences +import org.appdevforall.codeonthego.logsender.LogSender +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.models.LogLine +import org.appdevforall.codeonthego.preferences.internal.DevOpsPreferences import org.slf4j.LoggerFactory import java.util.concurrent.Executors import java.util.concurrent.TimeUnit @@ -47,8 +47,8 @@ class LogReceiverService : Service() { private val log = LoggerFactory.getLogger(LogReceiverService::class.java) - internal const val ACTION_CONNECT_LOG_CONSUMER = "com.itsaky.androidide.logrecevier.CONNECT_LOG_CONSUMER" - internal const val ACTION_CONNECTION_UPDATE = "com.itsaky.androidide.logreceiver.CONNECTION_UPDATE" + internal const val ACTION_CONNECT_LOG_CONSUMER = "org.appdevforall.codeonthego.logrecevier.CONNECT_LOG_CONSUMER" + internal const val ACTION_CONNECTION_UPDATE = "org.appdevforall.codeonthego.logreceiver.CONNECTION_UPDATE" private const val LOG_CONSUMER_WAIT_DURATION = 10 // seconds diff --git a/app/src/main/java/com/itsaky/androidide/services/log/LogReceiverServiceConnection.kt b/app/src/main/java/org/appdevforall/codeonthego/services/log/LogReceiverServiceConnection.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/services/log/LogReceiverServiceConnection.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/log/LogReceiverServiceConnection.kt index 1945758c24..0d0bca5b67 100644 --- a/app/src/main/java/com/itsaky/androidide/services/log/LogReceiverServiceConnection.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/log/LogReceiverServiceConnection.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.services.log +package org.appdevforall.codeonthego.services.log import android.content.ComponentName import android.content.ServiceConnection diff --git a/app/src/main/java/com/itsaky/androidide/services/log/LogSenderHandler.kt b/app/src/main/java/org/appdevforall/codeonthego/services/log/LogSenderHandler.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/services/log/LogSenderHandler.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/log/LogSenderHandler.kt index f28cd1a410..0ec0848e40 100644 --- a/app/src/main/java/com/itsaky/androidide/services/log/LogSenderHandler.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/log/LogSenderHandler.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.services.log +package org.appdevforall.codeonthego.services.log -import com.itsaky.androidide.logsender.socket.SenderInfoCommand -import com.itsaky.androidide.models.LogLine +import org.appdevforall.codeonthego.logsender.socket.SenderInfoCommand +import org.appdevforall.codeonthego.models.LogLine import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext diff --git a/app/src/main/java/com/itsaky/androidide/services/log/LogSendersRegistry.kt b/app/src/main/java/org/appdevforall/codeonthego/services/log/LogSendersRegistry.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/services/log/LogSendersRegistry.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/log/LogSendersRegistry.kt index 9c44adf6e7..ebe1899779 100644 --- a/app/src/main/java/com/itsaky/androidide/services/log/LogSendersRegistry.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/log/LogSendersRegistry.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.services.log +package org.appdevforall.codeonthego.services.log import java.util.concurrent.ConcurrentHashMap diff --git a/app/src/main/java/com/itsaky/androidide/services/log/MultiLogSenderHandler.kt b/app/src/main/java/org/appdevforall/codeonthego/services/log/MultiLogSenderHandler.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/services/log/MultiLogSenderHandler.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/log/MultiLogSenderHandler.kt index a4523f8e89..8977e90e81 100644 --- a/app/src/main/java/com/itsaky/androidide/services/log/MultiLogSenderHandler.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/log/MultiLogSenderHandler.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.services.log +package org.appdevforall.codeonthego.services.log -import com.itsaky.androidide.logsender.socket.SenderInfoCommand -import com.itsaky.androidide.logsender.socket.SocketCommandParser -import com.itsaky.androidide.models.LogLine -import com.itsaky.androidide.tasks.cancelIfActive +import org.appdevforall.codeonthego.logsender.socket.SenderInfoCommand +import org.appdevforall.codeonthego.logsender.socket.SocketCommandParser +import org.appdevforall.codeonthego.models.LogLine +import org.appdevforall.codeonthego.tasks.cancelIfActive import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/itsaky/androidide/services/log/utils.kt b/app/src/main/java/org/appdevforall/codeonthego/services/log/utils.kt similarity index 88% rename from app/src/main/java/com/itsaky/androidide/services/log/utils.kt rename to app/src/main/java/org/appdevforall/codeonthego/services/log/utils.kt index 29f67aba18..c7eab54466 100644 --- a/app/src/main/java/com/itsaky/androidide/services/log/utils.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/log/utils.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.services.log +package org.appdevforall.codeonthego.services.log import android.os.RemoteException -import com.itsaky.androidide.logsender.ILogSender +import org.appdevforall.codeonthego.logsender.ILogSender fun ILogSender.isAlive() : Boolean { return try { diff --git a/app/src/main/java/com/itsaky/androidide/shortcuts/IdeShortcutActions.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/IdeShortcutActions.kt similarity index 83% rename from app/src/main/java/com/itsaky/androidide/shortcuts/IdeShortcutActions.kt rename to app/src/main/java/org/appdevforall/codeonthego/shortcuts/IdeShortcutActions.kt index c7043ac5bb..dd2e828178 100644 --- a/app/src/main/java/com/itsaky/androidide/shortcuts/IdeShortcutActions.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/IdeShortcutActions.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.shortcuts +package org.appdevforall.codeonthego.shortcuts -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.ActionsRegistry -import com.itsaky.androidide.actions.internal.DefaultActionsRegistry +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionsRegistry +import org.appdevforall.codeonthego.actions.internal.DefaultActionsRegistry import org.slf4j.LoggerFactory /** diff --git a/app/src/main/java/com/itsaky/androidide/shortcuts/KeyShortcut.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/KeyShortcut.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/shortcuts/KeyShortcut.kt rename to app/src/main/java/org/appdevforall/codeonthego/shortcuts/KeyShortcut.kt index a24d54df9c..0a862f3196 100644 --- a/app/src/main/java/com/itsaky/androidide/shortcuts/KeyShortcut.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/KeyShortcut.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.shortcuts +package org.appdevforall.codeonthego.shortcuts import android.view.KeyEvent diff --git a/app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutCatalog.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutCatalog.kt similarity index 86% rename from app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutCatalog.kt rename to app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutCatalog.kt index 6771057bca..691e2e0aac 100644 --- a/app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutCatalog.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutCatalog.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.shortcuts +package org.appdevforall.codeonthego.shortcuts import android.content.Context diff --git a/app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutCategory.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutCategory.kt similarity index 71% rename from app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutCategory.kt rename to app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutCategory.kt index 6a22bad2f7..565a8d578c 100644 --- a/app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutCategory.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutCategory.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.shortcuts +package org.appdevforall.codeonthego.shortcuts enum class ShortcutCategory { FILE_MANAGEMENT, diff --git a/app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutContext.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutContext.kt similarity index 59% rename from app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutContext.kt rename to app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutContext.kt index d0df89914c..5a054b2a27 100644 --- a/app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutContext.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutContext.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.shortcuts +package org.appdevforall.codeonthego.shortcuts enum class ShortcutContext { APP_GLOBAL, diff --git a/app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutDefinition.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutDefinition.kt similarity index 80% rename from app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutDefinition.kt rename to app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutDefinition.kt index a3209c3426..c0a5b7bd7a 100644 --- a/app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutDefinition.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutDefinition.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.shortcuts +package org.appdevforall.codeonthego.shortcuts data class ShortcutDefinition( val id: String, diff --git a/app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutExecutionContext.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutExecutionContext.kt similarity index 76% rename from app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutExecutionContext.kt rename to app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutExecutionContext.kt index cec5e9dd9e..77d4cd1b30 100644 --- a/app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutExecutionContext.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutExecutionContext.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.shortcuts +package org.appdevforall.codeonthego.shortcuts /** * Execution context for resolving and running IDE shortcuts. diff --git a/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutGroupProvider.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutGroupProvider.kt new file mode 100644 index 0000000000..42e1589e52 --- /dev/null +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutGroupProvider.kt @@ -0,0 +1,19 @@ +package org.appdevforall.codeonthego.shortcuts + +import org.appdevforall.codeonthego.shortcuts.groups.FileManagementGroup +import org.appdevforall.codeonthego.shortcuts.groups.ProjectsAndSolutionsGroup +import org.appdevforall.codeonthego.shortcuts.groups.SearchAndReplaceGroup +import org.appdevforall.codeonthego.shortcuts.groups.ShortcutGroup +import org.appdevforall.codeonthego.shortcuts.groups.WindowsAndDisplayGroup + +/** + * Provides the set of available shortcut groups for the IDE. + */ +class ShortcutGroupProvider { + fun all(): List = listOf( + ProjectsAndSolutionsGroup(), + WindowsAndDisplayGroup(), + FileManagementGroup(), + SearchAndReplaceGroup(), + ) +} diff --git a/app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutManager.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutManager.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutManager.kt rename to app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutManager.kt index 7bef063b81..6d70b7c00a 100644 --- a/app/src/main/java/com/itsaky/androidide/shortcuts/ShortcutManager.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutManager.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.shortcuts +package org.appdevforall.codeonthego.shortcuts import android.content.Context import android.view.KeyEvent diff --git a/app/src/main/java/com/itsaky/androidide/shortcuts/groups/FileManagementGroup.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/FileManagementGroup.kt similarity index 69% rename from app/src/main/java/com/itsaky/androidide/shortcuts/groups/FileManagementGroup.kt rename to app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/FileManagementGroup.kt index c88ef80c1d..05eaa6af82 100644 --- a/app/src/main/java/com/itsaky/androidide/shortcuts/groups/FileManagementGroup.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/FileManagementGroup.kt @@ -1,14 +1,14 @@ -package com.itsaky.androidide.shortcuts.groups +package org.appdevforall.codeonthego.shortcuts.groups import android.content.Context import android.view.KeyEvent -import com.itsaky.androidide.actions.file.CloseFileAction -import com.itsaky.androidide.actions.file.SaveFileAction +import org.appdevforall.codeonthego.actions.file.CloseFileAction +import org.appdevforall.codeonthego.actions.file.SaveFileAction import com.itsaky.androidide.resources.R -import com.itsaky.androidide.shortcuts.KeyShortcut -import com.itsaky.androidide.shortcuts.ShortcutCategory -import com.itsaky.androidide.shortcuts.ShortcutContext -import com.itsaky.androidide.shortcuts.ShortcutDefinition +import org.appdevforall.codeonthego.shortcuts.KeyShortcut +import org.appdevforall.codeonthego.shortcuts.ShortcutCategory +import org.appdevforall.codeonthego.shortcuts.ShortcutContext +import org.appdevforall.codeonthego.shortcuts.ShortcutDefinition internal class FileManagementGroup : ShortcutGroup { override fun shortcuts(context: Context): List { diff --git a/app/src/main/java/com/itsaky/androidide/shortcuts/groups/ProjectsAndSolutionsGroup.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/ProjectsAndSolutionsGroup.kt similarity index 72% rename from app/src/main/java/com/itsaky/androidide/shortcuts/groups/ProjectsAndSolutionsGroup.kt rename to app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/ProjectsAndSolutionsGroup.kt index 7ab45d11e0..6c8328fd23 100644 --- a/app/src/main/java/com/itsaky/androidide/shortcuts/groups/ProjectsAndSolutionsGroup.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/ProjectsAndSolutionsGroup.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.shortcuts.groups +package org.appdevforall.codeonthego.shortcuts.groups import android.content.Context import android.view.KeyEvent -import com.itsaky.androidide.actions.main.CloneRepositoryAction -import com.itsaky.androidide.actions.main.CreateProjectAction -import com.itsaky.androidide.actions.main.OpenProjectAction +import org.appdevforall.codeonthego.actions.main.CloneRepositoryAction +import org.appdevforall.codeonthego.actions.main.CreateProjectAction +import org.appdevforall.codeonthego.actions.main.OpenProjectAction import com.itsaky.androidide.resources.R -import com.itsaky.androidide.shortcuts.KeyShortcut -import com.itsaky.androidide.shortcuts.ShortcutCategory -import com.itsaky.androidide.shortcuts.ShortcutContext -import com.itsaky.androidide.shortcuts.ShortcutDefinition +import org.appdevforall.codeonthego.shortcuts.KeyShortcut +import org.appdevforall.codeonthego.shortcuts.ShortcutCategory +import org.appdevforall.codeonthego.shortcuts.ShortcutContext +import org.appdevforall.codeonthego.shortcuts.ShortcutDefinition internal class ProjectsAndSolutionsGroup : ShortcutGroup { override fun shortcuts(context: Context): List { diff --git a/app/src/main/java/com/itsaky/androidide/shortcuts/groups/SearchAndReplaceGroup.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/SearchAndReplaceGroup.kt similarity index 73% rename from app/src/main/java/com/itsaky/androidide/shortcuts/groups/SearchAndReplaceGroup.kt rename to app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/SearchAndReplaceGroup.kt index bd533c9ea6..72a6ee4bdc 100644 --- a/app/src/main/java/com/itsaky/androidide/shortcuts/groups/SearchAndReplaceGroup.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/SearchAndReplaceGroup.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.shortcuts.groups +package org.appdevforall.codeonthego.shortcuts.groups import android.content.Context import android.view.KeyEvent -import com.itsaky.androidide.actions.etc.FindInFileAction -import com.itsaky.androidide.actions.etc.FindInProjectAction -import com.itsaky.androidide.actions.etc.ReplaceInProjectAction +import org.appdevforall.codeonthego.actions.etc.FindInFileAction +import org.appdevforall.codeonthego.actions.etc.FindInProjectAction +import org.appdevforall.codeonthego.actions.etc.ReplaceInProjectAction import com.itsaky.androidide.resources.R -import com.itsaky.androidide.shortcuts.KeyShortcut -import com.itsaky.androidide.shortcuts.ShortcutCategory -import com.itsaky.androidide.shortcuts.ShortcutContext -import com.itsaky.androidide.shortcuts.ShortcutDefinition +import org.appdevforall.codeonthego.shortcuts.KeyShortcut +import org.appdevforall.codeonthego.shortcuts.ShortcutCategory +import org.appdevforall.codeonthego.shortcuts.ShortcutContext +import org.appdevforall.codeonthego.shortcuts.ShortcutDefinition internal class SearchAndReplaceGroup : ShortcutGroup { override fun shortcuts(context: Context): List = diff --git a/app/src/main/java/com/itsaky/androidide/shortcuts/groups/ShortcutDefinitionIds.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/ShortcutDefinitionIds.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/shortcuts/groups/ShortcutDefinitionIds.kt rename to app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/ShortcutDefinitionIds.kt index a4ce6dc19c..2cd7232c49 100644 --- a/app/src/main/java/com/itsaky/androidide/shortcuts/groups/ShortcutDefinitionIds.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/ShortcutDefinitionIds.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.shortcuts.groups +package org.appdevforall.codeonthego.shortcuts.groups internal object ShortcutDefinitionIds { const val OPEN_TERMINAL = "shortcut.openTerminal" diff --git a/app/src/main/java/com/itsaky/androidide/shortcuts/groups/ShortcutGroup.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/ShortcutGroup.kt similarity index 50% rename from app/src/main/java/com/itsaky/androidide/shortcuts/groups/ShortcutGroup.kt rename to app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/ShortcutGroup.kt index f3b2800e3b..491c479fbc 100644 --- a/app/src/main/java/com/itsaky/androidide/shortcuts/groups/ShortcutGroup.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/ShortcutGroup.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.shortcuts.groups +package org.appdevforall.codeonthego.shortcuts.groups import android.content.Context -import com.itsaky.androidide.shortcuts.ShortcutDefinition +import org.appdevforall.codeonthego.shortcuts.ShortcutDefinition interface ShortcutGroup { fun shortcuts(context: Context): List diff --git a/app/src/main/java/com/itsaky/androidide/shortcuts/groups/WindowsAndDisplayGroup.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/WindowsAndDisplayGroup.kt similarity index 74% rename from app/src/main/java/com/itsaky/androidide/shortcuts/groups/WindowsAndDisplayGroup.kt rename to app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/WindowsAndDisplayGroup.kt index 496d48eb32..218681d234 100644 --- a/app/src/main/java/com/itsaky/androidide/shortcuts/groups/WindowsAndDisplayGroup.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/WindowsAndDisplayGroup.kt @@ -1,16 +1,16 @@ -package com.itsaky.androidide.shortcuts.groups +package org.appdevforall.codeonthego.shortcuts.groups import android.content.Context import android.view.KeyEvent -import com.itsaky.androidide.actions.main.OpenTerminalAction -import com.itsaky.androidide.actions.main.PreferencesAction -import com.itsaky.androidide.actions.sidebar.PreferencesSidebarAction -import com.itsaky.androidide.actions.sidebar.TerminalSidebarAction +import org.appdevforall.codeonthego.actions.main.OpenTerminalAction +import org.appdevforall.codeonthego.actions.main.PreferencesAction +import org.appdevforall.codeonthego.actions.sidebar.PreferencesSidebarAction +import org.appdevforall.codeonthego.actions.sidebar.TerminalSidebarAction import com.itsaky.androidide.resources.R -import com.itsaky.androidide.shortcuts.KeyShortcut -import com.itsaky.androidide.shortcuts.ShortcutCategory -import com.itsaky.androidide.shortcuts.ShortcutContext -import com.itsaky.androidide.shortcuts.ShortcutDefinition +import org.appdevforall.codeonthego.shortcuts.KeyShortcut +import org.appdevforall.codeonthego.shortcuts.ShortcutCategory +import org.appdevforall.codeonthego.shortcuts.ShortcutContext +import org.appdevforall.codeonthego.shortcuts.ShortcutDefinition internal class WindowsAndDisplayGroup : ShortcutGroup { override fun shortcuts(context: Context): List { diff --git a/app/src/main/java/com/itsaky/androidide/tasks/callables/FileTreeCallable.java b/app/src/main/java/org/appdevforall/codeonthego/tasks/callables/FileTreeCallable.java similarity index 95% rename from app/src/main/java/com/itsaky/androidide/tasks/callables/FileTreeCallable.java rename to app/src/main/java/org/appdevforall/codeonthego/tasks/callables/FileTreeCallable.java index afe8454fd9..af2ade771e 100755 --- a/app/src/main/java/com/itsaky/androidide/tasks/callables/FileTreeCallable.java +++ b/app/src/main/java/org/appdevforall/codeonthego/tasks/callables/FileTreeCallable.java @@ -18,11 +18,11 @@ * **************************************************************************************/ -package com.itsaky.androidide.tasks.callables; +package org.appdevforall.codeonthego.tasks.callables; import android.content.Context; -import com.itsaky.androidide.adapters.viewholders.FileTreeViewHolder; +import org.appdevforall.codeonthego.adapters.viewholders.FileTreeViewHolder; import com.unnamed.b.atv.model.TreeNode; import java.io.File; diff --git a/app/src/main/java/com/itsaky/androidide/tasks/callables/ListDirectoryCallable.java b/app/src/main/java/org/appdevforall/codeonthego/tasks/callables/ListDirectoryCallable.java similarity index 93% rename from app/src/main/java/com/itsaky/androidide/tasks/callables/ListDirectoryCallable.java rename to app/src/main/java/org/appdevforall/codeonthego/tasks/callables/ListDirectoryCallable.java index c0a5f0fb0b..74ac14bf5e 100755 --- a/app/src/main/java/com/itsaky/androidide/tasks/callables/ListDirectoryCallable.java +++ b/app/src/main/java/org/appdevforall/codeonthego/tasks/callables/ListDirectoryCallable.java @@ -18,10 +18,10 @@ * **************************************************************************************/ -package com.itsaky.androidide.tasks.callables; +package org.appdevforall.codeonthego.tasks.callables; import android.text.TextUtils; -import com.itsaky.androidide.utils.FileUtils; +import org.appdevforall.codeonthego.utils.FileUtils; import java.io.File; import java.io.FileFilter; diff --git a/app/src/main/java/com/itsaky/androidide/tasks/callables/UnzipCallable.java b/app/src/main/java/org/appdevforall/codeonthego/tasks/callables/UnzipCallable.java similarity index 92% rename from app/src/main/java/com/itsaky/androidide/tasks/callables/UnzipCallable.java rename to app/src/main/java/org/appdevforall/codeonthego/tasks/callables/UnzipCallable.java index 2813145216..4525d60a5a 100755 --- a/app/src/main/java/com/itsaky/androidide/tasks/callables/UnzipCallable.java +++ b/app/src/main/java/org/appdevforall/codeonthego/tasks/callables/UnzipCallable.java @@ -18,9 +18,9 @@ * **************************************************************************************/ -package com.itsaky.androidide.tasks.callables; +package org.appdevforall.codeonthego.tasks.callables; -import com.itsaky.androidide.utils.ZipUtils; +import org.appdevforall.codeonthego.utils.ZipUtils; import java.io.File; import java.util.List; import java.util.concurrent.Callable; diff --git a/app/src/main/java/com/itsaky/androidide/templates/manager/models/CgtFileItem.kt b/app/src/main/java/org/appdevforall/codeonthego/templates/manager/models/CgtFileItem.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/templates/manager/models/CgtFileItem.kt rename to app/src/main/java/org/appdevforall/codeonthego/templates/manager/models/CgtFileItem.kt index e620764d9c..ab5396f008 100644 --- a/app/src/main/java/com/itsaky/androidide/templates/manager/models/CgtFileItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/templates/manager/models/CgtFileItem.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.templates.manager.models +package org.appdevforall.codeonthego.templates.manager.models import java.io.File @@ -17,7 +17,7 @@ data class TemplateMetadata( /** * Where a `.cgt` file came from, inferred from its filename convention (there is no stable - * template ID: [com.itsaky.androidide.templates.Template.templateId] is a random UUID + * template ID: [org.appdevforall.codeonthego.templates.Template.templateId] is a random UUID * regenerated on every reload). Matches the convention used by * `IdeTemplateServiceImpl`/`PluginProjectManager` when they write into `Environment.TEMPLATES_DIR`. */ diff --git a/app/src/main/java/com/itsaky/androidide/templates/manager/parsing/CgtTemplateReader.kt b/app/src/main/java/org/appdevforall/codeonthego/templates/manager/parsing/CgtTemplateReader.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/templates/manager/parsing/CgtTemplateReader.kt rename to app/src/main/java/org/appdevforall/codeonthego/templates/manager/parsing/CgtTemplateReader.kt index ea14521b13..a81129bf97 100644 --- a/app/src/main/java/com/itsaky/androidide/templates/manager/parsing/CgtTemplateReader.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/templates/manager/parsing/CgtTemplateReader.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.templates.manager.parsing +package org.appdevforall.codeonthego.templates.manager.parsing -import com.itsaky.androidide.templates.manager.models.TemplateMetadata +import org.appdevforall.codeonthego.templates.manager.models.TemplateMetadata import org.json.JSONObject import java.io.ByteArrayOutputStream import java.io.IOException diff --git a/app/src/main/java/com/itsaky/androidide/ui/CodeEditorView.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/CodeEditorView.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/ui/CodeEditorView.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/CodeEditorView.kt index 6b18c644ba..3de3bd8916 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/CodeEditorView.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/CodeEditorView.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.annotation.SuppressLint import android.app.Activity @@ -30,34 +30,34 @@ import android.view.LayoutInflater import android.view.MotionEvent import androidx.appcompat.widget.LinearLayoutCompat import androidx.core.view.isVisible -import com.itsaky.androidide.activities.editor.BaseEditorActivity -import com.itsaky.androidide.editor.api.IEditor +import org.appdevforall.codeonthego.activities.editor.BaseEditorActivity +import org.appdevforall.codeonthego.editor.api.IEditor import com.itsaky.androidide.editor.databinding.LayoutCodeEditorBinding -import com.itsaky.androidide.editor.events.FileUpdateEvent -import com.itsaky.androidide.editor.events.LanguageUpdateEvent -import com.itsaky.androidide.editor.language.IDELanguage -import com.itsaky.androidide.editor.ui.EditorSearchLayout -import com.itsaky.androidide.editor.ui.IDEEditor -import com.itsaky.androidide.editor.ui.IDEEditor.Companion.createInputTypeFlags -import com.itsaky.androidide.editor.utils.ContentReadWrite.readContent -import com.itsaky.androidide.editor.utils.ContentReadWrite.writeTo -import com.itsaky.androidide.eventbus.events.preferences.PreferenceChangeEvent -import com.itsaky.androidide.lsp.BreakpointHandler -import com.itsaky.androidide.lsp.IDEDebugClientImpl -import com.itsaky.androidide.lsp.IDELanguageClientImpl -import com.itsaky.androidide.lsp.PluginLanguageSupport -import com.itsaky.androidide.lsp.api.ILanguageServer -import com.itsaky.androidide.lsp.api.ILanguageServerRegistry -import com.itsaky.androidide.lsp.java.JavaLanguageServer -import com.itsaky.androidide.lsp.kotlin.KotlinLanguageServer -import com.itsaky.androidide.lsp.xml.XMLLanguageServer -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.preferences.internal.EditorPreferences -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE -import com.itsaky.androidide.tasks.cancelIfActive -import com.itsaky.androidide.tasks.runOnUiThread -import com.itsaky.androidide.utils.customOrJBMono -import com.itsaky.androidide.utils.dpToPx +import org.appdevforall.codeonthego.editor.events.FileUpdateEvent +import org.appdevforall.codeonthego.editor.events.LanguageUpdateEvent +import org.appdevforall.codeonthego.editor.language.IDELanguage +import org.appdevforall.codeonthego.editor.ui.EditorSearchLayout +import org.appdevforall.codeonthego.editor.ui.IDEEditor +import org.appdevforall.codeonthego.editor.ui.IDEEditor.Companion.createInputTypeFlags +import org.appdevforall.codeonthego.editor.utils.ContentReadWrite.readContent +import org.appdevforall.codeonthego.editor.utils.ContentReadWrite.writeTo +import org.appdevforall.codeonthego.eventbus.events.preferences.PreferenceChangeEvent +import org.appdevforall.codeonthego.lsp.BreakpointHandler +import org.appdevforall.codeonthego.lsp.IDEDebugClientImpl +import org.appdevforall.codeonthego.lsp.IDELanguageClientImpl +import org.appdevforall.codeonthego.lsp.PluginLanguageSupport +import org.appdevforall.codeonthego.lsp.api.ILanguageServer +import org.appdevforall.codeonthego.lsp.api.ILanguageServerRegistry +import org.appdevforall.codeonthego.lsp.java.JavaLanguageServer +import org.appdevforall.codeonthego.lsp.kotlin.KotlinLanguageServer +import org.appdevforall.codeonthego.lsp.xml.XMLLanguageServer +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE +import org.appdevforall.codeonthego.tasks.cancelIfActive +import org.appdevforall.codeonthego.tasks.runOnUiThread +import org.appdevforall.codeonthego.utils.customOrJBMono +import org.appdevforall.codeonthego.utils.dpToPx import io.github.rosemoe.sora.event.ClickEvent import io.github.rosemoe.sora.event.InterceptTarget import io.github.rosemoe.sora.event.TextSizeChangeEvent diff --git a/app/src/main/java/com/itsaky/androidide/ui/CustomDividerItemDecoration.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/CustomDividerItemDecoration.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/ui/CustomDividerItemDecoration.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/CustomDividerItemDecoration.kt index e8a08420f0..f953fdf887 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/CustomDividerItemDecoration.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/CustomDividerItemDecoration.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.content.Context import android.graphics.Canvas diff --git a/app/src/main/java/com/itsaky/androidide/ui/CustomSnackbar.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/CustomSnackbar.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/ui/CustomSnackbar.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/CustomSnackbar.kt index d59c3bb1c5..7d0947076d 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/CustomSnackbar.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/CustomSnackbar.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.annotation.SuppressLint import android.content.Context diff --git a/app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/EditorBottomSheet.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/EditorBottomSheet.kt index 6478b837a4..b659f897cf 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/EditorBottomSheet.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.app.Activity import android.content.ClipData @@ -49,34 +49,34 @@ import com.google.android.material.tabs.TabLayout.Tab import com.google.android.material.tabs.TabLayoutMediator import com.google.android.material.transition.MaterialSharedAxis import com.itsaky.androidide.R -import com.itsaky.androidide.adapters.DiagnosticsAdapter -import com.itsaky.androidide.adapters.EditorBottomSheetTabAdapter -import com.itsaky.androidide.adapters.SearchListAdapter +import org.appdevforall.codeonthego.adapters.DiagnosticsAdapter +import org.appdevforall.codeonthego.adapters.EditorBottomSheetTabAdapter +import org.appdevforall.codeonthego.adapters.SearchListAdapter import com.itsaky.androidide.databinding.LayoutEditorBottomSheetBinding -import com.itsaky.androidide.fragments.EmptyStateFragment -import com.itsaky.androidide.fragments.output.SearchableOutputFragment -import com.itsaky.androidide.fragments.output.ShareableOutputFragment -import com.itsaky.androidide.fragments.output.ViewOptionsOutputFragment -import com.itsaky.androidide.fragments.output.WrappableOutputFragment -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.IDELanguageClientImpl -import com.itsaky.androidide.models.LogLine -import com.itsaky.androidide.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.fragments.EmptyStateFragment +import org.appdevforall.codeonthego.fragments.output.SearchableOutputFragment +import org.appdevforall.codeonthego.fragments.output.ShareableOutputFragment +import org.appdevforall.codeonthego.fragments.output.ViewOptionsOutputFragment +import org.appdevforall.codeonthego.fragments.output.WrappableOutputFragment +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.IDELanguageClientImpl +import org.appdevforall.codeonthego.models.LogLine +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences import com.itsaky.androidide.resources.R.string -import com.itsaky.androidide.tasks.runOnUiThread -import com.itsaky.androidide.utils.DiagnosticsFormatter -import com.itsaky.androidide.utils.IntentUtils.shareFile -import com.itsaky.androidide.utils.Symbols.forFile -import com.itsaky.androidide.utils.clearLongPressHelp -import com.itsaky.androidide.utils.displayTooltipOnLongPress -import com.itsaky.androidide.utils.dpToPx -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashSuccess -import com.itsaky.androidide.utils.isSoftInputVisible -import com.itsaky.androidide.viewmodel.ApkInstallationViewModel -import com.itsaky.androidide.viewmodel.BottomSheetViewModel -import com.itsaky.androidide.viewmodel.BuildOutputViewModel +import org.appdevforall.codeonthego.tasks.runOnUiThread +import org.appdevforall.codeonthego.utils.DiagnosticsFormatter +import org.appdevforall.codeonthego.utils.IntentUtils.shareFile +import org.appdevforall.codeonthego.utils.Symbols.forFile +import org.appdevforall.codeonthego.utils.clearLongPressHelp +import org.appdevforall.codeonthego.utils.displayTooltipOnLongPress +import org.appdevforall.codeonthego.utils.dpToPx +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashSuccess +import org.appdevforall.codeonthego.utils.isSoftInputVisible +import org.appdevforall.codeonthego.viewmodel.ApkInstallationViewModel +import org.appdevforall.codeonthego.viewmodel.BottomSheetViewModel +import org.appdevforall.codeonthego.viewmodel.BuildOutputViewModel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job import kotlinx.coroutines.flow.collectLatest @@ -628,7 +628,7 @@ class EditorBottomSheet * Records a line of build output and shows it if the Build Output tab is on screen. * * The view model is written first and unconditionally: the pager destroys - * [com.itsaky.androidide.fragments.output.BuildOutputFragment] whenever another tab is + * [org.appdevforall.codeonthego.fragments.output.BuildOutputFragment] whenever another tab is * shown, so while the fragment was the only writer, a build started from the AI agent's tab * -- the one place the user necessarily is when the agent builds -- left no log behind. */ diff --git a/app/src/main/java/com/itsaky/androidide/ui/EmptyView.java b/app/src/main/java/org/appdevforall/codeonthego/ui/EmptyView.java similarity index 96% rename from app/src/main/java/com/itsaky/androidide/ui/EmptyView.java rename to app/src/main/java/org/appdevforall/codeonthego/ui/EmptyView.java index 1569ee8e48..26a43ee313 100755 --- a/app/src/main/java/com/itsaky/androidide/ui/EmptyView.java +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/EmptyView.java @@ -18,7 +18,7 @@ * **************************************************************************************/ -package com.itsaky.androidide.ui; +package org.appdevforall.codeonthego.ui; import android.content.Context; import android.text.TextUtils; @@ -30,7 +30,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import com.itsaky.androidide.R; -import com.itsaky.androidide.utils.ContextUtilsKt; +import org.appdevforall.codeonthego.utils.ContextUtilsKt; public class EmptyView extends RelativeLayout { diff --git a/app/src/main/java/com/itsaky/androidide/ui/IdeNavigationRailView.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/IdeNavigationRailView.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/ui/IdeNavigationRailView.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/IdeNavigationRailView.kt index f10450b885..7012d67cfc 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/IdeNavigationRailView.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/IdeNavigationRailView.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.content.Context import android.util.AttributeSet diff --git a/app/src/main/java/com/itsaky/androidide/ui/InfoRowView.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/InfoRowView.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/ui/InfoRowView.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/InfoRowView.kt index 296b3023f9..3ca4aaaf98 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/InfoRowView.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/InfoRowView.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.content.Context import android.util.AttributeSet diff --git a/app/src/main/java/com/itsaky/androidide/ui/MemoryUsageChartRenderer.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/MemoryUsageChartRenderer.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/ui/MemoryUsageChartRenderer.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/MemoryUsageChartRenderer.kt index a7fe80d1b4..e548573772 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/MemoryUsageChartRenderer.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/MemoryUsageChartRenderer.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.content.Context import androidx.annotation.UiThread @@ -28,11 +28,11 @@ import com.github.mikephil.charting.data.LineData import com.github.mikephil.charting.data.LineDataSet import com.github.mikephil.charting.formatter.IAxisValueFormatter import com.itsaky.androidide.R -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.utils.MemoryUsageWatcher -import com.itsaky.androidide.utils.MemoryUsageWatcher.ProcessMemoryInfo -import com.itsaky.androidide.utils.MetricsAnnotationStore -import com.itsaky.androidide.utils.ShiftedLongArray +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.utils.MemoryUsageWatcher +import org.appdevforall.codeonthego.utils.MemoryUsageWatcher.ProcessMemoryInfo +import org.appdevforall.codeonthego.utils.MetricsAnnotationStore +import org.appdevforall.codeonthego.utils.ShiftedLongArray import kotlin.math.max import kotlin.math.roundToLong diff --git a/app/src/main/java/com/itsaky/androidide/ui/MetricsCarouselAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/MetricsCarouselAdapter.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/ui/MetricsCarouselAdapter.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/MetricsCarouselAdapter.kt index 0ea5ba14fc..bd1215f387 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/MetricsCarouselAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/MetricsCarouselAdapter.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.view.LayoutInflater import android.view.ViewGroup diff --git a/app/src/main/java/com/itsaky/androidide/ui/MetricsCarouselController.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/MetricsCarouselController.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/ui/MetricsCarouselController.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/MetricsCarouselController.kt index 1458025d00..97f3c9dfcd 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/MetricsCarouselController.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/MetricsCarouselController.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.app.Activity import android.content.Context @@ -38,25 +38,25 @@ import androidx.core.view.isVisible import androidx.core.widget.ImageViewCompat import androidx.viewpager2.widget.ViewPager2 import com.itsaky.androidide.R -import com.itsaky.androidide.app.configuration.IDEBuildConfigProvider +import org.appdevforall.codeonthego.app.configuration.IDEBuildConfigProvider import com.itsaky.androidide.databinding.LayoutMemUsageBinding -import com.itsaky.androidide.floating.window.OverlayDialogs -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.floating.window.OverlayDialogs +import org.appdevforall.codeonthego.idetooltips.TooltipTag import com.itsaky.androidide.resources.R.string -import com.itsaky.androidide.utils.DialogUtils -import com.itsaky.androidide.utils.IntentUtils -import com.itsaky.androidide.utils.MemoryUsageWatcher -import com.itsaky.androidide.utils.MetricsAnnotationStore -import com.itsaky.androidide.utils.MetricsCsv -import com.itsaky.androidide.utils.MetricsCsvFile -import com.itsaky.androidide.utils.MetricsSamplingRates -import com.itsaky.androidide.utils.MetricsSnapshot -import com.itsaky.androidide.utils.MetricsSnapshotAssembler -import com.itsaky.androidide.utils.NetworkUsageWatcher -import com.itsaky.androidide.utils.PowerUsageWatcher -import com.itsaky.androidide.utils.clearLongPressHelp -import com.itsaky.androidide.utils.displayTooltipOnLongPress -import com.itsaky.androidide.utils.showIdeCategoryTooltipIfPresent +import org.appdevforall.codeonthego.utils.DialogUtils +import org.appdevforall.codeonthego.utils.IntentUtils +import org.appdevforall.codeonthego.utils.MemoryUsageWatcher +import org.appdevforall.codeonthego.utils.MetricsAnnotationStore +import org.appdevforall.codeonthego.utils.MetricsCsv +import org.appdevforall.codeonthego.utils.MetricsCsvFile +import org.appdevforall.codeonthego.utils.MetricsSamplingRates +import org.appdevforall.codeonthego.utils.MetricsSnapshot +import org.appdevforall.codeonthego.utils.MetricsSnapshotAssembler +import org.appdevforall.codeonthego.utils.NetworkUsageWatcher +import org.appdevforall.codeonthego.utils.PowerUsageWatcher +import org.appdevforall.codeonthego.utils.clearLongPressHelp +import org.appdevforall.codeonthego.utils.displayTooltipOnLongPress +import org.appdevforall.codeonthego.utils.showIdeCategoryTooltipIfPresent import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/itsaky/androidide/ui/MetricsCarouselLayout.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/MetricsCarouselLayout.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/ui/MetricsCarouselLayout.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/MetricsCarouselLayout.kt index f5a6ddc746..5c0410948e 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/MetricsCarouselLayout.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/MetricsCarouselLayout.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.content.Context import android.util.AttributeSet diff --git a/app/src/main/java/com/itsaky/androidide/ui/MetricsChartRenderer.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/MetricsChartRenderer.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/ui/MetricsChartRenderer.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/MetricsChartRenderer.kt index 6b7bc0c739..be1c6947a5 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/MetricsChartRenderer.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/MetricsChartRenderer.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.content.Context import android.graphics.Bitmap @@ -38,11 +38,11 @@ import com.github.mikephil.charting.formatter.IAxisValueFormatter import com.github.mikephil.charting.listener.ChartTouchListener import com.github.mikephil.charting.listener.OnChartGestureListener import com.itsaky.androidide.R -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.utils.MetricsAnnotationStore -import com.itsaky.androidide.utils.longPressHelpTimeoutMillis -import com.itsaky.androidide.utils.resolveAttr -import com.itsaky.androidide.utils.showIdeCategoryTooltipIfPresent +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.utils.MetricsAnnotationStore +import org.appdevforall.codeonthego.utils.longPressHelpTimeoutMillis +import org.appdevforall.codeonthego.utils.resolveAttr +import org.appdevforall.codeonthego.utils.showIdeCategoryTooltipIfPresent import kotlin.math.ceil import kotlin.math.floor import kotlin.math.roundToInt diff --git a/app/src/main/java/com/itsaky/androidide/ui/NetworkUsageChartRenderer.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/NetworkUsageChartRenderer.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/ui/NetworkUsageChartRenderer.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/NetworkUsageChartRenderer.kt index 63113b946d..fe383e1ca3 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/NetworkUsageChartRenderer.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/NetworkUsageChartRenderer.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.content.Context import android.graphics.Color @@ -26,10 +26,10 @@ import com.github.mikephil.charting.data.Entry import com.github.mikephil.charting.data.LineDataSet import com.github.mikephil.charting.formatter.IAxisValueFormatter import com.itsaky.androidide.R -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.utils.MetricsAnnotationStore -import com.itsaky.androidide.utils.NetworkUsageWatcher -import com.itsaky.androidide.utils.NetworkUsageWatcher.NetworkUsage +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.utils.MetricsAnnotationStore +import org.appdevforall.codeonthego.utils.NetworkUsageWatcher +import org.appdevforall.codeonthego.utils.NetworkUsageWatcher.NetworkUsage import kotlin.math.ceil import kotlin.math.log10 import kotlin.math.max diff --git a/app/src/main/java/com/itsaky/androidide/ui/PowerUsageChartRenderer.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/PowerUsageChartRenderer.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/ui/PowerUsageChartRenderer.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/PowerUsageChartRenderer.kt index bdd73cf251..b62d7d68bd 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/PowerUsageChartRenderer.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/PowerUsageChartRenderer.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.content.Context import android.graphics.Color @@ -27,10 +27,10 @@ import com.github.mikephil.charting.data.Entry import com.github.mikephil.charting.data.LineDataSet import com.github.mikephil.charting.formatter.IAxisValueFormatter import com.itsaky.androidide.R -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.utils.MetricsAnnotationStore -import com.itsaky.androidide.utils.PowerUsageWatcher -import com.itsaky.androidide.utils.PowerUsageWatcher.PowerUsage +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.utils.MetricsAnnotationStore +import org.appdevforall.codeonthego.utils.PowerUsageWatcher +import org.appdevforall.codeonthego.utils.PowerUsageWatcher.PowerUsage import kotlin.math.abs import kotlin.math.ceil import kotlin.math.floor diff --git a/app/src/main/java/com/itsaky/androidide/ui/ProjectInfoBottomSheet.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/ProjectInfoBottomSheet.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/ui/ProjectInfoBottomSheet.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/ProjectInfoBottomSheet.kt index 614a70267d..2179144e0e 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/ProjectInfoBottomSheet.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/ProjectInfoBottomSheet.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.os.Bundle import android.view.LayoutInflater @@ -7,15 +7,15 @@ import android.view.ViewGroup import android.widget.Toast import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.itsaky.androidide.databinding.LayoutProjectInfoSheetBinding -import com.itsaky.androidide.models.ProjectFile +import org.appdevforall.codeonthego.models.ProjectFile import com.itsaky.androidide.resources.R -import com.itsaky.androidide.roomData.recentproject.RecentProject -import com.itsaky.androidide.templates.Language -import com.itsaky.androidide.utils.ProjectDetails -import com.itsaky.androidide.utils.capitalizeString -import com.itsaky.androidide.utils.formatDate -import com.itsaky.androidide.utils.loadProjectDetails -import com.itsaky.androidide.utils.viewLifecycleScope +import org.appdevforall.codeonthego.roomData.recentproject.RecentProject +import org.appdevforall.codeonthego.templates.Language +import org.appdevforall.codeonthego.utils.ProjectDetails +import org.appdevforall.codeonthego.utils.capitalizeString +import org.appdevforall.codeonthego.utils.formatDate +import org.appdevforall.codeonthego.utils.loadProjectDetails +import org.appdevforall.codeonthego.utils.viewLifecycleScope import com.termux.shared.interact.ShareUtils.copyTextToClipboard import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/itsaky/androidide/ui/SafeLineChart.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/SafeLineChart.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/ui/SafeLineChart.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/SafeLineChart.kt index f116dc2945..1437be755b 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/SafeLineChart.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/SafeLineChart.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.content.Context import android.graphics.Canvas diff --git a/app/src/main/java/com/itsaky/androidide/ui/ScalableTabLayout.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/ScalableTabLayout.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/ui/ScalableTabLayout.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/ScalableTabLayout.kt index 6f5a339f4f..48a21138d0 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/ScalableTabLayout.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/ScalableTabLayout.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.content.Context import android.util.AttributeSet diff --git a/app/src/main/java/com/itsaky/androidide/ui/StorageDialog.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/StorageDialog.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/ui/StorageDialog.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/StorageDialog.kt index b97d6cabf6..fe7a983ad9 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/StorageDialog.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/StorageDialog.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.app.Activity import android.app.AlertDialog @@ -6,7 +6,7 @@ import android.content.ActivityNotFoundException import android.content.Intent import android.provider.Settings import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.getMinimumStorageNeeded +import org.appdevforall.codeonthego.utils.getMinimumStorageNeeded fun Activity.showLowStorageDialog() { diff --git a/app/src/main/java/com/itsaky/androidide/ui/SwipeRevealLayout.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/SwipeRevealLayout.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/ui/SwipeRevealLayout.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/SwipeRevealLayout.kt index 86a0ee2503..2e7e42016b 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/SwipeRevealLayout.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/SwipeRevealLayout.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.annotation.SuppressLint import android.content.Context diff --git a/app/src/main/java/com/itsaky/androidide/ui/SymbolInputView.java b/app/src/main/java/org/appdevforall/codeonthego/ui/SymbolInputView.java similarity index 86% rename from app/src/main/java/com/itsaky/androidide/ui/SymbolInputView.java rename to app/src/main/java/org/appdevforall/codeonthego/ui/SymbolInputView.java index f787e6852e..fc6151ec52 100755 --- a/app/src/main/java/com/itsaky/androidide/ui/SymbolInputView.java +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/SymbolInputView.java @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . * */ -package com.itsaky.androidide.ui; +package org.appdevforall.codeonthego.ui; import android.content.Context; import android.util.AttributeSet; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.itsaky.androidide.adapters.SymbolInputAdapter; -import com.itsaky.androidide.editor.ui.IDEEditor; -import com.itsaky.androidide.models.Symbol; -import com.itsaky.androidide.utils.Symbols; +import org.appdevforall.codeonthego.adapters.SymbolInputAdapter; +import org.appdevforall.codeonthego.editor.ui.IDEEditor; +import org.appdevforall.codeonthego.models.Symbol; +import org.appdevforall.codeonthego.utils.Symbols; import java.util.List; public class SymbolInputView extends RecyclerView { diff --git a/app/src/main/java/com/itsaky/androidide/ui/compose/ManagerScreen.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/ManagerScreen.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/ui/compose/ManagerScreen.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/compose/ManagerScreen.kt index bf5c7c58f3..ebd23dc3ee 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/compose/ManagerScreen.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/ManagerScreen.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui.compose +package org.appdevforall.codeonthego.ui.compose import android.content.ActivityNotFoundException import android.content.Intent @@ -48,19 +48,19 @@ import androidx.compose.ui.semantics.Role import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.itsaky.androidide.R -import com.itsaky.androidide.activities.ExternalFileInstallDialogs -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.ui.compose.plugins.PluginManagerContent -import com.itsaky.androidide.ui.compose.templates.TemplateManagerScreen -import com.itsaky.androidide.ui.models.PluginManagerUiEvent -import com.itsaky.androidide.ui.models.TemplateManagerUiEvent -import com.itsaky.androidide.utils.UrlManager -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.getFileName -import com.itsaky.androidide.viewmodels.ExternalFileInstallViewModel -import com.itsaky.androidide.viewmodels.PluginManagerViewModel -import com.itsaky.androidide.viewmodels.TemplateManagerViewModel +import org.appdevforall.codeonthego.activities.ExternalFileInstallDialogs +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.ui.compose.plugins.PluginManagerContent +import org.appdevforall.codeonthego.ui.compose.templates.TemplateManagerScreen +import org.appdevforall.codeonthego.ui.models.PluginManagerUiEvent +import org.appdevforall.codeonthego.ui.models.TemplateManagerUiEvent +import org.appdevforall.codeonthego.utils.UrlManager +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.getFileName +import org.appdevforall.codeonthego.viewmodels.ExternalFileInstallViewModel +import org.appdevforall.codeonthego.viewmodels.PluginManagerViewModel +import org.appdevforall.codeonthego.viewmodels.TemplateManagerViewModel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.delay import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/itsaky/androidide/ui/compose/TooltipInterop.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/TooltipInterop.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/ui/compose/TooltipInterop.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/compose/TooltipInterop.kt index a6667bb866..f05187c666 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/compose/TooltipInterop.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/TooltipInterop.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui.compose +package org.appdevforall.codeonthego.ui.compose import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.combinedClickable @@ -8,7 +8,7 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import com.itsaky.androidide.R -import com.itsaky.androidide.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipManager /** * Wires the existing long-press help system (`idetooltips`) into a composable. Compose has no diff --git a/app/src/main/java/com/itsaky/androidide/ui/compose/common/FileImage.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/common/FileImage.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/ui/compose/common/FileImage.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/compose/common/FileImage.kt index fe44da5a1a..ec745548b7 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/compose/common/FileImage.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/common/FileImage.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui.compose.common +package org.appdevforall.codeonthego.ui.compose.common import android.graphics.Bitmap import android.graphics.BitmapFactory diff --git a/app/src/main/java/com/itsaky/androidide/ui/compose/plugins/PluginListItem.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/plugins/PluginListItem.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/ui/compose/plugins/PluginListItem.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/compose/plugins/PluginListItem.kt index 68644a865f..b935d54533 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/compose/plugins/PluginListItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/plugins/PluginListItem.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui.compose.plugins +package org.appdevforall.codeonthego.ui.compose.plugins import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.combinedClickable @@ -31,10 +31,10 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import com.itsaky.androidide.R -import com.itsaky.androidide.plugins.PluginInfo -import com.itsaky.androidide.templates.manager.models.versionLabel -import com.itsaky.androidide.ui.compose.common.FileImage -import com.itsaky.androidide.utils.isSystemInDarkMode +import org.appdevforall.codeonthego.plugins.PluginInfo +import org.appdevforall.codeonthego.templates.manager.models.versionLabel +import org.appdevforall.codeonthego.ui.compose.common.FileImage +import org.appdevforall.codeonthego.utils.isSystemInDarkMode import java.io.File @OptIn(ExperimentalFoundationApi::class) diff --git a/app/src/main/java/com/itsaky/androidide/ui/compose/plugins/PluginManagerContent.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/plugins/PluginManagerContent.kt similarity index 89% rename from app/src/main/java/com/itsaky/androidide/ui/compose/plugins/PluginManagerContent.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/compose/plugins/PluginManagerContent.kt index 9c5c9793a4..6432c96be2 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/compose/plugins/PluginManagerContent.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/plugins/PluginManagerContent.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui.compose.plugins +package org.appdevforall.codeonthego.ui.compose.plugins import android.content.ActivityNotFoundException import android.content.ClipData @@ -39,31 +39,31 @@ import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.repeatOnLifecycle import com.itsaky.androidide.R -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.plugins.PluginMetadata -import com.itsaky.androidide.ui.models.PluginInstallSource -import com.itsaky.androidide.ui.models.PluginManagerUiEffect -import com.itsaky.androidide.ui.models.PluginManagerUiEvent -import com.itsaky.androidide.utils.DURATION_INDEFINITE -import com.itsaky.androidide.utils.DialogUtils -import com.itsaky.androidide.utils.errorIcon -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashSuccess -import com.itsaky.androidide.utils.flashbarBuilder -import com.itsaky.androidide.utils.showOnUiThread -import com.itsaky.androidide.viewmodels.PluginManagerViewModel +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.plugins.PluginMetadata +import org.appdevforall.codeonthego.ui.models.PluginInstallSource +import org.appdevforall.codeonthego.ui.models.PluginManagerUiEffect +import org.appdevforall.codeonthego.ui.models.PluginManagerUiEvent +import org.appdevforall.codeonthego.utils.DURATION_INDEFINITE +import org.appdevforall.codeonthego.utils.DialogUtils +import org.appdevforall.codeonthego.utils.errorIcon +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashSuccess +import org.appdevforall.codeonthego.utils.flashbarBuilder +import org.appdevforall.codeonthego.utils.showOnUiThread +import org.appdevforall.codeonthego.viewmodels.PluginManagerViewModel import kotlinx.parcelize.Parcelize import org.slf4j.LoggerFactory private val log = LoggerFactory.getLogger("PluginManagerContent") /** - * Keyed on the plugin's id rather than holding a [com.itsaky.androidide.plugins.PluginInfo] + * Keyed on the plugin's id rather than holding a [org.appdevforall.codeonthego.plugins.PluginInfo] * directly: `PluginInfo` isn't Parcelable, so an id is what makes this `rememberSaveable`-able * across rotation/tab-switch (`HorizontalPager` disposes the off-screen page's state) without * changing `plugin-api`'s public API surface. Resolved back to the live `PluginInfo` from - * [com.itsaky.androidide.ui.models.PluginManagerUiState.plugins] at the point of use; an id with + * [org.appdevforall.codeonthego.ui.models.PluginManagerUiState.plugins] at the point of use; an id with * no match (e.g. the plugin was uninstalled elsewhere) is treated as "nothing to show" rather than * rendered with stale data. [PluginMetadata] (already Parcelable) is kept inline for * [OverwriteConfirm.incomingMetadata], which describes a plugin not yet installed and so has no id @@ -101,7 +101,7 @@ private sealed interface PluginManagerDialogState : Parcelable { * Plugins tab content (ADR 0009). Preserves every capability of the original * `PluginManagerActivity`/`activity_plugin_manager.xml` screen: install (via SAF picker; * the launcher lives here, the FAB that triggers it lives in - * [com.itsaky.androidide.ui.compose.ManagerScreen], which owns the shared Scaffold)/ + * [org.appdevforall.codeonthego.ui.compose.ManagerScreen], which owns the shared Scaffold)/ * enable/disable/uninstall, overwrite/signature-mismatch conflict handling, restart prompt. * * Content-only (no Scaffold/TopAppBar/FAB): composed as one tab's body inside the shared manager diff --git a/app/src/main/java/com/itsaky/androidide/ui/compose/plugins/PluginManagerDialogs.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/plugins/PluginManagerDialogs.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/ui/compose/plugins/PluginManagerDialogs.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/compose/plugins/PluginManagerDialogs.kt index 1e30b95006..292b80d60d 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/compose/plugins/PluginManagerDialogs.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/plugins/PluginManagerDialogs.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui.compose.plugins +package org.appdevforall.codeonthego.ui.compose.plugins import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -19,8 +19,8 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import com.itsaky.androidide.R -import com.itsaky.androidide.plugins.PluginInfo -import com.itsaky.androidide.plugins.PluginMetadata +import org.appdevforall.codeonthego.plugins.PluginInfo +import org.appdevforall.codeonthego.plugins.PluginMetadata @Composable fun InstallConfirmationDialog( diff --git a/app/src/main/java/com/itsaky/androidide/ui/compose/templates/TemplateListItem.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/templates/TemplateListItem.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/ui/compose/templates/TemplateListItem.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/compose/templates/TemplateListItem.kt index ba9346c603..f718d69a8f 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/compose/templates/TemplateListItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/templates/TemplateListItem.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui.compose.templates +package org.appdevforall.codeonthego.ui.compose.templates import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.clickable @@ -30,12 +30,12 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import com.itsaky.androidide.R -import com.itsaky.androidide.templates.manager.models.CgtFileItem -import com.itsaky.androidide.templates.manager.models.TemplateProvenance -import com.itsaky.androidide.templates.manager.models.displayName -import com.itsaky.androidide.templates.manager.models.hasMultipleTemplates -import com.itsaky.androidide.templates.manager.models.primaryTemplate -import com.itsaky.androidide.templates.manager.models.versionLabel +import org.appdevforall.codeonthego.templates.manager.models.CgtFileItem +import org.appdevforall.codeonthego.templates.manager.models.TemplateProvenance +import org.appdevforall.codeonthego.templates.manager.models.displayName +import org.appdevforall.codeonthego.templates.manager.models.hasMultipleTemplates +import org.appdevforall.codeonthego.templates.manager.models.primaryTemplate +import org.appdevforall.codeonthego.templates.manager.models.versionLabel /** * Card for a single `.cgt` file. Matches the reference plugin's card: tapping the card only diff --git a/app/src/main/java/com/itsaky/androidide/ui/compose/templates/TemplateManagerDialogs.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/templates/TemplateManagerDialogs.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/ui/compose/templates/TemplateManagerDialogs.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/compose/templates/TemplateManagerDialogs.kt index dcdb2f54e3..b27794673f 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/compose/templates/TemplateManagerDialogs.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/templates/TemplateManagerDialogs.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui.compose.templates +package org.appdevforall.codeonthego.ui.compose.templates import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Column @@ -19,11 +19,11 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.itsaky.androidide.R -import com.itsaky.androidide.templates.manager.models.CgtFileItem -import com.itsaky.androidide.templates.manager.models.TemplateMetadata -import com.itsaky.androidide.templates.manager.models.displayName -import com.itsaky.androidide.templates.manager.models.primaryTemplate -import com.itsaky.androidide.templates.manager.models.versionLabel +import org.appdevforall.codeonthego.templates.manager.models.CgtFileItem +import org.appdevforall.codeonthego.templates.manager.models.TemplateMetadata +import org.appdevforall.codeonthego.templates.manager.models.displayName +import org.appdevforall.codeonthego.templates.manager.models.primaryTemplate +import org.appdevforall.codeonthego.templates.manager.models.versionLabel @Composable fun DeleteTemplateConfirmationDialog( diff --git a/app/src/main/java/com/itsaky/androidide/ui/compose/templates/TemplateManagerScreen.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/templates/TemplateManagerScreen.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/ui/compose/templates/TemplateManagerScreen.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/compose/templates/TemplateManagerScreen.kt index 4e6da44a51..2eeb531ae5 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/compose/templates/TemplateManagerScreen.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/templates/TemplateManagerScreen.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui.compose.templates +package org.appdevforall.codeonthego.ui.compose.templates import android.content.ClipData import android.content.ClipboardManager @@ -36,17 +36,17 @@ import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.repeatOnLifecycle import com.itsaky.androidide.R -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.templates.manager.models.CgtFileItem -import com.itsaky.androidide.ui.models.TemplateManagerUiEffect -import com.itsaky.androidide.ui.models.TemplateManagerUiEvent -import com.itsaky.androidide.utils.DURATION_INDEFINITE -import com.itsaky.androidide.utils.errorIcon -import com.itsaky.androidide.utils.flashSuccess -import com.itsaky.androidide.utils.flashbarBuilder -import com.itsaky.androidide.utils.showOnUiThread -import com.itsaky.androidide.viewmodels.TemplateManagerViewModel +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.templates.manager.models.CgtFileItem +import org.appdevforall.codeonthego.ui.models.TemplateManagerUiEffect +import org.appdevforall.codeonthego.ui.models.TemplateManagerUiEvent +import org.appdevforall.codeonthego.utils.DURATION_INDEFINITE +import org.appdevforall.codeonthego.utils.errorIcon +import org.appdevforall.codeonthego.utils.flashSuccess +import org.appdevforall.codeonthego.utils.flashbarBuilder +import org.appdevforall.codeonthego.utils.showOnUiThread +import org.appdevforall.codeonthego.viewmodels.TemplateManagerViewModel import kotlinx.parcelize.Parcelize /** @@ -54,7 +54,7 @@ import kotlinx.parcelize.Parcelize * item carries a plain `java.io.File`, which isn't Parcelable, so a path is what makes this * `rememberSaveable`-able across rotation/tab-switch (`HorizontalPager` disposes the off-screen * page's state) without teaching the whole CgtFileItem/TemplateMetadata chain to be Parcelable. - * Resolved back to the live [CgtFileItem] from [TemplateManagerUiState.items][com.itsaky.androidide.ui.models.TemplateManagerUiState] + * Resolved back to the live [CgtFileItem] from [TemplateManagerUiState.items][org.appdevforall.codeonthego.ui.models.TemplateManagerUiState] * at the point of use; a path with no match (e.g. process death mid-scan, or the file was since * removed) is treated as "nothing to show" rather than rendered with stale data. */ diff --git a/app/src/main/java/com/itsaky/androidide/ui/compose/theme/ManagerTheme.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/theme/ManagerTheme.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/ui/compose/theme/ManagerTheme.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/compose/theme/ManagerTheme.kt index e5b5ae8c27..b6d5e679b6 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/compose/theme/ManagerTheme.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/compose/theme/ManagerTheme.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui.compose.theme +package org.appdevforall.codeonthego.ui.compose.theme import android.content.Context import androidx.compose.foundation.isSystemInDarkTheme diff --git a/app/src/main/java/com/itsaky/androidide/ui/models/ExternalFileInstallUiModels.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/models/ExternalFileInstallUiModels.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/ui/models/ExternalFileInstallUiModels.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/models/ExternalFileInstallUiModels.kt index b319b686a9..aae18bb686 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/models/ExternalFileInstallUiModels.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/models/ExternalFileInstallUiModels.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.ui.models +package org.appdevforall.codeonthego.ui.models import androidx.annotation.StringRes -import com.itsaky.androidide.repositories.TemplateCollectionRepository +import org.appdevforall.codeonthego.repositories.TemplateCollectionRepository import java.io.File sealed class ExternalFileInstallUiEvent { diff --git a/app/src/main/java/com/itsaky/androidide/ui/models/OutlineUiState.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/models/OutlineUiState.kt similarity index 79% rename from app/src/main/java/com/itsaky/androidide/ui/models/OutlineUiState.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/models/OutlineUiState.kt index b08f2961d3..60ad740777 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/models/OutlineUiState.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/models/OutlineUiState.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.ui.models +package org.appdevforall.codeonthego.ui.models -import com.itsaky.androidide.editor.language.outline.OutlineSymbol -import com.itsaky.androidide.models.Position +import org.appdevforall.codeonthego.editor.language.outline.OutlineSymbol +import org.appdevforall.codeonthego.models.Position sealed interface OutlineUiState { data object NoFileOpen : OutlineUiState diff --git a/app/src/main/java/com/itsaky/androidide/ui/models/PluginManagerUiState.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/models/PluginManagerUiState.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/ui/models/PluginManagerUiState.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/models/PluginManagerUiState.kt index e7eae77bc8..a30eaec883 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/models/PluginManagerUiState.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/models/PluginManagerUiState.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.ui.models +package org.appdevforall.codeonthego.ui.models import android.net.Uri import android.os.Parcelable import androidx.annotation.StringRes -import com.itsaky.androidide.plugins.PluginInfo -import com.itsaky.androidide.plugins.PluginMetadata +import org.appdevforall.codeonthego.plugins.PluginInfo +import org.appdevforall.codeonthego.plugins.PluginMetadata import kotlinx.parcelize.Parcelize import java.io.File @@ -24,7 +24,7 @@ data class PluginManagerUiState( /** * Where a plugin archive to install comes from - either a `content://` [Uri] the user picked via * SAF (any provider, including third-party ones), or a plain [File] this process already owns - * (the forwarded-`.cgp` case from [com.itsaky.androidide.activities.ExternalFileInstallActivity], + * (the forwarded-`.cgp` case from [org.appdevforall.codeonthego.activities.ExternalFileInstallActivity], * which needs no [android.content.ContentResolver] round-trip since it's already a private file). * * [Parcelable] so the Compose install-confirmation dialog can hold one in `rememberSaveable` and @@ -103,7 +103,7 @@ sealed class PluginManagerUiEffect { /** * Carries a [PluginInstallSource], not a bare [Uri], so both entry points share one dialog: * the SAF pick (a [PluginInstallSource.ContentUri]) and a `.cgp` forwarded from - * [com.itsaky.androidide.activities.ExternalFileInstallActivity] (a + * [org.appdevforall.codeonthego.activities.ExternalFileInstallActivity] (a * [PluginInstallSource.LocalFile]). */ data class ShowInstallConfirmation( diff --git a/app/src/main/java/com/itsaky/androidide/ui/models/TemplateManagerUiState.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/models/TemplateManagerUiState.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/ui/models/TemplateManagerUiState.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/models/TemplateManagerUiState.kt index b47f16115e..77558d2abc 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/models/TemplateManagerUiState.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/models/TemplateManagerUiState.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.ui.models +package org.appdevforall.codeonthego.ui.models import androidx.annotation.StringRes -import com.itsaky.androidide.templates.manager.models.CgtFileItem +import org.appdevforall.codeonthego.templates.manager.models.CgtFileItem data class TemplateManagerUiState( val isLoading: Boolean = false, diff --git a/app/src/main/java/com/itsaky/androidide/ui/outline/OutlinePanel.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/outline/OutlinePanel.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/ui/outline/OutlinePanel.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/outline/OutlinePanel.kt index d9d3bc3c08..5e56f36216 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/outline/OutlinePanel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/outline/OutlinePanel.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui.outline +package org.appdevforall.codeonthego.ui.outline import androidx.annotation.StringRes import androidx.compose.foundation.clickable @@ -40,10 +40,10 @@ import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.itsaky.androidide.R -import com.itsaky.androidide.editor.language.outline.OutlineSymbolKind -import com.itsaky.androidide.ui.models.OutlineUiEvent -import com.itsaky.androidide.ui.models.OutlineUiState -import com.itsaky.androidide.viewmodel.OutlineViewModel +import org.appdevforall.codeonthego.editor.language.outline.OutlineSymbolKind +import org.appdevforall.codeonthego.ui.models.OutlineUiEvent +import org.appdevforall.codeonthego.ui.models.OutlineUiState +import org.appdevforall.codeonthego.viewmodel.OutlineViewModel private const val MAX_INDENT_DEPTH = 6 private val INDENT_STEP = 14.dp diff --git a/app/src/main/java/com/itsaky/androidide/ui/outline/OutlineRows.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/outline/OutlineRows.kt similarity index 88% rename from app/src/main/java/com/itsaky/androidide/ui/outline/OutlineRows.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/outline/OutlineRows.kt index 1e8e116d63..9176a3b5a0 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/outline/OutlineRows.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/outline/OutlineRows.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.ui.outline +package org.appdevforall.codeonthego.ui.outline -import com.itsaky.androidide.editor.language.outline.OutlineSymbol +import org.appdevforall.codeonthego.editor.language.outline.OutlineSymbol internal data class OutlineRowModel( val symbol: OutlineSymbol, diff --git a/app/src/main/java/com/itsaky/androidide/ui/themes/ThemeManager.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/themes/ThemeManager.kt similarity index 89% rename from app/src/main/java/com/itsaky/androidide/ui/themes/ThemeManager.kt rename to app/src/main/java/org/appdevforall/codeonthego/ui/themes/ThemeManager.kt index c8be8b69c8..e66a4ddd35 100644 --- a/app/src/main/java/com/itsaky/androidide/ui/themes/ThemeManager.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/themes/ThemeManager.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.ui.themes +package org.appdevforall.codeonthego.ui.themes import android.app.Activity import androidx.appcompat.app.AppCompatDelegate import com.google.auto.service.AutoService -import com.itsaky.androidide.preferences.internal.GeneralPreferences -import com.itsaky.androidide.utils.isSystemInDarkMode +import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences +import org.appdevforall.codeonthego.utils.isSystemInDarkMode /** * Theme manager for AndroidIDE. diff --git a/app/src/main/java/com/itsaky/androidide/ui/transition/ArcMotionPlus.java b/app/src/main/java/org/appdevforall/codeonthego/ui/transition/ArcMotionPlus.java similarity index 98% rename from app/src/main/java/com/itsaky/androidide/ui/transition/ArcMotionPlus.java rename to app/src/main/java/org/appdevforall/codeonthego/ui/transition/ArcMotionPlus.java index c10a570ca7..e30adf9f1d 100755 --- a/app/src/main/java/com/itsaky/androidide/ui/transition/ArcMotionPlus.java +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/transition/ArcMotionPlus.java @@ -15,7 +15,7 @@ * */ -package com.itsaky.androidide.ui.transition; +package org.appdevforall.codeonthego.ui.transition; /** * A PathMotion that generates a curved path along an arc on an imaginary circle containing the two diff --git a/app/src/main/java/com/itsaky/androidide/ui/transition/CubicBezierArc.java b/app/src/main/java/org/appdevforall/codeonthego/ui/transition/CubicBezierArc.java similarity index 99% rename from app/src/main/java/com/itsaky/androidide/ui/transition/CubicBezierArc.java rename to app/src/main/java/org/appdevforall/codeonthego/ui/transition/CubicBezierArc.java index b89856be58..b55d512ab3 100755 --- a/app/src/main/java/com/itsaky/androidide/ui/transition/CubicBezierArc.java +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/transition/CubicBezierArc.java @@ -15,7 +15,7 @@ * */ -package com.itsaky.androidide.ui.transition; +package org.appdevforall.codeonthego.ui.transition; /** * A Class that takes an angle, start point and end point that it uses to calculate controls points diff --git a/app/src/main/java/com/itsaky/androidide/ui/transition/ProgressTransition.java b/app/src/main/java/org/appdevforall/codeonthego/ui/transition/ProgressTransition.java similarity index 96% rename from app/src/main/java/com/itsaky/androidide/ui/transition/ProgressTransition.java rename to app/src/main/java/org/appdevforall/codeonthego/ui/transition/ProgressTransition.java index 37219b89eb..294e648678 100755 --- a/app/src/main/java/com/itsaky/androidide/ui/transition/ProgressTransition.java +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/transition/ProgressTransition.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . * **************************************************************************************/ -package com.itsaky.androidide.ui.transition; +package org.appdevforall.codeonthego.ui.transition; import android.animation.Animator; import android.animation.ObjectAnimator; @@ -24,7 +24,7 @@ import android.widget.ProgressBar; import androidx.transition.Transition; import androidx.transition.TransitionValues; -import com.itsaky.androidide.utils.IntProperty; +import org.appdevforall.codeonthego.utils.IntProperty; public class ProgressTransition extends Transition { diff --git a/app/src/main/java/com/itsaky/androidide/utils/ActionMenuUtils.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/ActionMenuUtils.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/utils/ActionMenuUtils.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/ActionMenuUtils.kt index 5a03d39e6c..250b516f14 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/ActionMenuUtils.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/ActionMenuUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import android.graphics.Rect @@ -25,15 +25,15 @@ import android.view.View.OnLongClickListener import android.widget.FrameLayout.LayoutParams import android.widget.LinearLayout import android.widget.PopupWindow -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.ActionsRegistry -import com.itsaky.androidide.actions.internal.DefaultActionsRegistry +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionsRegistry +import org.appdevforall.codeonthego.actions.internal.DefaultActionsRegistry import com.itsaky.androidide.databinding.FileActionPopupWindowBinding import com.itsaky.androidide.databinding.FileActionPopupWindowItemBinding -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.plugins.extensions.FileTabMenuItem +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.plugins.extensions.FileTabMenuItem object ActionMenuUtils { fun showPopupWindow( diff --git a/app/src/main/java/com/itsaky/androidide/utils/ApkInstaller.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/ApkInstaller.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/utils/ApkInstaller.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/ApkInstaller.kt index 97f7466740..b5b338237a 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/ApkInstaller.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/ApkInstaller.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.app.PendingIntent import android.content.Context @@ -8,9 +8,9 @@ import android.content.pm.PackageInstaller import android.content.pm.PackageManager import android.os.Process import androidx.core.app.PendingIntentCompat -import com.itsaky.androidide.actions.build.DebugAction +import org.appdevforall.codeonthego.actions.build.DebugAction import com.itsaky.androidide.buildinfo.BuildInfo -import com.itsaky.androidide.services.InstallationResultReceiver +import org.appdevforall.codeonthego.services.InstallationResultReceiver import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.slf4j.LoggerFactory diff --git a/app/src/main/java/com/itsaky/androidide/utils/BuildCancellation.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/BuildCancellation.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/utils/BuildCancellation.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/BuildCancellation.kt index af0b83cb2c..10cdb8b232 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/BuildCancellation.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/BuildCancellation.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils -import com.itsaky.androidide.projects.builder.BuildService +import org.appdevforall.codeonthego.projects.builder.BuildService import com.itsaky.androidide.resources.R import org.slf4j.LoggerFactory @@ -34,7 +34,7 @@ private val log = LoggerFactory.getLogger("BuildCancellation") * two call sites written separately are how they came to disagree. * * Success is deliberately silent: the build stopping is its own feedback, and - * [com.itsaky.androidide.handlers.EditorBuildEventListener.onBuildFailed] reports the outcome the + * [org.appdevforall.codeonthego.handlers.EditorBuildEventListener.onBuildFailed] reports the outcome the * server actually reached. */ fun requestBuildCancellation(service: BuildService) { diff --git a/app/src/main/java/com/itsaky/androidide/utils/BuildInfoUtils.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/BuildInfoUtils.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/utils/BuildInfoUtils.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/BuildInfoUtils.kt index ff4a70ab71..f2e8f78097 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/BuildInfoUtils.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/BuildInfoUtils.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import android.os.Build import com.itsaky.androidide.BuildConfig -import com.itsaky.androidide.app.IDEApplication -import com.itsaky.androidide.app.configuration.IDEBuildConfigProvider +import org.appdevforall.codeonthego.app.IDEApplication +import org.appdevforall.codeonthego.app.configuration.IDEBuildConfigProvider import com.itsaky.androidide.buildinfo.BuildInfo import com.termux.shared.android.PackageUtils import com.termux.shared.termux.TermuxConstants diff --git a/app/src/main/java/com/itsaky/androidide/utils/ClassBuilder.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/ClassBuilder.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/utils/ClassBuilder.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/ClassBuilder.kt index bf569dc5a5..7825475aec 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/ClassBuilder.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/ClassBuilder.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.app.Activity import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import com.itsaky.androidide.preferences.utils.indentationString -import com.itsaky.androidide.utils.ClassBuilder.SourceLanguage.JAVA -import com.itsaky.androidide.utils.ClassBuilder.SourceLanguage.KOTLIN +import org.appdevforall.codeonthego.preferences.utils.indentationString +import org.appdevforall.codeonthego.utils.ClassBuilder.SourceLanguage.JAVA +import org.appdevforall.codeonthego.utils.ClassBuilder.SourceLanguage.KOTLIN import com.squareup.javapoet.JavaFile import com.squareup.javapoet.MethodSpec import com.squareup.javapoet.TypeSpec diff --git a/app/src/main/java/com/itsaky/androidide/utils/DeepLinkProjectResolution.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/DeepLinkProjectResolution.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/utils/DeepLinkProjectResolution.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/DeepLinkProjectResolution.kt index c4cae1661f..8b8a405f87 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/DeepLinkProjectResolution.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/DeepLinkProjectResolution.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.app.Activity import com.itsaky.androidide.resources.R.string diff --git a/app/src/main/java/com/itsaky/androidide/utils/DevicePowerSource.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/DevicePowerSource.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/utils/DevicePowerSource.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/DevicePowerSource.kt index 872c1e2b63..b7dd557052 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/DevicePowerSource.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/DevicePowerSource.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.BroadcastReceiver import android.content.Context @@ -26,10 +26,10 @@ import android.os.Build import android.os.PowerManager import androidx.annotation.VisibleForTesting import androidx.core.content.getSystemService -import com.itsaky.androidide.services.builder.ThermalInfo -import com.itsaky.androidide.services.builder.ThermalState -import com.itsaky.androidide.utils.PowerUsageWatcher.BatteryState -import com.itsaky.androidide.utils.PowerUsageWatcher.PowerReading +import org.appdevforall.codeonthego.services.builder.ThermalInfo +import org.appdevforall.codeonthego.services.builder.ThermalState +import org.appdevforall.codeonthego.utils.PowerUsageWatcher.BatteryState +import org.appdevforall.codeonthego.utils.PowerUsageWatcher.PowerReading import org.slf4j.LoggerFactory import kotlin.math.abs diff --git a/app/src/main/java/com/itsaky/androidide/utils/DiagnosticsFormatter.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/DiagnosticsFormatter.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/utils/DiagnosticsFormatter.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/DiagnosticsFormatter.kt index c13e1b1d17..0cfd9ed77e 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/DiagnosticsFormatter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/DiagnosticsFormatter.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils -import com.itsaky.androidide.lsp.models.DiagnosticItem -import com.itsaky.androidide.lsp.models.DiagnosticSeverity +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem +import org.appdevforall.codeonthego.lsp.models.DiagnosticSeverity import java.io.File import java.text.SimpleDateFormat import java.util.Date diff --git a/app/src/main/java/com/itsaky/androidide/utils/DropHighlighter.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/DropHighlighter.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/utils/DropHighlighter.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/DropHighlighter.kt index 1834e8cf10..e1e00ec7eb 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/DropHighlighter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/DropHighlighter.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import android.graphics.drawable.Drawable diff --git a/app/src/main/java/com/itsaky/androidide/utils/EditorActivityActions.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/EditorActivityActions.kt similarity index 69% rename from app/src/main/java/com/itsaky/androidide/utils/EditorActivityActions.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/EditorActivityActions.kt index 7bee677e97..8bd3f0095d 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/EditorActivityActions.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/EditorActivityActions.kt @@ -14,56 +14,56 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import android.util.Log -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.ActionItem.Location.EDITOR_FILE_TABS -import com.itsaky.androidide.actions.ActionItem.Location.EDITOR_FILE_TREE -import com.itsaky.androidide.actions.ActionItem.Location.EDITOR_TOOLBAR -import com.itsaky.androidide.actions.ActionsRegistry -import com.itsaky.androidide.actions.PluginActionItem -import com.itsaky.androidide.actions.PluginToolbarActionItem -import com.itsaky.androidide.actions.build.DebugAction -import com.itsaky.androidide.actions.build.PluginBuildActionItem -import com.itsaky.androidide.actions.build.ProjectSyncAction -import com.itsaky.androidide.actions.build.QuickBuildAction -import com.itsaky.androidide.actions.build.QuickRunAction -import com.itsaky.androidide.actions.build.RunTasksAction -import com.itsaky.androidide.actions.editor.CopyAction -import com.itsaky.androidide.actions.editor.CutAction -import com.itsaky.androidide.actions.editor.ExpandSelectionAction -import com.itsaky.androidide.actions.editor.LongSelectAction -import com.itsaky.androidide.actions.editor.PasteAction -import com.itsaky.androidide.actions.editor.SelectAllAction -import com.itsaky.androidide.actions.etc.DisconnectLogSendersAction -import com.itsaky.androidide.actions.etc.FindAction -import com.itsaky.androidide.actions.etc.FindInFileAction -import com.itsaky.androidide.actions.etc.FindInProjectAction -import com.itsaky.androidide.actions.etc.LaunchAppAction -import com.itsaky.androidide.actions.etc.ReplaceInProjectAction -import com.itsaky.androidide.actions.file.CloseAllFilesAction -import com.itsaky.androidide.actions.file.CloseFileAction -import com.itsaky.androidide.actions.file.CloseOtherFilesAction -import com.itsaky.androidide.actions.file.CreateLinkAction -import com.itsaky.androidide.actions.file.FormatCodeAction -import com.itsaky.androidide.actions.file.InstallFileAction -import com.itsaky.androidide.actions.file.SaveFileAction -import com.itsaky.androidide.actions.file.ShowTooltipAction -import com.itsaky.androidide.actions.filetree.CopyPathAction -import com.itsaky.androidide.actions.filetree.DeleteAction -import com.itsaky.androidide.actions.filetree.HelpAction -import com.itsaky.androidide.actions.filetree.NewFileAction -import com.itsaky.androidide.actions.filetree.NewFolderAction -import com.itsaky.androidide.actions.filetree.OpenWithAction -import com.itsaky.androidide.actions.filetree.RenameAction -import com.itsaky.androidide.actions.profiler.ProfilerAction -import com.itsaky.androidide.actions.text.RedoAction -import com.itsaky.androidide.actions.text.UndoAction -import com.itsaky.androidide.plugins.extensions.UIExtension -import com.itsaky.androidide.plugins.manager.build.PluginBuildActionManager -import com.itsaky.androidide.plugins.manager.core.PluginManager +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionItem.Location.EDITOR_FILE_TABS +import org.appdevforall.codeonthego.actions.ActionItem.Location.EDITOR_FILE_TREE +import org.appdevforall.codeonthego.actions.ActionItem.Location.EDITOR_TOOLBAR +import org.appdevforall.codeonthego.actions.ActionsRegistry +import org.appdevforall.codeonthego.actions.PluginActionItem +import org.appdevforall.codeonthego.actions.PluginToolbarActionItem +import org.appdevforall.codeonthego.actions.build.DebugAction +import org.appdevforall.codeonthego.actions.build.PluginBuildActionItem +import org.appdevforall.codeonthego.actions.build.ProjectSyncAction +import org.appdevforall.codeonthego.actions.build.QuickBuildAction +import org.appdevforall.codeonthego.actions.build.QuickRunAction +import org.appdevforall.codeonthego.actions.build.RunTasksAction +import org.appdevforall.codeonthego.actions.editor.CopyAction +import org.appdevforall.codeonthego.actions.editor.CutAction +import org.appdevforall.codeonthego.actions.editor.ExpandSelectionAction +import org.appdevforall.codeonthego.actions.editor.LongSelectAction +import org.appdevforall.codeonthego.actions.editor.PasteAction +import org.appdevforall.codeonthego.actions.editor.SelectAllAction +import org.appdevforall.codeonthego.actions.etc.DisconnectLogSendersAction +import org.appdevforall.codeonthego.actions.etc.FindAction +import org.appdevforall.codeonthego.actions.etc.FindInFileAction +import org.appdevforall.codeonthego.actions.etc.FindInProjectAction +import org.appdevforall.codeonthego.actions.etc.LaunchAppAction +import org.appdevforall.codeonthego.actions.etc.ReplaceInProjectAction +import org.appdevforall.codeonthego.actions.file.CloseAllFilesAction +import org.appdevforall.codeonthego.actions.file.CloseFileAction +import org.appdevforall.codeonthego.actions.file.CloseOtherFilesAction +import org.appdevforall.codeonthego.actions.file.CreateLinkAction +import org.appdevforall.codeonthego.actions.file.FormatCodeAction +import org.appdevforall.codeonthego.actions.file.InstallFileAction +import org.appdevforall.codeonthego.actions.file.SaveFileAction +import org.appdevforall.codeonthego.actions.file.ShowTooltipAction +import org.appdevforall.codeonthego.actions.filetree.CopyPathAction +import org.appdevforall.codeonthego.actions.filetree.DeleteAction +import org.appdevforall.codeonthego.actions.filetree.HelpAction +import org.appdevforall.codeonthego.actions.filetree.NewFileAction +import org.appdevforall.codeonthego.actions.filetree.NewFolderAction +import org.appdevforall.codeonthego.actions.filetree.OpenWithAction +import org.appdevforall.codeonthego.actions.filetree.RenameAction +import org.appdevforall.codeonthego.actions.profiler.ProfilerAction +import org.appdevforall.codeonthego.actions.text.RedoAction +import org.appdevforall.codeonthego.actions.text.UndoAction +import org.appdevforall.codeonthego.plugins.extensions.UIExtension +import org.appdevforall.codeonthego.plugins.manager.build.PluginBuildActionManager +import org.appdevforall.codeonthego.plugins.manager.core.PluginManager /** * Takes care of registering actions to the actions registry for the editor activity. @@ -200,7 +200,7 @@ class EditorActivityActions { .forEach { plugin -> try { Log.d("plugin_debug", "Registering menu items for plugin: ${plugin.javaClass.simpleName}") - val pluginId = pluginManager.getPluginIdForInstance(plugin as com.itsaky.androidide.plugins.IPlugin) ?: "" + val pluginId = pluginManager.getPluginIdForInstance(plugin as org.appdevforall.codeonthego.plugins.IPlugin) ?: "" plugin.getMainMenuItems().forEach { menuItem -> val action = PluginActionItem(context, menuItem, order++, pluginId) registry.registerAction(action) diff --git a/app/src/main/java/com/itsaky/androidide/utils/EditorDecorationBridge.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/EditorDecorationBridge.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/utils/EditorDecorationBridge.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/EditorDecorationBridge.kt index 7e305e2045..835e419200 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/EditorDecorationBridge.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/EditorDecorationBridge.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.ComponentCallbacks import android.content.res.Configuration import androidx.appcompat.app.AppCompatDelegate -import com.itsaky.androidide.app.BaseApplication -import com.itsaky.androidide.eventbus.events.editor.ColorSchemeInvalidatedEvent -import com.itsaky.androidide.plugins.manager.core.PluginManager -import com.itsaky.androidide.syntax.decoration.EditorDecorationRegistry +import org.appdevforall.codeonthego.app.BaseApplication +import org.appdevforall.codeonthego.eventbus.events.editor.ColorSchemeInvalidatedEvent +import org.appdevforall.codeonthego.plugins.manager.core.PluginManager +import org.appdevforall.codeonthego.syntax.decoration.EditorDecorationRegistry import org.greenrobot.eventbus.EventBus import org.slf4j.LoggerFactory import java.util.concurrent.atomic.AtomicBoolean diff --git a/app/src/main/java/com/itsaky/androidide/utils/EditorRightSidebarActions.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/EditorRightSidebarActions.kt similarity index 100% rename from app/src/main/java/com/itsaky/androidide/utils/EditorRightSidebarActions.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/EditorRightSidebarActions.kt diff --git a/app/src/main/java/com/itsaky/androidide/utils/EditorSidebarActions.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/EditorSidebarActions.kt similarity index 85% rename from app/src/main/java/com/itsaky/androidide/utils/EditorSidebarActions.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/EditorSidebarActions.kt index 0d68cc12f8..70a725185e 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/EditorSidebarActions.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/EditorSidebarActions.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import android.os.Bundle @@ -35,31 +35,31 @@ import androidx.navigation.navOptions import com.google.android.material.shape.CornerFamily import com.google.android.material.shape.MaterialShapeDrawable import com.google.android.material.shape.ShapeAppearanceModel -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.ActionsRegistry -import com.itsaky.androidide.actions.FillMenuParams -import com.itsaky.androidide.actions.PluginSidebarActionItem -import com.itsaky.androidide.actions.SidebarActionItem -import com.itsaky.androidide.actions.SidebarSlotManager -import com.itsaky.androidide.actions.internal.DefaultActionsRegistry -import com.itsaky.androidide.actions.sidebar.BuildVariantsSidebarAction -import com.itsaky.androidide.actions.sidebar.CloseProjectSidebarAction -import com.itsaky.androidide.actions.sidebar.FileTreeSidebarAction -import com.itsaky.androidide.actions.sidebar.HelpSideBarAction -import com.itsaky.androidide.actions.sidebar.OutlineSidebarAction -import com.itsaky.androidide.actions.sidebar.PreferencesSidebarAction -import com.itsaky.androidide.actions.sidebar.TerminalSidebarAction -import com.itsaky.androidide.eventbus.events.plugin.PluginCrashedEvent -import com.itsaky.androidide.fragments.sidebar.EditorSidebarFragment -import com.itsaky.androidide.plugins.extensions.UIExtension -import com.itsaky.androidide.plugins.manager.core.PluginManager +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionsRegistry +import org.appdevforall.codeonthego.actions.FillMenuParams +import org.appdevforall.codeonthego.actions.PluginSidebarActionItem +import org.appdevforall.codeonthego.actions.SidebarActionItem +import org.appdevforall.codeonthego.actions.SidebarSlotManager +import org.appdevforall.codeonthego.actions.internal.DefaultActionsRegistry +import org.appdevforall.codeonthego.actions.sidebar.BuildVariantsSidebarAction +import org.appdevforall.codeonthego.actions.sidebar.CloseProjectSidebarAction +import org.appdevforall.codeonthego.actions.sidebar.FileTreeSidebarAction +import org.appdevforall.codeonthego.actions.sidebar.HelpSideBarAction +import org.appdevforall.codeonthego.actions.sidebar.OutlineSidebarAction +import org.appdevforall.codeonthego.actions.sidebar.PreferencesSidebarAction +import org.appdevforall.codeonthego.actions.sidebar.TerminalSidebarAction +import org.appdevforall.codeonthego.eventbus.events.plugin.PluginCrashedEvent +import org.appdevforall.codeonthego.fragments.sidebar.EditorSidebarFragment +import org.appdevforall.codeonthego.plugins.extensions.UIExtension +import org.appdevforall.codeonthego.plugins.manager.core.PluginManager import org.greenrobot.eventbus.EventBus import java.lang.ref.WeakReference /** * Sets up the actions that are shown in the - * [EditorActivityKt][com.itsaky.androidide.activities.editor.EditorActivityKt]'s drawer's sidebar. + * [EditorActivityKt][org.appdevforall.codeonthego.activities.editor.EditorActivityKt]'s drawer's sidebar. * * @author Akash Yadav */ @@ -266,7 +266,7 @@ internal object EditorSidebarActions { .filterIsInstance() .forEach { plugin -> val pluginId = - pluginManager.getPluginIdForInstance(plugin as com.itsaky.androidide.plugins.IPlugin) + pluginManager.getPluginIdForInstance(plugin as org.appdevforall.codeonthego.plugins.IPlugin) ?: return@forEach try { diff --git a/app/src/main/java/com/itsaky/androidide/utils/FileDeleteUtils.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/FileDeleteUtils.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/utils/FileDeleteUtils.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/FileDeleteUtils.kt index 87c3832716..aaa38f3a9c 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/FileDeleteUtils.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/FileDeleteUtils.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.util.Log import kotlinx.coroutines.* diff --git a/app/src/main/java/com/itsaky/androidide/utils/FileImporter.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/FileImporter.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/utils/FileImporter.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/FileImporter.kt index ccb5a7ab1c..82735f9392 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/FileImporter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/FileImporter.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.ClipData import android.content.Context import com.itsaky.androidide.R -import com.itsaky.androidide.dnd.toImportableExternalUris +import org.appdevforall.codeonthego.dnd.toImportableExternalUris import java.io.File /** diff --git a/app/src/main/java/com/itsaky/androidide/utils/FlexboxUtils.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/FlexboxUtils.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/utils/FlexboxUtils.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/FlexboxUtils.kt index c6757f6a2d..e24c9ab0e6 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/FlexboxUtils.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/FlexboxUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.view.ViewTreeObserver import androidx.recyclerview.widget.RecyclerView diff --git a/app/src/main/java/com/itsaky/androidide/utils/FragmentUtils.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/FragmentUtils.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/utils/FragmentUtils.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/FragmentUtils.kt index b31049cef4..0ea6561a5f 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/FragmentUtils.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/FragmentUtils.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import androidx.fragment.app.DialogFragment import androidx.fragment.app.FragmentManager diff --git a/app/src/main/java/com/itsaky/androidide/utils/HtmlTextUtils.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/HtmlTextUtils.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/utils/HtmlTextUtils.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/HtmlTextUtils.kt index 8d37ecca79..358b0a4520 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/HtmlTextUtils.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/HtmlTextUtils.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.text.SpannableStringBuilder import android.text.Spanned diff --git a/app/src/main/java/com/itsaky/androidide/utils/InstallTempFiles.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/InstallTempFiles.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/utils/InstallTempFiles.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/InstallTempFiles.kt index 7c5b779269..6fb850c3a7 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/InstallTempFiles.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/InstallTempFiles.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext diff --git a/app/src/main/java/com/itsaky/androidide/utils/InstallationResultHandler.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/InstallationResultHandler.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/utils/InstallationResultHandler.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/InstallationResultHandler.kt index e5420a4234..b9fd349abf 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/InstallationResultHandler.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/InstallationResultHandler.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.app.Activity import android.app.PendingIntent @@ -24,7 +24,7 @@ import android.content.Intent import android.content.IntentSender import android.content.pm.PackageInstaller import androidx.core.app.PendingIntentCompat -import com.itsaky.androidide.services.InstallationResultReceiver +import org.appdevforall.codeonthego.services.InstallationResultReceiver import org.slf4j.LoggerFactory /** diff --git a/app/src/main/java/com/itsaky/androidide/utils/InstallerIoUtils.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/InstallerIoUtils.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/utils/InstallerIoUtils.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/InstallerIoUtils.kt index 32578c6c97..f2c328d940 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/InstallerIoUtils.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/InstallerIoUtils.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import com.aayushatharva.brotli4j.decoder.BrotliInputStream diff --git a/app/src/main/java/com/itsaky/androidide/utils/IntentUtils.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/IntentUtils.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/utils/IntentUtils.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/IntentUtils.kt index ce619dffc3..20b6de1243 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/IntentUtils.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/IntentUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import android.content.Intent @@ -23,7 +23,7 @@ import android.os.Build import androidx.annotation.RequiresApi import androidx.core.app.ShareCompat import com.itsaky.androidide.R -import com.itsaky.androidide.utils.ImageUtils.ImageType.TYPE_UNKNOWN +import org.appdevforall.codeonthego.utils.ImageUtils.ImageType.TYPE_UNKNOWN import org.slf4j.LoggerFactory import rikka.shizuku.Shizuku import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/utils/JSONUtility.java b/app/src/main/java/org/appdevforall/codeonthego/utils/JSONUtility.java similarity index 88% rename from app/src/main/java/com/itsaky/androidide/utils/JSONUtility.java rename to app/src/main/java/org/appdevforall/codeonthego/utils/JSONUtility.java index 0af8bfede1..36cfeed9fa 100755 --- a/app/src/main/java/com/itsaky/androidide/utils/JSONUtility.java +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/JSONUtility.java @@ -1,34 +1,34 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - * - */ -package com.itsaky.androidide.utils; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.itsaky.androidide.tooling.api.util.ToolingApiLauncher; - -public class JSONUtility { - public static final Gson gson = new Gson(); - public static final Gson toolingGson; - public static final Gson prettyPrinter = new GsonBuilder().setPrettyPrinting().create(); - - static { - final var builder = new GsonBuilder(); - ToolingApiLauncher.configureGson(builder); - toolingGson = builder.create(); - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + * + */ +package org.appdevforall.codeonthego.utils; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import org.appdevforall.codeonthego.tooling.api.util.ToolingApiLauncher; + +public class JSONUtility { + public static final Gson gson = new Gson(); + public static final Gson toolingGson; + public static final Gson prettyPrinter = new GsonBuilder().setPrettyPrinting().create(); + + static { + final var builder = new GsonBuilder(); + ToolingApiLauncher.configureGson(builder); + toolingGson = builder.create(); + } +} diff --git a/app/src/main/java/com/itsaky/androidide/utils/JdkUtils.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/JdkUtils.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/utils/JdkUtils.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/JdkUtils.kt index e20c4b8584..6c45332a6e 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/JdkUtils.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/JdkUtils.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import androidx.annotation.VisibleForTesting import androidx.annotation.WorkerThread -import com.itsaky.androidide.app.IDEApplication -import com.itsaky.androidide.models.JdkDistribution -import com.itsaky.androidide.shell.executeProcessAsync +import org.appdevforall.codeonthego.app.IDEApplication +import org.appdevforall.codeonthego.models.JdkDistribution +import org.appdevforall.codeonthego.shell.executeProcessAsync import com.termux.shared.termux.shell.command.environment.TermuxShellEnvironment import org.slf4j.LoggerFactory import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/utils/LastValueGate.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/LastValueGate.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/utils/LastValueGate.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/LastValueGate.kt index 6c894807a6..4257b9aa76 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/LastValueGate.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/LastValueGate.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils /** * Tracks the last value handed to [consume], so a caller can tell "already handled" from "new" diff --git a/app/src/main/java/com/itsaky/androidide/utils/ListingFileRedirect.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/ListingFileRedirect.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/utils/ListingFileRedirect.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/ListingFileRedirect.kt index 3043948fdc..673825e1bd 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/ListingFileRedirect.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/ListingFileRedirect.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import java.io.File import java.io.StringReader diff --git a/app/src/main/java/com/itsaky/androidide/utils/MainScreenActions.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/MainScreenActions.kt similarity index 56% rename from app/src/main/java/com/itsaky/androidide/utils/MainScreenActions.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/MainScreenActions.kt index f799c5616d..2069c4fb6a 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/MainScreenActions.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/MainScreenActions.kt @@ -1,16 +1,16 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.ActionsRegistry -import com.itsaky.androidide.actions.main.CloneRepositoryAction -import com.itsaky.androidide.actions.main.CreateProjectAction -import com.itsaky.androidide.actions.main.DeleteProjectAction -import com.itsaky.androidide.actions.main.DonateAction -import com.itsaky.androidide.actions.main.DocsAction -import com.itsaky.androidide.actions.main.OpenProjectAction -import com.itsaky.androidide.actions.main.OpenTerminalAction -import com.itsaky.androidide.actions.main.PreferencesAction +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionsRegistry +import org.appdevforall.codeonthego.actions.main.CloneRepositoryAction +import org.appdevforall.codeonthego.actions.main.CreateProjectAction +import org.appdevforall.codeonthego.actions.main.DeleteProjectAction +import org.appdevforall.codeonthego.actions.main.DonateAction +import org.appdevforall.codeonthego.actions.main.DocsAction +import org.appdevforall.codeonthego.actions.main.OpenProjectAction +import org.appdevforall.codeonthego.actions.main.OpenTerminalAction +import org.appdevforall.codeonthego.actions.main.PreferencesAction /** * Takes care of registering actions to the actions registry for the main screen. diff --git a/app/src/main/java/com/itsaky/androidide/utils/MemoryUsageWatcher.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/MemoryUsageWatcher.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/utils/MemoryUsageWatcher.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/MemoryUsageWatcher.kt index 56c6386aff..b038f1e101 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/MemoryUsageWatcher.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/MemoryUsageWatcher.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.os.Debug.MemoryInfo import androidx.annotation.VisibleForTesting import androidx.collection.IntObjectMap import androidx.collection.MutableIntObjectMap -import com.itsaky.androidide.tasks.cancelIfActive +import org.appdevforall.codeonthego.tasks.cancelIfActive import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.DelicateCoroutinesApi diff --git a/app/src/main/java/com/itsaky/androidide/utils/MetricsAnnotationStore.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/MetricsAnnotationStore.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/utils/MetricsAnnotationStore.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/MetricsAnnotationStore.kt index 0aba44c264..f85a1e1e08 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/MetricsAnnotationStore.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/MetricsAnnotationStore.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.os.SystemClock import androidx.annotation.StringRes diff --git a/app/src/main/java/com/itsaky/androidide/utils/MetricsCsv.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/MetricsCsv.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/utils/MetricsCsv.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/MetricsCsv.kt index b2454dfeed..d943a430de 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/MetricsCsv.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/MetricsCsv.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import java.time.Instant import java.time.ZoneId diff --git a/app/src/main/java/com/itsaky/androidide/utils/MetricsCsvFile.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/MetricsCsvFile.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/utils/MetricsCsvFile.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/MetricsCsvFile.kt index b73c686894..1db3508e86 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/MetricsCsvFile.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/MetricsCsvFile.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import androidx.annotation.VisibleForTesting diff --git a/app/src/main/java/com/itsaky/androidide/utils/MetricsFileName.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/MetricsFileName.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/utils/MetricsFileName.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/MetricsFileName.kt index 97a13b3419..6f44866d0a 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/MetricsFileName.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/MetricsFileName.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import java.time.Instant import java.time.ZoneId diff --git a/app/src/main/java/com/itsaky/androidide/utils/MetricsSamplingRates.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/MetricsSamplingRates.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/utils/MetricsSamplingRates.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/MetricsSamplingRates.kt index e50dc13fab..5e584a9bb7 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/MetricsSamplingRates.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/MetricsSamplingRates.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils -import com.itsaky.androidide.app.configuration.CpuArch -import com.itsaky.androidide.app.configuration.IDEBuildConfigProvider +import org.appdevforall.codeonthego.app.configuration.CpuArch +import org.appdevforall.codeonthego.app.configuration.IDEBuildConfigProvider /** * The sampling rates the metrics charts offer, and which of them a given device may use diff --git a/app/src/main/java/com/itsaky/androidide/utils/MetricsScratch.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/MetricsScratch.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/utils/MetricsScratch.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/MetricsScratch.kt index 089aade934..32f0075588 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/MetricsScratch.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/MetricsScratch.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import androidx.annotation.VisibleForTesting import java.util.concurrent.atomic.AtomicBoolean diff --git a/app/src/main/java/com/itsaky/androidide/utils/MetricsSnapshot.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/MetricsSnapshot.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/utils/MetricsSnapshot.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/MetricsSnapshot.kt index 113b9c89fe..13fa2bd0c0 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/MetricsSnapshot.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/MetricsSnapshot.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import android.graphics.Bitmap diff --git a/app/src/main/java/com/itsaky/androidide/utils/MetricsSnapshotAssembler.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/MetricsSnapshotAssembler.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/utils/MetricsSnapshotAssembler.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/MetricsSnapshotAssembler.kt index 1ddc498b13..1587c83995 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/MetricsSnapshotAssembler.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/MetricsSnapshotAssembler.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import android.os.SystemClock diff --git a/app/src/main/java/com/itsaky/androidide/utils/MetricsSource.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/MetricsSource.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/utils/MetricsSource.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/MetricsSource.kt index d84e9e19f3..c0697402d5 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/MetricsSource.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/MetricsSource.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils /** * Where a process-wide caller finds the live metrics watchers (ADFA-5526). diff --git a/app/src/main/java/com/itsaky/androidide/utils/MutableShiftedLongArray.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/MutableShiftedLongArray.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/utils/MutableShiftedLongArray.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/MutableShiftedLongArray.kt index 6add3e6902..b9b02061f7 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/MutableShiftedLongArray.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/MutableShiftedLongArray.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils /** * Mutable version of [ShiftedLongArray]. diff --git a/app/src/main/java/com/itsaky/androidide/utils/NetworkUsageWatcher.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/NetworkUsageWatcher.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/utils/NetworkUsageWatcher.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/NetworkUsageWatcher.kt index bf597315a1..22b7fc43f6 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/NetworkUsageWatcher.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/NetworkUsageWatcher.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.net.TrafficStats import android.os.Process import androidx.annotation.VisibleForTesting -import com.itsaky.androidide.tasks.cancelIfActive +import org.appdevforall.codeonthego.tasks.cancelIfActive import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.DelicateCoroutinesApi diff --git a/app/src/main/java/com/itsaky/androidide/utils/NoOpServiceConnection.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/NoOpServiceConnection.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/utils/NoOpServiceConnection.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/NoOpServiceConnection.kt index 47bbeefb83..2c578705a8 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/NoOpServiceConnection.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/NoOpServiceConnection.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.ComponentName import android.content.ServiceConnection diff --git a/app/src/main/java/com/itsaky/androidide/utils/OverlayPermissionGuide.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/OverlayPermissionGuide.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/utils/OverlayPermissionGuide.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/OverlayPermissionGuide.kt index 16d2378035..c88721335f 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/OverlayPermissionGuide.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/OverlayPermissionGuide.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.app.Activity import android.content.ActivityNotFoundException diff --git a/app/src/main/java/com/itsaky/androidide/utils/PermissionsHelper.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/PermissionsHelper.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/utils/PermissionsHelper.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/PermissionsHelper.kt index f5822bc5db..1e215a2d35 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/PermissionsHelper.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/PermissionsHelper.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.Manifest import android.app.ActivityManager @@ -11,7 +11,7 @@ import android.provider.Settings import androidx.annotation.RequiresApi import androidx.core.app.ActivityCompat import com.itsaky.androidide.R -import com.itsaky.androidide.models.OnboardingPermissionItem +import org.appdevforall.codeonthego.models.OnboardingPermissionItem import androidx.core.net.toUri /** diff --git a/app/src/main/java/com/itsaky/androidide/utils/PowerUsageWatcher.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/PowerUsageWatcher.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/utils/PowerUsageWatcher.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/PowerUsageWatcher.kt index df1f9758af..8b3aeb2cd8 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/PowerUsageWatcher.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/PowerUsageWatcher.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import androidx.annotation.VisibleForTesting -import com.itsaky.androidide.tasks.cancelIfActive +import org.appdevforall.codeonthego.tasks.cancelIfActive import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.DelicateCoroutinesApi diff --git a/app/src/main/java/com/itsaky/androidide/utils/PrivilegedActions.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/PrivilegedActions.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/utils/PrivilegedActions.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/PrivilegedActions.kt index f7d5a11e1a..00f3a9883a 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/PrivilegedActions.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/PrivilegedActions.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.ComponentName -import com.itsaky.androidide.lsp.java.debug.JdwpOptions +import org.appdevforall.codeonthego.lsp.java.debug.JdwpOptions import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.delay import kotlinx.coroutines.withContext diff --git a/app/src/main/java/com/itsaky/androidide/utils/ProcessMemoryReader.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/ProcessMemoryReader.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/utils/ProcessMemoryReader.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/ProcessMemoryReader.kt index 867699dfb7..382c8e45cf 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/ProcessMemoryReader.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/ProcessMemoryReader.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.os.Debug import android.os.Debug.MemoryInfo diff --git a/app/src/main/java/com/itsaky/androidide/utils/ProjectCreationManager.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/ProjectCreationManager.kt similarity index 78% rename from app/src/main/java/com/itsaky/androidide/utils/ProjectCreationManager.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/ProjectCreationManager.kt index 41c9fea5a5..582fcbc850 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/ProjectCreationManager.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/ProjectCreationManager.kt @@ -1,14 +1,14 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import com.itsaky.androidide.R -import com.itsaky.androidide.git.core.GitRepositoryManager -import com.itsaky.androidide.roomData.recentproject.RecentProject -import com.itsaky.androidide.tasks.executeAsyncProvideError -import com.itsaky.androidide.templates.ProjectTemplateRecipeResult -import com.itsaky.androidide.templates.StringParameter -import com.itsaky.androidide.templates.Template -import com.itsaky.androidide.templates.impl.ConstraintVerifier +import org.appdevforall.codeonthego.git.core.GitRepositoryManager +import org.appdevforall.codeonthego.roomData.recentproject.RecentProject +import org.appdevforall.codeonthego.tasks.executeAsyncProvideError +import org.appdevforall.codeonthego.templates.ProjectTemplateRecipeResult +import org.appdevforall.codeonthego.templates.StringParameter +import org.appdevforall.codeonthego.templates.Template +import org.appdevforall.codeonthego.templates.impl.ConstraintVerifier import kotlinx.coroutines.runBlocking import org.slf4j.LoggerFactory diff --git a/app/src/main/java/com/itsaky/androidide/utils/ProjectLocation.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/ProjectLocation.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/utils/ProjectLocation.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/ProjectLocation.kt index 6154dd9d84..acec2bd8bc 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/ProjectLocation.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/ProjectLocation.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/utils/ProjectOpenBookkeeping.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/ProjectOpenBookkeeping.kt similarity index 83% rename from app/src/main/java/com/itsaky/androidide/utils/ProjectOpenBookkeeping.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/ProjectOpenBookkeeping.kt index f4547125d2..c67ee0a092 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/ProjectOpenBookkeeping.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/ProjectOpenBookkeeping.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import androidx.lifecycle.ProcessLifecycleOwner import androidx.lifecycle.lifecycleScope -import com.itsaky.androidide.analytics.IAnalyticsManager -import com.itsaky.androidide.preferences.internal.GeneralPreferences -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.repositories.RecentProjectRepository -import com.itsaky.androidide.roomData.recentproject.RecentProject -import com.itsaky.androidide.templates.Language +import org.appdevforall.codeonthego.analytics.IAnalyticsManager +import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.repositories.RecentProjectRepository +import org.appdevforall.codeonthego.roomData.recentproject.RecentProject +import org.appdevforall.codeonthego.templates.Language import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -36,16 +36,16 @@ private val log = LoggerFactory.getLogger("ProjectOpenBookkeeping") /** * Marks [root] as the currently open project (singleton state + last-opened pref), records it in * Recents, and tracks the open in analytics -- the same bookkeeping - * [com.itsaky.androidide.activities.MainActivity.openProject] does for a normal manual open, + * [org.appdevforall.codeonthego.activities.MainActivity.openProject] does for a normal manual open, * extracted so a deep-link-triggered project switch gets it too even though that path bypasses * `openProject` entirely (see - * [com.itsaky.androidide.activities.editor.EditorHandlerActivity.onDestroy]). + * [org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity.onDestroy]). * * [recentProjectRepository] is the caller's Koin-provided instance (`by inject()`) -- per ADR * 0001/0006, persistence is always acquired through Koin, never by re-deriving the database * directly, and kept behind this repository interface (not the raw DAO) so callers in the UI layer - * (both [com.itsaky.androidide.activities.MainActivity] and - * [com.itsaky.androidide.activities.editor.EditorHandlerActivity]) don't depend on a Room data + * (both [org.appdevforall.codeonthego.activities.MainActivity] and + * [org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity]) don't depend on a Room data * source directly, per ARCHITECTURE.md's UI -> ViewModel -> Repository -> data source layering. * * Uses [ProcessLifecycleOwner]'s scope rather than a per-activity one, since this can run from an diff --git a/app/src/main/java/com/itsaky/androidide/utils/ProjectSearchOptions.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/ProjectSearchOptions.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/utils/ProjectSearchOptions.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/ProjectSearchOptions.kt index 4a9615463d..89cc31b7a1 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/ProjectSearchOptions.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/ProjectSearchOptions.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/utils/ProjectStringsXmlResolver.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/ProjectStringsXmlResolver.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/utils/ProjectStringsXmlResolver.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/ProjectStringsXmlResolver.kt index d0c3ce9c06..995e832ec3 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/ProjectStringsXmlResolver.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/ProjectStringsXmlResolver.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext diff --git a/app/src/main/java/com/itsaky/androidide/utils/ProjectValidations.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/ProjectValidations.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/utils/ProjectValidations.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/ProjectValidations.kt index eebbae8644..25cf8615f7 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/ProjectValidations.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/ProjectValidations.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import java.io.File import java.io.IOException diff --git a/app/src/main/java/com/itsaky/androidide/utils/ProjectWriter.java b/app/src/main/java/org/appdevforall/codeonthego/utils/ProjectWriter.java similarity index 97% rename from app/src/main/java/com/itsaky/androidide/utils/ProjectWriter.java rename to app/src/main/java/org/appdevforall/codeonthego/utils/ProjectWriter.java index f5f4bfbea6..d51ebc82fc 100755 --- a/app/src/main/java/com/itsaky/androidide/utils/ProjectWriter.java +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/ProjectWriter.java @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; import static java.lang.Character.isUpperCase; import static java.lang.Character.toLowerCase; import androidx.annotation.NonNull; -import com.itsaky.androidide.utils.ClassBuilder.SourceLanguage; +import org.appdevforall.codeonthego.utils.ClassBuilder.SourceLanguage; import java.io.File; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/app/src/main/java/com/itsaky/androidide/utils/RecentProjectLocationReconciler.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/RecentProjectLocationReconciler.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/utils/RecentProjectLocationReconciler.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/RecentProjectLocationReconciler.kt index 0769fe95e3..d9ef85fc67 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/RecentProjectLocationReconciler.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/RecentProjectLocationReconciler.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils -import com.itsaky.androidide.roomData.recentproject.RecentProject -import com.itsaky.androidide.templates.Language +import org.appdevforall.codeonthego.roomData.recentproject.RecentProject +import org.appdevforall.codeonthego.templates.Language import java.io.File /** Collapses Recents rows that resolve to the same directory, keeping useful project metadata. */ diff --git a/app/src/main/java/com/itsaky/androidide/utils/RecursiveFileSearcher.java b/app/src/main/java/org/appdevforall/codeonthego/utils/RecursiveFileSearcher.java similarity index 96% rename from app/src/main/java/com/itsaky/androidide/utils/RecursiveFileSearcher.java rename to app/src/main/java/org/appdevforall/codeonthego/utils/RecursiveFileSearcher.java index ab7ddaa38a..35ca605e45 100755 --- a/app/src/main/java/com/itsaky/androidide/utils/RecursiveFileSearcher.java +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/RecursiveFileSearcher.java @@ -17,12 +17,12 @@ * along with AndroidIDE. If not, see . * **************************************************************************************/ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; -import com.itsaky.androidide.models.SearchResult; -import com.itsaky.androidide.tasks.TaskExecutor; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; +import org.appdevforall.codeonthego.models.SearchResult; +import org.appdevforall.codeonthego.tasks.TaskExecutor; import io.github.rosemoe.sora.text.CharPosition; import io.github.rosemoe.sora.text.Content; import java.io.File; diff --git a/app/src/main/java/com/itsaky/androidide/utils/ShiftedLongArray.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/ShiftedLongArray.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/utils/ShiftedLongArray.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/ShiftedLongArray.kt index 36cf8ba013..b51a136ca5 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/ShiftedLongArray.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/ShiftedLongArray.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils /** * Represents an [Long] array whose indices are shifted by a specified number of positions. This class diff --git a/app/src/main/java/com/itsaky/androidide/utils/SingleBottomSheetCallback.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/SingleBottomSheetCallback.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/utils/SingleBottomSheetCallback.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/SingleBottomSheetCallback.kt index b0ef739681..a99fdfb4f4 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/SingleBottomSheetCallback.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/SingleBottomSheetCallback.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.view.View import com.google.android.material.bottomsheet.BottomSheetBehavior.BottomSheetCallback diff --git a/app/src/main/java/com/itsaky/androidide/utils/StorageSizeUtils.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/StorageSizeUtils.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/utils/StorageSizeUtils.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/StorageSizeUtils.kt index f44b1edc06..3f00e60843 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/StorageSizeUtils.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/StorageSizeUtils.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import kotlin.math.roundToLong diff --git a/app/src/main/java/com/itsaky/androidide/utils/StorageUtils.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/StorageUtils.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/utils/StorageUtils.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/StorageUtils.kt index 41ef2d67f1..4db85f5f71 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/StorageUtils.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/StorageUtils.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.os.Environment import android.os.StatFs diff --git a/app/src/main/java/com/itsaky/androidide/utils/StringsXmlInjector.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/StringsXmlInjector.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/utils/StringsXmlInjector.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/StringsXmlInjector.kt index e498795f6b..babffa01df 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/StringsXmlInjector.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/StringsXmlInjector.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import androidx.annotation.StringRes import com.itsaky.androidide.R -import com.itsaky.androidide.projects.IProjectManager +import org.appdevforall.codeonthego.projects.IProjectManager import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.slf4j.LoggerFactory diff --git a/app/src/main/java/com/itsaky/androidide/utils/Symbols.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/Symbols.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/utils/Symbols.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/Symbols.kt index d9c23e469d..10b5238884 100755 --- a/app/src/main/java/com/itsaky/androidide/utils/Symbols.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/Symbols.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . * */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils -import com.itsaky.androidide.models.Symbol +import org.appdevforall.codeonthego.models.Symbol import java.io.File object Symbols { diff --git a/app/src/main/java/com/itsaky/androidide/utils/TemplateRecipeExecutor.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/TemplateRecipeExecutor.kt similarity index 89% rename from app/src/main/java/com/itsaky/androidide/utils/TemplateRecipeExecutor.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/TemplateRecipeExecutor.kt index 40defdbe65..a16bdf3ad2 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/TemplateRecipeExecutor.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/TemplateRecipeExecutor.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context -import com.itsaky.androidide.app.IDEApplication -import com.itsaky.androidide.managers.ToolsManager -import com.itsaky.androidide.templates.RecipeExecutor +import org.appdevforall.codeonthego.app.IDEApplication +import org.appdevforall.codeonthego.managers.ToolsManager +import org.appdevforall.codeonthego.templates.RecipeExecutor import org.adfa.constants.LOCAL_MAVEN_CACHES_DEST import org.adfa.constants.LOCAL_MAVEN_REPO_ARCHIVE_ZIP_NAME import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/utils/TerminalInstallResultExtensions.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/TerminalInstallResultExtensions.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/utils/TerminalInstallResultExtensions.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/TerminalInstallResultExtensions.kt index 873d454863..39faea92b1 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/TerminalInstallResultExtensions.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/TerminalInstallResultExtensions.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import com.itsaky.androidide.resources.R diff --git a/app/src/main/java/com/itsaky/androidide/utils/TerminalInstaller.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/TerminalInstaller.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/utils/TerminalInstaller.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/TerminalInstaller.kt index 847aa4a18b..73b2ce61d5 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/TerminalInstaller.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/TerminalInstaller.kt @@ -15,7 +15,7 @@ * along with Scribe. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import android.system.Os diff --git a/app/src/main/java/com/itsaky/androidide/utils/TextWatcherAdapter.java b/app/src/main/java/org/appdevforall/codeonthego/utils/TextWatcherAdapter.java similarity index 96% rename from app/src/main/java/com/itsaky/androidide/utils/TextWatcherAdapter.java rename to app/src/main/java/org/appdevforall/codeonthego/utils/TextWatcherAdapter.java index 2554a0caae..953b43feec 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/TextWatcherAdapter.java +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/TextWatcherAdapter.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; import android.text.Editable; import android.text.TextWatcher; diff --git a/app/src/main/java/com/itsaky/androidide/utils/UriFileImporter.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/UriFileImporter.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/utils/UriFileImporter.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/UriFileImporter.kt index 49dd83da4f..df6ffed940 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/UriFileImporter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/UriFileImporter.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.ContentResolver import android.content.Context diff --git a/app/src/main/java/com/itsaky/androidide/utils/WindowInsetsExtensions.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/WindowInsetsExtensions.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/utils/WindowInsetsExtensions.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/WindowInsetsExtensions.kt index 93ad82081d..5f5c23e247 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/WindowInsetsExtensions.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/WindowInsetsExtensions.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.res.Configuration import android.view.View diff --git a/app/src/main/java/com/itsaky/androidide/utils/WordBoundary.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/WordBoundary.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/utils/WordBoundary.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/WordBoundary.kt index 275d7907d1..8046d16a07 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/WordBoundary.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/WordBoundary.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils object WordBoundary { @JvmStatic diff --git a/app/src/main/java/com/itsaky/androidide/utils/ZipExts.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/ZipExts.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/utils/ZipExts.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/ZipExts.kt index f09655570b..ca661978d1 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/ZipExts.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/ZipExts.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import java.util.zip.ZipEntry import java.util.zip.ZipInputStream diff --git a/app/src/main/java/com/itsaky/androidide/utils/ui/TemplateScrollGateKeeper.kt b/app/src/main/java/org/appdevforall/codeonthego/utils/ui/TemplateScrollGateKeeper.kt similarity index 98% rename from app/src/main/java/com/itsaky/androidide/utils/ui/TemplateScrollGateKeeper.kt rename to app/src/main/java/org/appdevforall/codeonthego/utils/ui/TemplateScrollGateKeeper.kt index 4eaa56324d..71c2f37843 100644 --- a/app/src/main/java/com/itsaky/androidide/utils/ui/TemplateScrollGateKeeper.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/utils/ui/TemplateScrollGateKeeper.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils.ui +package org.appdevforall.codeonthego.utils.ui import android.view.View import android.view.ViewTreeObserver diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/ApkInstallationViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/ApkInstallationViewModel.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/viewmodel/ApkInstallationViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/ApkInstallationViewModel.kt index 7ea0857b57..6f8ecce1d2 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/ApkInstallationViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/ApkInstallationViewModel.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import android.content.Context import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.itsaky.androidide.utils.ApkInstaller -import com.itsaky.androidide.utils.SingleSessionCallback +import org.appdevforall.codeonthego.utils.ApkInstaller +import org.appdevforall.codeonthego.utils.SingleSessionCallback import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.update diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/AppLogsCoordinator.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/AppLogsCoordinator.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/viewmodel/AppLogsCoordinator.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/AppLogsCoordinator.kt index eae7ced480..7eadd46731 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/AppLogsCoordinator.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/AppLogsCoordinator.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import android.app.Activity import android.content.BroadcastReceiver @@ -8,12 +8,12 @@ import android.content.IntentFilter import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.LifecycleOwner import androidx.localbroadcastmanager.content.LocalBroadcastManager -import com.itsaky.androidide.preferences.internal.DevOpsPreferences -import com.itsaky.androidide.services.log.ConnectionObserverParams -import com.itsaky.androidide.services.log.LogReceiverImpl -import com.itsaky.androidide.services.log.LogReceiverService -import com.itsaky.androidide.services.log.LogReceiverServiceConnection -import com.itsaky.androidide.services.log.lookupLogService +import org.appdevforall.codeonthego.preferences.internal.DevOpsPreferences +import org.appdevforall.codeonthego.services.log.ConnectionObserverParams +import org.appdevforall.codeonthego.services.log.LogReceiverImpl +import org.appdevforall.codeonthego.services.log.LogReceiverService +import org.appdevforall.codeonthego.services.log.LogReceiverServiceConnection +import org.appdevforall.codeonthego.services.log.lookupLogService import org.slf4j.LoggerFactory import java.util.concurrent.atomic.AtomicBoolean diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/AppLogsViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/AppLogsViewModel.kt similarity index 60% rename from app/src/main/java/com/itsaky/androidide/viewmodel/AppLogsViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/AppLogsViewModel.kt index 13999f7e29..a18f33a053 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/AppLogsViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/AppLogsViewModel.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel /** * @author Akash Yadav diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/BottomSheetViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/BottomSheetViewModel.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/viewmodel/BottomSheetViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/BottomSheetViewModel.kt index 3426d28c00..b8fd90a707 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/BottomSheetViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/BottomSheetViewModel.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import androidx.annotation.IntDef import androidx.annotation.Keep import androidx.lifecycle.ViewModel import com.google.android.material.bottomsheet.BottomSheetBehavior -import com.itsaky.androidide.adapters.EditorBottomSheetTabAdapter +import org.appdevforall.codeonthego.adapters.EditorBottomSheetTabAdapter import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.update diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/BuildOutputViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/BuildOutputViewModel.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/viewmodel/BuildOutputViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/BuildOutputViewModel.kt index c374b53232..36c7a50e06 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/BuildOutputViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/BuildOutputViewModel.kt @@ -14,12 +14,12 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import android.app.Application import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.viewModelScope -import com.itsaky.androidide.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.MutableStateFlow @@ -354,7 +354,7 @@ class BuildOutputViewModel( /** * Reads the last [maxChars] characters of [file], or `""` when it is missing or unreadable. - * Shared with [com.itsaky.androidide.api.BuildOutputProvider], which reads the same session + * Shared with [org.appdevforall.codeonthego.api.BuildOutputProvider], which reads the same session * file for consumers outside the editor UI. */ internal fun readTailFromFile( @@ -380,7 +380,7 @@ class BuildOutputViewModel( } } - /** Name of the on-disk build output session file, shared with [com.itsaky.androidide.api.BuildOutputProvider]. */ + /** Name of the on-disk build output session file, shared with [org.appdevforall.codeonthego.api.BuildOutputProvider]. */ internal const val SESSION_FILE_NAME = "build_output_session.txt" private const val WINDOW_SIZE_CHARS = 512 * 1024 diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/BuildState.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/BuildState.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/viewmodel/BuildState.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/BuildState.kt index 4a66254f72..50c85a39eb 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/BuildState.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/BuildState.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import java.io.File diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/BuildVariantsViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/BuildVariantsViewModel.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/viewmodel/BuildVariantsViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/BuildVariantsViewModel.kt index 6ba02eea62..d271b1232f 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/BuildVariantsViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/BuildVariantsViewModel.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel -import com.itsaky.androidide.tooling.api.models.BuildVariantInfo +import org.appdevforall.codeonthego.tooling.api.models.BuildVariantInfo /** * [ViewModel] for the build variants fragment. diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/BuildViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/BuildViewModel.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/viewmodel/BuildViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/BuildViewModel.kt index ee9080e593..b523960d54 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/BuildViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/BuildViewModel.kt @@ -1,22 +1,22 @@ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.itsaky.androidide.activities.editor.QuickBuildClobberConfirmation -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.models.ApkMetadata -import com.itsaky.androidide.models.InstallTaskRequest -import com.itsaky.androidide.models.installTaskRequestsIn -import com.itsaky.androidide.project.AndroidModels -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.api.AndroidModule -import com.itsaky.androidide.projects.builder.BuildService -import com.itsaky.androidide.projects.isPluginProject -import com.itsaky.androidide.projects.models.assembleTaskOutputListingFile -import com.itsaky.androidide.tooling.api.messages.BuildRunType -import com.itsaky.androidide.tooling.api.messages.GradleBuildParams -import com.itsaky.androidide.tooling.api.messages.TaskExecutionMessage -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult +import org.appdevforall.codeonthego.activities.editor.QuickBuildClobberConfirmation +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.models.ApkMetadata +import org.appdevforall.codeonthego.models.InstallTaskRequest +import org.appdevforall.codeonthego.models.installTaskRequestsIn +import org.appdevforall.codeonthego.project.AndroidModels +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.api.AndroidModule +import org.appdevforall.codeonthego.projects.builder.BuildService +import org.appdevforall.codeonthego.projects.isPluginProject +import org.appdevforall.codeonthego.projects.models.assembleTaskOutputListingFile +import org.appdevforall.codeonthego.tooling.api.messages.BuildRunType +import org.appdevforall.codeonthego.tooling.api.messages.GradleBuildParams +import org.appdevforall.codeonthego.tooling.api.messages.TaskExecutionMessage +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/CloneRepositoryViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/CloneRepositoryViewModel.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/viewmodel/CloneRepositoryViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/CloneRepositoryViewModel.kt index f141e262aa..7017acc822 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/CloneRepositoryViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/CloneRepositoryViewModel.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import android.app.Application import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.application import androidx.lifecycle.viewModelScope -import com.itsaky.androidide.git.core.GitCredentialsManager -import com.itsaky.androidide.git.core.GitRepositoryManager -import com.itsaky.androidide.git.core.models.CloneRepoUiState -import com.itsaky.androidide.git.core.parseGitRepositoryUrl +import org.appdevforall.codeonthego.git.core.GitCredentialsManager +import org.appdevforall.codeonthego.git.core.GitRepositoryManager +import org.appdevforall.codeonthego.git.core.models.CloneRepoUiState +import org.appdevforall.codeonthego.git.core.parseGitRepositoryUrl import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.isNetworkConnected +import org.appdevforall.codeonthego.utils.isNetworkConnected import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/DebuggerViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/DebuggerViewModel.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/viewmodel/DebuggerViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/DebuggerViewModel.kt index 731cc9a9bf..94482b718d 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/DebuggerViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/DebuggerViewModel.kt @@ -1,20 +1,20 @@ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import android.content.Context import android.content.Intent import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.itsaky.androidide.buildinfo.BuildInfo -import com.itsaky.androidide.fragments.debug.DebuggerFragment -import com.itsaky.androidide.fragments.debug.ResolvableThreadInfo -import com.itsaky.androidide.fragments.debug.ResolvableVariable -import com.itsaky.androidide.fragments.debug.VariableTreeNodeGenerator -import com.itsaky.androidide.fragments.debug.resolvedOrNull -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.IDEDebugClientImpl -import com.itsaky.androidide.lsp.debug.model.StackFrame -import com.itsaky.androidide.lsp.debug.model.ThreadInfo -import com.itsaky.androidide.utils.PrivilegedActions +import org.appdevforall.codeonthego.fragments.debug.DebuggerFragment +import org.appdevforall.codeonthego.fragments.debug.ResolvableThreadInfo +import org.appdevforall.codeonthego.fragments.debug.ResolvableVariable +import org.appdevforall.codeonthego.fragments.debug.VariableTreeNodeGenerator +import org.appdevforall.codeonthego.fragments.debug.resolvedOrNull +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.IDEDebugClientImpl +import org.appdevforall.codeonthego.lsp.debug.model.StackFrame +import org.appdevforall.codeonthego.lsp.debug.model.ThreadInfo +import org.appdevforall.codeonthego.utils.PrivilegedActions import io.github.dingyi222666.view.treeview.Tree import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/EditorViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/EditorViewModel.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/viewmodel/EditorViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/EditorViewModel.kt index 411168a952..19e3eb4e2c 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/EditorViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/EditorViewModel.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import android.view.Gravity.CENTER import androidx.lifecycle.LifecycleOwner @@ -24,15 +24,15 @@ import androidx.lifecycle.Observer import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.google.gson.GsonBuilder -import com.itsaky.androidide.models.OpenedFilesCache -import com.itsaky.androidide.models.SearchResult -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.quickbuild.QuickBuildFlashes -import com.itsaky.androidide.search.replace.ReplaceSession -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.FileUtils -import com.itsaky.androidide.utils.ILogger +import org.appdevforall.codeonthego.models.OpenedFilesCache +import org.appdevforall.codeonthego.models.SearchResult +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.quickbuild.QuickBuildFlashes +import org.appdevforall.codeonthego.search.replace.ReplaceSession +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.FileUtils +import org.appdevforall.codeonthego.utils.ILogger import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job import kotlinx.coroutines.flow.MutableStateFlow @@ -46,7 +46,7 @@ import java.io.IOException import java.util.Collections import java.util.concurrent.atomic.AtomicInteger -/** ViewModel for data used in [com.itsaky.androidide.activities.editor.EditorActivityKt] */ +/** ViewModel for data used in [org.appdevforall.codeonthego.activities.editor.EditorActivityKt] */ @Suppress("PropertyName") class EditorViewModel : ViewModel() { /** diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/EmptyStateFragmentViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/EmptyStateFragmentViewModel.kt similarity index 97% rename from app/src/main/java/com/itsaky/androidide/viewmodel/EmptyStateFragmentViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/EmptyStateFragmentViewModel.kt index 5016e3ed01..313dfd2fa7 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/EmptyStateFragmentViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/EmptyStateFragmentViewModel.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import androidx.lifecycle.ViewModel import kotlinx.coroutines.flow.MutableStateFlow diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/FileManagerViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/FileManagerViewModel.kt similarity index 89% rename from app/src/main/java/com/itsaky/androidide/viewmodel/FileManagerViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/FileManagerViewModel.kt index cd4977f770..fc3dc71d5f 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/FileManagerViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/FileManagerViewModel.kt @@ -1,13 +1,13 @@ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import android.content.Context import android.util.Log import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.itsaky.androidide.eventbus.events.file.FileRenameEvent -import com.itsaky.androidide.projects.FileManager +import org.appdevforall.codeonthego.eventbus.events.file.FileRenameEvent +import org.appdevforall.codeonthego.projects.FileManager import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.FileUtils +import org.appdevforall.codeonthego.utils.FileUtils import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.asSharedFlow diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/FileTreeViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/FileTreeViewModel.kt similarity index 90% rename from app/src/main/java/com/itsaky/androidide/viewmodel/FileTreeViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/FileTreeViewModel.kt index 7b80f97745..ae046eabdb 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/FileTreeViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/FileTreeViewModel.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel -import com.itsaky.androidide.tasks.executeAsync -import com.itsaky.androidide.tasks.runOnUiThread +import org.appdevforall.codeonthego.tasks.executeAsync +import org.appdevforall.codeonthego.tasks.runOnUiThread import com.unnamed.b.atv.view.AndroidTreeView /** diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/GitBottomSheetViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/GitBottomSheetViewModel.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/viewmodel/GitBottomSheetViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/GitBottomSheetViewModel.kt index 8bfc033afd..738b2eb928 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/GitBottomSheetViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/GitBottomSheetViewModel.kt @@ -1,23 +1,23 @@ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.itsaky.androidide.app.BaseApplication -import com.itsaky.androidide.eventbus.events.editor.DocumentSaveEvent -import com.itsaky.androidide.eventbus.events.file.FileCreationEvent -import com.itsaky.androidide.eventbus.events.file.FileDeletionEvent -import com.itsaky.androidide.eventbus.events.file.FileRenameEvent -import com.itsaky.androidide.events.ListProjectFilesRequestEvent -import com.itsaky.androidide.git.core.GitCredentialsManager -import com.itsaky.androidide.git.core.GitRepository -import com.itsaky.androidide.git.core.GitRepositoryManager -import com.itsaky.androidide.git.core.models.CommitHistoryUiState -import com.itsaky.androidide.git.core.models.GitBranch -import com.itsaky.androidide.git.core.models.GitStatus -import com.itsaky.androidide.preferences.internal.GitPreferences -import com.itsaky.androidide.projects.IProjectManager +import org.appdevforall.codeonthego.app.BaseApplication +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentSaveEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileCreationEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileDeletionEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileRenameEvent +import org.appdevforall.codeonthego.events.ListProjectFilesRequestEvent +import org.appdevforall.codeonthego.git.core.GitCredentialsManager +import org.appdevforall.codeonthego.git.core.GitRepository +import org.appdevforall.codeonthego.git.core.GitRepositoryManager +import org.appdevforall.codeonthego.git.core.models.CommitHistoryUiState +import org.appdevforall.codeonthego.git.core.models.GitBranch +import org.appdevforall.codeonthego.git.core.models.GitStatus +import org.appdevforall.codeonthego.preferences.internal.GitPreferences +import org.appdevforall.codeonthego.projects.IProjectManager import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.isNetworkConnected +import org.appdevforall.codeonthego.utils.isNetworkConnected import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Job import kotlinx.coroutines.delay diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/IDELogsViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/IDELogsViewModel.kt similarity index 82% rename from app/src/main/java/com/itsaky/androidide/viewmodel/IDELogsViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/IDELogsViewModel.kt index 124fea17e9..451a402b72 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/IDELogsViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/IDELogsViewModel.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel -import com.itsaky.androidide.logging.provider.IdeGlobalLogBuffer -import com.itsaky.androidide.utils.FeatureFlags -import com.itsaky.androidide.utils.ILogger +import org.appdevforall.codeonthego.logging.provider.IdeGlobalLogBuffer +import org.appdevforall.codeonthego.utils.FeatureFlags +import org.appdevforall.codeonthego.utils.ILogger import org.slf4j.event.Level /** diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/InstallationState.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/InstallationState.kt similarity index 88% rename from app/src/main/java/com/itsaky/androidide/viewmodel/InstallationState.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/InstallationState.kt index 42a622f5c9..f9218b987b 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/InstallationState.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/InstallationState.kt @@ -1,5 +1,5 @@ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel sealed class InstallationState { object InstallationPending : InstallationState() diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/InstallationViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/InstallationViewModel.kt similarity index 82% rename from app/src/main/java/com/itsaky/androidide/viewmodel/InstallationViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/InstallationViewModel.kt index 8fb69212e4..3a7820125d 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/InstallationViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/InstallationViewModel.kt @@ -1,25 +1,25 @@ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import android.content.Context import android.os.StatFs import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.itsaky.androidide.app.configuration.IJdkDistributionProvider -import com.itsaky.androidide.assets.AssetsInstallationHelper -import com.itsaky.androidide.events.InstallationEvent -import com.itsaky.androidide.models.StorageInfo +import org.appdevforall.codeonthego.app.configuration.IJdkDistributionProvider +import org.appdevforall.codeonthego.assets.AssetsInstallationHelper +import org.appdevforall.codeonthego.events.InstallationEvent +import org.appdevforall.codeonthego.models.StorageInfo import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.bytesToGigabytes -import com.itsaky.androidide.utils.getMinimumStorageNeeded -import com.itsaky.androidide.utils.gigabytesToBytes -import com.itsaky.androidide.utils.withStopWatch -import com.itsaky.androidide.viewmodel.InstallationState.InstallationComplete -import com.itsaky.androidide.viewmodel.InstallationState.InstallationError -import com.itsaky.androidide.viewmodel.InstallationState.InstallationGranted -import com.itsaky.androidide.viewmodel.InstallationState.InstallationPending -import com.itsaky.androidide.viewmodel.InstallationState.Installing +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.bytesToGigabytes +import org.appdevforall.codeonthego.utils.getMinimumStorageNeeded +import org.appdevforall.codeonthego.utils.gigabytesToBytes +import org.appdevforall.codeonthego.utils.withStopWatch +import org.appdevforall.codeonthego.viewmodel.InstallationState.InstallationComplete +import org.appdevforall.codeonthego.viewmodel.InstallationState.InstallationError +import org.appdevforall.codeonthego.viewmodel.InstallationState.InstallationGranted +import org.appdevforall.codeonthego.viewmodel.InstallationState.InstallationPending +import org.appdevforall.codeonthego.viewmodel.InstallationState.Installing import io.sentry.Sentry import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.MutableSharedFlow diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/LogViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/LogViewModel.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/viewmodel/LogViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/LogViewModel.kt index 866f0b895a..8b96d4481c 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/LogViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/LogViewModel.kt @@ -1,14 +1,14 @@ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import androidx.lifecycle.ViewModel -import com.itsaky.androidide.logs.LogBuffer -import com.itsaky.androidide.models.LogFilter -import com.itsaky.androidide.models.LogLine -import com.itsaky.androidide.utils.ILogger -import com.itsaky.androidide.viewmodel.LogViewModel.Companion.LOG_FREQUENCY -import com.itsaky.androidide.viewmodel.LogViewModel.Companion.MAX_CHUNK_SIZE -import com.itsaky.androidide.viewmodel.LogViewModel.Companion.MAX_LINE_COUNT -import com.itsaky.androidide.viewmodel.LogViewModel.Companion.TRIM_ON_LINE_COUNT +import org.appdevforall.codeonthego.logs.LogBuffer +import org.appdevforall.codeonthego.models.LogFilter +import org.appdevforall.codeonthego.models.LogLine +import org.appdevforall.codeonthego.utils.ILogger +import org.appdevforall.codeonthego.viewmodel.LogViewModel.Companion.LOG_FREQUENCY +import org.appdevforall.codeonthego.viewmodel.LogViewModel.Companion.MAX_CHUNK_SIZE +import org.appdevforall.codeonthego.viewmodel.LogViewModel.Companion.MAX_LINE_COUNT +import org.appdevforall.codeonthego.viewmodel.LogViewModel.Companion.TRIM_ON_LINE_COUNT import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.channels.BufferOverflow diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/MainViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/MainViewModel.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/viewmodel/MainViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/MainViewModel.kt index 6736fd9511..95e63f454b 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/MainViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/MainViewModel.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.LiveData @@ -23,14 +23,14 @@ import androidx.lifecycle.MutableLiveData import androidx.lifecycle.Observer import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.itsaky.androidide.templates.Template +import org.appdevforall.codeonthego.templates.Template import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.launch import java.util.concurrent.atomic.AtomicInteger /** - * [ViewModel] for [com.itsaky.androidide.activities.MainActivity] -- holds the single-Activity, + * [ViewModel] for [org.appdevforall.codeonthego.activities.MainActivity] -- holds the single-Activity, * multi-"screen" navigation state (see the `SCREEN_*` constants) plus one-shot events unrelated to * persisted UI state. * diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/MetricsViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/MetricsViewModel.kt similarity index 85% rename from app/src/main/java/com/itsaky/androidide/viewmodel/MetricsViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/MetricsViewModel.kt index 3a511114d5..fe112107db 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/MetricsViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/MetricsViewModel.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import android.app.Application import androidx.lifecycle.AndroidViewModel -import com.itsaky.androidide.utils.DevicePowerSource -import com.itsaky.androidide.utils.MemoryUsageWatcher -import com.itsaky.androidide.utils.MetricsAnnotationStore -import com.itsaky.androidide.utils.MetricsSource -import com.itsaky.androidide.utils.NetworkUsageWatcher -import com.itsaky.androidide.utils.PowerUsageWatcher +import org.appdevforall.codeonthego.utils.DevicePowerSource +import org.appdevforall.codeonthego.utils.MemoryUsageWatcher +import org.appdevforall.codeonthego.utils.MetricsAnnotationStore +import org.appdevforall.codeonthego.utils.MetricsSource +import org.appdevforall.codeonthego.utils.NetworkUsageWatcher +import org.appdevforall.codeonthego.utils.PowerUsageWatcher /** * Owns the sample history behind the editor's metrics carousel. diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/OutlineViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/OutlineViewModel.kt similarity index 92% rename from app/src/main/java/com/itsaky/androidide/viewmodel/OutlineViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/OutlineViewModel.kt index f26977b296..250406e762 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/OutlineViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/OutlineViewModel.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.itsaky.androidide.editor.language.outline.OutlineProvider -import com.itsaky.androidide.ui.models.OutlineUiEffect -import com.itsaky.androidide.ui.models.OutlineUiEvent -import com.itsaky.androidide.ui.models.OutlineUiState +import org.appdevforall.codeonthego.editor.language.outline.OutlineProvider +import org.appdevforall.codeonthego.ui.models.OutlineUiEffect +import org.appdevforall.codeonthego.ui.models.OutlineUiEvent +import org.appdevforall.codeonthego.ui.models.OutlineUiState import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/RecentProjectsViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/RecentProjectsViewModel.kt similarity index 93% rename from app/src/main/java/com/itsaky/androidide/viewmodel/RecentProjectsViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/RecentProjectsViewModel.kt index 39ee3f1e29..309ca4e66b 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/RecentProjectsViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/RecentProjectsViewModel.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import android.app.Application import android.database.SQLException @@ -8,19 +8,19 @@ import androidx.lifecycle.MutableLiveData import androidx.lifecycle.application import androidx.lifecycle.viewModelScope import androidx.room.withTransaction -import com.itsaky.androidide.adapters.RecentProjectsAdapter -import com.itsaky.androidide.models.ProjectFile +import org.appdevforall.codeonthego.adapters.RecentProjectsAdapter +import org.appdevforall.codeonthego.models.ProjectFile import com.itsaky.androidide.resources.R -import com.itsaky.androidide.roomData.recentproject.RecentProject -import com.itsaky.androidide.roomData.recentproject.RecentProjectDao -import com.itsaky.androidide.roomData.recentproject.RecentProjectMaintenance -import com.itsaky.androidide.roomData.recentproject.RecentProjectRoomDatabase -import com.itsaky.androidide.templates.Language -import com.itsaky.androidide.utils.canonicalProjectLocation -import com.itsaky.androidide.utils.getCreatedTime -import com.itsaky.androidide.utils.getLastModifiedTime -import com.itsaky.androidide.utils.readProjectLanguage -import com.itsaky.androidide.utils.reconcileRecentProjectLocations +import org.appdevforall.codeonthego.roomData.recentproject.RecentProject +import org.appdevforall.codeonthego.roomData.recentproject.RecentProjectDao +import org.appdevforall.codeonthego.roomData.recentproject.RecentProjectMaintenance +import org.appdevforall.codeonthego.roomData.recentproject.RecentProjectRoomDatabase +import org.appdevforall.codeonthego.templates.Language +import org.appdevforall.codeonthego.utils.canonicalProjectLocation +import org.appdevforall.codeonthego.utils.getCreatedTime +import org.appdevforall.codeonthego.utils.getLastModifiedTime +import org.appdevforall.codeonthego.utils.readProjectLanguage +import org.appdevforall.codeonthego.utils.reconcileRecentProjectLocations import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/RunTasksViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/RunTasksViewModel.kt similarity index 94% rename from app/src/main/java/com/itsaky/androidide/viewmodel/RunTasksViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/RunTasksViewModel.kt index 7afb9c9f56..34cc541501 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/RunTasksViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/RunTasksViewModel.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.MutableLiveData import androidx.lifecycle.Observer import androidx.lifecycle.ViewModel -import com.itsaky.androidide.models.Checkable -import com.itsaky.androidide.project.GradleModels +import org.appdevforall.codeonthego.models.Checkable +import org.appdevforall.codeonthego.project.GradleModels data class HelpNavigationEvent( val url: String, diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/TaskState.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/TaskState.kt similarity index 70% rename from app/src/main/java/com/itsaky/androidide/viewmodel/TaskState.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/TaskState.kt index c3a9c32a24..8d39a42edb 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/TaskState.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/TaskState.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel -import com.itsaky.androidide.tooling.api.messages.result.InitializeResult -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult +import org.appdevforall.codeonthego.tooling.api.messages.result.InitializeResult +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult /** * Represents the state of a long-running background task, like project initialization. diff --git a/app/src/main/java/com/itsaky/androidide/viewmodel/WADBConnectionViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/WADBConnectionViewModel.kt similarity index 99% rename from app/src/main/java/com/itsaky/androidide/viewmodel/WADBConnectionViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodel/WADBConnectionViewModel.kt index 398b413df0..65e14d9f35 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodel/WADBConnectionViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodel/WADBConnectionViewModel.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.viewmodel +package org.appdevforall.codeonthego.viewmodel import android.content.BroadcastReceiver import android.content.Context @@ -9,7 +9,7 @@ import androidx.annotation.RequiresApi import androidx.core.content.ContextCompat import androidx.lifecycle.ViewModel import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.flashError +import org.appdevforall.codeonthego.utils.flashError import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope diff --git a/app/src/main/java/com/itsaky/androidide/viewmodels/ExternalFileInstallViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodels/ExternalFileInstallViewModel.kt similarity index 96% rename from app/src/main/java/com/itsaky/androidide/viewmodels/ExternalFileInstallViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodels/ExternalFileInstallViewModel.kt index f2bb0c6dc3..2a13162e80 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodels/ExternalFileInstallViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodels/ExternalFileInstallViewModel.kt @@ -1,18 +1,18 @@ -package com.itsaky.androidide.viewmodels +package org.appdevforall.codeonthego.viewmodels import android.content.ContentResolver import android.net.Uri import androidx.annotation.StringRes import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.itsaky.androidide.repositories.PluginRepository -import com.itsaky.androidide.repositories.TemplateCollectionRepository +import org.appdevforall.codeonthego.repositories.PluginRepository +import org.appdevforall.codeonthego.repositories.TemplateCollectionRepository import com.itsaky.androidide.resources.R -import com.itsaky.androidide.ui.models.ExternalFileInstallUiEffect -import com.itsaky.androidide.ui.models.ExternalFileInstallUiEvent -import com.itsaky.androidide.utils.InstallTempFiles -import com.itsaky.androidide.utils.LastValueGate -import com.itsaky.androidide.utils.UriFileImporter +import org.appdevforall.codeonthego.ui.models.ExternalFileInstallUiEffect +import org.appdevforall.codeonthego.ui.models.ExternalFileInstallUiEvent +import org.appdevforall.codeonthego.utils.InstallTempFiles +import org.appdevforall.codeonthego.utils.LastValueGate +import org.appdevforall.codeonthego.utils.UriFileImporter import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.NonCancellable @@ -31,7 +31,7 @@ import java.io.File /** * Handles a `.cgp`/`.cgt` file opened from outside the app (e.g. an email attachment), backing - * [com.itsaky.androidide.activities.ExternalFileInstallActivity]. + * [org.appdevforall.codeonthego.activities.ExternalFileInstallActivity]. */ class ExternalFileInstallViewModel( private val pluginRepository: PluginRepository, diff --git a/app/src/main/java/com/itsaky/androidide/viewmodels/PluginManagerViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodels/PluginManagerViewModel.kt similarity index 95% rename from app/src/main/java/com/itsaky/androidide/viewmodels/PluginManagerViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodels/PluginManagerViewModel.kt index c4a27463f4..985b6455b6 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodels/PluginManagerViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodels/PluginManagerViewModel.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.viewmodels +package org.appdevforall.codeonthego.viewmodels import android.content.ContentResolver import android.net.Uri @@ -6,19 +6,19 @@ import android.provider.DocumentsContract import android.util.Log import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.itsaky.androidide.plugins.PluginInfo -import com.itsaky.androidide.repositories.PluginRepository +import org.appdevforall.codeonthego.plugins.PluginInfo +import org.appdevforall.codeonthego.repositories.PluginRepository import com.itsaky.androidide.resources.R -import com.itsaky.androidide.ui.models.PluginInstallSource -import com.itsaky.androidide.ui.models.PluginManagerUiEffect -import com.itsaky.androidide.ui.models.PluginManagerUiEvent -import com.itsaky.androidide.ui.models.PluginManagerUiState -import com.itsaky.androidide.ui.models.PluginOperation -import com.itsaky.androidide.utils.EditorDecorationBridge -import com.itsaky.androidide.utils.InstallTempFiles -import com.itsaky.androidide.utils.LastValueGate -import com.itsaky.androidide.utils.UriFileImporter -import com.itsaky.androidide.utils.getFileName +import org.appdevforall.codeonthego.ui.models.PluginInstallSource +import org.appdevforall.codeonthego.ui.models.PluginManagerUiEffect +import org.appdevforall.codeonthego.ui.models.PluginManagerUiEvent +import org.appdevforall.codeonthego.ui.models.PluginManagerUiState +import org.appdevforall.codeonthego.ui.models.PluginOperation +import org.appdevforall.codeonthego.utils.EditorDecorationBridge +import org.appdevforall.codeonthego.utils.InstallTempFiles +import org.appdevforall.codeonthego.utils.LastValueGate +import org.appdevforall.codeonthego.utils.UriFileImporter +import org.appdevforall.codeonthego.utils.getFileName import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.Dispatchers @@ -62,7 +62,7 @@ class PluginManagerViewModel( /** * Entry point for a `.cgp` forwarded from - * [com.itsaky.androidide.activities.ExternalFileInstallActivity], by absolute path. + * [org.appdevforall.codeonthego.activities.ExternalFileInstallActivity], by absolute path. * * Emits [PluginManagerUiEffect.ShowInstallConfirmation] with a * [PluginInstallSource.LocalFile], so the forwarded install reuses the same confirmation diff --git a/app/src/main/java/com/itsaky/androidide/viewmodels/TemplateManagerViewModel.kt b/app/src/main/java/org/appdevforall/codeonthego/viewmodels/TemplateManagerViewModel.kt similarity index 91% rename from app/src/main/java/com/itsaky/androidide/viewmodels/TemplateManagerViewModel.kt rename to app/src/main/java/org/appdevforall/codeonthego/viewmodels/TemplateManagerViewModel.kt index 13df7bca84..1bd672a479 100644 --- a/app/src/main/java/com/itsaky/androidide/viewmodels/TemplateManagerViewModel.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/viewmodels/TemplateManagerViewModel.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.viewmodels +package org.appdevforall.codeonthego.viewmodels import android.util.Log import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.itsaky.androidide.repositories.TemplateRepository +import org.appdevforall.codeonthego.repositories.TemplateRepository import com.itsaky.androidide.resources.R -import com.itsaky.androidide.templates.manager.models.CgtFileItem -import com.itsaky.androidide.templates.manager.models.displayName -import com.itsaky.androidide.ui.models.TemplateManagerUiEffect -import com.itsaky.androidide.ui.models.TemplateManagerUiEvent -import com.itsaky.androidide.ui.models.TemplateManagerUiState +import org.appdevforall.codeonthego.templates.manager.models.CgtFileItem +import org.appdevforall.codeonthego.templates.manager.models.displayName +import org.appdevforall.codeonthego.ui.models.TemplateManagerUiEffect +import org.appdevforall.codeonthego.ui.models.TemplateManagerUiEvent +import org.appdevforall.codeonthego.ui.models.TemplateManagerUiState import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow diff --git a/app/src/main/res/layout-land/activity_about.xml b/app/src/main/res/layout-land/activity_about.xml index 4ec21aaa12..da2413366e 100755 --- a/app/src/main/res/layout-land/activity_about.xml +++ b/app/src/main/res/layout-land/activity_about.xml @@ -60,7 +60,7 @@ - - - - - - + android:name="org.appdevforall.codeonthego.fragments.debug.WADBPermissionFragment" /> diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 516183136f..c4593439b5 100755 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -67,7 +67,7 @@ - - - - + - + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 069a7183cf..fa8c7121a8 100755 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -41,43 +41,43 @@ diff --git a/app/src/main/res/layout/activity_preferences.xml b/app/src/main/res/layout/activity_preferences.xml index f36f1eb036..d6f3a65558 100755 --- a/app/src/main/res/layout/activity_preferences.xml +++ b/app/src/main/res/layout/activity_preferences.xml @@ -41,7 +41,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" /> - diff --git a/app/src/main/res/layout/content_editor.xml b/app/src/main/res/layout/content_editor.xml index 0df1c2023e..55a0e42780 100644 --- a/app/src/main/res/layout/content_editor.xml +++ b/app/src/main/res/layout/content_editor.xml @@ -68,7 +68,7 @@ - - - - - - - -

Aa8_z|PR$JO=q6aOHi!XhKaM%({Y9-48UZ}iufQh|lMA>{(E|JPKs#RcB@ zH^`=3;MM<{tWMYA;p2Uyhll;Gc3iu_kNnp>>GlGicWXB>dU*J_Q4!&Pi!-(#^I7~2 z_D>4B@HyhF7C#| zxodulF`g9p(-u`p1|;6DN)iCVtBIuZs}bD&d)N`&am3mY@ys{Fp5Wq6YdMjIw5k(P z{LlZs0+x1lVvieqhdyMc`;X{Z+gd^|>`^NP`C1|#+y5h9h)>;54*Xm1CjNLG?nR?& z6HA)wt1!^?by^g-|Bct-0=y2#dG)s+P<*{X+QHiRBR` zi68Ot#AaUwo;dz^k0->p$p6826H(C$=DT}0Q9D^N)Vk7PxYA*`(qR}kB$e+baF_KR zyqhozX?>La|9m$gfVnpa4ZK0KmEwKC%(?KiAKtFdRf=E9STSD-hhoCM`O14Z%&QkF z>*Id1Xt7c}d%3biDPa7PMCD1u-bfg2zpTU+}&v-xQx-C;x6emBqQYAdCF5R?3xfU37NLAvQ>DW}IGeBypasq&6 zr4p|nMy^!e!a~}wQ7#1dd5y9NU|pKB10+68Q%(hA_NcTOG*ct-O=PC>^-4O zs_`Q(#_&3QwVC;JI63+UzE1!BV_ej?I)3u(-*~6~hrQLD##fmCAAOCBzHe!cR|J3e z(fYCW=0EuNxP&Dm&A-PFa>1kZhjdnjxg8CBsmBp&>GNFpbp1ZgY)(S?^EL)w=ihG+6r;P0rhb}+We4u zF~FHaYPb;*W*t_e=fBW6SA7a^#=qvPTOw7<6Y3BMZaAS9y_7GVRD&@^Kb};hM_0d7 z>P{Sa$^2p?g^!JGJ*DmqhSq6y4l>wzPCXWFwHgKLl>oT~YH&BDO$*gwkhrN3*Z^KA zQcu8A+WxF|g5b!X)htFwUQ(lT1zmep-PW2UdvBXKw&8xC+ML-tuS0GwrKflI+*>k> z0}qg^Y6X_TU&k_p_1D#Ci_$SSp|W5*-c(~xUAn1WfY!uB_~%WN-l^-->}OglRV0M_ zwrlOz$FE73Vc=MCOO0$yvs4Y9XM)dT^=M4o{zQ$= zFOQ$7T`_2Qrk)9~;+Z-d!1uY>jF{)@ArQLy9DA3#y-??CNpQDN_0K7VsRui$F5jsR z-*1$>1R~%R^hzzdVcsiKgUkqVuhq51a^9%hLa^+Ox-Sm0?>n^xMh|(f{%B4*U2AJr zwSU7IpFcMvbod9XuJG`KdJT*so%KZxcb9Zvxj5|c2t|V8YIfAUG%QQZ~Cr_q<%Tz+on`zK<$3dG_+%fwmB-H)@uERbCEv!{S zph0^CHMyM$vkOg3T0Kfd7c1>j#5>kn{IaLuS5+&z`CO@{g|$rZu+zGM*J$xPSz>Np zNlEJG=CHtzvDbp8r_~*_tpI`@v<-kV)j_N9`7zH|fA?pZs%?oK_z&}E30S5*4g>dZ z9IgKT3D7&S+FJjcE-c~?98jwqEgT5{-6PfI-3_czx=-5_Mf6AgnS)`{@9!55@GGEn z?lWyTOpMB7)F1H}b&9i20<-SNb7FxnfTr(-@7G38(>lRJL(7&R!v86smZLHnGfitR z6yK6vmwrD#dVr^@#lq(ZU3}#UYUM8&L<<(x8EQIOP;x4%7!=u-jlgnlNmDeh$Er0KF~1wg9~oKw*I1SwqaKR7tDT zUAnD5IUhT|1sv`T(FX&A(L?m&V}rGUdN>OF;g-dt`d18e!9UN&F-ocBeuGs?ACn`^ z_JYq)Evaq}kF);`v*!?MMoqoK|B z>cszBeM6=F^P~RC+v709k8S^SpKk~PmH(eIefBfoo4qqiFs#&7-V;^c6II?5RoXk> z)tA4)-l_Mesq^jK_OjI$HZlU=e%ZO&Vz^vJG<9gu4vTnU)lcvPa-imaS!aQ67(ITn zs4x7q-Xa*|*o_wOjSOMZMvJq!%WS&^egYBj(^iXExbP4rWm$~J_?Ouh8gPmD@lFEa z#d2!CNh1WeFg{g5fBeI&pKrfuJ!z>amhMzFX4-gQqR3f+%- z$zvrEPHr@I`(90*P5X@K6;*lF^J8802=If}_|459Pq)J@k6dLr3S{;_W#H_SQI9k5 z3#+56T1vjNN6W=R?G}~`Y$|P?N?WJW)~U30z7tz#Pqu0Kf3b2J2=T6_X1Gf{$H3j1^Qyfy$(WVHq-zgLkrZgVnwoWv) zhXs(9O*X+b4^0|r?n1NuO^s-53zJG#Q}KIL5ihf+hu52IsmoN81_(2zni^C4Sd#@! z3^yrh;-9g7P2gAF3H~+z<2!MH>*Jew{?4g*gUOSQoF+06OG}?-LZ4{(y9qMHuV%sD zZD?RCldH^sGJJn=vU$st>83i60Dm^6aZx50x_G+C0U~NqZ}8Y delta 34573 zcmeHw2UL{FvOkl)Ff+}}Far!pKokrJm=#5W5hG?r#f*t$TC;+#33UyuwkRSj1`H^e z+MF;a%(|iiV#WYw6!l;Ax%b_7&w2Yl_q}(|yQ>G!ksnoEU7f4DI(%G68CbM>U}nc) z8DSk`OcP{)u{Y&fK)UF?%?<#=USb4p>S&WQa*vELnSdPWC_5qtGNjC=6_5qvOiwXx zT)w<3O65fw@&OJ<8NL7NrA$f2t|7GJID>`xNVa|5fDal7S{?N>=t(|lyaFKwmc$M7@s%iM0%T4%^aZYdh9Qjy(&e(z1|Y>o zFD;~`3dZ0ZvTll8W#fRep!egW9p+vXui#>O5-iNNVE;b+Yme(*DT z2G(m%KO3Dq;nd9Cz=@j`3LM!!^=$=Uiict}Xy0CAfwf#uPFJ40^l-bo3_dLYc7=vPL#l`~(tTn4zs~d-L?BSYwl0D(tb0 zIR)w<)Fhj4b5p<(pF)GQIE7&Knt^o4hpR2go``I0kdWo@;ksHOVcJ4 z>8$twA_c$NOv0RI8BEm`N}^|k=9^4K(r?@QA4tKl7+cd@Ost?U8LB1$6I(BP3Rx&}~NjQHt6@Esa!%FE` z*<^)TDju%L2e>psQ4Ju*!_*y`q)$$33|kycvVn@YLyS` zeMXVNpfBSJ_Nk&PDe!at)w2)~IEL6lyqIg7vF@C1P5@r)IN}P)W{y>K0p@ng+|E)8 zdJXghc0{iU#G+n&Y4Cs;Wp@w3&;5Dl;b(k4boYcW`8PrAa4fln)m31p`4zxtCaDZz zkq@DIXrR9d3b5>hp%JhG9$kmuXA`I+n&qg0p3hR9G;JWogo95{02NneI1beIHqR+$ zBk!wWBT&D*+zYv2S*=YcQPl7z(Mb0F8gXy?g9i1g3svWMc1<|7fNVeThRNgvDmOt9 z1>yy~RT_x1k`Smn&{9xZ88cbDlEAR1BQ34kVqi@TR>sn3SsE~PR#rU#B4o1m0Q+Pz z91cY?*#Q7UFB4QA11lDZYP>nwVSr*z_8GV@c-a=Ls8woNIF!)QDjS$t8;OV+kOgXt zfV5zv0>(G>v6MkKqFEUv7KMhGB9usGD%#qUxb;ncJ!mcti(2USqIZ5Y(LHQpxan8C zlTb&KY!8TC%2HsDd}@+SHISKcw?4R;ZXBx~o*vTRh%=-RX^Ns3cM#?JB5N5|*^g+W zX+TXh?=<-$aRex~v~`D)z6`Qzj4j}Ng~S1wdWB%Svi8@>AZ&xf!BzoMTePw2g4nN- z49y_BlS}q1)@KID6dbAD_IV;l{;!8#RT)4@Is=&6^>^kh<4dd8UD4)H6l?<5PyK|VtDnA?;lN=KAB5TH!Pmb+AJs&7d? zH=jI>vE26qlP1A*k=jfNwv+Yuv&_X3RA{N32#|6^gVsfN6KoxjtAdqXG-SBkJ+;2i zsBI0vu)H&s0zWHU9{|uKSF;``f6PQ|q}~tlV6?s~ z_KALvH0dbj+R<_+kcXaV!hvMYy_7MCi+U?dG0%&OHFf}fC+jN#TrAe?g+Tu)`cRCU zH$eFT$h_AYX}*5>MspR}2f~$a050{ltP0T4WR0fC`)55EF}k?F`QqOfkF5(jX}QoR!dQ{8g?bV44VS?{=f-y*(V%1gqM zfraW_lk`~_)7eTJfTI0OT3E-iLnbX)Z0Ogi`gQBz09 zY;w6l=g^1M+U6TjBJ^+Ug>amr))0EhiV$zgTLFQ$eaxrEq zZmn`4%BCFEy8wCQsNNn)*K{Q;$Y{TGr7yrGnLJQMB31@L-%D5aREVU;c-g!KZ>GcQ z>!iN2j3cwgAL>9@REE+9l?I&Aufu9d4YN*0Z89QH1Bl+C1Uo_lF6v#(9= zc}tms93iZ38~JpU-`!3QHAjcFmsjNpfB5y+5JD5%%h8+}I>^CvvRfVGML1WU=px?) zrohU4Gw@Ozix!*D8CG@~L8e#@DAy(;mEKzVBPU49!?USYZ!&MXb9YaXMt7 z#c~gHYX0p$3*A&vu^%$>KXzLDX{xBG@$d0k=wLs^KIkI) z(eZn8ToNpE@6ku&6=T63EG~CmzE|gk-P@)Ra9I6_mKq%wEp2l_5dod_U*)~*R6<+iTe z*8PR|Yuwqq9jfNAo5(KRRDHz_pi8$@EjjXA{ozHh0h+4{0akRbsxH9VTvZ{!+}kQR zN1@kmt8gbV>W<1EV9Omh-i6{%_h7@nzM%aoQrQ^Ecvd+}Vg0i!H`shSSpP^_}o zku$#*O?O%Gv*}?_=JZyCH7izy!Uk9PuRY-Ob4>~6k2QX!8inz;zE+(zkk{vq4Ck3ztsZH0NK1Zszw-m@-60{)_No1JdcARG$E*mZ@F>M15AB z0ciL|O5oBLRTyYk>chbvE5utBraZUHbIPuGs;}aKy~neR$&prr?>?we!|6hNo$t3?ezGD_q183FST-aBy5c}Hy3l^ zWy=*nG`*RV_UaPsxg0`F@sW=?3kz$#g@qT*vgJJJG6!yxk$A_MXKWi3y6%0w?A9B; zRD05m&@PT#SBSsSk#j_KC!MfX{zJlI{W z!{LrL)7Imp{o)DrxoK9UETv%LPYH2}rj3I=lB}+_Csf^lTMW5KYQQZ3>1qw78elto zxkb3$+1#JQZEH3ufa`^+-3a0`F||1@I012SFlR>o#x|S>Aidmc+t%E z^x*13a`a^{&JDoWo5K@@PrW%m@5H4A!Cbb@K3a)H(D+3PPhjCq@(!&WoHiE-bOv?yt zK{hUe!*e!TDVl2oWK1+?i{zY<9IlOajO6evjU64u)dQrZqq&vD#CraQO7T@sRa@T0C!=4BY#6IEIoNV%_h)|7>N=ZSi&{_4;g$h}&E-5G zbkI>=ZP4+9qHgY&q@Sorn7a3cVW3pqHDp%)f%H2}&MB9jeWBpCzdv4ne$y~TPN z_X;%&%ejsKq06~d03VifWf1r_kqbhF4U#xdAO|OLdf1oi?03;_SWd%nFF&u!ne?u# zFt6`dLgQC)aJ0uRuHv>}R;I0n)`XZnQn_(FaeedAJc6+6saznYX-85CSr=@#2UrMHlBE7$p+YHJV@8Yu6B>u(VSvzW7=?hiJU@(B? zV^USw@8((oHE=fv#~$p+Zf-jkV(eaS1Qx$wKePf&KL;dZ5psa5h}j)|kQ)SW^B}hs zWak``T8bV&%ykB?-4U)Az}O?)IsnI`&?(?V>nOJm2Z#0qw-n&F6I>nO-Z;U{MsD9T z+*^RIXC-qx@hpdTkC^&A=Z&fPUXb!I?t(Npzh2;mTaqxi0c*q%i5}g4!#pO&J~%cnT^rs9X51eYFnF z7*)G|egBP9XN+#CEekz6Yv(eU=dN>Y(dabFh5iUQ`8Ky7v(xY{7YDHKE;k&w?s?xj zU_d^HhjVOL0VDMf7)AcOC7>#>9-k8n^@r^noCfCG=YPzW?X`6e4#gq?xzErPm- zN$nYT1Ok1Yb7iQgMlskx7;D8`UjW+@De=S-X^0&v;S`u?_AAZ-W%J%hhGh3!ZW2&+ z-f;r~mcQdRfK1SP&JJ_Z`y)35$YUS52N0EREW=*UT7Bj=@PMzB{6@r8TE3;+L~=A4 z;Y)pf^K|ua`^-`I?GH;}fLQWlA!3w{&jDzn=bwUnRRfQEhqRWF2RlcP82N3$9b@9# zDXdA~vZj+?Wz8Jz*>YjBV};LYjqk!)|8-k_IrQ6JVU3_a+409ARzrJWfz`I>VZNeO z9QY0*F+EvG6qSF4%Q6mpq7{+d3To3dPJUjd91!T&O=wP7bw^$U-J1Ml;BKqQ;~6+p)!}Eu9iUg^>W#lV?&qVc2%~lRpRkH88}c}4 z+BD>+0i12fqY)}?$U{4_8NR%9R+!v~U(S)r%f8qX+PE=~2I!Z@{6qlJkB7Av3-aTo z_0ZHNJkBE}O?a?qY_mWA9ur>^#8<}xU2MuPLhRohw1Zet3qB4YvL%m8E>$aj8x~-9 zYaVPT>(GYZEVCr9>UrO>7<%1#&aPMoNUj}!3c@b8B-&hEv_|f3h65eUm zntq7|_uq^^UDF-zq=oZ7m{i^{zN(REk2cF%^XSY(!D?1Q``g-gYoJYs^SP+!{RqAe zqGu%Uh5C9$OLd(Q&BG+kCdKe^$o)J@sNOOm19;QIW<{?^l6GdjZ|=@edtX^)@E`^oG{ z^&?p}^*(m=m=PXaGU8O{JyX=98^lgBn?H2vvoYGT-6wV}*9 zrvgm=@lr9fuXXzfT`}FuVLSA&pxQ7)zV8UC?!xaM>y;@RsU^O2kBfC;~e;n-r zX;L?#?bbj^VSTrjPehgJ>!42&wtoG$%oe1>7$VGR11~KbJ8$H1LSZvD@ttJOWX|?6 z@#KA%qzL)j3w7hVIC(wzefX{Gmpt*;w;$7 z=V6>k#*YNZV=$1R+wbNdV1F*z$Inxc-|;#EKNR!&_yBKELBPkO(sDCuUzBt=*wNU5&&+Zo=tSKa{@@Zaj;e5~WKSTUO=lD!)$Cw;`65_Kz6C?oA5stxpPz$m;Et3B9Kf z`X>ma-sjT*nm^!s03<))6WmB@D{DGvt>$c$$G#)Jg{r$Bn(lwKjf9$=R%z*%DktA3 zfiv`w$GJB3A)gI78vKY)MrFz;Jls*BGoJ9jI1&EWi6LP^p761<_BZ=f8=+(G=B=6r zXHWT9pdrlbDKA}h>Qf|5cr5%mACFa5@{-4^AXde^37gHM1g0Ng8(&MtyzOf~2CL=3 zJFu>VZF(>D1?u++Mg$o3PtdhBB&6={sF>`O-Zu#=E#v!v{L)aNiZvN%|1hRc(oZ++ zZq;{RmAWEvmQyxaN`>(dQ!f*6bkcOW(8HA+NE|eXOi3IxhWy@kNCas*ZAp_m>mLP% zy2Ux%47SLHnpOxnBc&>Y2#9Q{6wYH_Z>xj`kQlQT1#|(~8MPp-EISCX)<6WeDTyYT|0JX2(Ug=qaM30*PzE_XqJ18Q$IA=;jpHy+ActJQsq@}I?j-erBq_wx>IAKj-9 zF#f9xFe}r^)rI;1JE{xAAaVsy;UuR0&`SU}lCJRHKp&P1_`(w4U z7=NJ_2V`1vAswJ?3*i`W4K0N*tcaLkAr6IKwH6uz>Dfl=9Q0#bfw>a9PRDP#t+Z{j zHD>jd#9cd$sikQfRN9EnRqHg_;ay`bE+3$U?TNxa?Q=(`MmCNYl*{K{Oqn&I@xWQh zz8Cw!tlvR+jU%9GX90#jW1WRlm|ARC0oOdAx(c|a9NA6kabLO#MJW3;RERW^F4y-S z=-4-7a9Bv|O1@R+KiNar@Ls|=xZxF@yZ z33z9W{t_c>s6@V2bf{Z#>48BpSz%7xaeoFnW(S~g#(hLJrN2>BS9EEaI>;lEf| z1aNV&fHSf85}_(U&m}?)fZ0ogb^zCw2*)Af$^^jybHS+41{Et-2;K@pJkHs-8+G+Y zx4m(3uot;X2$ku`*tvr&#|;~I>f@3vduD>|N|tQI&1A4m5V1!JSPnf&Yq%vL$?a>; z_=fM*6Kr8VOof35$+6!AwD^{M#*MaZ4!m0E0; zM*7svQY|KJ7TQ4AsFB?G92ljHtKa{GYM=e$5i_Vr>pM2H1-osU8;AbIa&Qi-jPLxaHW#^XX2fW+fy z7g*2<0avZG)k)zBkdCLo>H^v9v^1u6oEFM}$~q(9%If(UAs7SepM$9b%6d-N43Kyp zdj@-S{@V!RazF^4ALR(uIg)Mr*#H+PbA)^>?|{ofI`kT$49+ zl7V;+wyUE~xp#9`jj&ulJGgnBSSomdnp35MlaY8V?r*+X=u+7`yOM)bahuUgz{M^F zYl^PA;0EerKSEtwlDE%NVsl@ui#*r$#xhu2e-e`I$cdlc6t;TY&}}Ps`td36$6ubP zoP{Zsrh{EA6JCLa(VvAG0C9uFO4NslPOQO~Z^icgDm1}jPLPQw0RrV>Ge~KcTpXmZ zBOg~@_svbL(j&XWp0-D-{l4IIr|=`8=szep@i|DBaAFcj|H6w~P=}vd1b3HBREwdw zQoW`Vaf&2*5hgCSQxAbazA}h7fSOo|I8P;5i4!1@7{yf>xXC1fC8MjY#jOAxY(z9V z`8FahkUQCml|Xcyt#}JXJK2c?0Cw7mI1zra6Sp8Y!$EY0-RbiVB2estqbO}+O|KwI zqidD3h#n_xS5d@jpIlKK3Q`Y%g2rSf4{;a6Nwgd;iH<3aLpmz0P-IY-;(628j3 z+_Q&2jr85{x;nJCr+7`~LJEB}_bfZt+`qNXVGnyl=anH&^$rhNVKsT}oC^*IYe6k} ziTgqCVK1=^b92B)ssZ+~rkI2DncAW|bWB=OPs|7Ma(yuzGPk~=FXo;4HWCj4x3rOn zemCvvCvE~#)&wd6NOylR0bsAcSOAa|ATG5gv#y;GHgz+$s^vJM(XRWu>P$T7L0F4G zkw662B?u}S@Iq4&-<+}MEyONZ=%6;@NZ8w+dCBNAq#gKR?ZnBzZO~p^h|;Gzh=XNr zzAJE8g~ zJw$(0R5etTHsphPi_((FKI~hI)a@%uo^hjoVqJ_ra)21Xk&@1H4ugdsAi^?_aV zErEN`fBUy4t}QH?`54g^Gro5`bV0!36U9&-@OYfqA3I0KnW86cUxBx#Ns~l3 zHgA>~iR{vN=n=5-F;DC*0DAr^`lFVJ<)UB*I5ta6(E{2W6c=j#ehK^e8PQCSofdH| z-t3I{+kb?BJr!eRLI34N2CtZiu|tMMjrIx-k$zDRi;RgLHOA$?6s8BxiS_>LQz@!D zFM9k*P^a@^wLb}3eqMC@lb{>t#Y%q?WP3pz`X@mvFNj`$9^~X2JZ5m@|G$jYa>QDH zqG5c_pDKqSS5}xK23Y?|T>l4uRtaq81JT$0KUzz=Oixo{wcIkTy0&zmzMfXC1RKa2 z8PqeeS01raA9f|}W3O0@dE|ep=lBPk51*9j75WCm;;UNN&&B2`-|Z&sH=|nGmV9nf zq)vsvb`{hM0q#_gL_bte!@zH=g09->nObQ#y?8dfWQWhs%+X38fl$S3VMmEoj@K5V zyClxn*2Y=Q?-#AKanW?4mLdPsBJBypqf4~CaU;WdsdfmEvzKb|x&%vD2JFh@{?vYT zUQK^}aP7*tq_>+$U?1C!rvsh~?SHlWlArMOxHK)kAt`qV(CNa<2-E z<#*~;;fJMuWUoq38(xI3Mg8l%s{Pz|^ie5%m3^P}`9gNtmitrX{#3a?1&fYye+nw$ zFX>NJWbkFF;eYq17<^Q!8=h!?D6)im0d(mz=>unno>?{os`Qy<134+9VczEYZ1{6a zUvRqU+E+md>o!FzZL(Jc+I|fMC?$<2j`lBfzAV<F{1h=OP_m4Wm<^>1F`PpX)LKwm+AOQt({Y7pTA& zSfP}@&}AFQp!N~E%gb^S_qDdXmRHFO4&`5h5NJAEtdp)7wtJ<6e!`x<(p8tzd4pBQ zdcDzg$9CQRPG^nm)9-bqgtWfdOzG6K?(|QeeBnyl2h1)DDb=llcB3!KbZ|yUkAIe0 zy6Cg+1yHxXU^k$FUv zl^*n*Gg(WhXfFP8XCIcB5N<3mXrtk-7) zNeudfScr2*y$j-VYyDBT@;SYHPPcYfy2}XS-V& z0_@2?F)!rGnGYY6PrqK0-9P)_l*s|r8?zN0Tm-c;z%65zV`Y#giH}A@l8NNk+HxoR zy~Wr%hQlLv|Fp3B2e=2j(PV(xiJdkX4l3-)7z@qyW)=sSMcT^PeWk7V%%Sa+nWKll zhiTmm-~9%`opy#Lh^-t9_@zm<$H^dFsquFH#5hwr|woC zaTNY|7Wr>iM4AU#4Tkpl*L`S`S|*x!wxOfdNBMWQubEGMlEB^!iLshezPVZc+5Ga) z=EHVW`R1kzRKj0wbCc!y7^DA_57af(I11(|da9QZ_8(cd-o`K_clI%&mk||aoK=BX z{CdpaqV4(%8;fw~J{HdG1#zCO=QeUHVBcJPUgnhgpbXFX(&8%k=j~J6-3+*r9vIN~V{*PRizx|1? z1~eqfCJSO?L1&=h@SM1_t|{OrJ29EEy`32&jF~<1cfIUkaBMaD&f2Hb{PCkuxK1{Kdz&bHP`g7b#xdw zI^WeF1jD-oqAf{#;`Ef{TG{qK&>-ybs5 z(j;pK_-qSdwyUfMs}w}&!!_1;Ln3vnb#2D4wH}1Lh;`QRod$My zo%I=<>o#n#-U)2hca!y0+(5s(#d@qXT({&qiihzef2VaZY4=8ryub{P%k} zr=TJJ`}fWN=G-)M*EXsj+h-YOX*&$s=U;a?!_GL_s=l}PyZLNk zW7~L#a(AWNT`6~0V8K!Du0SRH_1qQwOUA68%sl!Z-IcoRK{azj^e>#f%sqI(@pa8x z;0dUOMQga&+r%7g{^R%6-OQQz4X%)Z<_#$Kakx2J`A1k(v^iM>9+_Zn0dpQ5c}43& zLu3k`7B{vr&;#4djx<0`lyvhXGw7gM8sbM|k+F3R1ldeB>%VbZQkS*Bi2o0U2fqK* z!xpZJ2E>~6RJX&dr3d}YmWt|?Bt4RVk6FsEg+-&keUS`sO`LDdKSW@Y|C^5d6QKR< zl)okCf$Q?-iu4xnCu&+kmZT&$$C$PFPLZZhl`;z<4X8^`I3}nt5<-e|mDD^<3X#Q{ zt5ToWHj?gT>7W{)m(lhCX0@Wt4nn1HeNS_JT0Bik5*Q<(pa8z#H2Um@;>7foDe0;} zh;;SyA9c5AgV_WAngaxW4urCXfB8EfzAzhS&a%at9}izwO*9v1|7Zp6I`bIIKYpLN i!^~Oz@%y3^=C#-={m+>zQkVBSXDp{9OE_)b$NfM1A>(%d diff --git a/common-compose/src/main/java/com/itsaky/androidide/common/compose/IdeColorScheme.kt b/common-compose/src/main/java/org/appdevforall/codeonthego/common/compose/IdeColorScheme.kt similarity index 98% rename from common-compose/src/main/java/com/itsaky/androidide/common/compose/IdeColorScheme.kt rename to common-compose/src/main/java/org/appdevforall/codeonthego/common/compose/IdeColorScheme.kt index a777ae3fb4..46b1000bc4 100644 --- a/common-compose/src/main/java/com/itsaky/androidide/common/compose/IdeColorScheme.kt +++ b/common-compose/src/main/java/org/appdevforall/codeonthego/common/compose/IdeColorScheme.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.common.compose +package org.appdevforall.codeonthego.common.compose import android.content.Context import androidx.compose.material3.ColorScheme diff --git a/common-compose/src/main/java/com/itsaky/androidide/common/compose/IdeTheme.kt b/common-compose/src/main/java/org/appdevforall/codeonthego/common/compose/IdeTheme.kt similarity index 97% rename from common-compose/src/main/java/com/itsaky/androidide/common/compose/IdeTheme.kt rename to common-compose/src/main/java/org/appdevforall/codeonthego/common/compose/IdeTheme.kt index 9fecc28919..b45a37f695 100644 --- a/common-compose/src/main/java/com/itsaky/androidide/common/compose/IdeTheme.kt +++ b/common-compose/src/main/java/org/appdevforall/codeonthego/common/compose/IdeTheme.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.common.compose +package org.appdevforall.codeonthego.common.compose import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.material3.LocalContentColor diff --git a/common-compose/src/test/java/com/itsaky/androidide/common/compose/IdeColorSchemeTest.kt b/common-compose/src/test/java/org/appdevforall/codeonthego/common/compose/IdeColorSchemeTest.kt similarity index 98% rename from common-compose/src/test/java/com/itsaky/androidide/common/compose/IdeColorSchemeTest.kt rename to common-compose/src/test/java/org/appdevforall/codeonthego/common/compose/IdeColorSchemeTest.kt index 0c8b63f5d9..dd20a289be 100644 --- a/common-compose/src/test/java/com/itsaky/androidide/common/compose/IdeColorSchemeTest.kt +++ b/common-compose/src/test/java/org/appdevforall/codeonthego/common/compose/IdeColorSchemeTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.common.compose +package org.appdevforall.codeonthego.common.compose import androidx.compose.material3.ColorScheme import androidx.compose.material3.darkColorScheme diff --git a/common-ui/src/main/java/com/itsaky/androidide/DraggableTouchListener.kt b/common-ui/src/main/java/org/appdevforall/codeonthego/DraggableTouchListener.kt similarity index 98% rename from common-ui/src/main/java/com/itsaky/androidide/DraggableTouchListener.kt rename to common-ui/src/main/java/org/appdevforall/codeonthego/DraggableTouchListener.kt index 1c768add32..c48b8391cc 100644 --- a/common-ui/src/main/java/com/itsaky/androidide/DraggableTouchListener.kt +++ b/common-ui/src/main/java/org/appdevforall/codeonthego/DraggableTouchListener.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide +package org.appdevforall.codeonthego import android.annotation.SuppressLint import android.content.Context diff --git a/common-ui/src/main/java/com/itsaky/androidide/FabPositionCalculator.kt b/common-ui/src/main/java/org/appdevforall/codeonthego/FabPositionCalculator.kt similarity index 97% rename from common-ui/src/main/java/com/itsaky/androidide/FabPositionCalculator.kt rename to common-ui/src/main/java/org/appdevforall/codeonthego/FabPositionCalculator.kt index 2e8df75345..4312c6a445 100644 --- a/common-ui/src/main/java/com/itsaky/androidide/FabPositionCalculator.kt +++ b/common-ui/src/main/java/org/appdevforall/codeonthego/FabPositionCalculator.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide +package org.appdevforall.codeonthego import android.graphics.Rect import android.view.View @@ -6,7 +6,7 @@ import android.view.ViewGroup import androidx.core.view.ViewCompat import androidx.core.view.WindowInsetsCompat import com.google.android.material.floatingactionbutton.FloatingActionButton -import com.itsaky.androidide.utils.dpToPx +import org.appdevforall.codeonthego.utils.dpToPx internal class FabPositionCalculator { /** diff --git a/common-ui/src/main/java/com/itsaky/androidide/FabPositionRepository.kt b/common-ui/src/main/java/org/appdevforall/codeonthego/FabPositionRepository.kt similarity index 96% rename from common-ui/src/main/java/com/itsaky/androidide/FabPositionRepository.kt rename to common-ui/src/main/java/org/appdevforall/codeonthego/FabPositionRepository.kt index 2241a002b6..ef3259d3c5 100644 --- a/common-ui/src/main/java/com/itsaky/androidide/FabPositionRepository.kt +++ b/common-ui/src/main/java/org/appdevforall/codeonthego/FabPositionRepository.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide +package org.appdevforall.codeonthego import android.content.Context import android.content.SharedPreferences diff --git a/common-ui/src/main/java/com/itsaky/androidide/FeedbackButtonManager.kt b/common-ui/src/main/java/org/appdevforall/codeonthego/FeedbackButtonManager.kt similarity index 95% rename from common-ui/src/main/java/com/itsaky/androidide/FeedbackButtonManager.kt rename to common-ui/src/main/java/org/appdevforall/codeonthego/FeedbackButtonManager.kt index e0e954cb0f..ad78cc1c68 100644 --- a/common-ui/src/main/java/com/itsaky/androidide/FeedbackButtonManager.kt +++ b/common-ui/src/main/java/org/appdevforall/codeonthego/FeedbackButtonManager.kt @@ -1,13 +1,13 @@ -package com.itsaky.androidide +package org.appdevforall.codeonthego import android.annotation.SuppressLint import android.view.ViewGroup import androidx.appcompat.app.AppCompatActivity import androidx.lifecycle.lifecycleScope import com.google.android.material.floatingactionbutton.FloatingActionButton -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.utils.FeedbackManager +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.utils.FeedbackManager import kotlinx.coroutines.launch /** diff --git a/common/src/androidTest/java/com/itsaky/androidide/utils/DatabaseVersionResolverTest.kt b/common/src/androidTest/java/org/appdevforall/codeonthego/utils/DatabaseVersionResolverTest.kt similarity index 99% rename from common/src/androidTest/java/com/itsaky/androidide/utils/DatabaseVersionResolverTest.kt rename to common/src/androidTest/java/org/appdevforall/codeonthego/utils/DatabaseVersionResolverTest.kt index 0ee2f4f96d..d0259da329 100644 --- a/common/src/androidTest/java/com/itsaky/androidide/utils/DatabaseVersionResolverTest.kt +++ b/common/src/androidTest/java/org/appdevforall/codeonthego/utils/DatabaseVersionResolverTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.database.sqlite.SQLiteDatabase import androidx.test.ext.junit.runners.AndroidJUnit4 diff --git a/common/src/androidTest/java/com/itsaky/androidide/utils/FlashActivityUtilsKtTest.kt b/common/src/androidTest/java/org/appdevforall/codeonthego/utils/FlashActivityUtilsKtTest.kt similarity index 92% rename from common/src/androidTest/java/com/itsaky/androidide/utils/FlashActivityUtilsKtTest.kt rename to common/src/androidTest/java/org/appdevforall/codeonthego/utils/FlashActivityUtilsKtTest.kt index 1b2c22680c..a8b984811c 100644 --- a/common/src/androidTest/java/com/itsaky/androidide/utils/FlashActivityUtilsKtTest.kt +++ b/common/src/androidTest/java/org/appdevforall/codeonthego/utils/FlashActivityUtilsKtTest.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.app.Activity import androidx.test.ext.junit.rules.ActivityScenarioRule import androidx.test.ext.junit.runners.AndroidJUnit4 -import com.itsaky.androidide.testing.android.TestMaterialActivity +import org.appdevforall.codeonthego.testing.android.TestMaterialActivity import org.junit.Assert.assertTrue import org.junit.Rule import org.junit.Test diff --git a/common/src/main/java/com/itsaky/androidide/activities/editor/HelpActivity.kt b/common/src/main/java/org/appdevforall/codeonthego/activities/editor/HelpActivity.kt similarity index 96% rename from common/src/main/java/com/itsaky/androidide/activities/editor/HelpActivity.kt rename to common/src/main/java/org/appdevforall/codeonthego/activities/editor/HelpActivity.kt index 00fff79ace..f4ccef8bec 100644 --- a/common/src/main/java/com/itsaky/androidide/activities/editor/HelpActivity.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/activities/editor/HelpActivity.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.activities.editor +package org.appdevforall.codeonthego.activities.editor import android.app.Activity import android.content.Context @@ -29,14 +29,14 @@ import android.webkit.WebViewClient import androidx.activity.OnBackPressedCallback import androidx.core.net.toUri import androidx.core.view.WindowCompat -import com.itsaky.androidide.app.BaseIDEActivity +import org.appdevforall.codeonthego.app.BaseIDEActivity import com.itsaky.androidide.common.databinding.ActivityHelpBinding -import com.itsaky.androidide.documentation.DocumentationRequestInterceptor +import org.appdevforall.codeonthego.documentation.DocumentationRequestInterceptor import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.DeviceFormFactorUtils -import com.itsaky.androidide.utils.UrlManager -import com.itsaky.androidide.utils.applyMultiWindowFlags -import com.itsaky.androidide.utils.isSystemInDarkMode +import org.appdevforall.codeonthego.utils.DeviceFormFactorUtils +import org.appdevforall.codeonthego.utils.UrlManager +import org.appdevforall.codeonthego.utils.applyMultiWindowFlags +import org.appdevforall.codeonthego.utils.isSystemInDarkMode import org.adfa.constants.CONTENT_KEY import org.adfa.constants.CONTENT_TITLE_KEY import org.slf4j.LoggerFactory diff --git a/common/src/main/java/com/itsaky/androidide/adapters/IconTextAdapter.java b/common/src/main/java/org/appdevforall/codeonthego/adapters/IconTextAdapter.java similarity index 98% rename from common/src/main/java/com/itsaky/androidide/adapters/IconTextAdapter.java rename to common/src/main/java/org/appdevforall/codeonthego/adapters/IconTextAdapter.java index be0b87a9f0..ae24da38fa 100644 --- a/common/src/main/java/com/itsaky/androidide/adapters/IconTextAdapter.java +++ b/common/src/main/java/org/appdevforall/codeonthego/adapters/IconTextAdapter.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.adapters; +package org.appdevforall.codeonthego.adapters; import android.view.LayoutInflater; import android.view.View; diff --git a/common/src/main/java/com/itsaky/androidide/adapters/IconTitleDescriptionAdapter.kt b/common/src/main/java/org/appdevforall/codeonthego/adapters/IconTitleDescriptionAdapter.kt similarity index 93% rename from common/src/main/java/com/itsaky/androidide/adapters/IconTitleDescriptionAdapter.kt rename to common/src/main/java/org/appdevforall/codeonthego/adapters/IconTitleDescriptionAdapter.kt index 3085a6c007..4d44383ffb 100644 --- a/common/src/main/java/com/itsaky/androidide/adapters/IconTitleDescriptionAdapter.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/adapters/IconTitleDescriptionAdapter.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.adapters +package org.appdevforall.codeonthego.adapters import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.itsaky.androidide.common.databinding.LayoutIconTitleDescriptionBinding -import com.itsaky.androidide.models.IconTitleDescriptionItem +import org.appdevforall.codeonthego.models.IconTitleDescriptionItem /** * [RecyclerView.Adapter] for showing [IconTitleDescription] items. diff --git a/common/src/main/java/com/itsaky/androidide/adapters/SimpleIconTextAdapter.java b/common/src/main/java/org/appdevforall/codeonthego/adapters/SimpleIconTextAdapter.java similarity index 90% rename from common/src/main/java/com/itsaky/androidide/adapters/SimpleIconTextAdapter.java rename to common/src/main/java/org/appdevforall/codeonthego/adapters/SimpleIconTextAdapter.java index e8b9b4e6d3..4726c13e9a 100755 --- a/common/src/main/java/com/itsaky/androidide/adapters/SimpleIconTextAdapter.java +++ b/common/src/main/java/org/appdevforall/codeonthego/adapters/SimpleIconTextAdapter.java @@ -1,58 +1,58 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.adapters; - -import androidx.annotation.NonNull; -import com.itsaky.androidide.models.IconTextListItem; -import java.util.List; - -/** - * A simple implementation of {@link IconTextAdapter}. - * - * @author Akash Yadav - */ -public class SimpleIconTextAdapter extends IconTextAdapter { - - private final List items; - - public SimpleIconTextAdapter(List items) { - this.items = items; - } - - @Override - public int getItemCount() { - return items.size(); - } - - @NonNull - @Override - public IconTextListItem getItemAt(int index) { - return items.get(index); - } - - @Override - public int getIconResource(int index) { - return getItemAt(index).getIconResource(); - } - - @NonNull - @Override - public String getItemText(int index) { - return getItemAt(index).getText(); - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.adapters; + +import androidx.annotation.NonNull; +import org.appdevforall.codeonthego.models.IconTextListItem; +import java.util.List; + +/** + * A simple implementation of {@link IconTextAdapter}. + * + * @author Akash Yadav + */ +public class SimpleIconTextAdapter extends IconTextAdapter { + + private final List items; + + public SimpleIconTextAdapter(List items) { + this.items = items; + } + + @Override + public int getItemCount() { + return items.size(); + } + + @NonNull + @Override + public IconTextListItem getItemAt(int index) { + return items.get(index); + } + + @Override + public int getIconResource(int index) { + return getItemAt(index).getIconResource(); + } + + @NonNull + @Override + public String getItemText(int index) { + return getItemAt(index).getText(); + } +} diff --git a/common/src/main/java/com/itsaky/androidide/adapters/SimpleIconTitleDescriptionAdapter.kt b/common/src/main/java/org/appdevforall/codeonthego/adapters/SimpleIconTitleDescriptionAdapter.kt similarity index 90% rename from common/src/main/java/com/itsaky/androidide/adapters/SimpleIconTitleDescriptionAdapter.kt rename to common/src/main/java/org/appdevforall/codeonthego/adapters/SimpleIconTitleDescriptionAdapter.kt index 53046e10d4..030cd71fdc 100644 --- a/common/src/main/java/com/itsaky/androidide/adapters/SimpleIconTitleDescriptionAdapter.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/adapters/SimpleIconTitleDescriptionAdapter.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.adapters +package org.appdevforall.codeonthego.adapters -import com.itsaky.androidide.models.IconTitleDescriptionItem +import org.appdevforall.codeonthego.models.IconTitleDescriptionItem /** * Simple implementation of [IconTitleDescriptionAdapter]. diff --git a/common/src/main/java/com/itsaky/androidide/app/BaseApplication.kt b/common/src/main/java/org/appdevforall/codeonthego/app/BaseApplication.kt similarity index 92% rename from common/src/main/java/com/itsaky/androidide/app/BaseApplication.kt rename to common/src/main/java/org/appdevforall/codeonthego/app/BaseApplication.kt index 5adefa731b..c9e1d5e86e 100644 --- a/common/src/main/java/com/itsaky/androidide/app/BaseApplication.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/app/BaseApplication.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.app +package org.appdevforall.codeonthego.app import android.app.Activity import android.app.Application @@ -22,9 +22,9 @@ import android.content.Context import android.content.ContextWrapper import android.content.SharedPreferences import androidx.core.os.UserManagerCompat -import com.itsaky.androidide.managers.NoopSharedPreferencesImpl -import com.itsaky.androidide.managers.PreferenceManager -import com.itsaky.androidide.utils.JavaCharacter +import org.appdevforall.codeonthego.managers.NoopSharedPreferencesImpl +import org.appdevforall.codeonthego.managers.PreferenceManager +import org.appdevforall.codeonthego.utils.JavaCharacter import org.slf4j.LoggerFactory open class BaseApplication : Application() { diff --git a/common/src/main/java/com/itsaky/androidide/app/BaseIDEActivity.kt b/common/src/main/java/org/appdevforall/codeonthego/app/BaseIDEActivity.kt similarity index 91% rename from common/src/main/java/com/itsaky/androidide/app/BaseIDEActivity.kt rename to common/src/main/java/org/appdevforall/codeonthego/app/BaseIDEActivity.kt index 3adbd8b732..2647c30fcc 100755 --- a/common/src/main/java/com/itsaky/androidide/app/BaseIDEActivity.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/app/BaseIDEActivity.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.app +package org.appdevforall.codeonthego.app import android.annotation.SuppressLint import android.os.Bundle @@ -22,10 +22,10 @@ import android.view.View import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment import com.itsaky.androidide.common.R -import com.itsaky.androidide.tasks.cancelIfActive -import com.itsaky.androidide.ui.themes.IThemeManager -import com.itsaky.androidide.utils.OrientationUtilities -import com.itsaky.androidide.utils.resolveAttr +import org.appdevforall.codeonthego.tasks.cancelIfActive +import org.appdevforall.codeonthego.ui.themes.IThemeManager +import org.appdevforall.codeonthego.utils.OrientationUtilities +import org.appdevforall.codeonthego.utils.resolveAttr import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import org.greenrobot.eventbus.EventBus diff --git a/common/src/main/java/com/itsaky/androidide/app/configuration/CpuArch.kt b/common/src/main/java/org/appdevforall/codeonthego/app/configuration/CpuArch.kt similarity index 95% rename from common/src/main/java/com/itsaky/androidide/app/configuration/CpuArch.kt rename to common/src/main/java/org/appdevforall/codeonthego/app/configuration/CpuArch.kt index fa558f675f..9ea92b174f 100644 --- a/common/src/main/java/com/itsaky/androidide/app/configuration/CpuArch.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/app/configuration/CpuArch.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.app.configuration +package org.appdevforall.codeonthego.app.configuration /** * Enum for supported CPU architectures. diff --git a/common/src/main/java/com/itsaky/androidide/app/configuration/IDEBuildConfigProvider.kt b/common/src/main/java/org/appdevforall/codeonthego/app/configuration/IDEBuildConfigProvider.kt similarity index 95% rename from common/src/main/java/com/itsaky/androidide/app/configuration/IDEBuildConfigProvider.kt rename to common/src/main/java/org/appdevforall/codeonthego/app/configuration/IDEBuildConfigProvider.kt index 8b25b0bd2f..a4e44ac018 100644 --- a/common/src/main/java/com/itsaky/androidide/app/configuration/IDEBuildConfigProvider.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/app/configuration/IDEBuildConfigProvider.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.app.configuration +package org.appdevforall.codeonthego.app.configuration import android.os.Build -import com.itsaky.androidide.utils.ServiceLoader +import org.appdevforall.codeonthego.utils.ServiceLoader /** * [IDEBuildConfigProvider] provides information about the build variant of the IDE itself. diff --git a/common/src/main/java/com/itsaky/androidide/app/configuration/IJdkDistributionProvider.kt b/common/src/main/java/org/appdevforall/codeonthego/app/configuration/IJdkDistributionProvider.kt similarity index 93% rename from common/src/main/java/com/itsaky/androidide/app/configuration/IJdkDistributionProvider.kt rename to common/src/main/java/org/appdevforall/codeonthego/app/configuration/IJdkDistributionProvider.kt index d754dce9d4..f03cbf55b9 100644 --- a/common/src/main/java/com/itsaky/androidide/app/configuration/IJdkDistributionProvider.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/app/configuration/IJdkDistributionProvider.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.app.configuration +package org.appdevforall.codeonthego.app.configuration import androidx.annotation.WorkerThread -import com.itsaky.androidide.models.JdkDistribution -import com.itsaky.androidide.utils.ServiceLoader +import org.appdevforall.codeonthego.models.JdkDistribution +import org.appdevforall.codeonthego.utils.ServiceLoader /** * Provides information about various JDK distributions installed on the device. diff --git a/common/src/main/java/com/itsaky/androidide/colorpicker/ColorPickerView.java b/common/src/main/java/org/appdevforall/codeonthego/colorpicker/ColorPickerView.java similarity index 96% rename from common/src/main/java/com/itsaky/androidide/colorpicker/ColorPickerView.java rename to common/src/main/java/org/appdevforall/codeonthego/colorpicker/ColorPickerView.java index 02c16cbfa6..a413839261 100644 --- a/common/src/main/java/com/itsaky/androidide/colorpicker/ColorPickerView.java +++ b/common/src/main/java/org/appdevforall/codeonthego/colorpicker/ColorPickerView.java @@ -1,228 +1,228 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.colorpicker; - -import static android.graphics.Color.alpha; -import static android.graphics.Color.argb; -import static android.graphics.Color.blue; -import static android.graphics.Color.green; -import static android.graphics.Color.parseColor; -import static android.graphics.Color.red; - -import android.content.Context; -import android.text.Editable; -import android.text.TextWatcher; -import android.util.AttributeSet; -import android.view.LayoutInflater; -import android.view.ViewGroup; -import android.widget.LinearLayout; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.core.content.ContextCompat; -import com.google.android.material.slider.Slider; -import com.itsaky.androidide.common.R; -import com.itsaky.androidide.common.databinding.LayoutColorPickerBinding; - -/** - * A color picker view. - * - * @author Akash Yadav - */ -public class ColorPickerView extends LinearLayout { - - private final LayoutColorPickerBinding binding; - private final int DEFAULT_COLOR; - private int alpha; - private int red; - private int green; - private int blue; - private final Slider.OnChangeListener mValueChangeListener = - (slider, value, fromUser) -> { - - // If it's not from user, then the values have already been updated - if (fromUser) { - final var id = slider.getId(); - final var intVal = (int) value; - if (id == R.id.alpha_slider) { - alpha = intVal; - } else if (id == R.id.red_slider) { - red = intVal; - } else if (id == R.id.green_slider) { - green = intVal; - } else if (id == R.id.blue_slider) { - blue = intVal; - } - - updatePreview(); - } - }; - private OnPickListener mPickListener; - - public ColorPickerView(Context context) { - this(context, null); - } - - public ColorPickerView(Context context, @Nullable AttributeSet attrs) { - this(context, attrs, 0); - } - - public ColorPickerView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { - this(context, attrs, defStyleAttr, 0); - } - - public ColorPickerView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { - super(context, attrs, defStyleAttr, defStyleRes); - - this.DEFAULT_COLOR = ContextCompat.getColor(context, R.color.color_picker_default_color); - - this.binding = LayoutColorPickerBinding.inflate(LayoutInflater.from(context)); - - removeAllViews(); - addView( - binding.getRoot(), - new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); - - init(); - } - - private void init() { - - setColor(DEFAULT_COLOR); - - this.binding.alphaSlider.addOnChangeListener(mValueChangeListener); - this.binding.redSlider.addOnChangeListener(mValueChangeListener); - this.binding.greenSlider.addOnChangeListener(mValueChangeListener); - this.binding.blueSlider.addOnChangeListener(mValueChangeListener); - - this.binding.hexField.getEditText().addTextChangedListener(new ColorTextWatcher()); - - this.binding.pick.setOnClickListener( - v -> { - if (mPickListener != null) { - mPickListener.onPick(getColor(), getHexColor()); - } - }); - } - - /** - * Get the hex color code of the current color value. - * - * @return The hex color code of the current color value. - */ - @NonNull - public String getHexColor() { - return "#" + Integer.toHexString(getColor()); - } - - /** - * Set a listener that will be notified when the user picks a color. - * - * @param listener The listener to set. - */ - public void setOnPickListener(OnPickListener listener) { - this.mPickListener = listener; - } - - /** - * A TextWatcher that is used to listen for text updates in the hex color input field. - */ - private class ColorTextWatcher implements TextWatcher { - - @Override - public void beforeTextChanged(CharSequence s, int start, int count, int after) { - } - - @Override - public void onTextChanged(CharSequence s, int start, int before, int count) { - try { - final var color = parseColor("#" + s); - setColor(color); - } catch (Exception e) { - // May happen due to invalid color values - // Simply ignore - } - } - - @Override - public void afterTextChanged(Editable s) { - } - } - - /** - * Set the color value of this picker to the given hex color code. - * - * @param hexCode The hex color code. - * @see #setColor(int) - */ - public void setColor(final String hexCode) { - setColor(parseColor(hexCode)); - } - - /** - * A listener that can be used to get notified when the user picks a color. - * - * @author Akash Yadav - */ - public interface OnPickListener { - - /** - * Called when the user picks a color using the 'Pick' button. - * - * @param color The integer value of the color. - * @param hexCode The hex color code of the color. - */ - void onPick(int color, String hexCode); - } - - /** - * Set the color value for this color picker. this will in turn update value of the sliders and - * the color preview. - * - * @param color The new color value. - */ - public void setColor(int color) { - this.alpha = alpha(color); - this.red = red(color); - this.green = green(color); - this.blue = blue(color); - - this.binding.alphaSlider.setValue(alpha); - this.binding.redSlider.setValue(red); - this.binding.greenSlider.setValue(green); - this.binding.blueSlider.setValue(blue); - - updatePreview(); - } - - /** - * Get the int value of the color from the current values of alpha, red, green and blue color - * values. - * - * @return The int color value. - */ - public int getColor() { - return argb(alpha, red, green, blue); - } - - /** - * Call this method to update the preview of the current color. - */ - private void updatePreview() { - this.binding.colorPreview.setBackgroundColor(getColor()); - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.colorpicker; + +import static android.graphics.Color.alpha; +import static android.graphics.Color.argb; +import static android.graphics.Color.blue; +import static android.graphics.Color.green; +import static android.graphics.Color.parseColor; +import static android.graphics.Color.red; + +import android.content.Context; +import android.text.Editable; +import android.text.TextWatcher; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; +import com.google.android.material.slider.Slider; +import com.itsaky.androidide.common.R; +import com.itsaky.androidide.common.databinding.LayoutColorPickerBinding; + +/** + * A color picker view. + * + * @author Akash Yadav + */ +public class ColorPickerView extends LinearLayout { + + private final LayoutColorPickerBinding binding; + private final int DEFAULT_COLOR; + private int alpha; + private int red; + private int green; + private int blue; + private final Slider.OnChangeListener mValueChangeListener = + (slider, value, fromUser) -> { + + // If it's not from user, then the values have already been updated + if (fromUser) { + final var id = slider.getId(); + final var intVal = (int) value; + if (id == R.id.alpha_slider) { + alpha = intVal; + } else if (id == R.id.red_slider) { + red = intVal; + } else if (id == R.id.green_slider) { + green = intVal; + } else if (id == R.id.blue_slider) { + blue = intVal; + } + + updatePreview(); + } + }; + private OnPickListener mPickListener; + + public ColorPickerView(Context context) { + this(context, null); + } + + public ColorPickerView(Context context, @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public ColorPickerView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + this(context, attrs, defStyleAttr, 0); + } + + public ColorPickerView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + + this.DEFAULT_COLOR = ContextCompat.getColor(context, R.color.color_picker_default_color); + + this.binding = LayoutColorPickerBinding.inflate(LayoutInflater.from(context)); + + removeAllViews(); + addView( + binding.getRoot(), + new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); + + init(); + } + + private void init() { + + setColor(DEFAULT_COLOR); + + this.binding.alphaSlider.addOnChangeListener(mValueChangeListener); + this.binding.redSlider.addOnChangeListener(mValueChangeListener); + this.binding.greenSlider.addOnChangeListener(mValueChangeListener); + this.binding.blueSlider.addOnChangeListener(mValueChangeListener); + + this.binding.hexField.getEditText().addTextChangedListener(new ColorTextWatcher()); + + this.binding.pick.setOnClickListener( + v -> { + if (mPickListener != null) { + mPickListener.onPick(getColor(), getHexColor()); + } + }); + } + + /** + * Get the hex color code of the current color value. + * + * @return The hex color code of the current color value. + */ + @NonNull + public String getHexColor() { + return "#" + Integer.toHexString(getColor()); + } + + /** + * Set a listener that will be notified when the user picks a color. + * + * @param listener The listener to set. + */ + public void setOnPickListener(OnPickListener listener) { + this.mPickListener = listener; + } + + /** + * A TextWatcher that is used to listen for text updates in the hex color input field. + */ + private class ColorTextWatcher implements TextWatcher { + + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + try { + final var color = parseColor("#" + s); + setColor(color); + } catch (Exception e) { + // May happen due to invalid color values + // Simply ignore + } + } + + @Override + public void afterTextChanged(Editable s) { + } + } + + /** + * Set the color value of this picker to the given hex color code. + * + * @param hexCode The hex color code. + * @see #setColor(int) + */ + public void setColor(final String hexCode) { + setColor(parseColor(hexCode)); + } + + /** + * A listener that can be used to get notified when the user picks a color. + * + * @author Akash Yadav + */ + public interface OnPickListener { + + /** + * Called when the user picks a color using the 'Pick' button. + * + * @param color The integer value of the color. + * @param hexCode The hex color code of the color. + */ + void onPick(int color, String hexCode); + } + + /** + * Set the color value for this color picker. this will in turn update value of the sliders and + * the color preview. + * + * @param color The new color value. + */ + public void setColor(int color) { + this.alpha = alpha(color); + this.red = red(color); + this.green = green(color); + this.blue = blue(color); + + this.binding.alphaSlider.setValue(alpha); + this.binding.redSlider.setValue(red); + this.binding.greenSlider.setValue(green); + this.binding.blueSlider.setValue(blue); + + updatePreview(); + } + + /** + * Get the int value of the color from the current values of alpha, red, green and blue color + * values. + * + * @return The int color value. + */ + public int getColor() { + return argb(alpha, red, green, blue); + } + + /** + * Call this method to update the preview of the current color. + */ + private void updatePreview() { + this.binding.colorPreview.setBackgroundColor(getColor()); + } +} diff --git a/common/src/main/java/com/itsaky/androidide/documentation/DatabaseTemplateLoader.kt b/common/src/main/java/org/appdevforall/codeonthego/documentation/DatabaseTemplateLoader.kt similarity index 99% rename from common/src/main/java/com/itsaky/androidide/documentation/DatabaseTemplateLoader.kt rename to common/src/main/java/org/appdevforall/codeonthego/documentation/DatabaseTemplateLoader.kt index 19e80caa5d..0250d758a5 100644 --- a/common/src/main/java/com/itsaky/androidide/documentation/DatabaseTemplateLoader.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/documentation/DatabaseTemplateLoader.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.documentation +package org.appdevforall.codeonthego.documentation import android.database.sqlite.SQLiteDatabase import io.pebbletemplates.pebble.error.LoaderException diff --git a/common/src/main/java/com/itsaky/androidide/documentation/DocumentationContentSource.kt b/common/src/main/java/org/appdevforall/codeonthego/documentation/DocumentationContentSource.kt similarity index 99% rename from common/src/main/java/com/itsaky/androidide/documentation/DocumentationContentSource.kt rename to common/src/main/java/org/appdevforall/codeonthego/documentation/DocumentationContentSource.kt index 173d95a84e..8894d51f32 100644 --- a/common/src/main/java/com/itsaky/androidide/documentation/DocumentationContentSource.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/documentation/DocumentationContentSource.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.documentation +package org.appdevforall.codeonthego.documentation import android.database.sqlite.SQLiteDatabase import androidx.annotation.VisibleForTesting @@ -23,8 +23,8 @@ import com.google.gson.Gson import com.google.gson.GsonBuilder import com.google.gson.ToNumberPolicy import com.google.gson.reflect.TypeToken -import com.itsaky.androidide.utils.BrotliDictionaryCodec -import com.itsaky.androidide.utils.loadCompressionDictionary +import org.appdevforall.codeonthego.utils.BrotliDictionaryCodec +import org.appdevforall.codeonthego.utils.loadCompressionDictionary import io.pebbletemplates.pebble.PebbleEngine import io.pebbletemplates.pebble.error.PebbleException import org.slf4j.LoggerFactory diff --git a/common/src/main/java/com/itsaky/androidide/documentation/DocumentationRequestInterceptor.kt b/common/src/main/java/org/appdevforall/codeonthego/documentation/DocumentationRequestInterceptor.kt similarity index 98% rename from common/src/main/java/com/itsaky/androidide/documentation/DocumentationRequestInterceptor.kt rename to common/src/main/java/org/appdevforall/codeonthego/documentation/DocumentationRequestInterceptor.kt index de3e175cc7..83ebc24726 100644 --- a/common/src/main/java/com/itsaky/androidide/documentation/DocumentationRequestInterceptor.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/documentation/DocumentationRequestInterceptor.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.documentation +package org.appdevforall.codeonthego.documentation import android.os.Environment.getExternalStorageDirectory import android.webkit.WebResourceRequest import android.webkit.WebResourceResponse -import com.itsaky.androidide.utils.ContentTypeHeaders -import com.itsaky.androidide.utils.Environment +import org.appdevforall.codeonthego.utils.ContentTypeHeaders +import org.appdevforall.codeonthego.utils.Environment import org.slf4j.LoggerFactory import java.io.ByteArrayInputStream import java.io.File diff --git a/common/src/main/java/com/itsaky/androidide/fragments/BaseFragment.kt b/common/src/main/java/org/appdevforall/codeonthego/fragments/BaseFragment.kt similarity index 94% rename from common/src/main/java/com/itsaky/androidide/fragments/BaseFragment.kt rename to common/src/main/java/org/appdevforall/codeonthego/fragments/BaseFragment.kt index 3afc3cd739..8b38ad1192 100755 --- a/common/src/main/java/com/itsaky/androidide/fragments/BaseFragment.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/fragments/BaseFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.content.Intent import android.os.Environment @@ -33,9 +33,9 @@ import androidx.documentfile.provider.DocumentFile import androidx.fragment.app.Fragment import com.itsaky.androidide.common.R import com.itsaky.androidide.resources.R.string -import com.itsaky.androidide.utils.Environment.PROJECTS_FOLDER -import com.itsaky.androidide.utils.FileUtil -import com.itsaky.androidide.utils.flashError +import org.appdevforall.codeonthego.utils.Environment.PROJECTS_FOLDER +import org.appdevforall.codeonthego.utils.FileUtil +import org.appdevforall.codeonthego.utils.flashError import java.io.File inline fun Fragment.ifAttached(block: () -> Unit) { @@ -55,7 +55,7 @@ open class BaseFragment companion object { const val ANDROID_DOCS_AUTHORITY = "com.android.externalstorage.documents" - const val ANDROIDIDE_DOCS_AUTHORITY = "com.itsaky.androidide.documents" + const val ANDROIDIDE_DOCS_AUTHORITY = "org.appdevforall.codeonthego.documents" } private val startForResult = diff --git a/common/src/main/java/com/itsaky/androidide/fragments/FragmentWithBinding.kt b/common/src/main/java/org/appdevforall/codeonthego/fragments/FragmentWithBinding.kt similarity index 97% rename from common/src/main/java/com/itsaky/androidide/fragments/FragmentWithBinding.kt rename to common/src/main/java/org/appdevforall/codeonthego/fragments/FragmentWithBinding.kt index e3c1ff4630..28039e1f9d 100644 --- a/common/src/main/java/com/itsaky/androidide/fragments/FragmentWithBinding.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/fragments/FragmentWithBinding.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.fragments +package org.appdevforall.codeonthego.fragments import android.os.Bundle import android.view.LayoutInflater diff --git a/common/src/main/java/com/itsaky/androidide/interfaces/Filter.java b/common/src/main/java/org/appdevforall/codeonthego/interfaces/Filter.java similarity index 94% rename from common/src/main/java/com/itsaky/androidide/interfaces/Filter.java rename to common/src/main/java/org/appdevforall/codeonthego/interfaces/Filter.java index bb1d4b25ee..e2c33d8ad1 100755 --- a/common/src/main/java/com/itsaky/androidide/interfaces/Filter.java +++ b/common/src/main/java/org/appdevforall/codeonthego/interfaces/Filter.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . * **************************************************************************************/ -package com.itsaky.androidide.interfaces; +package org.appdevforall.codeonthego.interfaces; public interface Filter { diff --git a/common/src/main/java/com/itsaky/androidide/interfaces/ProjectWriterCallback.java b/common/src/main/java/org/appdevforall/codeonthego/interfaces/ProjectWriterCallback.java similarity index 95% rename from common/src/main/java/com/itsaky/androidide/interfaces/ProjectWriterCallback.java rename to common/src/main/java/org/appdevforall/codeonthego/interfaces/ProjectWriterCallback.java index 11116b2324..7ce4949dce 100755 --- a/common/src/main/java/com/itsaky/androidide/interfaces/ProjectWriterCallback.java +++ b/common/src/main/java/org/appdevforall/codeonthego/interfaces/ProjectWriterCallback.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . * **************************************************************************************/ -package com.itsaky.androidide.interfaces; +package org.appdevforall.codeonthego.interfaces; import java.io.File; diff --git a/common/src/main/java/com/itsaky/androidide/managers/NoopSharedPreferencesImpl.kt b/common/src/main/java/org/appdevforall/codeonthego/managers/NoopSharedPreferencesImpl.kt similarity index 97% rename from common/src/main/java/com/itsaky/androidide/managers/NoopSharedPreferencesImpl.kt rename to common/src/main/java/org/appdevforall/codeonthego/managers/NoopSharedPreferencesImpl.kt index caee99b952..e8ffff9215 100644 --- a/common/src/main/java/com/itsaky/androidide/managers/NoopSharedPreferencesImpl.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/managers/NoopSharedPreferencesImpl.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.managers +package org.appdevforall.codeonthego.managers import android.content.SharedPreferences diff --git a/common/src/main/java/com/itsaky/androidide/managers/PreferenceManager.kt b/common/src/main/java/org/appdevforall/codeonthego/managers/PreferenceManager.kt similarity index 94% rename from common/src/main/java/com/itsaky/androidide/managers/PreferenceManager.kt rename to common/src/main/java/org/appdevforall/codeonthego/managers/PreferenceManager.kt index d20ef8815a..48d9d6a64d 100755 --- a/common/src/main/java/com/itsaky/androidide/managers/PreferenceManager.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/managers/PreferenceManager.kt @@ -14,14 +14,14 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.managers +package org.appdevforall.codeonthego.managers import android.annotation.SuppressLint import android.content.Context import android.content.SharedPreferences import androidx.preference.PreferenceManager -import com.itsaky.androidide.eventbus.events.preferences.PreferenceChangeEvent -import com.itsaky.androidide.eventbus.events.preferences.PreferenceRemoveEvent +import org.appdevforall.codeonthego.eventbus.events.preferences.PreferenceChangeEvent +import org.appdevforall.codeonthego.eventbus.events.preferences.PreferenceRemoveEvent import org.greenrobot.eventbus.EventBus import org.jetbrains.annotations.Contract diff --git a/common/src/main/java/com/itsaky/androidide/managers/ToolsManager.java b/common/src/main/java/org/appdevforall/codeonthego/managers/ToolsManager.java similarity index 96% rename from common/src/main/java/com/itsaky/androidide/managers/ToolsManager.java rename to common/src/main/java/org/appdevforall/codeonthego/managers/ToolsManager.java index 3977d3fc94..9fc80e8951 100755 --- a/common/src/main/java/com/itsaky/androidide/managers/ToolsManager.java +++ b/common/src/main/java/org/appdevforall/codeonthego/managers/ToolsManager.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . * */ -package com.itsaky.androidide.managers; +package org.appdevforall.codeonthego.managers; import static org.adfa.constants.ConstantsKt.V7_KEY; import static org.adfa.constants.ConstantsKt.V8_KEY; @@ -27,15 +27,15 @@ import androidx.annotation.WorkerThread; import com.aayushatharva.brotli4j.Brotli4jLoader; import com.aayushatharva.brotli4j.decoder.BrotliInputStream; -import com.itsaky.androidide.app.BaseApplication; -import com.itsaky.androidide.app.configuration.IDEBuildConfigProvider; -import com.itsaky.androidide.app.configuration.IJdkDistributionProvider; -import com.itsaky.androidide.utils.Environment; -import com.itsaky.androidide.utils.FileIOUtils; -import com.itsaky.androidide.utils.FileUtils; -import com.itsaky.androidide.utils.IoUtilsKt; -import com.itsaky.androidide.utils.ResourceUtils; -import com.itsaky.androidide.utils.SelfSignedCertUtils; +import org.appdevforall.codeonthego.app.BaseApplication; +import org.appdevforall.codeonthego.app.configuration.IDEBuildConfigProvider; +import org.appdevforall.codeonthego.app.configuration.IJdkDistributionProvider; +import org.appdevforall.codeonthego.utils.Environment; +import org.appdevforall.codeonthego.utils.FileIOUtils; +import org.appdevforall.codeonthego.utils.FileUtils; +import org.appdevforall.codeonthego.utils.IoUtilsKt; +import org.appdevforall.codeonthego.utils.ResourceUtils; +import org.appdevforall.codeonthego.utils.SelfSignedCertUtils; import java.io.File; import java.io.FileOutputStream; import java.io.FileReader; diff --git a/common/src/main/java/com/itsaky/androidide/models/Constants.java b/common/src/main/java/org/appdevforall/codeonthego/models/Constants.java similarity index 94% rename from common/src/main/java/com/itsaky/androidide/models/Constants.java rename to common/src/main/java/org/appdevforall/codeonthego/models/Constants.java index d94aa9862b..7a348369f5 100755 --- a/common/src/main/java/com/itsaky/androidide/models/Constants.java +++ b/common/src/main/java/org/appdevforall/codeonthego/models/Constants.java @@ -1,49 +1,49 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - * - */ -package com.itsaky.androidide.models; - -public class Constants { - - public static final String VIRTUAL_KEYS = - "[" - + "\n [" - + "\n \"ESC\"," - + "\n {" - + "\n \"key\": \"/\"," - + "\n \"popup\": \"\\\\\"" - + "\n }," - + "\n {" - + "\n \"key\": \"-\"," - + "\n \"popup\": \"|\"" - + "\n }," - + "\n \"HOME\"," - + "\n \"UP\"," - + "\n \"END\"," - + "\n \"PGUP\"" - + "\n ]," - + "\n [" - + "\n \"TAB\"," - + "\n \"CTRL\"," - + "\n \"ALT\"," - + "\n \"LEFT\"," - + "\n \"DOWN\"," - + "\n \"RIGHT\"," - + "\n \"PGDN\"" - + "\n ]" - + "\n]"; -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + * + */ +package org.appdevforall.codeonthego.models; + +public class Constants { + + public static final String VIRTUAL_KEYS = + "[" + + "\n [" + + "\n \"ESC\"," + + "\n {" + + "\n \"key\": \"/\"," + + "\n \"popup\": \"\\\\\"" + + "\n }," + + "\n {" + + "\n \"key\": \"-\"," + + "\n \"popup\": \"|\"" + + "\n }," + + "\n \"HOME\"," + + "\n \"UP\"," + + "\n \"END\"," + + "\n \"PGUP\"" + + "\n ]," + + "\n [" + + "\n \"TAB\"," + + "\n \"CTRL\"," + + "\n \"ALT\"," + + "\n \"LEFT\"," + + "\n \"DOWN\"," + + "\n \"RIGHT\"," + + "\n \"PGDN\"" + + "\n ]" + + "\n]"; +} diff --git a/common/src/main/java/com/itsaky/androidide/models/IconTextListItem.java b/common/src/main/java/org/appdevforall/codeonthego/models/IconTextListItem.java similarity index 93% rename from common/src/main/java/com/itsaky/androidide/models/IconTextListItem.java rename to common/src/main/java/org/appdevforall/codeonthego/models/IconTextListItem.java index f008fe92b9..e28bed483a 100755 --- a/common/src/main/java/com/itsaky/androidide/models/IconTextListItem.java +++ b/common/src/main/java/org/appdevforall/codeonthego/models/IconTextListItem.java @@ -1,41 +1,41 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.models; - -import androidx.annotation.DrawableRes; - -public interface IconTextListItem { - - public static IconTextListItem create(String name, @DrawableRes int icon) { - return new IconTextListItem() { - @Override - public String getText() { - return name; - } - - @Override - public int getIconResource() { - return icon; - } - }; - } - - String getText(); - - int getIconResource(); -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.models; + +import androidx.annotation.DrawableRes; + +public interface IconTextListItem { + + public static IconTextListItem create(String name, @DrawableRes int icon) { + return new IconTextListItem() { + @Override + public String getText() { + return name; + } + + @Override + public int getIconResource() { + return icon; + } + }; + } + + String getText(); + + int getIconResource(); +} diff --git a/common/src/main/java/com/itsaky/androidide/models/IconTitleDescriptionItem.kt b/common/src/main/java/org/appdevforall/codeonthego/models/IconTitleDescriptionItem.kt similarity index 87% rename from common/src/main/java/com/itsaky/androidide/models/IconTitleDescriptionItem.kt rename to common/src/main/java/org/appdevforall/codeonthego/models/IconTitleDescriptionItem.kt index 528de0a5ac..934abebe98 100644 --- a/common/src/main/java/com/itsaky/androidide/models/IconTitleDescriptionItem.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/models/IconTitleDescriptionItem.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models import android.graphics.drawable.Drawable /** - * Model for [com.itsaky.androidide.adapters.IconTitleDescriptionAdapter]. + * Model for [org.appdevforall.codeonthego.adapters.IconTitleDescriptionAdapter]. * * @author Akash Yadav */ diff --git a/common/src/main/java/com/itsaky/androidide/models/JdkDistribution.kt b/common/src/main/java/org/appdevforall/codeonthego/models/JdkDistribution.kt similarity index 95% rename from common/src/main/java/com/itsaky/androidide/models/JdkDistribution.kt rename to common/src/main/java/org/appdevforall/codeonthego/models/JdkDistribution.kt index 5f9d8ee35c..7a4de2e6bf 100644 --- a/common/src/main/java/com/itsaky/androidide/models/JdkDistribution.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/models/JdkDistribution.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models /** * An installed JDK distribution. diff --git a/common/src/main/java/com/itsaky/androidide/models/SaveResult.java b/common/src/main/java/org/appdevforall/codeonthego/models/SaveResult.java similarity index 97% rename from common/src/main/java/com/itsaky/androidide/models/SaveResult.java rename to common/src/main/java/org/appdevforall/codeonthego/models/SaveResult.java index 818530c7ba..e99d715f07 100755 --- a/common/src/main/java/com/itsaky/androidide/models/SaveResult.java +++ b/common/src/main/java/org/appdevforall/codeonthego/models/SaveResult.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . * **************************************************************************************/ -package com.itsaky.androidide.models; +package org.appdevforall.codeonthego.models; /** Result obtained when files are saved */ public final class SaveResult { diff --git a/common/src/main/java/com/itsaky/androidide/models/SheetOption.java b/common/src/main/java/org/appdevforall/codeonthego/models/SheetOption.java similarity index 97% rename from common/src/main/java/com/itsaky/androidide/models/SheetOption.java rename to common/src/main/java/org/appdevforall/codeonthego/models/SheetOption.java index 7692c77a87..36536b8626 100755 --- a/common/src/main/java/com/itsaky/androidide/models/SheetOption.java +++ b/common/src/main/java/org/appdevforall/codeonthego/models/SheetOption.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . * **************************************************************************************/ -package com.itsaky.androidide.models; +package org.appdevforall.codeonthego.models; import android.graphics.drawable.Drawable; import java.util.Objects; diff --git a/common/src/main/java/com/itsaky/androidide/models/SimpleIconTitleDescriptionItem.kt b/common/src/main/java/org/appdevforall/codeonthego/models/SimpleIconTitleDescriptionItem.kt similarity index 97% rename from common/src/main/java/com/itsaky/androidide/models/SimpleIconTitleDescriptionItem.kt rename to common/src/main/java/org/appdevforall/codeonthego/models/SimpleIconTitleDescriptionItem.kt index 3447c3ea09..32e6c73173 100644 --- a/common/src/main/java/com/itsaky/androidide/models/SimpleIconTitleDescriptionItem.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/models/SimpleIconTitleDescriptionItem.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models import android.content.Context import android.graphics.drawable.Drawable diff --git a/common/src/main/java/com/itsaky/androidide/shell/IProcessBuilder.kt b/common/src/main/java/org/appdevforall/codeonthego/shell/IProcessBuilder.kt similarity index 92% rename from common/src/main/java/com/itsaky/androidide/shell/IProcessBuilder.kt rename to common/src/main/java/org/appdevforall/codeonthego/shell/IProcessBuilder.kt index b087117fa3..acb62da56b 100644 --- a/common/src/main/java/com/itsaky/androidide/shell/IProcessBuilder.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/shell/IProcessBuilder.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.shell +package org.appdevforall.codeonthego.shell import kotlinx.coroutines.Dispatchers import java.io.File @@ -40,7 +40,7 @@ interface IProcessBuilder { /** * The working directory for the command. If set to `null`, the - * [Environment.HOME][com.itsaky.androidide.utils.Environment.HOME] directory will be used. + * [Environment.HOME][org.appdevforall.codeonthego.utils.Environment.HOME] directory will be used. * * Default value is `null`. */ diff --git a/common/src/main/java/com/itsaky/androidide/shell/ProcessBuilderImpl.kt b/common/src/main/java/org/appdevforall/codeonthego/shell/ProcessBuilderImpl.kt similarity index 95% rename from common/src/main/java/com/itsaky/androidide/shell/ProcessBuilderImpl.kt rename to common/src/main/java/org/appdevforall/codeonthego/shell/ProcessBuilderImpl.kt index 543d0aa344..a8683a2186 100644 --- a/common/src/main/java/com/itsaky/androidide/shell/ProcessBuilderImpl.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/shell/ProcessBuilderImpl.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.shell +package org.appdevforall.codeonthego.shell -import com.itsaky.androidide.utils.Environment +import org.appdevforall.codeonthego.utils.Environment import kotlinx.coroutines.withContext import java.io.File import kotlin.coroutines.CoroutineContext diff --git a/common/src/main/java/com/itsaky/androidide/shell/shellUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/shell/shellUtils.kt similarity index 97% rename from common/src/main/java/com/itsaky/androidide/shell/shellUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/shell/shellUtils.kt index 9fd722c2c5..9410039b75 100644 --- a/common/src/main/java/com/itsaky/androidide/shell/shellUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/shell/shellUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.shell +package org.appdevforall.codeonthego.shell import kotlinx.coroutines.Dispatchers import kotlin.coroutines.CoroutineContext diff --git a/common/src/main/java/com/itsaky/androidide/syntax/colorschemes/DynamicColorScheme.kt b/common/src/main/java/org/appdevforall/codeonthego/syntax/colorschemes/DynamicColorScheme.kt similarity index 95% rename from common/src/main/java/com/itsaky/androidide/syntax/colorschemes/DynamicColorScheme.kt rename to common/src/main/java/org/appdevforall/codeonthego/syntax/colorschemes/DynamicColorScheme.kt index 2db13d610e..e3392f073f 100644 --- a/common/src/main/java/com/itsaky/androidide/syntax/colorschemes/DynamicColorScheme.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/syntax/colorschemes/DynamicColorScheme.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.syntax.colorschemes +package org.appdevforall.codeonthego.syntax.colorschemes import android.content.Context import android.graphics.Color import androidx.core.graphics.toColorInt import com.itsaky.androidide.common.R.attr -import com.itsaky.androidide.utils.isSystemInDarkMode -import com.itsaky.androidide.utils.resolveAttr +import org.appdevforall.codeonthego.utils.isSystemInDarkMode +import org.appdevforall.codeonthego.utils.resolveAttr /** * [SchemeAndroidIDE] implementation that uses dynamic colors. diff --git a/common/src/main/java/com/itsaky/androidide/syntax/colorschemes/SchemeAndroidIDE.java b/common/src/main/java/org/appdevforall/codeonthego/syntax/colorschemes/SchemeAndroidIDE.java similarity index 99% rename from common/src/main/java/com/itsaky/androidide/syntax/colorschemes/SchemeAndroidIDE.java rename to common/src/main/java/org/appdevforall/codeonthego/syntax/colorschemes/SchemeAndroidIDE.java index 49599f432d..6e21b41e22 100644 --- a/common/src/main/java/com/itsaky/androidide/syntax/colorschemes/SchemeAndroidIDE.java +++ b/common/src/main/java/org/appdevforall/codeonthego/syntax/colorschemes/SchemeAndroidIDE.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . * */ -package com.itsaky.androidide.syntax.colorschemes; +package org.appdevforall.codeonthego.syntax.colorschemes; import android.content.Context; import android.graphics.Color; diff --git a/common/src/main/java/com/itsaky/androidide/syntax/decoration/EditorDecorationRegistry.kt b/common/src/main/java/org/appdevforall/codeonthego/syntax/decoration/EditorDecorationRegistry.kt similarity index 93% rename from common/src/main/java/com/itsaky/androidide/syntax/decoration/EditorDecorationRegistry.kt rename to common/src/main/java/org/appdevforall/codeonthego/syntax/decoration/EditorDecorationRegistry.kt index b0c49535ff..ec660e7da9 100644 --- a/common/src/main/java/com/itsaky/androidide/syntax/decoration/EditorDecorationRegistry.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/syntax/decoration/EditorDecorationRegistry.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.syntax.decoration +package org.appdevforall.codeonthego.syntax.decoration -import com.itsaky.androidide.plugins.extensions.EditorDecorationProvider +import org.appdevforall.codeonthego.plugins.extensions.EditorDecorationProvider /** * Process-wide holder for the editor decoration providers contributed by enabled plugins. diff --git a/common/src/main/java/com/itsaky/androidide/syntax/highlighters/Highlighter.java b/common/src/main/java/org/appdevforall/codeonthego/syntax/highlighters/Highlighter.java similarity index 90% rename from common/src/main/java/com/itsaky/androidide/syntax/highlighters/Highlighter.java rename to common/src/main/java/org/appdevforall/codeonthego/syntax/highlighters/Highlighter.java index bca54fecbd..8793dcfc3e 100644 --- a/common/src/main/java/com/itsaky/androidide/syntax/highlighters/Highlighter.java +++ b/common/src/main/java/org/appdevforall/codeonthego/syntax/highlighters/Highlighter.java @@ -17,10 +17,10 @@ * along with AndroidIDE. If not, see . * **************************************************************************************/ -package com.itsaky.androidide.syntax.highlighters; +package org.appdevforall.codeonthego.syntax.highlighters; import android.text.SpannableStringBuilder; -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE; +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE; /** * A highlighter is used to highlight a small piece of code diff --git a/common/src/main/java/com/itsaky/androidide/syntax/highlighters/JavaHighlighter.java b/common/src/main/java/org/appdevforall/codeonthego/syntax/highlighters/JavaHighlighter.java similarity index 98% rename from common/src/main/java/com/itsaky/androidide/syntax/highlighters/JavaHighlighter.java rename to common/src/main/java/org/appdevforall/codeonthego/syntax/highlighters/JavaHighlighter.java index 410b93d49f..84d052e234 100644 --- a/common/src/main/java/com/itsaky/androidide/syntax/highlighters/JavaHighlighter.java +++ b/common/src/main/java/org/appdevforall/codeonthego/syntax/highlighters/JavaHighlighter.java @@ -14,13 +14,13 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.syntax.highlighters; +package org.appdevforall.codeonthego.syntax.highlighters; import android.text.SpannableStringBuilder; import android.text.style.BackgroundColorSpan; import android.text.style.ForegroundColorSpan; import com.itsaky.androidide.lexers.java.JavaLexer; -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE; +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE; import io.github.rosemoe.sora.widget.schemes.EditorColorScheme; import java.io.StringReader; import java.util.regex.Matcher; diff --git a/common/src/main/java/com/itsaky/androidide/tasks/TaskExecutor.kt b/common/src/main/java/org/appdevforall/codeonthego/tasks/TaskExecutor.kt similarity index 98% rename from common/src/main/java/com/itsaky/androidide/tasks/TaskExecutor.kt rename to common/src/main/java/org/appdevforall/codeonthego/tasks/TaskExecutor.kt index d3091f0135..33a2342d85 100755 --- a/common/src/main/java/com/itsaky/androidide/tasks/TaskExecutor.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/tasks/TaskExecutor.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tasks +package org.appdevforall.codeonthego.tasks import android.app.ProgressDialog import android.content.Context diff --git a/common/src/main/java/com/itsaky/androidide/tasks/coroutineUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/tasks/coroutineUtils.kt similarity index 95% rename from common/src/main/java/com/itsaky/androidide/tasks/coroutineUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/tasks/coroutineUtils.kt index 1505d54a07..62ae175f5a 100644 --- a/common/src/main/java/com/itsaky/androidide/tasks/coroutineUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/tasks/coroutineUtils.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tasks +package org.appdevforall.codeonthego.tasks -import com.itsaky.androidide.flashbar.Flashbar -import com.itsaky.androidide.progress.ICancelChecker -import com.itsaky.androidide.utils.flashProgress +import org.appdevforall.codeonthego.flashbar.Flashbar +import org.appdevforall.codeonthego.progress.ICancelChecker +import org.appdevforall.codeonthego.utils.flashProgress import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineStart diff --git a/common/src/main/java/com/itsaky/androidide/templates/Language.kt b/common/src/main/java/org/appdevforall/codeonthego/templates/Language.kt similarity index 94% rename from common/src/main/java/com/itsaky/androidide/templates/Language.kt rename to common/src/main/java/org/appdevforall/codeonthego/templates/Language.kt index 81718c8791..4d8f665682 100644 --- a/common/src/main/java/com/itsaky/androidide/templates/Language.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/templates/Language.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates +package org.appdevforall.codeonthego.templates /** * Language for source files. diff --git a/common/src/main/java/com/itsaky/androidide/ui/BottomInsetHeightDistributor.kt b/common/src/main/java/org/appdevforall/codeonthego/ui/BottomInsetHeightDistributor.kt similarity index 94% rename from common/src/main/java/com/itsaky/androidide/ui/BottomInsetHeightDistributor.kt rename to common/src/main/java/org/appdevforall/codeonthego/ui/BottomInsetHeightDistributor.kt index 4d4a4ef138..d5279103d1 100644 --- a/common/src/main/java/com/itsaky/androidide/ui/BottomInsetHeightDistributor.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/ui/BottomInsetHeightDistributor.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.content.Context import android.util.AttributeSet @@ -23,7 +23,7 @@ import android.view.ViewGroup import android.widget.FrameLayout import androidx.core.view.doOnAttach import androidx.core.view.updateLayoutParams -import com.itsaky.androidide.utils.getSystemBarInsets +import org.appdevforall.codeonthego.utils.getSystemBarInsets /** * This view will set its height to the value of a bottom screen inset as soon diff --git a/common/src/main/java/com/itsaky/androidide/ui/ContentTranslatingDrawerLayout.kt b/common/src/main/java/org/appdevforall/codeonthego/ui/ContentTranslatingDrawerLayout.kt similarity index 98% rename from common/src/main/java/com/itsaky/androidide/ui/ContentTranslatingDrawerLayout.kt rename to common/src/main/java/org/appdevforall/codeonthego/ui/ContentTranslatingDrawerLayout.kt index c7d7cab6d9..cfc0085048 100644 --- a/common/src/main/java/com/itsaky/androidide/ui/ContentTranslatingDrawerLayout.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/ui/ContentTranslatingDrawerLayout.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.content.Context import android.util.AttributeSet diff --git a/common/src/main/java/com/itsaky/androidide/ui/InterceptableDrawerLayout.kt b/common/src/main/java/org/appdevforall/codeonthego/ui/InterceptableDrawerLayout.kt similarity index 98% rename from common/src/main/java/com/itsaky/androidide/ui/InterceptableDrawerLayout.kt rename to common/src/main/java/org/appdevforall/codeonthego/ui/InterceptableDrawerLayout.kt index 5572efb749..ea671ee5ee 100644 --- a/common/src/main/java/com/itsaky/androidide/ui/InterceptableDrawerLayout.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/ui/InterceptableDrawerLayout.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.content.Context import android.graphics.Rect diff --git a/common/src/main/java/com/itsaky/androidide/ui/ProjectActionsToolbar.kt b/common/src/main/java/org/appdevforall/codeonthego/ui/ProjectActionsToolbar.kt similarity index 99% rename from common/src/main/java/com/itsaky/androidide/ui/ProjectActionsToolbar.kt rename to common/src/main/java/org/appdevforall/codeonthego/ui/ProjectActionsToolbar.kt index 39835c95ce..314ff853a1 100644 --- a/common/src/main/java/com/itsaky/androidide/ui/ProjectActionsToolbar.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/ui/ProjectActionsToolbar.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.ui +package org.appdevforall.codeonthego.ui import android.content.Context import android.graphics.drawable.Drawable diff --git a/common/src/main/java/com/itsaky/androidide/ui/themes/IDETheme.kt b/common/src/main/java/org/appdevforall/codeonthego/ui/themes/IDETheme.kt similarity index 96% rename from common/src/main/java/com/itsaky/androidide/ui/themes/IDETheme.kt rename to common/src/main/java/org/appdevforall/codeonthego/ui/themes/IDETheme.kt index 7fdd7e14bb..0691a9518c 100644 --- a/common/src/main/java/com/itsaky/androidide/ui/themes/IDETheme.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/ui/themes/IDETheme.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.ui.themes +package org.appdevforall.codeonthego.ui.themes import androidx.annotation.StringRes import androidx.annotation.StyleRes diff --git a/common/src/main/java/com/itsaky/androidide/ui/themes/IThemeManager.kt b/common/src/main/java/org/appdevforall/codeonthego/ui/themes/IThemeManager.kt similarity index 92% rename from common/src/main/java/com/itsaky/androidide/ui/themes/IThemeManager.kt rename to common/src/main/java/org/appdevforall/codeonthego/ui/themes/IThemeManager.kt index 936eae1781..19cf009d39 100644 --- a/common/src/main/java/com/itsaky/androidide/ui/themes/IThemeManager.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/ui/themes/IThemeManager.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.ui.themes +package org.appdevforall.codeonthego.ui.themes import android.app.Activity -import com.itsaky.androidide.utils.ServiceLoader +import org.appdevforall.codeonthego.utils.ServiceLoader /** * Theme manager for AndroidIDE. diff --git a/common/src/main/java/com/itsaky/androidide/utils/AndroidUtils.java b/common/src/main/java/org/appdevforall/codeonthego/utils/AndroidUtils.java similarity index 97% rename from common/src/main/java/com/itsaky/androidide/utils/AndroidUtils.java rename to common/src/main/java/org/appdevforall/codeonthego/utils/AndroidUtils.java index ec2212f0e2..60d4d68b1e 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/AndroidUtils.java +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/AndroidUtils.java @@ -1,6 +1,6 @@ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; -import com.itsaky.androidide.app.BaseApplication; +import org.appdevforall.codeonthego.app.BaseApplication; import com.itsaky.androidide.resources.R; import java.util.Locale; import org.apache.commons.lang3.StringUtils; diff --git a/common/src/main/java/com/itsaky/androidide/utils/BuildInfoUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/BuildInfoUtils.kt similarity index 96% rename from common/src/main/java/com/itsaky/androidide/utils/BuildInfoUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/BuildInfoUtils.kt index ff5a5ccc2e..b68bdb579f 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/BuildInfoUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/BuildInfoUtils.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import com.itsaky.androidide.buildinfo.BuildInfo diff --git a/common/src/main/java/com/itsaky/androidide/utils/CharSequenceInputStream.java b/common/src/main/java/org/appdevforall/codeonthego/utils/CharSequenceInputStream.java similarity index 99% rename from common/src/main/java/com/itsaky/androidide/utils/CharSequenceInputStream.java rename to common/src/main/java/org/appdevforall/codeonthego/utils/CharSequenceInputStream.java index d11252c7ea..0ddf637104 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/CharSequenceInputStream.java +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/CharSequenceInputStream.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; import java.io.IOException; import java.io.InputStream; diff --git a/common/src/main/java/com/itsaky/androidide/utils/CharSequenceReader.java b/common/src/main/java/org/appdevforall/codeonthego/utils/CharSequenceReader.java similarity index 99% rename from common/src/main/java/com/itsaky/androidide/utils/CharSequenceReader.java rename to common/src/main/java/org/appdevforall/codeonthego/utils/CharSequenceReader.java index c81a248dda..3bf450512b 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/CharSequenceReader.java +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/CharSequenceReader.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; import androidx.annotation.NonNull; import java.io.Reader; diff --git a/common/src/main/java/com/itsaky/androidide/utils/CollectionExts.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/CollectionExts.kt similarity index 72% rename from common/src/main/java/com/itsaky/androidide/utils/CollectionExts.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/CollectionExts.kt index 310b7b7a9a..61a0dcdbbe 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/CollectionExts.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/CollectionExts.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils inline fun > T.ifNotEmpty(crossinline action: T.() -> Unit) { if (isNotEmpty()) action() diff --git a/common/src/main/java/com/itsaky/androidide/utils/ColorUtil.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/ColorUtil.kt similarity index 97% rename from common/src/main/java/com/itsaky/androidide/utils/ColorUtil.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/ColorUtil.kt index 90878aefd0..6a2f9ec0db 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/ColorUtil.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/ColorUtil.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.graphics.Color diff --git a/common/src/main/java/com/itsaky/androidide/utils/ContentTypeHeaders.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/ContentTypeHeaders.kt similarity index 99% rename from common/src/main/java/com/itsaky/androidide/utils/ContentTypeHeaders.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/ContentTypeHeaders.kt index 298ebe4761..f266d10001 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/ContentTypeHeaders.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/ContentTypeHeaders.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils /** * Turns a stored `ContentTypes.value` into the `Content-Type` a client should be sent. diff --git a/common/src/main/java/com/itsaky/androidide/utils/ContextUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/ContextUtils.kt similarity index 99% rename from common/src/main/java/com/itsaky/androidide/utils/ContextUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/ContextUtils.kt index 5ce3d0a095..8b5aa4c95d 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/ContextUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/ContextUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.app.Activity import android.app.AlarmManager diff --git a/common/src/main/java/com/itsaky/androidide/utils/DatabaseVersionResolver.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/DatabaseVersionResolver.kt similarity index 99% rename from common/src/main/java/com/itsaky/androidide/utils/DatabaseVersionResolver.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/DatabaseVersionResolver.kt index 6dc0439354..ccfa0016f7 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/DatabaseVersionResolver.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/DatabaseVersionResolver.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.database.sqlite.SQLiteDatabase import org.slf4j.LoggerFactory diff --git a/common/src/main/java/com/itsaky/androidide/utils/DateFormatter.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/DateFormatter.kt similarity index 93% rename from common/src/main/java/com/itsaky/androidide/utils/DateFormatter.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/DateFormatter.kt index 28befa364e..e24ff6e8d8 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/DateFormatter.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/DateFormatter.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import java.text.SimpleDateFormat import java.util.Date diff --git a/common/src/main/java/com/itsaky/androidide/utils/DeviceFormFactor.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/DeviceFormFactor.kt similarity index 99% rename from common/src/main/java/com/itsaky/androidide/utils/DeviceFormFactor.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/DeviceFormFactor.kt index 25f14a5ce4..7885250940 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/DeviceFormFactor.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/DeviceFormFactor.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import android.content.res.Configuration diff --git a/common/src/main/java/com/itsaky/androidide/utils/DeviceUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/DeviceUtils.kt similarity index 97% rename from common/src/main/java/com/itsaky/androidide/utils/DeviceUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/DeviceUtils.kt index d2adb4d89b..161dc93b61 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/DeviceUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/DeviceUtils.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.annotation.SuppressLint import android.os.Build diff --git a/common/src/main/java/com/itsaky/androidide/utils/DialogUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/DialogUtils.kt similarity index 96% rename from common/src/main/java/com/itsaky/androidide/utils/DialogUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/DialogUtils.kt index 67c8e3620c..029afcb1f8 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/DialogUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/DialogUtils.kt @@ -1,182 +1,182 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.utils - -import android.app.Activity -import android.content.Context -import android.content.DialogInterface.OnClickListener -import android.view.LayoutInflater -import android.view.View -import com.google.android.material.dialog.MaterialAlertDialogBuilder -import com.itsaky.androidide.common.databinding.LayoutDialogProgressBinding -import com.itsaky.androidide.resources.R.string -import com.itsaky.androidide.resources.R.style -import org.jetbrains.annotations.Contract -import java.util.concurrent.atomic.AtomicInteger - -/** - * Utility class for creating dialogs. - * - * @author Akash Yadav - */ -object DialogUtils { - - @JvmStatic - @JvmOverloads - fun newProgressDialog( - context: Context, - title: String, - message: String? = null, - cancelable: Boolean = false, - onCancelClick: OnClickListener? = null - ): MaterialAlertDialogBuilder { - val binding = LayoutDialogProgressBinding.inflate(LayoutInflater.from(context)) - val builder = newMaterialDialogBuilder(context) - builder.setTitle(title) - builder.setView(binding.root) - builder.setCancelable(cancelable) - - if (message != null) { - binding.message.text = message - binding.message.visibility = View.VISIBLE - } - - if (onCancelClick != null) { - builder.setPositiveButton(android.R.string.cancel) { dialog, which -> - dialog.dismiss() - onCancelClick.onClick(dialog, which) - } - } - - return builder - } - - /** - * Create a new alert dialog with two buttons: Yes and No. This method - * simply calls [.newYesNoDialog] with default values for title and message. - * - * @param context The context for the dialog. - * @param positiveClickListener A listener that will be invoked on the Yes button - * click. - * @param negativeClickListener A listener that will be invoked on the No button - * click. - * @return The newly created dialog. - */ - @JvmStatic - @JvmOverloads - fun showConfirmationDialog( - context: Context, - positiveClickListener: OnClickListener? = null, - negativeClickListener: OnClickListener? = null - ): MaterialAlertDialogBuilder { - return showConfirmationDialog( - context, - context.getString(string.msg_yesno_def_title), - context.getString(string.msg_yesno_def_message), - positiveClickListener, - negativeClickListener - ) - } - - /** - * Create a new alert dialog with two buttons: Yes and No. - * - * @param context The context for the dialog. - * @param title The title of the dialog. - * @param message The message of the dialog. - * @param positiveClickListener A listener that will be invoked on the Yes button - * click. - * @param negativeClickListener A listener that will be invoked on the No button - * click. - * @return The newly created dialog instance. - */ - @JvmStatic - @JvmOverloads - fun showConfirmationDialog( - context: Context, - title: String, - message: String? = null, - positiveClickListener: OnClickListener? = null, - negativeClickListener: OnClickListener? = null - ): MaterialAlertDialogBuilder { - val builder = newMaterialDialogBuilder(context) - builder.setTitle(title) - builder.setMessage(message) - builder.setPositiveButton(string.yes, positiveClickListener) - builder.setNegativeButton(string.no, negativeClickListener) - return builder - } - - /** - * Creates a new MaterialAlertDialogBuilder with the app's default style. - * - * @param context The context for the dialog builder. - * @return The new MaterialAlertDialogBuilder instance. - */ - @JvmStatic - @Contract("_ -> new") - fun newMaterialDialogBuilder(context: Context): MaterialAlertDialogBuilder { - return MaterialAlertDialogBuilder(context, style.AppTheme_MaterialAlertDialog) - } - - /** - * Creates a new single-choice material alert dialog builder. - * - * @param context The context used to build the [MaterialAlertDialogBuilder]. - * @param title The title for the dialog. - * @param choices The choices for the dialog. - * @param checkedChoice The index of the item which should be checked. - * @param cancelable Whether the dialog should be cancellable or not. - * @param onSelected The function which will be called once the user confirms the selection. - */ - @JvmStatic - fun newSingleChoiceDialog( - context: Context, - title: String, - choices: Array, - checkedChoice: Int, - cancelable: Boolean = false, - onSelected: (Int) -> Unit - ): MaterialAlertDialogBuilder { - val selection = AtomicInteger(checkedChoice) - return newMaterialDialogBuilder(context) - .setTitle(title) - .setSingleChoiceItems(choices, checkedChoice) { _, which -> - selection.set(which) - } - .setPositiveButton(android.R.string.ok) { dialog, _ -> - dialog.dismiss() - onSelected(selection.get()) - } - .setNegativeButton(android.R.string.cancel, null) - .setCancelable(cancelable) - } - - @JvmStatic - @JvmOverloads - fun showRestartPrompt(activity: Activity, cancelable: Boolean = true) { - newMaterialDialogBuilder(activity) - .setTitle(string.title_restart_required) - .setMessage(string.msg_restart_for_plugin_changes) - .setPositiveButton(string.btn_restart_now) { _, _ -> - activity.restartApp() - } - .setNegativeButton(string.btn_later, null) - .setCancelable(cancelable) - .show() - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.utils + +import android.app.Activity +import android.content.Context +import android.content.DialogInterface.OnClickListener +import android.view.LayoutInflater +import android.view.View +import com.google.android.material.dialog.MaterialAlertDialogBuilder +import com.itsaky.androidide.common.databinding.LayoutDialogProgressBinding +import com.itsaky.androidide.resources.R.string +import com.itsaky.androidide.resources.R.style +import org.jetbrains.annotations.Contract +import java.util.concurrent.atomic.AtomicInteger + +/** + * Utility class for creating dialogs. + * + * @author Akash Yadav + */ +object DialogUtils { + + @JvmStatic + @JvmOverloads + fun newProgressDialog( + context: Context, + title: String, + message: String? = null, + cancelable: Boolean = false, + onCancelClick: OnClickListener? = null + ): MaterialAlertDialogBuilder { + val binding = LayoutDialogProgressBinding.inflate(LayoutInflater.from(context)) + val builder = newMaterialDialogBuilder(context) + builder.setTitle(title) + builder.setView(binding.root) + builder.setCancelable(cancelable) + + if (message != null) { + binding.message.text = message + binding.message.visibility = View.VISIBLE + } + + if (onCancelClick != null) { + builder.setPositiveButton(android.R.string.cancel) { dialog, which -> + dialog.dismiss() + onCancelClick.onClick(dialog, which) + } + } + + return builder + } + + /** + * Create a new alert dialog with two buttons: Yes and No. This method + * simply calls [.newYesNoDialog] with default values for title and message. + * + * @param context The context for the dialog. + * @param positiveClickListener A listener that will be invoked on the Yes button + * click. + * @param negativeClickListener A listener that will be invoked on the No button + * click. + * @return The newly created dialog. + */ + @JvmStatic + @JvmOverloads + fun showConfirmationDialog( + context: Context, + positiveClickListener: OnClickListener? = null, + negativeClickListener: OnClickListener? = null + ): MaterialAlertDialogBuilder { + return showConfirmationDialog( + context, + context.getString(string.msg_yesno_def_title), + context.getString(string.msg_yesno_def_message), + positiveClickListener, + negativeClickListener + ) + } + + /** + * Create a new alert dialog with two buttons: Yes and No. + * + * @param context The context for the dialog. + * @param title The title of the dialog. + * @param message The message of the dialog. + * @param positiveClickListener A listener that will be invoked on the Yes button + * click. + * @param negativeClickListener A listener that will be invoked on the No button + * click. + * @return The newly created dialog instance. + */ + @JvmStatic + @JvmOverloads + fun showConfirmationDialog( + context: Context, + title: String, + message: String? = null, + positiveClickListener: OnClickListener? = null, + negativeClickListener: OnClickListener? = null + ): MaterialAlertDialogBuilder { + val builder = newMaterialDialogBuilder(context) + builder.setTitle(title) + builder.setMessage(message) + builder.setPositiveButton(string.yes, positiveClickListener) + builder.setNegativeButton(string.no, negativeClickListener) + return builder + } + + /** + * Creates a new MaterialAlertDialogBuilder with the app's default style. + * + * @param context The context for the dialog builder. + * @return The new MaterialAlertDialogBuilder instance. + */ + @JvmStatic + @Contract("_ -> new") + fun newMaterialDialogBuilder(context: Context): MaterialAlertDialogBuilder { + return MaterialAlertDialogBuilder(context, style.AppTheme_MaterialAlertDialog) + } + + /** + * Creates a new single-choice material alert dialog builder. + * + * @param context The context used to build the [MaterialAlertDialogBuilder]. + * @param title The title for the dialog. + * @param choices The choices for the dialog. + * @param checkedChoice The index of the item which should be checked. + * @param cancelable Whether the dialog should be cancellable or not. + * @param onSelected The function which will be called once the user confirms the selection. + */ + @JvmStatic + fun newSingleChoiceDialog( + context: Context, + title: String, + choices: Array, + checkedChoice: Int, + cancelable: Boolean = false, + onSelected: (Int) -> Unit + ): MaterialAlertDialogBuilder { + val selection = AtomicInteger(checkedChoice) + return newMaterialDialogBuilder(context) + .setTitle(title) + .setSingleChoiceItems(choices, checkedChoice) { _, which -> + selection.set(which) + } + .setPositiveButton(android.R.string.ok) { dialog, _ -> + dialog.dismiss() + onSelected(selection.get()) + } + .setNegativeButton(android.R.string.cancel, null) + .setCancelable(cancelable) + } + + @JvmStatic + @JvmOverloads + fun showRestartPrompt(activity: Activity, cancelable: Boolean = true) { + newMaterialDialogBuilder(activity) + .setTitle(string.title_restart_required) + .setMessage(string.msg_restart_for_plugin_changes) + .setPositiveButton(string.btn_restart_now) { _, _ -> + activity.restartApp() + } + .setNegativeButton(string.btn_later, null) + .setCancelable(cancelable) + .show() + } +} diff --git a/common/src/main/java/com/itsaky/androidide/utils/DocumentationCompression.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/DocumentationCompression.kt similarity index 99% rename from common/src/main/java/com/itsaky/androidide/utils/DocumentationCompression.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/DocumentationCompression.kt index 8eb43c5880..2c60bb2b19 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/DocumentationCompression.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/DocumentationCompression.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.database.sqlite.SQLiteDatabase import com.aayushatharva.brotli4j.Brotli4jLoader diff --git a/common/src/main/java/com/itsaky/androidide/utils/EdgeToEdgeUtils.java b/common/src/main/java/org/appdevforall/codeonthego/utils/EdgeToEdgeUtils.java similarity index 99% rename from common/src/main/java/com/itsaky/androidide/utils/EdgeToEdgeUtils.java rename to common/src/main/java/org/appdevforall/codeonthego/utils/EdgeToEdgeUtils.java index b4d7cf04cd..e7e132627e 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/EdgeToEdgeUtils.java +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/EdgeToEdgeUtils.java @@ -31,7 +31,7 @@ * limitations under the License. */ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; import static android.graphics.Color.TRANSPARENT; import static com.google.android.material.color.MaterialColors.isColorLight; diff --git a/common/src/main/java/com/itsaky/androidide/utils/Environment.java b/common/src/main/java/org/appdevforall/codeonthego/utils/Environment.java similarity index 98% rename from common/src/main/java/com/itsaky/androidide/utils/Environment.java rename to common/src/main/java/org/appdevforall/codeonthego/utils/Environment.java index ce5e1f0db9..98f5798970 100755 --- a/common/src/main/java/com/itsaky/androidide/utils/Environment.java +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/Environment.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; import static org.adfa.constants.ConstantsKt.GRADLE_DISTRIBUTION_VERSION; import static org.adfa.constants.ConstantsKt.LOGSENDER_AAR_NAME; @@ -22,7 +22,7 @@ import android.annotation.SuppressLint; import android.content.Context; import androidx.annotation.NonNull; -import com.itsaky.androidide.app.configuration.IDEBuildConfigProvider; +import org.appdevforall.codeonthego.app.configuration.IDEBuildConfigProvider; import com.itsaky.androidide.buildinfo.BuildInfo; import com.itsaky.androidide.javac.config.JavacConfigProvider; import java.io.File; diff --git a/common/src/main/java/com/itsaky/androidide/utils/FeatureFlags.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/FeatureFlags.kt similarity index 99% rename from common/src/main/java/com/itsaky/androidide/utils/FeatureFlags.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/FeatureFlags.kt index 296e4f204e..103d17bd63 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/FeatureFlags.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/FeatureFlags.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.os.Environment import androidx.annotation.VisibleForTesting diff --git a/common/src/main/java/com/itsaky/androidide/utils/FeedbackEmailHandler.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/FeedbackEmailHandler.kt similarity index 99% rename from common/src/main/java/com/itsaky/androidide/utils/FeedbackEmailHandler.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/FeedbackEmailHandler.kt index 969d164336..7603cdb737 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/FeedbackEmailHandler.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/FeedbackEmailHandler.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.app.Activity import android.content.Context diff --git a/common/src/main/java/com/itsaky/androidide/utils/FeedbackManager.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/FeedbackManager.kt similarity index 98% rename from common/src/main/java/com/itsaky/androidide/utils/FeedbackManager.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/FeedbackManager.kt index cd492ab4d5..6b0e5c1a75 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/FeedbackManager.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/FeedbackManager.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.app.Activity import android.content.ActivityNotFoundException @@ -20,7 +20,7 @@ import androidx.core.graphics.createBitmap import androidx.core.net.toUri import androidx.core.text.HtmlCompat import androidx.lifecycle.lifecycleScope -import com.itsaky.androidide.eventbus.events.editor.ReportCaughtExceptionEvent +import org.appdevforall.codeonthego.eventbus.events.editor.ReportCaughtExceptionEvent import com.itsaky.androidide.resources.R import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers diff --git a/common/src/main/java/com/itsaky/androidide/utils/FileProviderUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/FileProviderUtils.kt similarity index 96% rename from common/src/main/java/com/itsaky/androidide/utils/FileProviderUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/FileProviderUtils.kt index dbce28665b..180ba13fcc 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/FileProviderUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/FileProviderUtils.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import android.net.Uri diff --git a/common/src/main/java/com/itsaky/androidide/utils/FileUtil.java b/common/src/main/java/org/appdevforall/codeonthego/utils/FileUtil.java similarity index 99% rename from common/src/main/java/com/itsaky/androidide/utils/FileUtil.java rename to common/src/main/java/org/appdevforall/codeonthego/utils/FileUtil.java index 24299dcee5..39ee94245f 100755 --- a/common/src/main/java/com/itsaky/androidide/utils/FileUtil.java +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/FileUtil.java @@ -18,7 +18,7 @@ * **************************************************************************************/ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; import android.content.ContentResolver; import android.content.ContentUris; diff --git a/common/src/main/java/com/itsaky/androidide/utils/FileUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/FileUtils.kt similarity index 99% rename from common/src/main/java/com/itsaky/androidide/utils/FileUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/FileUtils.kt index 2e4d033215..eea914f812 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/FileUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/FileUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import org.slf4j.LoggerFactory import java.io.File diff --git a/common/src/main/java/com/itsaky/androidide/utils/FlashbarActivityUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/FlashbarActivityUtils.kt similarity index 95% rename from common/src/main/java/com/itsaky/androidide/utils/FlashbarActivityUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/FlashbarActivityUtils.kt index 82e4f3e6d0..86253e44b3 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/FlashbarActivityUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/FlashbarActivityUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.app.Activity import android.graphics.Color @@ -27,13 +27,13 @@ import androidx.annotation.ColorInt import androidx.annotation.DrawableRes import androidx.annotation.FloatRange import androidx.annotation.StringRes -import com.itsaky.androidide.flashbar.Flashbar -import com.itsaky.androidide.flashbar.Flashbar.Gravity.TOP +import org.appdevforall.codeonthego.flashbar.Flashbar +import org.appdevforall.codeonthego.flashbar.Flashbar.Gravity.TOP import com.itsaky.androidide.resources.R -import com.itsaky.androidide.tasks.runOnUiThread -import com.itsaky.androidide.utils.FlashType.ERROR -import com.itsaky.androidide.utils.FlashType.INFO -import com.itsaky.androidide.utils.FlashType.SUCCESS +import org.appdevforall.codeonthego.tasks.runOnUiThread +import org.appdevforall.codeonthego.utils.FlashType.ERROR +import org.appdevforall.codeonthego.utils.FlashType.INFO +import org.appdevforall.codeonthego.utils.FlashType.SUCCESS import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext diff --git a/common/src/main/java/com/itsaky/androidide/utils/FlashbarDismissGate.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/FlashbarDismissGate.kt similarity index 96% rename from common/src/main/java/com/itsaky/androidide/utils/FlashbarDismissGate.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/FlashbarDismissGate.kt index b511556707..c62f799c43 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/FlashbarDismissGate.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/FlashbarDismissGate.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils /** * Whether an indefinite error bar also dismisses on any tap or swipe, not only via its diff --git a/common/src/main/java/com/itsaky/androidide/utils/FlashbarUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/FlashbarUtils.kt similarity index 94% rename from common/src/main/java/com/itsaky/androidide/utils/FlashbarUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/FlashbarUtils.kt index 1d951a5495..d52406521d 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/FlashbarUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/FlashbarUtils.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.app.Activity import androidx.annotation.StringRes -import com.itsaky.androidide.app.BaseApplication -import com.itsaky.androidide.flashbar.Flashbar +import org.appdevforall.codeonthego.app.BaseApplication +import org.appdevforall.codeonthego.flashbar.Flashbar fun flashbarBuilder(): Flashbar.Builder? = withActivity { flashbarBuilder() } diff --git a/common/src/main/java/com/itsaky/androidide/utils/FragmentExts.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/FragmentExts.kt similarity index 95% rename from common/src/main/java/com/itsaky/androidide/utils/FragmentExts.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/FragmentExts.kt index 2267a03fe9..32de640936 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/FragmentExts.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/FragmentExts.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import androidx.fragment.app.Fragment import androidx.lifecycle.lifecycleScope diff --git a/common/src/main/java/com/itsaky/androidide/utils/GetProjectBuildVersions.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/GetProjectBuildVersions.kt similarity index 97% rename from common/src/main/java/com/itsaky/androidide/utils/GetProjectBuildVersions.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/GetProjectBuildVersions.kt index 898a9f4c6d..f5525f52a5 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/GetProjectBuildVersions.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/GetProjectBuildVersions.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils -import com.itsaky.androidide.templates.Language +import org.appdevforall.codeonthego.templates.Language import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import java.io.File diff --git a/common/src/main/java/com/itsaky/androidide/utils/GetProjectDetails.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/GetProjectDetails.kt similarity index 96% rename from common/src/main/java/com/itsaky/androidide/utils/GetProjectDetails.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/GetProjectDetails.kt index e372473f06..252a95881e 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/GetProjectDetails.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/GetProjectDetails.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import android.text.format.Formatter.formatFileSize diff --git a/common/src/main/java/com/itsaky/androidide/utils/ImageUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/ImageUtils.kt similarity index 98% rename from common/src/main/java/com/itsaky/androidide/utils/ImageUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/ImageUtils.kt index 017aed85be..1fe9f28c44 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/ImageUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/ImageUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.graphics.Bitmap import android.graphics.BitmapFactory diff --git a/common/src/main/java/com/itsaky/androidide/utils/InsetUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/InsetUtils.kt similarity index 98% rename from common/src/main/java/com/itsaky/androidide/utils/InsetUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/InsetUtils.kt index 328894ca04..a9d2a5d85c 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/InsetUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/InsetUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.os.Build import android.view.View diff --git a/common/src/main/java/com/itsaky/androidide/utils/IntProperty.java b/common/src/main/java/org/appdevforall/codeonthego/utils/IntProperty.java similarity index 97% rename from common/src/main/java/com/itsaky/androidide/utils/IntProperty.java rename to common/src/main/java/org/appdevforall/codeonthego/utils/IntProperty.java index 4bb97a2ad7..d5f4e49e6e 100755 --- a/common/src/main/java/com/itsaky/androidide/utils/IntProperty.java +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/IntProperty.java @@ -18,7 +18,7 @@ * **************************************************************************************/ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; import android.util.Property; diff --git a/common/src/main/java/com/itsaky/androidide/utils/IntentExtensions.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/IntentExtensions.kt similarity index 93% rename from common/src/main/java/com/itsaky/androidide/utils/IntentExtensions.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/IntentExtensions.kt index a29050d86b..8297e11353 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/IntentExtensions.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/IntentExtensions.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.app.Activity import android.content.Context diff --git a/common/src/main/java/com/itsaky/androidide/utils/JavaCharacter.java b/common/src/main/java/org/appdevforall/codeonthego/utils/JavaCharacter.java similarity index 98% rename from common/src/main/java/com/itsaky/androidide/utils/JavaCharacter.java rename to common/src/main/java/org/appdevforall/codeonthego/utils/JavaCharacter.java index ebabcc3875..c6b1e8b545 100755 --- a/common/src/main/java/com/itsaky/androidide/utils/JavaCharacter.java +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/JavaCharacter.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . * **************************************************************************************/ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; import java.util.Arrays; diff --git a/common/src/main/java/com/itsaky/androidide/utils/KeyboardUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/KeyboardUtils.kt similarity index 97% rename from common/src/main/java/com/itsaky/androidide/utils/KeyboardUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/KeyboardUtils.kt index db3ebc4c0e..95d41ef7bc 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/KeyboardUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/KeyboardUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import android.content.res.Configuration diff --git a/common/src/main/java/com/itsaky/androidide/utils/KeyedDebouncingAction.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/KeyedDebouncingAction.kt similarity index 95% rename from common/src/main/java/com/itsaky/androidide/utils/KeyedDebouncingAction.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/KeyedDebouncingAction.kt index 987808fe7b..e3e3d307a1 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/KeyedDebouncingAction.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/KeyedDebouncingAction.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils -import com.itsaky.androidide.progress.ICancelChecker -import com.itsaky.androidide.tasks.JobCancelChecker +import org.appdevforall.codeonthego.progress.ICancelChecker +import org.appdevforall.codeonthego.tasks.JobCancelChecker import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers diff --git a/common/src/main/java/com/itsaky/androidide/utils/LSPUtils.java b/common/src/main/java/org/appdevforall/codeonthego/utils/LSPUtils.java similarity index 96% rename from common/src/main/java/com/itsaky/androidide/utils/LSPUtils.java rename to common/src/main/java/org/appdevforall/codeonthego/utils/LSPUtils.java index 9cabbf9702..4a8a307fa9 100755 --- a/common/src/main/java/com/itsaky/androidide/utils/LSPUtils.java +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/LSPUtils.java @@ -14,10 +14,10 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; import java.util.Comparator; import java.util.List; diff --git a/common/src/main/java/com/itsaky/androidide/utils/LegacyIdeDataDirMigration.java b/common/src/main/java/org/appdevforall/codeonthego/utils/LegacyIdeDataDirMigration.java similarity index 97% rename from common/src/main/java/com/itsaky/androidide/utils/LegacyIdeDataDirMigration.java rename to common/src/main/java/org/appdevforall/codeonthego/utils/LegacyIdeDataDirMigration.java index 4355032ccc..38905e9e7b 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/LegacyIdeDataDirMigration.java +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/LegacyIdeDataDirMigration.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; import java.io.File; import org.slf4j.Logger; diff --git a/common/src/main/java/com/itsaky/androidide/utils/ManufacturerUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/ManufacturerUtils.kt similarity index 97% rename from common/src/main/java/com/itsaky/androidide/utils/ManufacturerUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/ManufacturerUtils.kt index cc6bbdbf5c..9a511c062d 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/ManufacturerUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/ManufacturerUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.os.Build diff --git a/common/src/main/java/com/itsaky/androidide/utils/NavigationBar.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/NavigationBar.kt similarity index 98% rename from common/src/main/java/com/itsaky/androidide/utils/NavigationBar.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/NavigationBar.kt index a824b5202e..0875eb0764 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/NavigationBar.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/NavigationBar.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.annotation.SuppressLint import android.content.Context diff --git a/common/src/main/java/com/itsaky/androidide/utils/OrientationUtilities.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/OrientationUtilities.kt similarity index 96% rename from common/src/main/java/com/itsaky/androidide/utils/OrientationUtilities.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/OrientationUtilities.kt index 459d6988f3..ba0aea857a 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/OrientationUtilities.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/OrientationUtilities.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.pm.ActivityInfo diff --git a/common/src/main/java/com/itsaky/androidide/utils/PathTraversal.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/PathTraversal.kt similarity index 99% rename from common/src/main/java/com/itsaky/androidide/utils/PathTraversal.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/PathTraversal.kt index 1c25e364b9..601b2bb931 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/PathTraversal.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/PathTraversal.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import org.slf4j.LoggerFactory import java.io.File diff --git a/common/src/main/java/com/itsaky/androidide/utils/ProjectAttrs.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/ProjectAttrs.kt similarity index 95% rename from common/src/main/java/com/itsaky/androidide/utils/ProjectAttrs.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/ProjectAttrs.kt index 0e694e3321..4f7c2e5f7a 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/ProjectAttrs.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/ProjectAttrs.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import java.nio.file.Files diff --git a/common/src/main/java/com/itsaky/androidide/utils/ReflectUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/ReflectUtils.kt similarity index 99% rename from common/src/main/java/com/itsaky/androidide/utils/ReflectUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/ReflectUtils.kt index 9ccec80420..2ddac96199 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/ReflectUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/ReflectUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import java.lang.reflect.Constructor import java.lang.reflect.Field diff --git a/common/src/main/java/com/itsaky/androidide/utils/ResourceUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/ResourceUtils.kt similarity index 95% rename from common/src/main/java/com/itsaky/androidide/utils/ResourceUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/ResourceUtils.kt index 85c8cfd467..3ddac2513d 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/ResourceUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/ResourceUtils.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils -import com.itsaky.androidide.app.BaseApplication +import org.appdevforall.codeonthego.app.BaseApplication import org.slf4j.LoggerFactory import java.io.File import java.io.IOException diff --git a/common/src/main/java/com/itsaky/androidide/utils/SelfSignedCert.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/SelfSignedCert.kt similarity index 99% rename from common/src/main/java/com/itsaky/androidide/utils/SelfSignedCert.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/SelfSignedCert.kt index b26a489198..7b021474f5 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/SelfSignedCert.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/SelfSignedCert.kt @@ -1,6 +1,6 @@ @file:JvmName("SelfSignedCertUtils") -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import java.io.ByteArrayOutputStream import java.math.BigInteger diff --git a/common/src/main/java/com/itsaky/androidide/utils/SingleSessionCallback.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/SingleSessionCallback.kt similarity index 96% rename from common/src/main/java/com/itsaky/androidide/utils/SingleSessionCallback.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/SingleSessionCallback.kt index 83b78ad129..777d8057c2 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/SingleSessionCallback.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/SingleSessionCallback.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.pm.PackageInstaller diff --git a/common/src/main/java/com/itsaky/androidide/utils/SingleTextWatcher.java b/common/src/main/java/org/appdevforall/codeonthego/utils/SingleTextWatcher.java similarity index 91% rename from common/src/main/java/com/itsaky/androidide/utils/SingleTextWatcher.java rename to common/src/main/java/org/appdevforall/codeonthego/utils/SingleTextWatcher.java index 899ed9bbe0..678a3a88ec 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/SingleTextWatcher.java +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/SingleTextWatcher.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; import android.text.Editable; import android.text.TextWatcher; diff --git a/common/src/main/java/com/itsaky/androidide/utils/SparseArrayUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/SparseArrayUtils.kt similarity index 95% rename from common/src/main/java/com/itsaky/androidide/utils/SparseArrayUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/SparseArrayUtils.kt index 88b088828d..e16671e90f 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/SparseArrayUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/SparseArrayUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.util.SparseIntArray diff --git a/common/src/main/java/com/itsaky/androidide/utils/StrictModeExts.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/StrictModeExts.kt similarity index 96% rename from common/src/main/java/com/itsaky/androidide/utils/StrictModeExts.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/StrictModeExts.kt index aab4f4022c..5beb006932 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/StrictModeExts.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/StrictModeExts.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.os.StrictMode import org.slf4j.Logger diff --git a/common/src/main/java/com/itsaky/androidide/utils/TermuxProcessEnvironment.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/TermuxProcessEnvironment.kt similarity index 94% rename from common/src/main/java/com/itsaky/androidide/utils/TermuxProcessEnvironment.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/TermuxProcessEnvironment.kt index 1011bedef0..af8d5a1c1d 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/TermuxProcessEnvironment.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/TermuxProcessEnvironment.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import java.io.File diff --git a/common/src/main/java/com/itsaky/androidide/utils/TestModeUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/TestModeUtils.kt similarity index 82% rename from common/src/main/java/com/itsaky/androidide/utils/TestModeUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/TestModeUtils.kt index b3b66a4107..40500415d8 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/TestModeUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/TestModeUtils.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils fun isTestMode(): Boolean { // Check system property (for unit tests) diff --git a/common/src/main/java/com/itsaky/androidide/utils/TypefaceUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/TypefaceUtils.kt similarity index 91% rename from common/src/main/java/com/itsaky/androidide/utils/TypefaceUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/TypefaceUtils.kt index 26ff4c9756..99433c1e8f 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/TypefaceUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/TypefaceUtils.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . * */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.graphics.Typeface -import com.itsaky.androidide.app.BaseApplication +import org.appdevforall.codeonthego.app.BaseApplication import java.io.File fun jetbrainsMono(): Typeface = Typeface.createFromAsset(BaseApplication.baseInstance.assets, "fonts/jetbrains-mono.ttf") diff --git a/common/src/main/java/com/itsaky/androidide/utils/UriExtensions.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/UriExtensions.kt similarity index 96% rename from common/src/main/java/com/itsaky/androidide/utils/UriExtensions.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/UriExtensions.kt index 2109dc8350..8e83dfb2f3 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/UriExtensions.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/UriExtensions.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.ContentResolver import android.content.Context diff --git a/common/src/main/java/com/itsaky/androidide/utils/ViewExtensions.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/ViewExtensions.kt similarity index 99% rename from common/src/main/java/com/itsaky/androidide/utils/ViewExtensions.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/ViewExtensions.kt index 8e765bc123..74898e7e6b 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/ViewExtensions.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/ViewExtensions.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.annotation.SuppressLint import android.os.Handler diff --git a/common/src/main/java/com/itsaky/androidide/utils/WindowInsetExtensions.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/WindowInsetExtensions.kt similarity index 98% rename from common/src/main/java/com/itsaky/androidide/utils/WindowInsetExtensions.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/WindowInsetExtensions.kt index 1d747a04fd..1c5bafca9f 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/WindowInsetExtensions.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/WindowInsetExtensions.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.view.View import androidx.core.graphics.Insets diff --git a/common/src/main/java/com/itsaky/androidide/utils/WindowUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/WindowUtils.kt similarity index 96% rename from common/src/main/java/com/itsaky/androidide/utils/WindowUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/WindowUtils.kt index ba33217c80..f269a31a7c 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/WindowUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/WindowUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.view.Window import android.view.WindowManager diff --git a/common/src/main/java/com/itsaky/androidide/utils/ZipUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/ZipUtils.kt similarity index 98% rename from common/src/main/java/com/itsaky/androidide/utils/ZipUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/ZipUtils.kt index 34d48bc1e7..f944044725 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/ZipUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/ZipUtils.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils -import com.itsaky.androidide.utils.ContainedPathResolver.Resolution +import org.appdevforall.codeonthego.utils.ContainedPathResolver.Resolution import org.slf4j.LoggerFactory import java.io.File import java.io.IOException diff --git a/common/src/main/java/com/itsaky/androidide/utils/buildVersionExt.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/buildVersionExt.kt similarity index 97% rename from common/src/main/java/com/itsaky/androidide/utils/buildVersionExt.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/buildVersionExt.kt index 6759891d24..eaec5a7a8f 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/buildVersionExt.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/buildVersionExt.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.os.Build import androidx.annotation.ChecksSdkIntAtLeast diff --git a/common/src/main/java/com/itsaky/androidide/utils/connectionUtilExt.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/connectionUtilExt.kt similarity index 98% rename from common/src/main/java/com/itsaky/androidide/utils/connectionUtilExt.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/connectionUtilExt.kt index d3063acd3d..229d4f6c8e 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/connectionUtilExt.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/connectionUtilExt.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.Manifest import android.content.Context diff --git a/common/src/main/java/com/itsaky/androidide/utils/ioUtils.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/ioUtils.kt similarity index 98% rename from common/src/main/java/com/itsaky/androidide/utils/ioUtils.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/ioUtils.kt index bc706feb1b..94fc58ab29 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/ioUtils.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/ioUtils.kt @@ -40,7 +40,7 @@ * questions. */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import java.io.IOException import java.io.InputStream diff --git a/common/src/main/java/com/itsaky/androidide/utils/urlManager.kt b/common/src/main/java/org/appdevforall/codeonthego/utils/urlManager.kt similarity index 96% rename from common/src/main/java/com/itsaky/androidide/utils/urlManager.kt rename to common/src/main/java/org/appdevforall/codeonthego/utils/urlManager.kt index 7a3f375cde..c4e9e784c7 100644 --- a/common/src/main/java/com/itsaky/androidide/utils/urlManager.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/utils/urlManager.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.app.Activity import android.content.ActivityNotFoundException @@ -6,7 +6,7 @@ import android.content.Context import android.content.Intent import android.net.Uri import androidx.preference.PreferenceManager -import com.itsaky.androidide.app.BaseApplication +import org.appdevforall.codeonthego.app.BaseApplication import com.itsaky.androidide.common.R object UrlManager { diff --git a/common/src/main/java/com/itsaky/androidide/window/ActivityCompatHelper.kt b/common/src/main/java/org/appdevforall/codeonthego/window/ActivityCompatHelper.kt similarity index 96% rename from common/src/main/java/com/itsaky/androidide/window/ActivityCompatHelper.kt rename to common/src/main/java/org/appdevforall/codeonthego/window/ActivityCompatHelper.kt index 0a581608e8..f2d45274d2 100644 --- a/common/src/main/java/com/itsaky/androidide/window/ActivityCompatHelper.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/window/ActivityCompatHelper.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.itsaky.androidide.window +package org.appdevforall.codeonthego.window import android.annotation.SuppressLint import android.app.Activity diff --git a/common/src/main/java/com/itsaky/androidide/window/Bounds.kt b/common/src/main/java/org/appdevforall/codeonthego/window/Bounds.kt similarity index 98% rename from common/src/main/java/com/itsaky/androidide/window/Bounds.kt rename to common/src/main/java/org/appdevforall/codeonthego/window/Bounds.kt index 8d423eae71..780625bfc4 100644 --- a/common/src/main/java/com/itsaky/androidide/window/Bounds.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/window/Bounds.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.itsaky.androidide.window +package org.appdevforall.codeonthego.window import android.graphics.Rect diff --git a/common/src/main/java/com/itsaky/androidide/window/DisplayCompatHelper.kt b/common/src/main/java/org/appdevforall/codeonthego/window/DisplayCompatHelper.kt similarity index 97% rename from common/src/main/java/com/itsaky/androidide/window/DisplayCompatHelper.kt rename to common/src/main/java/org/appdevforall/codeonthego/window/DisplayCompatHelper.kt index 4f21a37ee2..f80ff7d4a4 100644 --- a/common/src/main/java/com/itsaky/androidide/window/DisplayCompatHelper.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/window/DisplayCompatHelper.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.itsaky.androidide.window +package org.appdevforall.codeonthego.window import android.annotation.SuppressLint import android.graphics.Point diff --git a/common/src/main/java/com/itsaky/androidide/window/WindowManager.kt b/common/src/main/java/org/appdevforall/codeonthego/window/WindowManager.kt similarity index 95% rename from common/src/main/java/com/itsaky/androidide/window/WindowManager.kt rename to common/src/main/java/org/appdevforall/codeonthego/window/WindowManager.kt index b53826d9b6..2e84e6d2e6 100644 --- a/common/src/main/java/com/itsaky/androidide/window/WindowManager.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/window/WindowManager.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.itsaky.androidide.window +package org.appdevforall.codeonthego.window import android.app.Activity import android.content.Context @@ -44,8 +44,8 @@ class WindowManager( /** * Activity that was registered with this instance of [WindowManager] at creation. * This is used to find the token identifier of the window when requesting layout information - * from the [com.itsaky.androidide.window.sidecar.SidecarInterface] or is passed directly to the - * [com.itsaky.androidide.window.extensions.ExtensionInterface]. + * from the [org.appdevforall.codeonthego.window.sidecar.SidecarInterface] or is passed directly to the + * [org.appdevforall.codeonthego.window.extensions.ExtensionInterface]. */ private val activity: Activity = getActivityFromContext(context) ?: throw IllegalArgumentException( diff --git a/common/src/main/java/com/itsaky/androidide/window/WindowMetrics.kt b/common/src/main/java/org/appdevforall/codeonthego/window/WindowMetrics.kt similarity index 97% rename from common/src/main/java/com/itsaky/androidide/window/WindowMetrics.kt rename to common/src/main/java/org/appdevforall/codeonthego/window/WindowMetrics.kt index 01355a1891..963c5da113 100644 --- a/common/src/main/java/com/itsaky/androidide/window/WindowMetrics.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/window/WindowMetrics.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.itsaky.androidide.window +package org.appdevforall.codeonthego.window import android.graphics.Rect diff --git a/common/src/main/java/com/itsaky/androidide/window/WindowMetricsCalculator.kt b/common/src/main/java/org/appdevforall/codeonthego/window/WindowMetricsCalculator.kt similarity index 98% rename from common/src/main/java/com/itsaky/androidide/window/WindowMetricsCalculator.kt rename to common/src/main/java/org/appdevforall/codeonthego/window/WindowMetricsCalculator.kt index 914943b493..c91c644808 100644 --- a/common/src/main/java/com/itsaky/androidide/window/WindowMetricsCalculator.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/window/WindowMetricsCalculator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.itsaky.androidide.window +package org.appdevforall.codeonthego.window import android.app.Activity import android.os.Build diff --git a/common/src/main/java/com/itsaky/androidide/window/WindowMetricsCalculatorCompat.kt b/common/src/main/java/org/appdevforall/codeonthego/window/WindowMetricsCalculatorCompat.kt similarity index 94% rename from common/src/main/java/com/itsaky/androidide/window/WindowMetricsCalculatorCompat.kt rename to common/src/main/java/org/appdevforall/codeonthego/window/WindowMetricsCalculatorCompat.kt index 1de79985ab..7456b1b7dd 100644 --- a/common/src/main/java/com/itsaky/androidide/window/WindowMetricsCalculatorCompat.kt +++ b/common/src/main/java/org/appdevforall/codeonthego/window/WindowMetricsCalculatorCompat.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.itsaky.androidide.window +package org.appdevforall.codeonthego.window import android.annotation.SuppressLint import android.app.Activity @@ -28,14 +28,14 @@ import android.view.Display import android.view.DisplayCutout import androidx.annotation.RequiresApi import androidx.annotation.VisibleForTesting -import com.itsaky.androidide.window.ActivityCompatHelperApi24.isInMultiWindowMode -import com.itsaky.androidide.window.ActivityCompatHelperApi30.currentWindowBounds -import com.itsaky.androidide.window.ActivityCompatHelperApi30.maximumWindowBounds -import com.itsaky.androidide.window.DisplayCompatHelperApi17.getRealSize -import com.itsaky.androidide.window.DisplayCompatHelperApi28.safeInsetBottom -import com.itsaky.androidide.window.DisplayCompatHelperApi28.safeInsetLeft -import com.itsaky.androidide.window.DisplayCompatHelperApi28.safeInsetRight -import com.itsaky.androidide.window.DisplayCompatHelperApi28.safeInsetTop +import org.appdevforall.codeonthego.window.ActivityCompatHelperApi24.isInMultiWindowMode +import org.appdevforall.codeonthego.window.ActivityCompatHelperApi30.currentWindowBounds +import org.appdevforall.codeonthego.window.ActivityCompatHelperApi30.maximumWindowBounds +import org.appdevforall.codeonthego.window.DisplayCompatHelperApi17.getRealSize +import org.appdevforall.codeonthego.window.DisplayCompatHelperApi28.safeInsetBottom +import org.appdevforall.codeonthego.window.DisplayCompatHelperApi28.safeInsetLeft +import org.appdevforall.codeonthego.window.DisplayCompatHelperApi28.safeInsetRight +import org.appdevforall.codeonthego.window.DisplayCompatHelperApi28.safeInsetTop import java.lang.reflect.InvocationTargetException /** diff --git a/common/src/test/java/com/itsaky/androidide/documentation/DatabaseTemplateLoaderTest.kt b/common/src/test/java/org/appdevforall/codeonthego/documentation/DatabaseTemplateLoaderTest.kt similarity index 99% rename from common/src/test/java/com/itsaky/androidide/documentation/DatabaseTemplateLoaderTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/documentation/DatabaseTemplateLoaderTest.kt index a44445357c..bcd2af2eac 100644 --- a/common/src/test/java/com/itsaky/androidide/documentation/DatabaseTemplateLoaderTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/documentation/DatabaseTemplateLoaderTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.documentation +package org.appdevforall.codeonthego.documentation import android.database.Cursor import android.database.sqlite.SQLiteDatabase diff --git a/common/src/test/java/com/itsaky/androidide/documentation/DocumentationContentSourceTest.kt b/common/src/test/java/org/appdevforall/codeonthego/documentation/DocumentationContentSourceTest.kt similarity index 99% rename from common/src/test/java/com/itsaky/androidide/documentation/DocumentationContentSourceTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/documentation/DocumentationContentSourceTest.kt index f5cad65a29..eaa69cbf75 100644 --- a/common/src/test/java/com/itsaky/androidide/documentation/DocumentationContentSourceTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/documentation/DocumentationContentSourceTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.documentation +package org.appdevforall.codeonthego.documentation import android.database.Cursor import android.database.sqlite.SQLiteDatabase diff --git a/common/src/test/java/com/itsaky/androidide/documentation/DocumentationRequestInterceptorTest.kt b/common/src/test/java/org/appdevforall/codeonthego/documentation/DocumentationRequestInterceptorTest.kt similarity index 99% rename from common/src/test/java/com/itsaky/androidide/documentation/DocumentationRequestInterceptorTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/documentation/DocumentationRequestInterceptorTest.kt index e07729beb1..86d929033c 100644 --- a/common/src/test/java/com/itsaky/androidide/documentation/DocumentationRequestInterceptorTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/documentation/DocumentationRequestInterceptorTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.documentation +package org.appdevforall.codeonthego.documentation import android.net.Uri import android.webkit.WebResourceRequest diff --git a/common/src/test/java/com/itsaky/androidide/managers/ToolsManagerToolingJarTest.kt b/common/src/test/java/org/appdevforall/codeonthego/managers/ToolsManagerToolingJarTest.kt similarity index 99% rename from common/src/test/java/com/itsaky/androidide/managers/ToolsManagerToolingJarTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/managers/ToolsManagerToolingJarTest.kt index f5b42d9cb4..396e5b9476 100644 --- a/common/src/test/java/com/itsaky/androidide/managers/ToolsManagerToolingJarTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/managers/ToolsManagerToolingJarTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.managers +package org.appdevforall.codeonthego.managers import com.google.common.truth.Truth.assertThat import org.junit.Rule diff --git a/common/src/test/java/com/itsaky/androidide/utils/BasicBuildInfoTest.kt b/common/src/test/java/org/appdevforall/codeonthego/utils/BasicBuildInfoTest.kt similarity index 94% rename from common/src/test/java/com/itsaky/androidide/utils/BasicBuildInfoTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/utils/BasicBuildInfoTest.kt index ccb3bea36e..8ef4f20e46 100644 --- a/common/src/test/java/com/itsaky/androidide/utils/BasicBuildInfoTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/utils/BasicBuildInfoTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import com.google.common.truth.Truth.assertThat import org.junit.Test diff --git a/common/src/test/java/com/itsaky/androidide/utils/ContentTypeHeadersTest.kt b/common/src/test/java/org/appdevforall/codeonthego/utils/ContentTypeHeadersTest.kt similarity index 99% rename from common/src/test/java/com/itsaky/androidide/utils/ContentTypeHeadersTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/utils/ContentTypeHeadersTest.kt index 284fa41258..1668de0ead 100644 --- a/common/src/test/java/com/itsaky/androidide/utils/ContentTypeHeadersTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/utils/ContentTypeHeadersTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import com.google.common.truth.Truth.assertThat import org.junit.Test diff --git a/common/src/test/java/com/itsaky/androidide/utils/DatabaseVersionResolverBranchTest.kt b/common/src/test/java/org/appdevforall/codeonthego/utils/DatabaseVersionResolverBranchTest.kt similarity index 98% rename from common/src/test/java/com/itsaky/androidide/utils/DatabaseVersionResolverBranchTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/utils/DatabaseVersionResolverBranchTest.kt index f2b584a3d2..fafbc09c58 100644 --- a/common/src/test/java/com/itsaky/androidide/utils/DatabaseVersionResolverBranchTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/utils/DatabaseVersionResolverBranchTest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.database.Cursor import android.database.sqlite.SQLiteDatabase diff --git a/common/src/test/java/com/itsaky/androidide/utils/FeatureFlagsTest.kt b/common/src/test/java/org/appdevforall/codeonthego/utils/FeatureFlagsTest.kt similarity index 98% rename from common/src/test/java/com/itsaky/androidide/utils/FeatureFlagsTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/utils/FeatureFlagsTest.kt index 438c55c597..3fbabcadad 100644 --- a/common/src/test/java/com/itsaky/androidide/utils/FeatureFlagsTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/utils/FeatureFlagsTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runTest diff --git a/common/src/test/java/com/itsaky/androidide/utils/FeedbackMetricsAttachmentTest.kt b/common/src/test/java/org/appdevforall/codeonthego/utils/FeedbackMetricsAttachmentTest.kt similarity index 98% rename from common/src/test/java/com/itsaky/androidide/utils/FeedbackMetricsAttachmentTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/utils/FeedbackMetricsAttachmentTest.kt index 3b67c459fb..b7db20e067 100644 --- a/common/src/test/java/com/itsaky/androidide/utils/FeedbackMetricsAttachmentTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/utils/FeedbackMetricsAttachmentTest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.net.Uri import com.google.common.truth.Truth.assertThat diff --git a/common/src/test/java/com/itsaky/androidide/utils/FileProviderUtilsTest.kt b/common/src/test/java/org/appdevforall/codeonthego/utils/FileProviderUtilsTest.kt similarity index 95% rename from common/src/test/java/com/itsaky/androidide/utils/FileProviderUtilsTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/utils/FileProviderUtilsTest.kt index f9f10926c1..c010a1f84a 100644 --- a/common/src/test/java/com/itsaky/androidide/utils/FileProviderUtilsTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/utils/FileProviderUtilsTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import com.google.common.truth.Truth.assertThat diff --git a/common/src/test/java/com/itsaky/androidide/utils/FileUtilsTest.kt b/common/src/test/java/org/appdevforall/codeonthego/utils/FileUtilsTest.kt similarity index 98% rename from common/src/test/java/com/itsaky/androidide/utils/FileUtilsTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/utils/FileUtilsTest.kt index c888db5e04..423e05e953 100644 --- a/common/src/test/java/com/itsaky/androidide/utils/FileUtilsTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/utils/FileUtilsTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import com.google.common.truth.Truth.assertThat import org.junit.Rule diff --git a/common/src/test/java/com/itsaky/androidide/utils/FlashbarDismissGateTest.kt b/common/src/test/java/org/appdevforall/codeonthego/utils/FlashbarDismissGateTest.kt similarity index 97% rename from common/src/test/java/com/itsaky/androidide/utils/FlashbarDismissGateTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/utils/FlashbarDismissGateTest.kt index 2cfd58bf67..352c22485e 100644 --- a/common/src/test/java/com/itsaky/androidide/utils/FlashbarDismissGateTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/utils/FlashbarDismissGateTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runTest diff --git a/common/src/test/java/com/itsaky/androidide/utils/GetProjectBuildVersionsTest.kt b/common/src/test/java/org/appdevforall/codeonthego/utils/GetProjectBuildVersionsTest.kt similarity index 99% rename from common/src/test/java/com/itsaky/androidide/utils/GetProjectBuildVersionsTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/utils/GetProjectBuildVersionsTest.kt index af170c3342..24e2b8b09b 100644 --- a/common/src/test/java/com/itsaky/androidide/utils/GetProjectBuildVersionsTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/utils/GetProjectBuildVersionsTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.runBlocking diff --git a/common/src/test/java/com/itsaky/androidide/utils/ImageUtilsTest.kt b/common/src/test/java/org/appdevforall/codeonthego/utils/ImageUtilsTest.kt similarity index 98% rename from common/src/test/java/com/itsaky/androidide/utils/ImageUtilsTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/utils/ImageUtilsTest.kt index b652ed53df..07b1934b8f 100644 --- a/common/src/test/java/com/itsaky/androidide/utils/ImageUtilsTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/utils/ImageUtilsTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import com.google.common.truth.Truth.assertThat import org.junit.Rule diff --git a/common/src/test/java/com/itsaky/androidide/utils/KeyedDebouncingActionCancelTest.kt b/common/src/test/java/org/appdevforall/codeonthego/utils/KeyedDebouncingActionCancelTest.kt similarity index 98% rename from common/src/test/java/com/itsaky/androidide/utils/KeyedDebouncingActionCancelTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/utils/KeyedDebouncingActionCancelTest.kt index 582b9c63ea..dd3edacaf4 100644 --- a/common/src/test/java/com/itsaky/androidide/utils/KeyedDebouncingActionCancelTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/utils/KeyedDebouncingActionCancelTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.CompletableDeferred diff --git a/common/src/test/java/com/itsaky/androidide/utils/KeyedDebouncingActionSelfScheduleTest.kt b/common/src/test/java/org/appdevforall/codeonthego/utils/KeyedDebouncingActionSelfScheduleTest.kt similarity index 97% rename from common/src/test/java/com/itsaky/androidide/utils/KeyedDebouncingActionSelfScheduleTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/utils/KeyedDebouncingActionSelfScheduleTest.kt index 02ee017a98..caace8eb6c 100644 --- a/common/src/test/java/com/itsaky/androidide/utils/KeyedDebouncingActionSelfScheduleTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/utils/KeyedDebouncingActionSelfScheduleTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.CoroutineScope diff --git a/common/src/test/java/com/itsaky/androidide/utils/PathTraversalTest.kt b/common/src/test/java/org/appdevforall/codeonthego/utils/PathTraversalTest.kt similarity index 99% rename from common/src/test/java/com/itsaky/androidide/utils/PathTraversalTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/utils/PathTraversalTest.kt index 1d33d6fae5..2657666b18 100644 --- a/common/src/test/java/com/itsaky/androidide/utils/PathTraversalTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/utils/PathTraversalTest.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.utils.ContainedPathResolver.Resolution +import org.appdevforall.codeonthego.utils.ContainedPathResolver.Resolution import org.junit.Assume import org.junit.Rule import org.junit.Test diff --git a/common/src/test/java/com/itsaky/androidide/utils/ReflectUtilsTest.kt b/common/src/test/java/org/appdevforall/codeonthego/utils/ReflectUtilsTest.kt similarity index 98% rename from common/src/test/java/com/itsaky/androidide/utils/ReflectUtilsTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/utils/ReflectUtilsTest.kt index a4799abccf..634a32ba8c 100644 --- a/common/src/test/java/com/itsaky/androidide/utils/ReflectUtilsTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/utils/ReflectUtilsTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import com.google.common.truth.Truth.assertThat import org.junit.Assert.assertThrows diff --git a/common/src/test/java/com/itsaky/androidide/utils/ResourceUtilsTest.kt b/common/src/test/java/org/appdevforall/codeonthego/utils/ResourceUtilsTest.kt similarity index 97% rename from common/src/test/java/com/itsaky/androidide/utils/ResourceUtilsTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/utils/ResourceUtilsTest.kt index 00d8c2913f..64c7b2b011 100644 --- a/common/src/test/java/com/itsaky/androidide/utils/ResourceUtilsTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/utils/ResourceUtilsTest.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.res.AssetManager import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.app.BaseApplication +import org.appdevforall.codeonthego.app.BaseApplication import io.mockk.every import io.mockk.mockk import io.mockk.mockkObject diff --git a/common/src/test/java/com/itsaky/androidide/utils/SelfSignedCertTest.kt b/common/src/test/java/org/appdevforall/codeonthego/utils/SelfSignedCertTest.kt similarity index 98% rename from common/src/test/java/com/itsaky/androidide/utils/SelfSignedCertTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/utils/SelfSignedCertTest.kt index acfaa24ad8..f01214a645 100644 --- a/common/src/test/java/com/itsaky/androidide/utils/SelfSignedCertTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/utils/SelfSignedCertTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import com.google.common.truth.Truth.assertThat import org.junit.Test diff --git a/common/src/test/java/com/itsaky/androidide/utils/SymlinkTestSupport.kt b/common/src/test/java/org/appdevforall/codeonthego/utils/SymlinkTestSupport.kt similarity index 97% rename from common/src/test/java/com/itsaky/androidide/utils/SymlinkTestSupport.kt rename to common/src/test/java/org/appdevforall/codeonthego/utils/SymlinkTestSupport.kt index 98190f1933..c2dcc271f0 100644 --- a/common/src/test/java/com/itsaky/androidide/utils/SymlinkTestSupport.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/utils/SymlinkTestSupport.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import org.junit.Assume import java.nio.file.FileSystemException diff --git a/common/src/test/java/com/itsaky/androidide/utils/ZipUtilsTest.kt b/common/src/test/java/org/appdevforall/codeonthego/utils/ZipUtilsTest.kt similarity index 99% rename from common/src/test/java/com/itsaky/androidide/utils/ZipUtilsTest.kt rename to common/src/test/java/org/appdevforall/codeonthego/utils/ZipUtilsTest.kt index 37654c2ee9..fa36f7f508 100644 --- a/common/src/test/java/com/itsaky/androidide/utils/ZipUtilsTest.kt +++ b/common/src/test/java/org/appdevforall/codeonthego/utils/ZipUtilsTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import com.google.common.truth.Truth.assertThat import org.junit.Assert.assertThrows diff --git a/docs/PLUGIN_API_CHANGELOG.md b/docs/PLUGIN_API_CHANGELOG.md index 7a9f73b90d..902199de63 100644 --- a/docs/PLUGIN_API_CHANGELOG.md +++ b/docs/PLUGIN_API_CHANGELOG.md @@ -87,10 +87,10 @@ milestone. **[verified]** = read from the checked-in ABI dump. **[reconstructed] that does not implement it reads as `AVAILABLE`. `isAvailable()` still means only "set up"; a configured OpenAI-compatible server that is not running is `DEGRADED`. Same cheap, non-blocking rule and unknown-constant reading as for a tool source. - - `com.itsaky.androidide.plugins.services.CapabilityStatus` (new top-level enum) is the one + - `org.appdevforall.codeonthego.plugins.services.CapabilityStatus` (new top-level enum) is the one status both contracts return, so a consumer showing backends and tool sources side by side maps one vocabulary, not two identical enums. - - `com.itsaky.androidide.plugins.ai.LlmBackendRegistration` keeps a backend plugin's + - `org.appdevforall.codeonthego.plugins.ai.LlmBackendRegistration` keeps a backend plugin's `LlmBackend` registered with the router: `start(backend)` from `activate`, `stop()` from `deactivate` and `dispose`. It re-registers when AI Core restarts, and calls `notifyBackendChanged` when one of the `watchedKeys` in the plugin's settings changes, so @@ -124,7 +124,7 @@ milestone. **[verified]** = read from the checked-in ABI dump. **[reconstructed] config, and the credential screens their own copy of the reveal toggle and pane styling, so a fix had to be repeated per plugin and a missed copy made the plugins drift. The host now ships one copy. - `com.itsaky.androidide.plugins.ai.prompt`: `PromptTemplateEngine` and `PromptText` + `org.appdevforall.codeonthego.plugins.ai.prompt`: `PromptTemplateEngine` and `PromptText` (the `{{NAME}}` / `{{#NAME}}` / `{{^NAME}}` renderer; names may be in any case and hold dots, e.g. `{{fileName}}` or `{{item.name}}`, `{{{{` writes a literal `{{`, and config text keeps its whitespace as YAML parsed it); `PromptConfigLoader.load(source, @@ -137,7 +137,7 @@ milestone. **[verified]** = read from the checked-in ABI dump. **[reconstructed] `val shared = PromptConfigStore(MyParser)`, and calls `shared.reload(source, onLoaded, onFailed)` from `activate()` and `shared.clear()` from `deactivate()`. The YAML library (snakeyaml-engine 2.10) is on the host side, so a plugin using the loader no longer bundles it. - `com.itsaky.androidide.plugins.ai.ui`: `SecretRevealController`, whose two states are + `org.appdevforall.codeonthego.plugins.ai.ui`: `SecretRevealController`, whose two states are each a `RevealToggle` (icon and content description), and `View.applyPaneStyling(PaneStyle, outlinedButtonIds)`, with `PaneStyle` grouping a `ButtonColors` per emphasis and a `FieldColors`. Both take the plugin's own resource ids @@ -416,8 +416,8 @@ milestone. **[verified]** = read from the checked-in ABI dump. **[reconstructed] The plugin API and the builder Gradle plugin are injected into the on-device local Maven repository at onboarding, so a plugin resolves them by coordinate, offline, without committing `libs/*.jar`: - `compileOnly("com.itsaky.androidide:plugin-api:1.0.0")` and - `plugins { id("com.itsaky.androidide.plugins.build") version "1.0.0" }`. + `compileOnly("org.appdevforall.codeonthego:plugin-api:1.0.0")` and + `plugins { id("org.appdevforall.codeonthego.plugins.build") version "1.0.0" }`. `plugin-api:1.0.0` bundles `:plugin-api` + `common` + `eventbus-events` + `idetooltips`. (No-`libs/` project detection lands separately in ADFA-4913.) diff --git a/docs/PLUGIN_AUTHORING.md b/docs/PLUGIN_AUTHORING.md index 2a98c17a30..d3d7258030 100644 --- a/docs/PLUGIN_AUTHORING.md +++ b/docs/PLUGIN_AUTHORING.md @@ -33,14 +33,14 @@ my-plugin/ └── values/ ``` -The build is wired up by applying `com.itsaky.androidide.plugins.build` +The build is wired up by applying `org.appdevforall.codeonthego.plugins.build` in `build.gradle.kts`: ```kotlin plugins { id("com.android.application") version "8.8.2" id("org.jetbrains.kotlin.android") version "2.3.0" - id("com.itsaky.androidide.plugins.build") + id("org.appdevforall.codeonthego.plugins.build") } pluginBuilder { @@ -57,14 +57,14 @@ resolves offline, with no `libs/*.jar` to commit: ```kotlin dependencies { - compileOnly("com.itsaky.androidide:plugin-api:1.0.0") + compileOnly("org.appdevforall.codeonthego:plugin-api:1.0.0") } ``` `plugin-api:1.0.0` is a single jar bundling the API surface plugins compile against — the `:plugin-api` module plus `common`, `eventbus-events`, and `idetooltips`. The builder plugin applied above resolves the same way, from the -injected `com.itsaky.androidide.plugins.build` `1.0.0` marker. +injected `org.appdevforall.codeonthego.plugins.build` `1.0.0` marker. #### Building on-device (offline) pins the AGP/Kotlin/Gradle versions diff --git a/docs/features/java-extract-method.md b/docs/features/java-extract-method.md index 6d15989064..f6edb3215f 100644 --- a/docs/features/java-extract-method.md +++ b/docs/features/java-extract-method.md @@ -297,10 +297,10 @@ Unit tests in `:lsp:java` and `:lsp:ui`, mirroring the extract-variable split so ```bash flox activate -d flox/local -- ./gradlew \ :lsp:java:testV7DebugUnitTest \ - --tests "com.itsaky.androidide.lsp.java.refactor.*" \ - --tests "com.itsaky.androidide.lsp.java.actions.*" \ + --tests "org.appdevforall.codeonthego.lsp.java.refactor.*" \ + --tests "org.appdevforall.codeonthego.lsp.java.actions.*" \ :lsp:ui:testV7DebugUnitTest :lsp:refactor-core:testV7DebugUnitTest \ - :lsp:kotlin:testV7DebugUnitTest --tests "com.itsaky.androidide.lsp.kotlin.utils.refactor.*" + :lsp:kotlin:testV7DebugUnitTest --tests "org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.*" ``` Both packages are needed. `JavaCodeActionTooltipTagTest` lives in `...lsp.java.actions` and asserts diff --git a/docs/features/kotlin-goto-definition.md b/docs/features/kotlin-goto-definition.md index 8bd6d0c872..5569e26753 100644 --- a/docs/features/kotlin-goto-definition.md +++ b/docs/features/kotlin-goto-definition.md @@ -23,7 +23,7 @@ One declaration a reference resolved to. A reference normally has exactly one; a _Avoid_: match, result, hit. **Location**: -The existing `com.itsaky.androidide.models.Location` (file + range) that a candidate is converted into for transport to the editor. A candidate has a location only if its declaration lives in a workspace source. +The existing `org.appdevforall.codeonthego.models.Location` (file + range) that a candidate is converted into for transport to the editor. A candidate has a location only if its declaration lives in a workspace source. _Avoid_: position, target, site. **Workspace source**: diff --git a/docs/plugin-api.md b/docs/plugin-api.md index 9b1a83256e..9dc4990984 100644 --- a/docs/plugin-api.md +++ b/docs/plugin-api.md @@ -8,7 +8,7 @@ This is *not* a plugin-authoring how-to. For that — project layout, manifest c The surface a plugin binds to is broader than one module. All of the following are contract: -- **The `:plugin-api` module** — package `com.itsaky.androidide.plugins.*`: +- **The `:plugin-api` module** — package `org.appdevforall.codeonthego.plugins.*`: - Core: `IPlugin` (lifecycle), `PluginContext`, `PluginLogger`, `ServiceRegistry`, `ResourceManager`. - Extension interfaces plugins **implement**: `UIExtension`, `EditorExtension`, `EditorTabExtension`, `DocumentationExtension`, `BuildActionExtension`, `SnippetExtension`, `ProjectExtension`, `FileOpenExtension`, `SettingsExtension`, `LanguageExtension`. - IDE service interfaces plugins **call** (via `ServiceRegistry.get(X::class.java)`): `IdeProjectService`, `IdeEditorService`, `IdeFileService`, `IdeEnvironmentService`, `IdeArchiveService`, `IdeBuildService`, `IdeLogService`, `IdeUIService`, `IdeEditorTabService`, `IdeTooltipService`, `IdeThemeService`, `IdeFeatureFlagService`, `IdeCommandService`, `IdeTemplateService`, `IdeSnippetService`, `IdeSidebarService`. @@ -47,7 +47,7 @@ These look source-compatible but break already-built `.cgp` plugins: - *Plugin-implemented service interfaces* (`LlmInferenceService` and the backend interfaces nested in it) are implemented **by a plugin** even though they are shaped like services. The extension-interface rule applies, not the host-service one: **adding** a method is breaking. A Kotlin implementor that already declares a same-signature method without `override` stops compiling when a Java `default` appears above it, so the break is in the *other* repo — the impact check below catches it. Prefer a new interface extending the old one over a new method on it: `StatusReportingBackend`, `ActiveModelReportingBackend` and `StatusReportingToolSource` follow this, and the consumer asks with `instanceof`. The same rule covers `ToolSource`, which every contributing plugin implements. `LlmInferenceService` and `ToolSourceRegistry` themselves took `default` methods in 26.41 as an exception: AI-Core is their only implementor, and its released implementations were checked to declare none of the new names. - **Enum constants.** Removing or renaming a constant (`PluginPermission`, `ShowAsAction`, `ArchiveFormat`, `ToolbarActionIds`, `BuildActionCategory`) breaks plugins that name it; adding one can still break an exhaustive `when`. - **Types & nullability.** Flipping nullable↔non-null, changing a parameter/return type, or `val`↔`var` on an API property. -- **Moving or renaming** any class/package under `com.itsaky.androidide.plugins.*` — breaks imports and `ServiceRegistry.get(...)` lookups. +- **Moving or renaming** any class/package under `org.appdevforall.codeonthego.plugins.*` — breaks imports and `ServiceRegistry.get(...)` lookups. - **Manifest key or permission-string renames** — silently break every existing plugin, since both are matched by string. ## Before you change the plugin API — checklist diff --git a/editor-api/src/main/java/com/itsaky/androidide/editor/api/IEditor.java b/editor-api/src/main/java/org/appdevforall/codeonthego/editor/api/IEditor.java similarity index 97% rename from editor-api/src/main/java/com/itsaky/androidide/editor/api/IEditor.java rename to editor-api/src/main/java/org/appdevforall/codeonthego/editor/api/IEditor.java index 3cbc3a28e2..094af0cfe3 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/editor/api/IEditor.java +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/editor/api/IEditor.java @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.api; +package org.appdevforall.codeonthego.editor.api; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; import io.github.rosemoe.sora.text.CharPosition; import java.io.File; diff --git a/editor-api/src/main/java/com/itsaky/androidide/editor/api/ILspEditor.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/editor/api/ILspEditor.kt similarity index 90% rename from editor-api/src/main/java/com/itsaky/androidide/editor/api/ILspEditor.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/editor/api/ILspEditor.kt index 62794c50ac..112ba2979e 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/editor/api/ILspEditor.kt +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/editor/api/ILspEditor.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.api +package org.appdevforall.codeonthego.editor.api -import com.itsaky.androidide.lsp.api.ILanguageClient -import com.itsaky.androidide.lsp.api.ILanguageServer -import com.itsaky.androidide.lsp.models.Command -import com.itsaky.androidide.lsp.models.SignatureHelp +import org.appdevforall.codeonthego.lsp.api.ILanguageClient +import org.appdevforall.codeonthego.lsp.api.ILanguageServer +import org.appdevforall.codeonthego.lsp.models.Command +import org.appdevforall.codeonthego.lsp.models.SignatureHelp /** * LSP functions for the editor. diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterInputEdit.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterInputEdit.kt similarity index 94% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterInputEdit.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterInputEdit.kt index 4e451b619b..52513232c8 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterInputEdit.kt +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterInputEdit.kt @@ -19,8 +19,8 @@ package com.itsaky.androidide.treesitter.api import com.itsaky.androidide.treesitter.TSInputEdit import com.itsaky.androidide.treesitter.TSPoint -import com.itsaky.androidide.utils.DefaultRecyclable -import com.itsaky.androidide.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.DefaultRecyclable +import org.appdevforall.codeonthego.utils.RecyclableObjectPool class TreeSitterInputEdit @JvmOverloads internal constructor( startByte: Int = 0, diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterLookaheadIterator.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterLookaheadIterator.kt similarity index 91% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterLookaheadIterator.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterLookaheadIterator.kt index 30d07ade98..e4af134bf0 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterLookaheadIterator.kt +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterLookaheadIterator.kt @@ -18,8 +18,8 @@ package com.itsaky.androidide.treesitter.api import com.itsaky.androidide.treesitter.TSLookaheadIterator -import com.itsaky.androidide.utils.DefaultRecyclable -import com.itsaky.androidide.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.DefaultRecyclable +import org.appdevforall.codeonthego.utils.RecyclableObjectPool /** * @author Akash Yadav diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterNativeLanguage.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterNativeLanguage.kt similarity index 92% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterNativeLanguage.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterNativeLanguage.kt index b5fe74db32..a085168f17 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterNativeLanguage.kt +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterNativeLanguage.kt @@ -18,8 +18,8 @@ package com.itsaky.androidide.treesitter.api import com.itsaky.androidide.treesitter.TSLanguage -import com.itsaky.androidide.utils.DefaultRecyclable -import com.itsaky.androidide.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.DefaultRecyclable +import org.appdevforall.codeonthego.utils.RecyclableObjectPool /** * @author Akash Yadav diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterNode.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterNode.kt similarity index 93% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterNode.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterNode.kt index 386027b789..254d24c04a 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterNode.kt +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterNode.kt @@ -18,8 +18,8 @@ package com.itsaky.androidide.treesitter.api import com.itsaky.androidide.treesitter.TSNode -import com.itsaky.androidide.utils.DefaultRecyclable -import com.itsaky.androidide.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.DefaultRecyclable +import org.appdevforall.codeonthego.utils.RecyclableObjectPool /** * @author Akash Yadav diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterObjectFactory.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterObjectFactory.kt similarity index 100% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterObjectFactory.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterObjectFactory.kt diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterObjectPoolProvider.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterObjectPoolProvider.kt similarity index 90% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterObjectPoolProvider.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterObjectPoolProvider.kt index b2a0b848a6..de3e170c52 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterObjectPoolProvider.kt +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterObjectPoolProvider.kt @@ -17,11 +17,11 @@ package com.itsaky.androidide.treesitter.api -import com.itsaky.androidide.utils.RecyclableObjectPool -import com.itsaky.androidide.utils.RecyclableObjectPool.Companion.CAPACITY_DEFAULT -import com.itsaky.androidide.utils.RecyclableObjectPool.Companion.CAPACITY_MINI -import com.itsaky.androidide.utils.newRecyclableObjectPool -import com.itsaky.androidide.utils.uncheckedCast +import org.appdevforall.codeonthego.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.RecyclableObjectPool.Companion.CAPACITY_DEFAULT +import org.appdevforall.codeonthego.utils.RecyclableObjectPool.Companion.CAPACITY_MINI +import org.appdevforall.codeonthego.utils.newRecyclableObjectPool +import org.appdevforall.codeonthego.utils.uncheckedCast import java.util.concurrent.ConcurrentHashMap /** diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterParser.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterParser.kt similarity index 91% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterParser.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterParser.kt index f9c0b90df9..66d3360bb7 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterParser.kt +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterParser.kt @@ -18,8 +18,8 @@ package com.itsaky.androidide.treesitter.api import com.itsaky.androidide.treesitter.TSParser -import com.itsaky.androidide.utils.DefaultRecyclable -import com.itsaky.androidide.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.DefaultRecyclable +import org.appdevforall.codeonthego.utils.RecyclableObjectPool /** * @author Akash Yadav diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterPoint.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterPoint.kt similarity index 91% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterPoint.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterPoint.kt index ecb632f68e..da17678635 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterPoint.kt +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterPoint.kt @@ -18,8 +18,8 @@ package com.itsaky.androidide.treesitter.api import com.itsaky.androidide.treesitter.TSPoint -import com.itsaky.androidide.utils.DefaultRecyclable -import com.itsaky.androidide.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.DefaultRecyclable +import org.appdevforall.codeonthego.utils.RecyclableObjectPool /** * @author Akash Yadav diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterQuery.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterQuery.kt similarity index 91% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterQuery.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterQuery.kt index edc50e62bc..47f8e354e7 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterQuery.kt +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterQuery.kt @@ -18,8 +18,8 @@ package com.itsaky.androidide.treesitter.api import com.itsaky.androidide.treesitter.TSQuery -import com.itsaky.androidide.utils.DefaultRecyclable -import com.itsaky.androidide.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.DefaultRecyclable +import org.appdevforall.codeonthego.utils.RecyclableObjectPool /** * @author Akash Yadav diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterQueryCapture.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterQueryCapture.kt similarity index 92% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterQueryCapture.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterQueryCapture.kt index 34f20a6b02..97bb51ffb6 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterQueryCapture.kt +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterQueryCapture.kt @@ -19,8 +19,8 @@ package com.itsaky.androidide.treesitter.api import com.itsaky.androidide.treesitter.TSNode import com.itsaky.androidide.treesitter.TSQueryCapture -import com.itsaky.androidide.utils.DefaultRecyclable -import com.itsaky.androidide.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.DefaultRecyclable +import org.appdevforall.codeonthego.utils.RecyclableObjectPool /** * @author Akash Yadav diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterQueryCursor.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterQueryCursor.kt similarity index 91% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterQueryCursor.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterQueryCursor.kt index 2f47369aa7..cc4cf8eac0 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterQueryCursor.kt +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterQueryCursor.kt @@ -18,8 +18,8 @@ package com.itsaky.androidide.treesitter.api import com.itsaky.androidide.treesitter.TSQueryCursor -import com.itsaky.androidide.utils.DefaultRecyclable -import com.itsaky.androidide.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.DefaultRecyclable +import org.appdevforall.codeonthego.utils.RecyclableObjectPool /** * @author Akash Yadav diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterQueryMatch.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterQueryMatch.kt similarity index 92% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterQueryMatch.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterQueryMatch.kt index 7b98d613c3..ce28ac4389 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterQueryMatch.kt +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterQueryMatch.kt @@ -19,8 +19,8 @@ package com.itsaky.androidide.treesitter.api import com.itsaky.androidide.treesitter.TSQueryCapture import com.itsaky.androidide.treesitter.TSQueryMatch -import com.itsaky.androidide.utils.DefaultRecyclable -import com.itsaky.androidide.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.DefaultRecyclable +import org.appdevforall.codeonthego.utils.RecyclableObjectPool /** * @author Akash Yadav diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterQueryPredicateStep.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterQueryPredicateStep.kt similarity index 91% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterQueryPredicateStep.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterQueryPredicateStep.kt index 51f8451be9..bda3808719 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterQueryPredicateStep.kt +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterQueryPredicateStep.kt @@ -18,8 +18,8 @@ package com.itsaky.androidide.treesitter.api import com.itsaky.androidide.treesitter.TSQueryPredicateStep -import com.itsaky.androidide.utils.DefaultRecyclable -import com.itsaky.androidide.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.DefaultRecyclable +import org.appdevforall.codeonthego.utils.RecyclableObjectPool /** * @author Akash Yadav diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterRange.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterRange.kt similarity index 93% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterRange.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterRange.kt index 293e699ee2..3946ddcc66 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterRange.kt +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterRange.kt @@ -19,8 +19,8 @@ package com.itsaky.androidide.treesitter.api import com.itsaky.androidide.treesitter.TSPoint import com.itsaky.androidide.treesitter.TSRange -import com.itsaky.androidide.utils.DefaultRecyclable -import com.itsaky.androidide.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.DefaultRecyclable +import org.appdevforall.codeonthego.utils.RecyclableObjectPool /** * @author Akash Yadav diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterTree.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterTree.kt similarity index 92% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterTree.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterTree.kt index 2244f16304..9a071aefd8 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterTree.kt +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterTree.kt @@ -18,8 +18,8 @@ package com.itsaky.androidide.treesitter.api import com.itsaky.androidide.treesitter.TSTree -import com.itsaky.androidide.utils.DefaultRecyclable -import com.itsaky.androidide.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.DefaultRecyclable +import org.appdevforall.codeonthego.utils.RecyclableObjectPool /** * @author Akash Yadav diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterTreeCursor.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterTreeCursor.kt similarity index 92% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterTreeCursor.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterTreeCursor.kt index 3301231f56..639fc1c5f7 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterTreeCursor.kt +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterTreeCursor.kt @@ -18,8 +18,8 @@ package com.itsaky.androidide.treesitter.api import com.itsaky.androidide.treesitter.TSTreeCursor -import com.itsaky.androidide.utils.DefaultRecyclable -import com.itsaky.androidide.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.DefaultRecyclable +import org.appdevforall.codeonthego.utils.RecyclableObjectPool /** * @author Akash Yadav diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterTreeCursorNode.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterTreeCursorNode.kt similarity index 92% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterTreeCursorNode.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterTreeCursorNode.kt index a2d0cdc5cc..0957c6d437 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/TreeSitterTreeCursorNode.kt +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/TreeSitterTreeCursorNode.kt @@ -18,8 +18,8 @@ package com.itsaky.androidide.treesitter.api import com.itsaky.androidide.treesitter.TSTreeCursorNode -import com.itsaky.androidide.utils.DefaultRecyclable -import com.itsaky.androidide.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.DefaultRecyclable +import org.appdevforall.codeonthego.utils.RecyclableObjectPool /** * @author Akash Yadav diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/tsRecyclableUtils.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/tsRecyclableUtils.kt similarity index 95% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/tsRecyclableUtils.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/tsRecyclableUtils.kt index 58b4ff12d7..4a96401f0a 100644 --- a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/tsRecyclableUtils.kt +++ b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/tsRecyclableUtils.kt @@ -17,7 +17,7 @@ package com.itsaky.androidide.treesitter.api -import com.itsaky.androidide.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.RecyclableObjectPool /** * Returns this [RecyclableObjectPool.Recyclable] object to the pool from the [TreeSitterObjectPoolProvider]. diff --git a/editor-api/src/main/java/com/itsaky/androidide/treesitter/api/tsUtils.kt b/editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/tsUtils.kt similarity index 100% rename from editor-api/src/main/java/com/itsaky/androidide/treesitter/api/tsUtils.kt rename to editor-api/src/main/java/org/appdevforall/codeonthego/treesitter/api/tsUtils.kt diff --git a/editor-treesitter/src/main/java/io/github/rosemoe/sora/editor/ts/LineSpansGenerator.kt b/editor-treesitter/src/main/java/io/github/rosemoe/sora/editor/ts/LineSpansGenerator.kt index 33dcc4b9ed..1593a023d0 100644 --- a/editor-treesitter/src/main/java/io/github/rosemoe/sora/editor/ts/LineSpansGenerator.kt +++ b/editor-treesitter/src/main/java/io/github/rosemoe/sora/editor/ts/LineSpansGenerator.kt @@ -44,8 +44,8 @@ import android.os.Handler import android.os.Looper import android.util.Log import android.util.LruCache -import com.itsaky.androidide.plugins.extensions.DecorationSpan -import com.itsaky.androidide.syntax.decoration.EditorDecorationRegistry +import org.appdevforall.codeonthego.plugins.extensions.DecorationSpan +import org.appdevforall.codeonthego.syntax.decoration.EditorDecorationRegistry import com.itsaky.androidide.treesitter.TSQueryCapture import com.itsaky.androidide.treesitter.TSQueryCursor import com.itsaky.androidide.treesitter.TSTree diff --git a/editor-treesitter/src/main/java/io/github/rosemoe/sora/editor/ts/TsAnalyzeWorker.kt b/editor-treesitter/src/main/java/io/github/rosemoe/sora/editor/ts/TsAnalyzeWorker.kt index 321291936b..3cc2cafdac 100644 --- a/editor-treesitter/src/main/java/io/github/rosemoe/sora/editor/ts/TsAnalyzeWorker.kt +++ b/editor-treesitter/src/main/java/io/github/rosemoe/sora/editor/ts/TsAnalyzeWorker.kt @@ -19,7 +19,7 @@ package io.github.rosemoe.sora.editor.ts import android.os.Handler import android.os.Looper -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE import com.itsaky.androidide.treesitter.TSInputEdit import com.itsaky.androidide.treesitter.TSQueryCursor import com.itsaky.androidide.treesitter.TSTree diff --git a/editor-treesitter/src/main/java/com/itsaky/androidide/treesitter/nodeExt.kt b/editor-treesitter/src/main/java/org/appdevforall/codeonthego/treesitter/nodeExt.kt similarity index 100% rename from editor-treesitter/src/main/java/com/itsaky/androidide/treesitter/nodeExt.kt rename to editor-treesitter/src/main/java/org/appdevforall/codeonthego/treesitter/nodeExt.kt diff --git a/editor-treesitter/src/main/java/com/itsaky/androidide/treesitter/pointExt.kt b/editor-treesitter/src/main/java/org/appdevforall/codeonthego/treesitter/pointExt.kt similarity index 100% rename from editor-treesitter/src/main/java/com/itsaky/androidide/treesitter/pointExt.kt rename to editor-treesitter/src/main/java/org/appdevforall/codeonthego/treesitter/pointExt.kt diff --git a/editor/src/androidTest/java/com/itsaky/androidide/editor/language/outline/TreeSitterOutlineProviderTest.kt b/editor/src/androidTest/java/org/appdevforall/codeonthego/editor/language/outline/TreeSitterOutlineProviderTest.kt similarity index 98% rename from editor/src/androidTest/java/com/itsaky/androidide/editor/language/outline/TreeSitterOutlineProviderTest.kt rename to editor/src/androidTest/java/org/appdevforall/codeonthego/editor/language/outline/TreeSitterOutlineProviderTest.kt index a68deb3033..7c7c73945f 100644 --- a/editor/src/androidTest/java/com/itsaky/androidide/editor/language/outline/TreeSitterOutlineProviderTest.kt +++ b/editor/src/androidTest/java/org/appdevforall/codeonthego/editor/language/outline/TreeSitterOutlineProviderTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.editor.language.outline +package org.appdevforall.codeonthego.editor.language.outline import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry diff --git a/editor/src/androidTest/java/com/itsaky/androidide/editor/language/outline/TreeSitterOutlineQueryTest.kt b/editor/src/androidTest/java/org/appdevforall/codeonthego/editor/language/outline/TreeSitterOutlineQueryTest.kt similarity index 96% rename from editor/src/androidTest/java/com/itsaky/androidide/editor/language/outline/TreeSitterOutlineQueryTest.kt rename to editor/src/androidTest/java/org/appdevforall/codeonthego/editor/language/outline/TreeSitterOutlineQueryTest.kt index 2af6cf3252..2cd7ed0d1d 100644 --- a/editor/src/androidTest/java/com/itsaky/androidide/editor/language/outline/TreeSitterOutlineQueryTest.kt +++ b/editor/src/androidTest/java/org/appdevforall/codeonthego/editor/language/outline/TreeSitterOutlineQueryTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.editor.language.outline +package org.appdevforall.codeonthego.editor.language.outline import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry diff --git a/editor/src/androidTest/java/com/itsaky/androidide/editor/language/treesitter/LineSpansSnapshotTest.kt b/editor/src/androidTest/java/org/appdevforall/codeonthego/editor/language/treesitter/LineSpansSnapshotTest.kt similarity index 96% rename from editor/src/androidTest/java/com/itsaky/androidide/editor/language/treesitter/LineSpansSnapshotTest.kt rename to editor/src/androidTest/java/org/appdevforall/codeonthego/editor/language/treesitter/LineSpansSnapshotTest.kt index 6ef1c60f06..ae1b184a5a 100644 --- a/editor/src/androidTest/java/com/itsaky/androidide/editor/language/treesitter/LineSpansSnapshotTest.kt +++ b/editor/src/androidTest/java/org/appdevforall/codeonthego/editor/language/treesitter/LineSpansSnapshotTest.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.editor.language.treesitter +package org.appdevforall.codeonthego.editor.language.treesitter import android.os.Bundle import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.editor.schemes.LanguageSpecProvider +import org.appdevforall.codeonthego.editor.schemes.LanguageSpecProvider import com.itsaky.androidide.treesitter.TreeSitter import com.itsaky.androidide.treesitter.java.TSLanguageJava import io.github.rosemoe.sora.editor.ts.LineSpansGenerator diff --git a/editor/src/androidTest/java/com/itsaky/androidide/editor/language/treesitter/TsAnalyzeWorkerStopTest.kt b/editor/src/androidTest/java/org/appdevforall/codeonthego/editor/language/treesitter/TsAnalyzeWorkerStopTest.kt similarity index 96% rename from editor/src/androidTest/java/com/itsaky/androidide/editor/language/treesitter/TsAnalyzeWorkerStopTest.kt rename to editor/src/androidTest/java/org/appdevforall/codeonthego/editor/language/treesitter/TsAnalyzeWorkerStopTest.kt index e4a9601b32..7e5a27c58e 100644 --- a/editor/src/androidTest/java/com/itsaky/androidide/editor/language/treesitter/TsAnalyzeWorkerStopTest.kt +++ b/editor/src/androidTest/java/org/appdevforall/codeonthego/editor/language/treesitter/TsAnalyzeWorkerStopTest.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.editor.language.treesitter +package org.appdevforall.codeonthego.editor.language.treesitter import android.os.Bundle import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.editor.schemes.LanguageSpecProvider -import com.itsaky.androidide.logging.provider.IdeGlobalLogBuffer +import org.appdevforall.codeonthego.editor.schemes.LanguageSpecProvider +import org.appdevforall.codeonthego.logging.provider.IdeGlobalLogBuffer import com.itsaky.androidide.treesitter.TreeSitter import com.itsaky.androidide.treesitter.java.TSLanguageJava import com.itsaky.androidide.treesitter.log.TSLanguageLog diff --git a/editor/src/main/java/io/github/rosemoe/sora/widget/IDEEditorSearcher.kt b/editor/src/main/java/io/github/rosemoe/sora/widget/IDEEditorSearcher.kt index 627b8da76d..9e05634e6a 100644 --- a/editor/src/main/java/io/github/rosemoe/sora/widget/IDEEditorSearcher.kt +++ b/editor/src/main/java/io/github/rosemoe/sora/widget/IDEEditorSearcher.kt @@ -17,7 +17,7 @@ package io.github.rosemoe.sora.widget -import com.itsaky.androidide.editor.ui.IDEEditor +import org.appdevforall.codeonthego.editor.ui.IDEEditor /** * Search text in editor. As the constructor of [EditorSearcher] is package private, we cannot diff --git a/editor/src/main/java/com/itsaky/androidide/editor/adapters/CompletionListAdapter.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/adapters/CompletionListAdapter.kt similarity index 79% rename from editor/src/main/java/com/itsaky/androidide/editor/adapters/CompletionListAdapter.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/adapters/CompletionListAdapter.kt index e0806e4180..544e07fcb5 100755 --- a/editor/src/main/java/com/itsaky/androidide/editor/adapters/CompletionListAdapter.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/adapters/CompletionListAdapter.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.adapters +package org.appdevforall.codeonthego.editor.adapters import android.content.res.Resources import android.graphics.Typeface @@ -28,32 +28,32 @@ import android.widget.TextView import androidx.core.view.isVisible import com.itsaky.androidide.editor.R import com.itsaky.androidide.editor.databinding.LayoutCompletionItemBinding -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.models.ClassCompletionData -import com.itsaky.androidide.lsp.models.CompletionItemKind.CLASS -import com.itsaky.androidide.lsp.models.CompletionItemKind.CONSTRUCTOR -import com.itsaky.androidide.lsp.models.CompletionItemKind.ENUM -import com.itsaky.androidide.lsp.models.CompletionItemKind.FIELD -import com.itsaky.androidide.lsp.models.CompletionItemKind.INTERFACE -import com.itsaky.androidide.lsp.models.CompletionItemKind.METHOD -import com.itsaky.androidide.lsp.models.MemberCompletionData -import com.itsaky.androidide.lsp.models.MethodCompletionData -import com.itsaky.androidide.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.models.ClassCompletionData +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind.CLASS +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind.CONSTRUCTOR +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind.ENUM +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind.FIELD +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind.INTERFACE +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind.METHOD +import org.appdevforall.codeonthego.lsp.models.MemberCompletionData +import org.appdevforall.codeonthego.lsp.models.MethodCompletionData +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences import com.itsaky.androidide.resources.R.string.msg_api_info_deprecated import com.itsaky.androidide.resources.R.string.msg_api_info_removed import com.itsaky.androidide.resources.R.string.msg_api_info_since -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE.COMPLETION_WND_TEXT_API -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE.COMPLETION_WND_TEXT_DETAIL -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE.COMPLETION_WND_TEXT_LABEL -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE.COMPLETION_WND_TEXT_TYPE -import com.itsaky.androidide.tasks.executeAsync -import com.itsaky.androidide.utils.customOrJBMono -import com.itsaky.androidide.xml.versions.ApiVersion -import com.itsaky.androidide.xml.versions.ApiVersions -import com.itsaky.androidide.xml.versions.Info +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE.COMPLETION_WND_TEXT_API +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE.COMPLETION_WND_TEXT_DETAIL +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE.COMPLETION_WND_TEXT_LABEL +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE.COMPLETION_WND_TEXT_TYPE +import org.appdevforall.codeonthego.tasks.executeAsync +import org.appdevforall.codeonthego.utils.customOrJBMono +import org.appdevforall.codeonthego.xml.versions.ApiVersion +import org.appdevforall.codeonthego.xml.versions.ApiVersions +import org.appdevforall.codeonthego.xml.versions.Info import io.github.rosemoe.sora.widget.component.EditorCompletionAdapter -import com.itsaky.androidide.lsp.models.CompletionItem as LspCompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionItem as LspCompletionItem class CompletionListAdapter : EditorCompletionAdapter() { override fun getItemHeight(): Int = diff --git a/editor/src/main/java/com/itsaky/androidide/editor/adapters/IdeEditorAdapter.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/adapters/IdeEditorAdapter.kt similarity index 79% rename from editor/src/main/java/com/itsaky/androidide/editor/adapters/IdeEditorAdapter.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/adapters/IdeEditorAdapter.kt index 1a69714ae8..0d4d6fc1f7 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/adapters/IdeEditorAdapter.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/adapters/IdeEditorAdapter.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.editor.adapters +package org.appdevforall.codeonthego.editor.adapters import android.view.View -import com.itsaky.androidide.actions.MutableTextTarget -import com.itsaky.androidide.editor.ui.IDEEditor +import org.appdevforall.codeonthego.actions.MutableTextTarget +import org.appdevforall.codeonthego.editor.ui.IDEEditor class IdeEditorAdapter(private val editor: IDEEditor) : MutableTextTarget { override fun copyText() = editor.copyText() diff --git a/editor/src/main/java/com/itsaky/androidide/editor/events/FileUpdateEvent.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/events/FileUpdateEvent.kt similarity index 78% rename from editor/src/main/java/com/itsaky/androidide/editor/events/FileUpdateEvent.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/events/FileUpdateEvent.kt index fae1b86025..1af5df88e7 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/events/FileUpdateEvent.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/events/FileUpdateEvent.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.editor.events +package org.appdevforall.codeonthego.editor.events import io.github.rosemoe.sora.event.Event import io.github.rosemoe.sora.widget.CodeEditor diff --git a/editor/src/main/java/com/itsaky/androidide/editor/events/LanguageUpdateEvent.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/events/LanguageUpdateEvent.kt similarity index 81% rename from editor/src/main/java/com/itsaky/androidide/editor/events/LanguageUpdateEvent.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/events/LanguageUpdateEvent.kt index e69dea8f95..9d0c7a3f4c 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/events/LanguageUpdateEvent.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/events/LanguageUpdateEvent.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.editor.events +package org.appdevforall.codeonthego.editor.events import io.github.rosemoe.sora.event.Event import io.github.rosemoe.sora.lang.Language diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/CommonCompletionProvider.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/CommonCompletionProvider.kt similarity index 81% rename from editor/src/main/java/com/itsaky/androidide/editor/language/CommonCompletionProvider.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/CommonCompletionProvider.kt index 01fc98b186..eb2c5a9266 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/CommonCompletionProvider.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/CommonCompletionProvider.kt @@ -1,99 +1,99 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.editor.language - -import com.itsaky.androidide.editor.language.utils.CompletionHelper -import com.itsaky.androidide.lsp.api.ILanguageServer -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.FailureType.COMPLETION -import com.itsaky.androidide.lsp.models.LSPFailure -import com.itsaky.androidide.lsp.util.setupLookupForCompletion -import com.itsaky.androidide.models.Position -import io.github.rosemoe.sora.lang.completion.CompletionCancelledException -import io.github.rosemoe.sora.text.CharPosition -import io.github.rosemoe.sora.text.ContentReference -import org.slf4j.LoggerFactory -import java.nio.file.Path -import java.util.concurrent.CancellationException - -/** - * Common implementation of completion provider which requests completions to provided language - * server. - * - * @author Akash Yadav - */ -internal class CommonCompletionProvider( - private val server: ILanguageServer, - private val cancelChecker: CompletionCancelChecker -) { - - companion object { - - private val log = LoggerFactory.getLogger(CommonCompletionProvider::class.java) - } - - /** - * Computes completion items using the provided language server instance. - * - * @param content The reference to the content of the editor. - * @param file The file to compute completions for. - * @param position The position of the cursor in the content. - * @return The computed completion items. May return an empty list if the there was an error - * computing the completion items. - */ - inline fun complete( - content: ContentReference, - file: Path, - position: CharPosition, - prefixMatcher: (Char) -> Boolean - ): List { - val completionResult = - try { - setupLookupForCompletion(file) - val prefix = CompletionHelper.computePrefix(content, position, prefixMatcher) - val params = - CompletionParams( - Position(position.line, position.column, position.index), file, - cancelChecker - ) - params.content = content - params.prefix = prefix - server.complete(params) - } catch (e: Throwable) { - - if (e is CancellationException) { - log.debug("Completion process cancelled") - } - - // Do not log if completion was interrupted or cancelled - if (!(e is CancellationException || e is CompletionCancelledException)) { - if (!server.handleFailure(LSPFailure(COMPLETION, e))) { - log.error("Unable to compute completions", e) - } - } - CompletionResult.EMPTY - } - - if (completionResult == CompletionResult.EMPTY) { - return listOf() - } - - return completionResult.items - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.editor.language + +import org.appdevforall.codeonthego.editor.language.utils.CompletionHelper +import org.appdevforall.codeonthego.lsp.api.ILanguageServer +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.FailureType.COMPLETION +import org.appdevforall.codeonthego.lsp.models.LSPFailure +import org.appdevforall.codeonthego.lsp.util.setupLookupForCompletion +import org.appdevforall.codeonthego.models.Position +import io.github.rosemoe.sora.lang.completion.CompletionCancelledException +import io.github.rosemoe.sora.text.CharPosition +import io.github.rosemoe.sora.text.ContentReference +import org.slf4j.LoggerFactory +import java.nio.file.Path +import java.util.concurrent.CancellationException + +/** + * Common implementation of completion provider which requests completions to provided language + * server. + * + * @author Akash Yadav + */ +internal class CommonCompletionProvider( + private val server: ILanguageServer, + private val cancelChecker: CompletionCancelChecker +) { + + companion object { + + private val log = LoggerFactory.getLogger(CommonCompletionProvider::class.java) + } + + /** + * Computes completion items using the provided language server instance. + * + * @param content The reference to the content of the editor. + * @param file The file to compute completions for. + * @param position The position of the cursor in the content. + * @return The computed completion items. May return an empty list if the there was an error + * computing the completion items. + */ + inline fun complete( + content: ContentReference, + file: Path, + position: CharPosition, + prefixMatcher: (Char) -> Boolean + ): List { + val completionResult = + try { + setupLookupForCompletion(file) + val prefix = CompletionHelper.computePrefix(content, position, prefixMatcher) + val params = + CompletionParams( + Position(position.line, position.column, position.index), file, + cancelChecker + ) + params.content = content + params.prefix = prefix + server.complete(params) + } catch (e: Throwable) { + + if (e is CancellationException) { + log.debug("Completion process cancelled") + } + + // Do not log if completion was interrupted or cancelled + if (!(e is CancellationException || e is CompletionCancelledException)) { + if (!server.handleFailure(LSPFailure(COMPLETION, e))) { + log.error("Unable to compute completions", e) + } + } + CompletionResult.EMPTY + } + + if (completionResult == CompletionResult.EMPTY) { + return listOf() + } + + return completionResult.items + } +} diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/CompletionCancelChecker.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/CompletionCancelChecker.kt similarity index 91% rename from editor/src/main/java/com/itsaky/androidide/editor/language/CompletionCancelChecker.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/CompletionCancelChecker.kt index 9e25923933..d4cf2893fb 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/CompletionCancelChecker.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/CompletionCancelChecker.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language +package org.appdevforall.codeonthego.editor.language -import com.itsaky.androidide.progress.ICancelChecker +import org.appdevforall.codeonthego.progress.ICancelChecker import io.github.rosemoe.sora.lang.completion.CompletionCancelledException import io.github.rosemoe.sora.lang.completion.CompletionPublisher diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/IDELanguage.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/IDELanguage.kt similarity index 87% rename from editor/src/main/java/com/itsaky/androidide/editor/language/IDELanguage.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/IDELanguage.kt index ec948cb24a..f48f1d88aa 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/IDELanguage.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/IDELanguage.kt @@ -14,18 +14,18 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language +package org.appdevforall.codeonthego.editor.language import android.os.Bundle -import com.itsaky.androidide.editor.api.IEditor -import com.itsaky.androidide.editor.ui.IDECompletionPublisher -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.api.ILanguageServer -import com.itsaky.androidide.lsp.debug.model.BreakpointDefinition -import com.itsaky.androidide.lsp.debug.model.BreakpointRequest -import com.itsaky.androidide.preferences.internal.EditorPreferences -import com.itsaky.androidide.progress.ICancelChecker -import com.itsaky.androidide.progress.ProgressManager +import org.appdevforall.codeonthego.editor.api.IEditor +import org.appdevforall.codeonthego.editor.ui.IDECompletionPublisher +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.api.ILanguageServer +import org.appdevforall.codeonthego.lsp.debug.model.BreakpointDefinition +import org.appdevforall.codeonthego.lsp.debug.model.BreakpointRequest +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.progress.ICancelChecker +import org.appdevforall.codeonthego.progress.ProgressManager import io.github.rosemoe.sora.lang.Language import io.github.rosemoe.sora.lang.completion.CompletionCancelledException import io.github.rosemoe.sora.lang.completion.CompletionPublisher diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/LSPFormatter.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/LSPFormatter.kt similarity index 87% rename from editor/src/main/java/com/itsaky/androidide/editor/language/LSPFormatter.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/LSPFormatter.kt index b5251b3d3f..910c351148 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/LSPFormatter.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/LSPFormatter.kt @@ -15,17 +15,17 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language +package org.appdevforall.codeonthego.editor.language -import com.itsaky.androidide.app.BaseApplication +import org.appdevforall.codeonthego.app.BaseApplication import com.itsaky.androidide.editor.R -import com.itsaky.androidide.lsp.api.ILanguageServer -import com.itsaky.androidide.lsp.models.CodeFormatException -import com.itsaky.androidide.lsp.models.CodeFormatResult -import com.itsaky.androidide.lsp.models.FormatCodeParams -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.utils.flashError +import org.appdevforall.codeonthego.lsp.api.ILanguageServer +import org.appdevforall.codeonthego.lsp.models.CodeFormatException +import org.appdevforall.codeonthego.lsp.models.CodeFormatResult +import org.appdevforall.codeonthego.lsp.models.FormatCodeParams +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.utils.flashError import io.github.rosemoe.sora.lang.format.AsyncFormatter import io.github.rosemoe.sora.text.CharPosition import io.github.rosemoe.sora.text.Content diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/cpp/CppAnalyzer.java b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/cpp/CppAnalyzer.java similarity index 88% rename from editor/src/main/java/com/itsaky/androidide/editor/language/cpp/CppAnalyzer.java rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/cpp/CppAnalyzer.java index ca6e0012c3..bb3b45a62a 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/cpp/CppAnalyzer.java +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/cpp/CppAnalyzer.java @@ -15,20 +15,20 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.cpp; +package org.appdevforall.codeonthego.editor.language.cpp; -import static com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE.LITERAL; -import static com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE.OPERATOR; -import static com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE.TEXT_NORMAL; -import static com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE.TYPE_NAME; -import static com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE.forComment; -import static com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE.forKeyword; -import static com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE.forString; +import static org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE.LITERAL; +import static org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE.OPERATOR; +import static org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE.TEXT_NORMAL; +import static org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE.TYPE_NAME; +import static org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE.forComment; +import static org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE.forKeyword; +import static org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE.forString; import static io.github.rosemoe.sora.lang.styling.TextStyle.makeStyle; -import com.itsaky.androidide.editor.language.incremental.BaseIncrementalAnalyzeManager; -import com.itsaky.androidide.editor.language.incremental.IncrementalToken; -import com.itsaky.androidide.editor.language.incremental.LineState; +import org.appdevforall.codeonthego.editor.language.incremental.BaseIncrementalAnalyzeManager; +import org.appdevforall.codeonthego.editor.language.incremental.IncrementalToken; +import org.appdevforall.codeonthego.editor.language.incremental.LineState; import com.itsaky.androidide.lexers.cpp.CPP14Lexer; import io.github.rosemoe.sora.lang.styling.Span; import java.util.ArrayList; diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/cpp/CppLanguage.java b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/cpp/CppLanguage.java similarity index 92% rename from editor/src/main/java/com/itsaky/androidide/editor/language/cpp/CppLanguage.java rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/cpp/CppLanguage.java index 9ffd1a4f55..f228890ee4 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/cpp/CppLanguage.java +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/cpp/CppLanguage.java @@ -14,13 +14,13 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.cpp; +package org.appdevforall.codeonthego.editor.language.cpp; import android.os.Bundle; import androidx.annotation.NonNull; -import com.itsaky.androidide.editor.language.IDELanguage; -import com.itsaky.androidide.editor.language.newline.BracketsNewlineHandler; -import com.itsaky.androidide.editor.language.utils.CommonSymbolPairs; +import org.appdevforall.codeonthego.editor.language.IDELanguage; +import org.appdevforall.codeonthego.editor.language.newline.BracketsNewlineHandler; +import org.appdevforall.codeonthego.editor.language.utils.CommonSymbolPairs; import com.itsaky.androidide.lexers.cpp.CPP14Lexer; import io.github.rosemoe.sora.lang.analysis.AnalyzeManager; import io.github.rosemoe.sora.lang.completion.CompletionCancelledException; diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/groovy/GroovyAnalyzer.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/groovy/GroovyAnalyzer.kt similarity index 94% rename from editor/src/main/java/com/itsaky/androidide/editor/language/groovy/GroovyAnalyzer.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/groovy/GroovyAnalyzer.kt index 3ae0e3f90a..45ff3d1b11 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/groovy/GroovyAnalyzer.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/groovy/GroovyAnalyzer.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.groovy +package org.appdevforall.codeonthego.editor.language.groovy -import com.itsaky.androidide.editor.language.incremental.BaseIncrementalAnalyzeManager -import com.itsaky.androidide.editor.language.incremental.IncrementalToken -import com.itsaky.androidide.editor.language.incremental.LineState +import org.appdevforall.codeonthego.editor.language.incremental.BaseIncrementalAnalyzeManager +import org.appdevforall.codeonthego.editor.language.incremental.IncrementalToken +import org.appdevforall.codeonthego.editor.language.incremental.LineState import com.itsaky.androidide.lexers.groovy.GroovyLexer -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE import io.github.rosemoe.sora.lang.analysis.IncrementalAnalyzeManager.LineTokenizeResult import io.github.rosemoe.sora.lang.styling.Span import io.github.rosemoe.sora.lang.styling.SpanFactory diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/groovy/GroovyAutoComplete.java b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/groovy/GroovyAutoComplete.java similarity index 98% rename from editor/src/main/java/com/itsaky/androidide/editor/language/groovy/GroovyAutoComplete.java rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/groovy/GroovyAutoComplete.java index 96690f2637..7b6b6408b9 100755 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/groovy/GroovyAutoComplete.java +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/groovy/GroovyAutoComplete.java @@ -14,12 +14,12 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.groovy; +package org.appdevforall.codeonthego.editor.language.groovy; import android.os.Bundle; -import com.itsaky.androidide.lsp.models.CompletionItem; -import com.itsaky.androidide.lsp.models.CompletionItemKind; -import com.itsaky.androidide.lsp.models.InsertTextFormat; +import org.appdevforall.codeonthego.lsp.models.CompletionItem; +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind; +import org.appdevforall.codeonthego.lsp.models.InsertTextFormat; import io.github.rosemoe.sora.lang.completion.CompletionHelper; import io.github.rosemoe.sora.lang.completion.CompletionPublisher; import io.github.rosemoe.sora.text.CharPosition; diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/groovy/GroovyLanguage.java b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/groovy/GroovyLanguage.java similarity index 92% rename from editor/src/main/java/com/itsaky/androidide/editor/language/groovy/GroovyLanguage.java rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/groovy/GroovyLanguage.java index 5fac2e17af..247a4d254a 100755 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/groovy/GroovyLanguage.java +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/groovy/GroovyLanguage.java @@ -14,15 +14,15 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.groovy; +package org.appdevforall.codeonthego.editor.language.groovy; import android.os.Bundle; import androidx.annotation.NonNull; -import com.itsaky.androidide.editor.language.IDELanguage; -import com.itsaky.androidide.editor.language.newline.BracketsNewlineHandler; -import com.itsaky.androidide.editor.language.utils.CommonSymbolPairs; +import org.appdevforall.codeonthego.editor.language.IDELanguage; +import org.appdevforall.codeonthego.editor.language.newline.BracketsNewlineHandler; +import org.appdevforall.codeonthego.editor.language.utils.CommonSymbolPairs; import com.itsaky.androidide.lexers.groovy.GroovyLexer; -import com.itsaky.androidide.utils.CharSequenceReader; +import org.appdevforall.codeonthego.utils.CharSequenceReader; import io.github.rosemoe.sora.lang.analysis.AnalyzeManager; import io.github.rosemoe.sora.lang.completion.CompletionCancelledException; import io.github.rosemoe.sora.lang.completion.CompletionPublisher; diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/incremental/BaseIncrementalAnalyzeManager.java b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/incremental/BaseIncrementalAnalyzeManager.java similarity index 96% rename from editor/src/main/java/com/itsaky/androidide/editor/language/incremental/BaseIncrementalAnalyzeManager.java rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/incremental/BaseIncrementalAnalyzeManager.java index 8ed4e59a48..95016e6610 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/incremental/BaseIncrementalAnalyzeManager.java +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/incremental/BaseIncrementalAnalyzeManager.java @@ -15,17 +15,17 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.incremental; +package org.appdevforall.codeonthego.editor.language.incremental; -import static com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE.FIXME_COMMENT; -import static com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE.TODO_COMMENT; -import static com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE.withoutCompletion; +import static org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE.FIXME_COMMENT; +import static org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE.TODO_COMMENT; +import static org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE.withoutCompletion; import androidx.annotation.NonNull; import com.google.common.base.Preconditions; import com.google.common.collect.EvictingQueue; -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE; -import com.itsaky.androidide.utils.CharSequenceReader; +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE; +import org.appdevforall.codeonthego.utils.CharSequenceReader; import io.github.rosemoe.sora.lang.analysis.AsyncIncrementalAnalyzeManager; import io.github.rosemoe.sora.lang.styling.CodeBlock; import io.github.rosemoe.sora.lang.styling.Span; diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/incremental/IncrementalToken.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/incremental/IncrementalToken.kt similarity index 96% rename from editor/src/main/java/com/itsaky/androidide/editor/language/incremental/IncrementalToken.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/incremental/IncrementalToken.kt index cfb68d82d9..e61a4ef05d 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/incremental/IncrementalToken.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/incremental/IncrementalToken.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.incremental +package org.appdevforall.codeonthego.editor.language.incremental import org.antlr.v4.runtime.CharStream import org.antlr.v4.runtime.Token diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/incremental/LineState.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/incremental/LineState.kt similarity index 95% rename from editor/src/main/java/com/itsaky/androidide/editor/language/incremental/LineState.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/incremental/LineState.kt index 46b1501187..53fe2029c9 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/incremental/LineState.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/incremental/LineState.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.incremental +package org.appdevforall.codeonthego.editor.language.incremental import org.antlr.v4.runtime.Lexer diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/newline/BaseNewlineHandler.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/newline/BaseNewlineHandler.kt similarity index 97% rename from editor/src/main/java/com/itsaky/androidide/editor/language/newline/BaseNewlineHandler.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/newline/BaseNewlineHandler.kt index 03ede36f4c..0a1228fe47 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/newline/BaseNewlineHandler.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/newline/BaseNewlineHandler.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.newline +package org.appdevforall.codeonthego.editor.language.newline import io.github.rosemoe.sora.lang.smartEnter.NewlineHandler import io.github.rosemoe.sora.lang.styling.Styles diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/newline/BracketsNewlineHandler.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/newline/BracketsNewlineHandler.kt similarity index 97% rename from editor/src/main/java/com/itsaky/androidide/editor/language/newline/BracketsNewlineHandler.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/newline/BracketsNewlineHandler.kt index ad23b6f229..6f5bc80ccf 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/newline/BracketsNewlineHandler.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/newline/BracketsNewlineHandler.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.newline +package org.appdevforall.codeonthego.editor.language.newline import io.github.rosemoe.sora.lang.smartEnter.NewlineHandleResult import io.github.rosemoe.sora.lang.styling.Styles diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/newline/CStyleBracketsHandler.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/newline/CStyleBracketsHandler.kt similarity index 94% rename from editor/src/main/java/com/itsaky/androidide/editor/language/newline/CStyleBracketsHandler.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/newline/CStyleBracketsHandler.kt index f6d8204b10..1a63314edd 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/newline/CStyleBracketsHandler.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/newline/CStyleBracketsHandler.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.newline +package org.appdevforall.codeonthego.editor.language.newline /** * Newline handler for brackets in Java language. diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/newline/TSBracketsHandler.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/newline/TSBracketsHandler.kt similarity index 93% rename from editor/src/main/java/com/itsaky/androidide/editor/language/newline/TSBracketsHandler.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/newline/TSBracketsHandler.kt index a1bf8f7d94..3556fdd225 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/newline/TSBracketsHandler.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/newline/TSBracketsHandler.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.newline +package org.appdevforall.codeonthego.editor.language.newline -import com.itsaky.androidide.editor.language.treesitter.TreeSitterLanguage +import org.appdevforall.codeonthego.editor.language.treesitter.TreeSitterLanguage import io.github.rosemoe.sora.lang.smartEnter.NewlineHandleResult import io.github.rosemoe.sora.lang.styling.Styles import io.github.rosemoe.sora.text.CharPosition diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/newline/TSCStyleBracketsHandler.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/newline/TSCStyleBracketsHandler.kt similarity index 87% rename from editor/src/main/java/com/itsaky/androidide/editor/language/newline/TSCStyleBracketsHandler.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/newline/TSCStyleBracketsHandler.kt index 2561911d5a..484f7149c8 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/newline/TSCStyleBracketsHandler.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/newline/TSCStyleBracketsHandler.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.newline +package org.appdevforall.codeonthego.editor.language.newline -import com.itsaky.androidide.editor.language.treesitter.TreeSitterLanguage +import org.appdevforall.codeonthego.editor.language.treesitter.TreeSitterLanguage /** * C style brackets handler for tree-sitter languages. diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/outline/OutlineProvider.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/outline/OutlineProvider.kt similarity index 73% rename from editor/src/main/java/com/itsaky/androidide/editor/language/outline/OutlineProvider.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/outline/OutlineProvider.kt index 7ae47f33f2..7b7b3cf003 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/outline/OutlineProvider.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/outline/OutlineProvider.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.editor.language.outline +package org.appdevforall.codeonthego.editor.language.outline interface OutlineProvider { fun supports(fileExtension: String): Boolean diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/outline/OutlineSymbol.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/outline/OutlineSymbol.kt similarity index 87% rename from editor/src/main/java/com/itsaky/androidide/editor/language/outline/OutlineSymbol.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/outline/OutlineSymbol.kt index e8bc368422..1d841546d0 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/outline/OutlineSymbol.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/outline/OutlineSymbol.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.editor.language.outline +package org.appdevforall.codeonthego.editor.language.outline -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.models.Range enum class OutlineSymbolKind( val badge: String, diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/outline/OutlineTreeBuilder.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/outline/OutlineTreeBuilder.kt similarity index 93% rename from editor/src/main/java/com/itsaky/androidide/editor/language/outline/OutlineTreeBuilder.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/outline/OutlineTreeBuilder.kt index c6eef11985..d34f229994 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/outline/OutlineTreeBuilder.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/outline/OutlineTreeBuilder.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.editor.language.outline +package org.appdevforall.codeonthego.editor.language.outline -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.models.Range internal data class RawOutlineSymbol( val name: String, diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/outline/TreeSitterOutlineProvider.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/outline/TreeSitterOutlineProvider.kt similarity index 91% rename from editor/src/main/java/com/itsaky/androidide/editor/language/outline/TreeSitterOutlineProvider.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/outline/TreeSitterOutlineProvider.kt index 8fe7c91baa..62ecc85d6b 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/outline/TreeSitterOutlineProvider.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/outline/TreeSitterOutlineProvider.kt @@ -1,13 +1,13 @@ -package com.itsaky.androidide.editor.language.outline +package org.appdevforall.codeonthego.editor.language.outline import android.content.Context -import com.itsaky.androidide.editor.language.treesitter.predicates.AnyOfPredicate -import com.itsaky.androidide.editor.language.treesitter.predicates.EqualPredicate -import com.itsaky.androidide.editor.language.treesitter.predicates.MatchPredicate -import com.itsaky.androidide.editor.language.treesitter.predicates.NotEqualPredicate -import com.itsaky.androidide.editor.language.treesitter.predicates.NotMatchPredicate -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.editor.language.treesitter.predicates.AnyOfPredicate +import org.appdevforall.codeonthego.editor.language.treesitter.predicates.EqualPredicate +import org.appdevforall.codeonthego.editor.language.treesitter.predicates.MatchPredicate +import org.appdevforall.codeonthego.editor.language.treesitter.predicates.NotEqualPredicate +import org.appdevforall.codeonthego.editor.language.treesitter.predicates.NotMatchPredicate +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range import com.itsaky.androidide.treesitter.TSLanguage import com.itsaky.androidide.treesitter.TSNode import com.itsaky.androidide.treesitter.TSParser diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/JavaLanguage.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/JavaLanguage.kt similarity index 77% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/JavaLanguage.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/JavaLanguage.kt index 3c3e29dc76..4ee072ad16 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/JavaLanguage.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/JavaLanguage.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter +package org.appdevforall.codeonthego.editor.language.treesitter import android.content.Context -import com.itsaky.androidide.editor.language.newline.TSBracketsHandler -import com.itsaky.androidide.editor.language.newline.TSCStyleBracketsHandler -import com.itsaky.androidide.editor.language.treesitter.TreeSitterLanguage.Factory -import com.itsaky.androidide.editor.language.utils.CommonSymbolPairs -import com.itsaky.androidide.lsp.api.ILanguageServer -import com.itsaky.androidide.lsp.api.ILanguageServerRegistry -import com.itsaky.androidide.lsp.java.JavaLanguageServer +import org.appdevforall.codeonthego.editor.language.newline.TSBracketsHandler +import org.appdevforall.codeonthego.editor.language.newline.TSCStyleBracketsHandler +import org.appdevforall.codeonthego.editor.language.treesitter.TreeSitterLanguage.Factory +import org.appdevforall.codeonthego.editor.language.utils.CommonSymbolPairs +import org.appdevforall.codeonthego.lsp.api.ILanguageServer +import org.appdevforall.codeonthego.lsp.api.ILanguageServerRegistry +import org.appdevforall.codeonthego.lsp.java.JavaLanguageServer import com.itsaky.androidide.treesitter.java.TSLanguageJava import io.github.rosemoe.sora.lang.Language.INTERRUPTION_LEVEL_SLIGHT import io.github.rosemoe.sora.util.MyCharacter diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/JsonLanguage.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/JsonLanguage.kt similarity index 89% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/JsonLanguage.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/JsonLanguage.kt index 6ab361fb5f..98d71a119c 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/JsonLanguage.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/JsonLanguage.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter +package org.appdevforall.codeonthego.editor.language.treesitter import android.content.Context -import com.itsaky.androidide.editor.language.treesitter.TreeSitterLanguage.Factory +import org.appdevforall.codeonthego.editor.language.treesitter.TreeSitterLanguage.Factory import com.itsaky.androidide.treesitter.json.TSLanguageJson import io.github.rosemoe.sora.lang.Language.INTERRUPTION_LEVEL_STRONG diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/KotlinLanguage.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/KotlinLanguage.kt similarity index 80% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/KotlinLanguage.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/KotlinLanguage.kt index 69adc8575c..af4a5976ad 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/KotlinLanguage.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/KotlinLanguage.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter +package org.appdevforall.codeonthego.editor.language.treesitter import android.content.Context -import com.itsaky.androidide.editor.language.newline.TSBracketsHandler -import com.itsaky.androidide.editor.language.newline.TSCStyleBracketsHandler -import com.itsaky.androidide.editor.language.utils.CommonSymbolPairs -import com.itsaky.androidide.lsp.api.ILanguageServer -import com.itsaky.androidide.lsp.api.ILanguageServerRegistry -import com.itsaky.androidide.lsp.kotlin.KotlinLanguageServer +import org.appdevforall.codeonthego.editor.language.newline.TSBracketsHandler +import org.appdevforall.codeonthego.editor.language.newline.TSCStyleBracketsHandler +import org.appdevforall.codeonthego.editor.language.utils.CommonSymbolPairs +import org.appdevforall.codeonthego.lsp.api.ILanguageServer +import org.appdevforall.codeonthego.lsp.api.ILanguageServerRegistry +import org.appdevforall.codeonthego.lsp.kotlin.KotlinLanguageServer import com.itsaky.androidide.treesitter.kotlin.TSLanguageKotlin import io.github.rosemoe.sora.lang.Language.INTERRUPTION_LEVEL_STRONG import io.github.rosemoe.sora.util.MyCharacter diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/LogLanguage.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/LogLanguage.kt similarity index 87% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/LogLanguage.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/LogLanguage.kt index 4170f389a2..2dd9c0bd16 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/LogLanguage.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/LogLanguage.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter +package org.appdevforall.codeonthego.editor.language.treesitter import android.content.Context -import com.itsaky.androidide.editor.language.treesitter.TreeSitterLanguage.Factory +import org.appdevforall.codeonthego.editor.language.treesitter.TreeSitterLanguage.Factory import com.itsaky.androidide.treesitter.log.TSLanguageLog /** diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/PluginTreeSitterLanguage.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/PluginTreeSitterLanguage.kt similarity index 88% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/PluginTreeSitterLanguage.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/PluginTreeSitterLanguage.kt index b3c6e2e699..cc744f8ac9 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/PluginTreeSitterLanguage.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/PluginTreeSitterLanguage.kt @@ -1,13 +1,13 @@ -package com.itsaky.androidide.editor.language.treesitter +package org.appdevforall.codeonthego.editor.language.treesitter import android.content.Context import android.content.res.AssetManager -import com.itsaky.androidide.editor.language.newline.TSBracketsHandler -import com.itsaky.androidide.editor.language.newline.TSCStyleBracketsHandler -import com.itsaky.androidide.editor.schemes.LanguageSpecProvider -import com.itsaky.androidide.editor.schemes.LocalCaptureSpecProvider.newLocalCaptureSpec -import com.itsaky.androidide.lsp.api.ILanguageServer -import com.itsaky.androidide.lsp.api.ILanguageServerRegistry +import org.appdevforall.codeonthego.editor.language.newline.TSBracketsHandler +import org.appdevforall.codeonthego.editor.language.newline.TSCStyleBracketsHandler +import org.appdevforall.codeonthego.editor.schemes.LanguageSpecProvider +import org.appdevforall.codeonthego.editor.schemes.LocalCaptureSpecProvider.newLocalCaptureSpec +import org.appdevforall.codeonthego.lsp.api.ILanguageServer +import org.appdevforall.codeonthego.lsp.api.ILanguageServerRegistry import com.itsaky.androidide.treesitter.TSLanguage import com.itsaky.androidide.treesitter.TSLanguageCache import io.github.rosemoe.sora.util.MyCharacter diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TSLanguageRegistry.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TSLanguageRegistry.kt similarity index 95% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TSLanguageRegistry.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TSLanguageRegistry.kt index fae7383481..671736e0ae 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TSLanguageRegistry.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TSLanguageRegistry.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter +package org.appdevforall.codeonthego.editor.language.treesitter -import com.itsaky.androidide.editor.language.treesitter.internal.TSLanguageRegistryImpl +import org.appdevforall.codeonthego.editor.language.treesitter.internal.TSLanguageRegistryImpl /** * Registry for managing [TreeSitterLanguage factories][TreeSitterLanguage.Factory]. diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TreeSitterAnalyzeManager.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TreeSitterAnalyzeManager.kt similarity index 92% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TreeSitterAnalyzeManager.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TreeSitterAnalyzeManager.kt index ee9949c999..8744c24e1f 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TreeSitterAnalyzeManager.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TreeSitterAnalyzeManager.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter +package org.appdevforall.codeonthego.editor.language.treesitter -import com.itsaky.androidide.editor.schemes.LanguageScheme +import org.appdevforall.codeonthego.editor.schemes.LanguageScheme import io.github.rosemoe.sora.editor.ts.TsAnalyzeManager import io.github.rosemoe.sora.editor.ts.TsLanguageSpec import io.github.rosemoe.sora.editor.ts.TsTheme diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TreeSitterIndentProvider.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TreeSitterIndentProvider.kt similarity index 98% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TreeSitterIndentProvider.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TreeSitterIndentProvider.kt index 0bf7e9f6e2..b9a7048b4b 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TreeSitterIndentProvider.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TreeSitterIndentProvider.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter +package org.appdevforall.codeonthego.editor.language.treesitter import androidx.collection.MutableLongObjectMap import androidx.collection.mutableIntObjectMapOf import androidx.collection.mutableLongObjectMapOf import androidx.core.text.trimmedLength -import com.itsaky.androidide.editor.utils.getFirstNodeAtLine -import com.itsaky.androidide.editor.utils.getLastNodeAtLine -import com.itsaky.androidide.editor.utils.previousNonBlankLine +import org.appdevforall.codeonthego.editor.utils.getFirstNodeAtLine +import org.appdevforall.codeonthego.editor.utils.getLastNodeAtLine +import org.appdevforall.codeonthego.editor.utils.previousNonBlankLine import com.itsaky.androidide.treesitter.TSNode import com.itsaky.androidide.treesitter.TSParser import com.itsaky.androidide.treesitter.TSPoint @@ -33,7 +33,7 @@ import com.itsaky.androidide.treesitter.TSQueryCursor import com.itsaky.androidide.treesitter.TSQueryMatch import com.itsaky.androidide.treesitter.TSTree import com.itsaky.androidide.treesitter.predicate.SetDirectiveHandler -import com.itsaky.androidide.utils.IntPair +import org.appdevforall.codeonthego.utils.IntPair import io.github.rosemoe.sora.editor.ts.TsAnalyzeWorker import io.github.rosemoe.sora.text.Content import io.github.rosemoe.sora.text.TextUtils diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TreeSitterLanguage.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TreeSitterLanguage.kt similarity index 89% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TreeSitterLanguage.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TreeSitterLanguage.kt index 6544138684..8ea0cb0921 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TreeSitterLanguage.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TreeSitterLanguage.kt @@ -15,19 +15,19 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter +package org.appdevforall.codeonthego.editor.language.treesitter import android.content.Context -import com.itsaky.androidide.editor.language.IDELanguage -import com.itsaky.androidide.editor.language.newline.TSBracketsHandler -import com.itsaky.androidide.editor.language.utils.CommonSymbolPairs -import com.itsaky.androidide.editor.schemes.IDEColorScheme -import com.itsaky.androidide.editor.schemes.LanguageScheme -import com.itsaky.androidide.editor.schemes.LanguageSpecProvider.getLanguageSpec -import com.itsaky.androidide.editor.schemes.LocalCaptureSpecProvider.newLocalCaptureSpec +import org.appdevforall.codeonthego.editor.language.IDELanguage +import org.appdevforall.codeonthego.editor.language.newline.TSBracketsHandler +import org.appdevforall.codeonthego.editor.language.utils.CommonSymbolPairs +import org.appdevforall.codeonthego.editor.schemes.IDEColorScheme +import org.appdevforall.codeonthego.editor.schemes.LanguageScheme +import org.appdevforall.codeonthego.editor.schemes.LanguageSpecProvider.getLanguageSpec +import org.appdevforall.codeonthego.editor.schemes.LocalCaptureSpecProvider.newLocalCaptureSpec import com.itsaky.androidide.treesitter.TSLanguage import com.itsaky.androidide.treesitter.TreeSitter -import com.itsaky.androidide.utils.IntPair +import org.appdevforall.codeonthego.utils.IntPair import io.github.rosemoe.sora.editor.ts.TsTheme import io.github.rosemoe.sora.lang.Language.INTERRUPTION_LEVEL_STRONG import io.github.rosemoe.sora.lang.analysis.AnalyzeManager diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TreeSitterLanguageProvider.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TreeSitterLanguageProvider.kt similarity index 96% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TreeSitterLanguageProvider.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TreeSitterLanguageProvider.kt index adb550c1b9..97111c78ea 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TreeSitterLanguageProvider.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TreeSitterLanguageProvider.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter +package org.appdevforall.codeonthego.editor.language.treesitter import android.content.Context import org.slf4j.LoggerFactory diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TreeSitterLanguageSpec.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TreeSitterLanguageSpec.kt similarity index 96% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TreeSitterLanguageSpec.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TreeSitterLanguageSpec.kt index 12ea71c32a..aaf906fd88 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TreeSitterLanguageSpec.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TreeSitterLanguageSpec.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter +package org.appdevforall.codeonthego.editor.language.treesitter import com.itsaky.androidide.treesitter.TSLanguage import com.itsaky.androidide.treesitter.TSQuery diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TreeSitterSpanFactory.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TreeSitterSpanFactory.kt similarity index 95% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TreeSitterSpanFactory.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TreeSitterSpanFactory.kt index 594b387fe4..1be507e35e 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/TreeSitterSpanFactory.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/TreeSitterSpanFactory.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter +package org.appdevforall.codeonthego.editor.language.treesitter import android.graphics.Color import androidx.core.graphics.ColorUtils -import com.itsaky.androidide.editor.schemes.LanguageScheme +import org.appdevforall.codeonthego.editor.schemes.LanguageScheme import com.itsaky.androidide.treesitter.TSQuery import com.itsaky.androidide.treesitter.TSQueryCapture -import com.itsaky.androidide.utils.StackFrameLocator -import com.itsaky.androidide.utils.parseHexColor +import org.appdevforall.codeonthego.utils.StackFrameLocator +import org.appdevforall.codeonthego.utils.parseHexColor import io.github.rosemoe.sora.editor.ts.spans.DefaultSpanFactory import io.github.rosemoe.sora.editor.ts.spans.TsSpanFactory import io.github.rosemoe.sora.lang.styling.Span diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/XMLLanguage.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/XMLLanguage.kt similarity index 82% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/XMLLanguage.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/XMLLanguage.kt index 14faa6febf..307d706a15 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/XMLLanguage.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/XMLLanguage.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter +package org.appdevforall.codeonthego.editor.language.treesitter import android.content.Context -import com.itsaky.androidide.editor.language.treesitter.TreeSitterLanguage.Factory -import com.itsaky.androidide.lsp.api.ILanguageServer -import com.itsaky.androidide.lsp.api.ILanguageServerRegistry -import com.itsaky.androidide.lsp.xml.XMLLanguageServer +import org.appdevforall.codeonthego.editor.language.treesitter.TreeSitterLanguage.Factory +import org.appdevforall.codeonthego.lsp.api.ILanguageServer +import org.appdevforall.codeonthego.lsp.api.ILanguageServerRegistry +import org.appdevforall.codeonthego.lsp.xml.XMLLanguageServer import com.itsaky.androidide.treesitter.xml.TSLanguageXml import io.github.rosemoe.sora.lang.Language.INTERRUPTION_LEVEL_STRONG import io.github.rosemoe.sora.util.MyCharacter diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/common.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/common.kt similarity index 85% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/common.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/common.kt index 863177d6b9..f81ef6ff7c 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/common.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/common.kt @@ -15,8 +15,8 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter +package org.appdevforall.codeonthego.editor.language.treesitter -import com.itsaky.androidide.editor.schemes.LanguageScheme +import org.appdevforall.codeonthego.editor.schemes.LanguageScheme typealias LangScheme = Pair \ No newline at end of file diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/internal/TSLanguageRegistryImpl.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/internal/TSLanguageRegistryImpl.kt similarity index 89% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/internal/TSLanguageRegistryImpl.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/internal/TSLanguageRegistryImpl.kt index 4e3580950f..a9c31f0786 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/internal/TSLanguageRegistryImpl.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/internal/TSLanguageRegistryImpl.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter.internal +package org.appdevforall.codeonthego.editor.language.treesitter.internal -import com.itsaky.androidide.editor.language.treesitter.TSLanguageRegistry -import com.itsaky.androidide.editor.language.treesitter.TreeSitterLanguage +import org.appdevforall.codeonthego.editor.language.treesitter.TSLanguageRegistry +import org.appdevforall.codeonthego.editor.language.treesitter.TreeSitterLanguage import java.util.concurrent.ConcurrentHashMap /** diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/AnyOfPredicate.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/AnyOfPredicate.kt similarity index 97% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/AnyOfPredicate.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/AnyOfPredicate.kt index cead7bdbb2..767fbebe86 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/AnyOfPredicate.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/AnyOfPredicate.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter.predicates +package org.appdevforall.codeonthego.editor.language.treesitter.predicates import com.itsaky.androidide.treesitter.TSQuery import com.itsaky.androidide.treesitter.TSQueryMatch diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/EqualPredicate.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/EqualPredicate.kt similarity index 97% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/EqualPredicate.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/EqualPredicate.kt index 51d0bb840a..a96230e4f2 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/EqualPredicate.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/EqualPredicate.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter.predicates +package org.appdevforall.codeonthego.editor.language.treesitter.predicates import com.itsaky.androidide.treesitter.TSQuery import com.itsaky.androidide.treesitter.TSQueryMatch diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/InvertingPredicate.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/InvertingPredicate.kt similarity index 96% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/InvertingPredicate.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/InvertingPredicate.kt index 685edb9162..5b9e0f3006 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/InvertingPredicate.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/InvertingPredicate.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter.predicates +package org.appdevforall.codeonthego.editor.language.treesitter.predicates import com.itsaky.androidide.treesitter.TSQuery import com.itsaky.androidide.treesitter.TSQueryMatch diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/MatchPredicate.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/MatchPredicate.kt similarity index 97% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/MatchPredicate.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/MatchPredicate.kt index a94d42b1da..cdd45d11cb 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/MatchPredicate.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/MatchPredicate.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter.predicates +package org.appdevforall.codeonthego.editor.language.treesitter.predicates import com.itsaky.androidide.treesitter.TSQuery import com.itsaky.androidide.treesitter.TSQueryMatch diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/NotEqualPredicate.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/NotEqualPredicate.kt similarity index 93% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/NotEqualPredicate.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/NotEqualPredicate.kt index 86f032a7a7..39cf5824da 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/NotEqualPredicate.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/NotEqualPredicate.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter.predicates +package org.appdevforall.codeonthego.editor.language.treesitter.predicates import io.github.rosemoe.sora.editor.ts.predicate.TsPredicate diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/NotMatchPredicate.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/NotMatchPredicate.kt similarity index 92% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/NotMatchPredicate.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/NotMatchPredicate.kt index 766c309c0c..d97f7b7257 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/NotMatchPredicate.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/NotMatchPredicate.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter.predicates +package org.appdevforall.codeonthego.editor.language.treesitter.predicates import io.github.rosemoe.sora.editor.ts.predicate.TsPredicate diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/TreeSitterPredicate.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/TreeSitterPredicate.kt similarity index 97% rename from editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/TreeSitterPredicate.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/TreeSitterPredicate.kt index 24d35696aa..1d1010eadb 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/treesitter/predicates/TreeSitterPredicate.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/treesitter/predicates/TreeSitterPredicate.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.treesitter.predicates +package org.appdevforall.codeonthego.editor.language.treesitter.predicates import com.itsaky.androidide.treesitter.TSQuery import com.itsaky.androidide.treesitter.TSQueryMatch diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/utils/CommonSymbolPairs.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/utils/CommonSymbolPairs.kt similarity index 96% rename from editor/src/main/java/com/itsaky/androidide/editor/language/utils/CommonSymbolPairs.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/utils/CommonSymbolPairs.kt index c770eb7174..1a0ea8370b 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/utils/CommonSymbolPairs.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/utils/CommonSymbolPairs.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.utils +package org.appdevforall.codeonthego.editor.language.utils import io.github.rosemoe.sora.text.Content import io.github.rosemoe.sora.widget.SymbolPairMatch diff --git a/editor/src/main/java/com/itsaky/androidide/editor/language/utils/CompletionHelper.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/utils/CompletionHelper.kt similarity index 96% rename from editor/src/main/java/com/itsaky/androidide/editor/language/utils/CompletionHelper.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/language/utils/CompletionHelper.kt index 36dbc92875..bb80c6c1ba 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/language/utils/CompletionHelper.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/language/utils/CompletionHelper.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.language.utils +package org.appdevforall.codeonthego.editor.language.utils import io.github.rosemoe.sora.text.CharPosition import io.github.rosemoe.sora.text.ContentReference diff --git a/editor/src/main/java/com/itsaky/androidide/editor/processing/SimpleMacroProcessor.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/processing/SimpleMacroProcessor.kt similarity index 98% rename from editor/src/main/java/com/itsaky/androidide/editor/processing/SimpleMacroProcessor.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/processing/SimpleMacroProcessor.kt index 165cfb2fb5..8ea0c960aa 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/processing/SimpleMacroProcessor.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/processing/SimpleMacroProcessor.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.editor.processing +package org.appdevforall.codeonthego.editor.processing import io.github.rosemoe.sora.text.CharPosition import io.github.rosemoe.sora.text.TextRange diff --git a/editor/src/main/java/com/itsaky/androidide/editor/processing/TextProcessor.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/processing/TextProcessor.kt similarity index 96% rename from editor/src/main/java/com/itsaky/androidide/editor/processing/TextProcessor.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/processing/TextProcessor.kt index 8dfc217dc3..864c1fb8e3 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/processing/TextProcessor.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/processing/TextProcessor.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.editor.processing +package org.appdevforall.codeonthego.editor.processing import io.github.rosemoe.sora.text.Content import io.github.rosemoe.sora.text.Cursor diff --git a/editor/src/main/java/com/itsaky/androidide/editor/processing/TextProcessorEngine.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/processing/TextProcessorEngine.kt similarity index 95% rename from editor/src/main/java/com/itsaky/androidide/editor/processing/TextProcessorEngine.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/processing/TextProcessorEngine.kt index b0d590b322..3a6f6abdb7 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/processing/TextProcessorEngine.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/processing/TextProcessorEngine.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.editor.processing +package org.appdevforall.codeonthego.editor.processing class TextProcessorEngine { diff --git a/editor/src/main/java/com/itsaky/androidide/editor/schemes/IDEColorScheme.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/IDEColorScheme.kt similarity index 94% rename from editor/src/main/java/com/itsaky/androidide/editor/schemes/IDEColorScheme.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/IDEColorScheme.kt index b242172975..faf17e6ba8 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/schemes/IDEColorScheme.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/IDEColorScheme.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.schemes +package org.appdevforall.codeonthego.editor.schemes import androidx.collection.MutableIntIntMap -import com.itsaky.androidide.editor.schemes.internal.parser.SchemeParser -import com.itsaky.androidide.syntax.colorschemes.DynamicColorScheme -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE +import org.appdevforall.codeonthego.editor.schemes.internal.parser.SchemeParser +import org.appdevforall.codeonthego.syntax.colorschemes.DynamicColorScheme +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE import io.github.rosemoe.sora.lang.styling.TextStyle import io.github.rosemoe.sora.widget.schemes.EditorColorScheme import java.io.File diff --git a/editor/src/main/java/com/itsaky/androidide/editor/schemes/IDEColorSchemeProvider.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/IDEColorSchemeProvider.kt similarity index 95% rename from editor/src/main/java/com/itsaky/androidide/editor/schemes/IDEColorSchemeProvider.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/IDEColorSchemeProvider.kt index 4d43bdb1b4..4c2b5519a7 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/schemes/IDEColorSchemeProvider.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/IDEColorSchemeProvider.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.schemes +package org.appdevforall.codeonthego.editor.schemes import android.content.Context import androidx.annotation.WorkerThread -import com.itsaky.androidide.eventbus.events.editor.ColorSchemeInvalidatedEvent -import com.itsaky.androidide.preferences.internal.EditorPreferences -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.isSystemInDarkMode +import org.appdevforall.codeonthego.eventbus.events.editor.ColorSchemeInvalidatedEvent +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.isSystemInDarkMode import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/editor/src/main/java/com/itsaky/androidide/editor/schemes/LanguageSpecProvider.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/LanguageSpecProvider.kt similarity index 82% rename from editor/src/main/java/com/itsaky/androidide/editor/schemes/LanguageSpecProvider.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/LanguageSpecProvider.kt index c1f41b4dcb..66f61979bb 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/schemes/LanguageSpecProvider.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/LanguageSpecProvider.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.schemes +package org.appdevforall.codeonthego.editor.schemes import android.content.Context import android.content.res.AssetManager -import com.itsaky.androidide.editor.language.treesitter.TreeSitterLanguageSpec -import com.itsaky.androidide.editor.language.treesitter.predicates.AnyOfPredicate -import com.itsaky.androidide.editor.language.treesitter.predicates.EqualPredicate -import com.itsaky.androidide.editor.language.treesitter.predicates.MatchPredicate -import com.itsaky.androidide.editor.language.treesitter.predicates.NotEqualPredicate -import com.itsaky.androidide.editor.language.treesitter.predicates.NotMatchPredicate +import org.appdevforall.codeonthego.editor.language.treesitter.TreeSitterLanguageSpec +import org.appdevforall.codeonthego.editor.language.treesitter.predicates.AnyOfPredicate +import org.appdevforall.codeonthego.editor.language.treesitter.predicates.EqualPredicate +import org.appdevforall.codeonthego.editor.language.treesitter.predicates.MatchPredicate +import org.appdevforall.codeonthego.editor.language.treesitter.predicates.NotEqualPredicate +import org.appdevforall.codeonthego.editor.language.treesitter.predicates.NotMatchPredicate import com.itsaky.androidide.treesitter.TSLanguage import io.github.rosemoe.sora.editor.ts.LocalsCaptureSpec import io.github.rosemoe.sora.editor.ts.TsLanguageSpec diff --git a/editor/src/main/java/com/itsaky/androidide/editor/schemes/LocalCaptureSpecProvider.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/LocalCaptureSpecProvider.kt similarity index 97% rename from editor/src/main/java/com/itsaky/androidide/editor/schemes/LocalCaptureSpecProvider.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/LocalCaptureSpecProvider.kt index f3f08f4d9d..a32acf1d04 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/schemes/LocalCaptureSpecProvider.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/LocalCaptureSpecProvider.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.schemes +package org.appdevforall.codeonthego.editor.schemes import io.github.rosemoe.sora.editor.ts.LocalsCaptureSpec import org.slf4j.LoggerFactory diff --git a/editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/EditorSchemeParser.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/internal/parser/EditorSchemeParser.kt similarity index 84% rename from editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/EditorSchemeParser.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/internal/parser/EditorSchemeParser.kt index 49b830d9ac..4d4c2d1bc8 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/EditorSchemeParser.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/internal/parser/EditorSchemeParser.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.schemes.internal.parser +package org.appdevforall.codeonthego.editor.schemes.internal.parser import com.google.gson.stream.JsonReader -import com.itsaky.androidide.editor.schemes.IDEColorScheme -import com.itsaky.androidide.editor.schemes.internal.parser.SchemeParser.EditorColors +import org.appdevforall.codeonthego.editor.schemes.IDEColorScheme +import org.appdevforall.codeonthego.editor.schemes.internal.parser.SchemeParser.EditorColors /** * Parses editor scheme from a JSON color scheme file. diff --git a/editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/LanguageParser.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/internal/parser/LanguageParser.kt similarity index 92% rename from editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/LanguageParser.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/internal/parser/LanguageParser.kt index 5b37996f49..c86220c9d8 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/LanguageParser.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/internal/parser/LanguageParser.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.schemes.internal.parser +package org.appdevforall.codeonthego.editor.schemes.internal.parser import com.google.gson.stream.JsonReader import com.google.gson.stream.JsonToken.BEGIN_OBJECT import com.google.gson.stream.JsonToken.STRING -import com.itsaky.androidide.editor.schemes.IDEColorScheme -import com.itsaky.androidide.editor.schemes.LanguageScheme -import com.itsaky.androidide.editor.schemes.StyleDef +import org.appdevforall.codeonthego.editor.schemes.IDEColorScheme +import org.appdevforall.codeonthego.editor.schemes.LanguageScheme +import org.appdevforall.codeonthego.editor.schemes.StyleDef /** * Parses language definitions in JSON color scheme files. diff --git a/editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/ParseException.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/internal/parser/ParseException.kt similarity index 93% rename from editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/ParseException.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/internal/parser/ParseException.kt index 4d31b4f7de..5dd9ef9aea 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/ParseException.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/internal/parser/ParseException.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.schemes.internal.parser +package org.appdevforall.codeonthego.editor.schemes.internal.parser import com.google.gson.JsonParseException diff --git a/editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/SchemeParser.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/internal/parser/SchemeParser.kt similarity index 96% rename from editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/SchemeParser.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/internal/parser/SchemeParser.kt index 68a17f4140..f70ad2c2d8 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/SchemeParser.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/internal/parser/SchemeParser.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.schemes.internal.parser +package org.appdevforall.codeonthego.editor.schemes.internal.parser import com.google.gson.stream.JsonReader -import com.itsaky.androidide.editor.schemes.IDEColorScheme -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE +import org.appdevforall.codeonthego.editor.schemes.IDEColorScheme +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE import io.github.rosemoe.sora.widget.schemes.EditorColorScheme import java.io.File diff --git a/editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/common.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/internal/parser/common.kt similarity index 92% rename from editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/common.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/internal/parser/common.kt index eda0832617..667e2bc4dc 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/schemes/internal/parser/common.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/schemes/internal/parser/common.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.schemes.internal.parser +package org.appdevforall.codeonthego.editor.schemes.internal.parser import com.google.gson.stream.JsonReader import com.google.gson.stream.JsonToken.STRING -import com.itsaky.androidide.editor.schemes.IDEColorScheme -import com.itsaky.androidide.editor.schemes.LanguageScheme -import com.itsaky.androidide.editor.schemes.StyleDef -import com.itsaky.androidide.utils.parseHexColor +import org.appdevforall.codeonthego.editor.schemes.IDEColorScheme +import org.appdevforall.codeonthego.editor.schemes.LanguageScheme +import org.appdevforall.codeonthego.editor.schemes.StyleDef +import org.appdevforall.codeonthego.utils.parseHexColor import java.io.File /** @author Akash Yadav */ diff --git a/editor/src/main/java/com/itsaky/androidide/editor/snippets/AbstractSnippetVariableResolver.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/snippets/AbstractSnippetVariableResolver.kt similarity index 94% rename from editor/src/main/java/com/itsaky/androidide/editor/snippets/AbstractSnippetVariableResolver.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/snippets/AbstractSnippetVariableResolver.kt index 391d252bcf..b71b5bb9e9 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/snippets/AbstractSnippetVariableResolver.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/snippets/AbstractSnippetVariableResolver.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.snippets +package org.appdevforall.codeonthego.editor.snippets import io.github.rosemoe.sora.widget.snippet.variable.ISnippetVariableResolver diff --git a/editor/src/main/java/com/itsaky/androidide/editor/snippets/FileVariableResolver.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/snippets/FileVariableResolver.kt similarity index 92% rename from editor/src/main/java/com/itsaky/androidide/editor/snippets/FileVariableResolver.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/snippets/FileVariableResolver.kt index ec68a3405f..fa15c7df3f 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/snippets/FileVariableResolver.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/snippets/FileVariableResolver.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.snippets +package org.appdevforall.codeonthego.editor.snippets -import com.itsaky.androidide.editor.ui.IDEEditor -import com.itsaky.androidide.projects.IProjectManager +import org.appdevforall.codeonthego.editor.ui.IDEEditor +import org.appdevforall.codeonthego.projects.IProjectManager import io.github.rosemoe.sora.widget.snippet.variable.FileBasedSnippetVariableResolver /** diff --git a/editor/src/main/java/com/itsaky/androidide/editor/snippets/WorkspaceVariableResolver.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/snippets/WorkspaceVariableResolver.kt similarity index 93% rename from editor/src/main/java/com/itsaky/androidide/editor/snippets/WorkspaceVariableResolver.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/snippets/WorkspaceVariableResolver.kt index 98a90226bf..7a28f2c883 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/snippets/WorkspaceVariableResolver.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/snippets/WorkspaceVariableResolver.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.snippets +package org.appdevforall.codeonthego.editor.snippets -import com.itsaky.androidide.projects.IProjectManager +import org.appdevforall.codeonthego.projects.IProjectManager import io.github.rosemoe.sora.widget.snippet.variable.WorkspaceBasedSnippetVariableResolver /** diff --git a/editor/src/main/java/com/itsaky/androidide/editor/ui/AbstractPopupWindow.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/AbstractPopupWindow.kt similarity index 97% rename from editor/src/main/java/com/itsaky/androidide/editor/ui/AbstractPopupWindow.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/ui/AbstractPopupWindow.kt index 0da3bdd303..54a6ae78a7 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/ui/AbstractPopupWindow.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/AbstractPopupWindow.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.ui +package org.appdevforall.codeonthego.editor.ui import io.github.rosemoe.sora.widget.CodeEditor import io.github.rosemoe.sora.widget.base.EditorPopupWindow diff --git a/editor/src/main/java/com/itsaky/androidide/editor/ui/BaseEditorWindow.java b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/BaseEditorWindow.java similarity index 97% rename from editor/src/main/java/com/itsaky/androidide/editor/ui/BaseEditorWindow.java rename to editor/src/main/java/org/appdevforall/codeonthego/editor/ui/BaseEditorWindow.java index cd61000aa8..22ce4edfe8 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/ui/BaseEditorWindow.java +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/BaseEditorWindow.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.ui; +package org.appdevforall.codeonthego.editor.ui; import static android.view.View.MeasureSpec.AT_MOST; import static android.view.View.MeasureSpec.makeMeasureSpec; @@ -29,7 +29,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import com.itsaky.androidide.resources.R; -import com.itsaky.androidide.utils.ContextUtilsKt; +import org.appdevforall.codeonthego.utils.ContextUtilsKt; import io.github.rosemoe.sora.widget.base.EditorPopupWindow; /** diff --git a/editor/src/main/java/com/itsaky/androidide/editor/ui/DiagnosticWindow.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/DiagnosticWindow.kt similarity index 91% rename from editor/src/main/java/com/itsaky/androidide/editor/ui/DiagnosticWindow.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/ui/DiagnosticWindow.kt index cf38739b80..8da36c47a1 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/ui/DiagnosticWindow.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/DiagnosticWindow.kt @@ -14,9 +14,9 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.ui +package org.appdevforall.codeonthego.editor.ui -import com.itsaky.androidide.lsp.models.DiagnosticItem +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem /** * Popup window used to show diagnostic messages. diff --git a/editor/src/main/java/com/itsaky/androidide/editor/ui/EditorActionsMenu.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/EditorActionsMenu.kt similarity index 90% rename from editor/src/main/java/com/itsaky/androidide/editor/ui/EditorActionsMenu.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/ui/EditorActionsMenu.kt index 10cf6101c6..eacc99d586 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/ui/EditorActionsMenu.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/EditorActionsMenu.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.ui +package org.appdevforall.codeonthego.editor.ui import android.annotation.SuppressLint import android.content.res.ColorStateList @@ -34,30 +34,30 @@ import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView.ViewHolder import androidx.transition.ChangeBounds import androidx.transition.TransitionManager -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.ActionMenu -import com.itsaky.androidide.actions.ActionsRegistry -import com.itsaky.androidide.actions.ActionsRegistry.Companion.getInstance -import com.itsaky.androidide.actions.EditorActionItem -import com.itsaky.androidide.actions.FillMenuParams -import com.itsaky.androidide.actions.TextTarget -import com.itsaky.androidide.editor.adapters.IdeEditorAdapter +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionMenu +import org.appdevforall.codeonthego.actions.ActionsRegistry +import org.appdevforall.codeonthego.actions.ActionsRegistry.Companion.getInstance +import org.appdevforall.codeonthego.actions.EditorActionItem +import org.appdevforall.codeonthego.actions.FillMenuParams +import org.appdevforall.codeonthego.actions.TextTarget +import org.appdevforall.codeonthego.editor.adapters.IdeEditorAdapter import com.itsaky.androidide.editor.databinding.LayoutPopupMenuItemBinding -import com.itsaky.androidide.editor.ui.EditorActionsMenu.ActionsListAdapter.VH -import com.itsaky.androidide.idetooltips.TooltipCategory -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.lsp.api.ILanguageClient -import com.itsaky.androidide.lsp.api.ILanguageServerRegistry -import com.itsaky.androidide.lsp.java.JavaLanguageServer -import com.itsaky.androidide.lsp.kotlin.KotlinLanguageServer -import com.itsaky.androidide.lsp.models.DiagnosticItem -import com.itsaky.androidide.lsp.models.DiagnosticsInSelection -import com.itsaky.androidide.lsp.util.DiagnosticUtil -import com.itsaky.androidide.lsp.xml.XMLLanguageServer +import org.appdevforall.codeonthego.editor.ui.EditorActionsMenu.ActionsListAdapter.VH +import org.appdevforall.codeonthego.idetooltips.TooltipCategory +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.lsp.api.ILanguageClient +import org.appdevforall.codeonthego.lsp.api.ILanguageServerRegistry +import org.appdevforall.codeonthego.lsp.java.JavaLanguageServer +import org.appdevforall.codeonthego.lsp.kotlin.KotlinLanguageServer +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem +import org.appdevforall.codeonthego.lsp.models.DiagnosticsInSelection +import org.appdevforall.codeonthego.lsp.util.DiagnosticUtil +import org.appdevforall.codeonthego.lsp.xml.XMLLanguageServer import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.dpToPx -import com.itsaky.androidide.utils.resolveAttr +import org.appdevforall.codeonthego.utils.dpToPx +import org.appdevforall.codeonthego.utils.resolveAttr import io.github.rosemoe.sora.event.HandleStateChangeEvent import io.github.rosemoe.sora.event.ScrollEvent import io.github.rosemoe.sora.event.SelectionChangeEvent @@ -343,7 +343,7 @@ open class EditorActionsMenu( DiagnosticUtil.binarySearchDiagnostic(inSelection, range.start.line, range.start.column), ) data.put(DiagnosticsInSelection::class.java, DiagnosticsInSelection(inSelection)) - data.put(com.itsaky.androidide.models.Range::class.java, range) + data.put(org.appdevforall.codeonthego.models.Range::class.java, range) data.put( JavaLanguageServer::class.java, languageServerRegistry.getServer(JavaLanguageServer.SERVER_ID) diff --git a/editor/src/main/java/com/itsaky/androidide/editor/ui/EditorCompletionLayout.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/EditorCompletionLayout.kt similarity index 97% rename from editor/src/main/java/com/itsaky/androidide/editor/ui/EditorCompletionLayout.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/ui/EditorCompletionLayout.kt index 65f9d64481..50d16115c4 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/ui/EditorCompletionLayout.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/EditorCompletionLayout.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.ui +package org.appdevforall.codeonthego.editor.ui import android.graphics.drawable.GradientDrawable import android.view.ViewGroup diff --git a/editor/src/main/java/com/itsaky/androidide/editor/ui/EditorCompletionWindow.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/EditorCompletionWindow.kt similarity index 93% rename from editor/src/main/java/com/itsaky/androidide/editor/ui/EditorCompletionWindow.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/ui/EditorCompletionWindow.kt index b870e6e0bb..8718a668b4 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/ui/EditorCompletionWindow.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/EditorCompletionWindow.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.ui +package org.appdevforall.codeonthego.editor.ui import android.util.Log import android.widget.ListView -import com.itsaky.androidide.idetooltips.TooltipCategory -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.lsp.util.DocumentationReferenceProvider -import com.itsaky.androidide.progress.ProgressManager -import com.itsaky.androidide.utils.KeyboardUtils +import org.appdevforall.codeonthego.idetooltips.TooltipCategory +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.lsp.util.DocumentationReferenceProvider +import org.appdevforall.codeonthego.progress.ProgressManager +import org.appdevforall.codeonthego.utils.KeyboardUtils import io.github.rosemoe.sora.lang.completion.CompletionItem import io.github.rosemoe.sora.widget.component.CompletionLayout import io.github.rosemoe.sora.widget.component.EditorAutoCompletion @@ -81,7 +81,7 @@ class EditorCompletionWindow( } val completionItem = - items[position] as? com.itsaky.androidide.lsp.models.CompletionItem + items[position] as? org.appdevforall.codeonthego.lsp.models.CompletionItem val completionData = completionItem?.data val tag = diff --git a/editor/src/main/java/com/itsaky/androidide/editor/ui/EditorEventDispatcher.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/EditorEventDispatcher.kt similarity index 81% rename from editor/src/main/java/com/itsaky/androidide/editor/ui/EditorEventDispatcher.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/ui/EditorEventDispatcher.kt index 03fb4948c8..1dac9b1229 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/ui/EditorEventDispatcher.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/EditorEventDispatcher.kt @@ -15,17 +15,17 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.ui - -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentCloseEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentOpenEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentSaveEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentSelectedEvent -import com.itsaky.androidide.projects.FileManager.onDocumentClose -import com.itsaky.androidide.projects.FileManager.onDocumentContentChange -import com.itsaky.androidide.projects.FileManager.onDocumentOpen +package org.appdevforall.codeonthego.editor.ui + +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentCloseEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentOpenEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentSaveEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentSelectedEvent +import org.appdevforall.codeonthego.projects.FileManager.onDocumentClose +import org.appdevforall.codeonthego.projects.FileManager.onDocumentContentChange +import org.appdevforall.codeonthego.projects.FileManager.onDocumentOpen import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job diff --git a/editor/src/main/java/com/itsaky/androidide/editor/ui/EditorFeatures.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/EditorFeatures.kt similarity index 94% rename from editor/src/main/java/com/itsaky/androidide/editor/ui/EditorFeatures.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/ui/EditorFeatures.kt index d941fd5ac8..d89e062d8b 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/ui/EditorFeatures.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/EditorFeatures.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.ui +package org.appdevforall.codeonthego.editor.ui -import com.itsaky.androidide.editor.api.IEditor -import com.itsaky.androidide.editor.ui.IDEEditor.Companion.log -import com.itsaky.androidide.editor.utils.append -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.editor.api.IEditor +import org.appdevforall.codeonthego.editor.ui.IDEEditor.Companion.log +import org.appdevforall.codeonthego.editor.utils.append +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range import io.github.rosemoe.sora.widget.SelectionMovement import java.io.File diff --git a/editor/src/main/java/com/itsaky/androidide/editor/ui/EditorSearchLayout.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/EditorSearchLayout.kt similarity index 95% rename from editor/src/main/java/com/itsaky/androidide/editor/ui/EditorSearchLayout.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/ui/EditorSearchLayout.kt index 1c39f28eb7..8fa644f83e 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/ui/EditorSearchLayout.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/EditorSearchLayout.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.ui +package org.appdevforall.codeonthego.editor.ui import android.annotation.SuppressLint import android.content.Context @@ -33,15 +33,15 @@ import androidx.core.view.ViewCompat import androidx.core.view.WindowInsetsCompat import androidx.core.view.updateLayoutParams import com.itsaky.androidide.editor.databinding.LayoutFindInFileBinding -import com.itsaky.androidide.editor.ui.ReplaceAction.doReplace -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.editor.ui.ReplaceAction.doReplace +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag import com.itsaky.androidide.resources.R import com.itsaky.androidide.resources.databinding.SearchOptionsPopupMenuBinding -import com.itsaky.androidide.utils.KeyboardUtils -import com.itsaky.androidide.utils.SingleTextWatcher -import com.itsaky.androidide.utils.applyLongPressRecursively -import com.itsaky.androidide.utils.flashInfo +import org.appdevforall.codeonthego.utils.KeyboardUtils +import org.appdevforall.codeonthego.utils.SingleTextWatcher +import org.appdevforall.codeonthego.utils.applyLongPressRecursively +import org.appdevforall.codeonthego.utils.flashInfo import io.github.rosemoe.sora.widget.EditorSearcher.SearchOptions import java.util.regex.Pattern import java.util.regex.PatternSyntaxException diff --git a/editor/src/main/java/com/itsaky/androidide/editor/ui/GhostTextRenderer.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/GhostTextRenderer.kt similarity index 99% rename from editor/src/main/java/com/itsaky/androidide/editor/ui/GhostTextRenderer.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/ui/GhostTextRenderer.kt index db7d5ada53..93ae10f198 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/ui/GhostTextRenderer.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/GhostTextRenderer.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.ui +package org.appdevforall.codeonthego.editor.ui import android.graphics.Canvas import android.graphics.Paint diff --git a/editor/src/main/java/com/itsaky/androidide/editor/ui/IDECompletionPublisher.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/IDECompletionPublisher.kt similarity index 96% rename from editor/src/main/java/com/itsaky/androidide/editor/ui/IDECompletionPublisher.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/ui/IDECompletionPublisher.kt index 21bc6437c0..e19e7122f1 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/ui/IDECompletionPublisher.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/IDECompletionPublisher.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.ui +package org.appdevforall.codeonthego.editor.ui import android.os.Handler import io.github.rosemoe.sora.lang.completion.CompletionItem diff --git a/editor/src/main/java/com/itsaky/androidide/editor/ui/IDEEditor.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/IDEEditor.kt similarity index 91% rename from editor/src/main/java/com/itsaky/androidide/editor/ui/IDEEditor.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/ui/IDEEditor.kt index e7d65d9a08..2348d348d6 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/ui/IDEEditor.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/IDEEditor.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.ui +package org.appdevforall.codeonthego.editor.ui import android.content.Context import android.graphics.Rect @@ -32,58 +32,58 @@ import androidx.annotation.StringRes import androidx.annotation.VisibleForTesting import com.itsaky.androidide.editor.R import com.itsaky.androidide.editor.R.string -import com.itsaky.androidide.editor.adapters.CompletionListAdapter -import com.itsaky.androidide.editor.api.IEditor -import com.itsaky.androidide.editor.api.ILspEditor -import com.itsaky.androidide.editor.events.FileUpdateEvent -import com.itsaky.androidide.editor.events.LanguageUpdateEvent -import com.itsaky.androidide.editor.language.IDELanguage -import com.itsaky.androidide.editor.language.cpp.CppLanguage -import com.itsaky.androidide.editor.language.groovy.GroovyLanguage -import com.itsaky.androidide.editor.language.treesitter.TreeSitterLanguage -import com.itsaky.androidide.editor.language.treesitter.TreeSitterLanguageProvider -import com.itsaky.androidide.editor.processing.ProcessContext -import com.itsaky.androidide.editor.processing.TextProcessorEngine -import com.itsaky.androidide.editor.schemes.IDEColorScheme -import com.itsaky.androidide.editor.schemes.IDEColorSchemeProvider -import com.itsaky.androidide.editor.snippets.AbstractSnippetVariableResolver -import com.itsaky.androidide.editor.snippets.FileVariableResolver -import com.itsaky.androidide.editor.snippets.WorkspaceVariableResolver -import com.itsaky.androidide.editor.utils.getOperatorRangeAt -import com.itsaky.androidide.eventbus.events.editor.ChangeType -import com.itsaky.androidide.eventbus.events.editor.ColorSchemeInvalidatedEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentCloseEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentOpenEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentSaveEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentSelectedEvent -import com.itsaky.androidide.flashbar.Flashbar -import com.itsaky.androidide.lsp.api.ILanguageClient -import com.itsaky.androidide.lsp.api.ILanguageServer -import com.itsaky.androidide.lsp.java.utils.CancelChecker -import com.itsaky.androidide.lsp.models.Command -import com.itsaky.androidide.lsp.models.DefinitionParams -import com.itsaky.androidide.lsp.models.DefinitionResult -import com.itsaky.androidide.lsp.models.ExpandSelectionParams -import com.itsaky.androidide.lsp.models.ReferenceParams -import com.itsaky.androidide.lsp.models.ReferenceResult -import com.itsaky.androidide.lsp.models.ShowDocumentParams -import com.itsaky.androidide.lsp.models.SignatureHelp -import com.itsaky.androidide.lsp.models.SignatureHelpParams -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.preferences.internal.EditorPreferences -import com.itsaky.androidide.progress.ICancelChecker -import com.itsaky.androidide.syntax.colorschemes.DynamicColorScheme -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE -import com.itsaky.androidide.tasks.JobCancelChecker -import com.itsaky.androidide.tasks.cancelIfActive -import com.itsaky.androidide.tasks.doAsyncWithProgress -import com.itsaky.androidide.utils.BasicBuildInfo -import com.itsaky.androidide.utils.DocumentUtils -import com.itsaky.androidide.utils.FileUtils -import com.itsaky.androidide.utils.dpToPx -import com.itsaky.androidide.utils.flashError +import org.appdevforall.codeonthego.editor.adapters.CompletionListAdapter +import org.appdevforall.codeonthego.editor.api.IEditor +import org.appdevforall.codeonthego.editor.api.ILspEditor +import org.appdevforall.codeonthego.editor.events.FileUpdateEvent +import org.appdevforall.codeonthego.editor.events.LanguageUpdateEvent +import org.appdevforall.codeonthego.editor.language.IDELanguage +import org.appdevforall.codeonthego.editor.language.cpp.CppLanguage +import org.appdevforall.codeonthego.editor.language.groovy.GroovyLanguage +import org.appdevforall.codeonthego.editor.language.treesitter.TreeSitterLanguage +import org.appdevforall.codeonthego.editor.language.treesitter.TreeSitterLanguageProvider +import org.appdevforall.codeonthego.editor.processing.ProcessContext +import org.appdevforall.codeonthego.editor.processing.TextProcessorEngine +import org.appdevforall.codeonthego.editor.schemes.IDEColorScheme +import org.appdevforall.codeonthego.editor.schemes.IDEColorSchemeProvider +import org.appdevforall.codeonthego.editor.snippets.AbstractSnippetVariableResolver +import org.appdevforall.codeonthego.editor.snippets.FileVariableResolver +import org.appdevforall.codeonthego.editor.snippets.WorkspaceVariableResolver +import org.appdevforall.codeonthego.editor.utils.getOperatorRangeAt +import org.appdevforall.codeonthego.eventbus.events.editor.ChangeType +import org.appdevforall.codeonthego.eventbus.events.editor.ColorSchemeInvalidatedEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentCloseEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentOpenEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentSaveEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentSelectedEvent +import org.appdevforall.codeonthego.flashbar.Flashbar +import org.appdevforall.codeonthego.lsp.api.ILanguageClient +import org.appdevforall.codeonthego.lsp.api.ILanguageServer +import org.appdevforall.codeonthego.lsp.java.utils.CancelChecker +import org.appdevforall.codeonthego.lsp.models.Command +import org.appdevforall.codeonthego.lsp.models.DefinitionParams +import org.appdevforall.codeonthego.lsp.models.DefinitionResult +import org.appdevforall.codeonthego.lsp.models.ExpandSelectionParams +import org.appdevforall.codeonthego.lsp.models.ReferenceParams +import org.appdevforall.codeonthego.lsp.models.ReferenceResult +import org.appdevforall.codeonthego.lsp.models.ShowDocumentParams +import org.appdevforall.codeonthego.lsp.models.SignatureHelp +import org.appdevforall.codeonthego.lsp.models.SignatureHelpParams +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.progress.ICancelChecker +import org.appdevforall.codeonthego.syntax.colorschemes.DynamicColorScheme +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE +import org.appdevforall.codeonthego.tasks.JobCancelChecker +import org.appdevforall.codeonthego.tasks.cancelIfActive +import org.appdevforall.codeonthego.tasks.doAsyncWithProgress +import org.appdevforall.codeonthego.utils.BasicBuildInfo +import org.appdevforall.codeonthego.utils.DocumentUtils +import org.appdevforall.codeonthego.utils.FileUtils +import org.appdevforall.codeonthego.utils.dpToPx +import org.appdevforall.codeonthego.utils.flashError import io.github.rosemoe.sora.event.ContentChangeEvent import io.github.rosemoe.sora.event.SelectionChangeEvent import io.github.rosemoe.sora.lang.EmptyLanguage diff --git a/editor/src/main/java/com/itsaky/androidide/editor/ui/ReplaceAction.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/ReplaceAction.kt similarity index 90% rename from editor/src/main/java/com/itsaky/androidide/editor/ui/ReplaceAction.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/ui/ReplaceAction.kt index a877752496..e14a9d8d71 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/ui/ReplaceAction.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/ReplaceAction.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.ui +package org.appdevforall.codeonthego.editor.ui import android.view.LayoutInflater import com.itsaky.androidide.editor.databinding.LayoutEditorFindReplaceBinding -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.idetooltips.attachTooltip +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.idetooltips.attachTooltip import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.DialogUtils +import org.appdevforall.codeonthego.utils.DialogUtils import org.slf4j.LoggerFactory /** diff --git a/editor/src/main/java/com/itsaky/androidide/editor/ui/SignatureHelpWindow.java b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/SignatureHelpWindow.java similarity index 95% rename from editor/src/main/java/com/itsaky/androidide/editor/ui/SignatureHelpWindow.java rename to editor/src/main/java/org/appdevforall/codeonthego/editor/ui/SignatureHelpWindow.java index 1c1ff59be7..60f234d505 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/ui/SignatureHelpWindow.java +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/SignatureHelpWindow.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.ui; +package org.appdevforall.codeonthego.editor.ui; import static com.itsaky.androidide.editor.R.attr; @@ -23,9 +23,9 @@ import android.text.style.ForegroundColorSpan; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.itsaky.androidide.lsp.models.SignatureHelp; -import com.itsaky.androidide.lsp.models.SignatureInformation; -import com.itsaky.androidide.utils.ContextUtilsKt; +import org.appdevforall.codeonthego.lsp.models.SignatureHelp; +import org.appdevforall.codeonthego.lsp.models.SignatureInformation; +import org.appdevforall.codeonthego.utils.ContextUtilsKt; import io.github.rosemoe.sora.event.SelectionChangeEvent; import io.github.rosemoe.sora.widget.base.EditorPopupWindow; import java.util.ArrayList; diff --git a/editor/src/main/java/com/itsaky/androidide/editor/ui/TracingEditorRenderer.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/TracingEditorRenderer.kt similarity index 99% rename from editor/src/main/java/com/itsaky/androidide/editor/ui/TracingEditorRenderer.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/ui/TracingEditorRenderer.kt index 0de32e45f7..3e06d81889 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/ui/TracingEditorRenderer.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/ui/TracingEditorRenderer.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.ui +package org.appdevforall.codeonthego.editor.ui import android.graphics.Canvas import android.graphics.Rect diff --git a/editor/src/main/java/com/itsaky/androidide/editor/utils/ContentExt.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/utils/ContentExt.kt similarity index 97% rename from editor/src/main/java/com/itsaky/androidide/editor/utils/ContentExt.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/utils/ContentExt.kt index 636f60543f..5c95cc0d6a 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/utils/ContentExt.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/utils/ContentExt.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.utils +package org.appdevforall.codeonthego.editor.utils -import com.itsaky.androidide.editor.ui.IDEEditor +import org.appdevforall.codeonthego.editor.ui.IDEEditor import com.itsaky.androidide.treesitter.TSNode import com.itsaky.androidide.treesitter.TSTree import com.itsaky.androidide.treesitter.getNodeAt diff --git a/editor/src/main/java/com/itsaky/androidide/editor/utils/ContentReadWrite.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/utils/ContentReadWrite.kt similarity index 99% rename from editor/src/main/java/com/itsaky/androidide/editor/utils/ContentReadWrite.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/utils/ContentReadWrite.kt index 55c2835099..3bee974e28 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/utils/ContentReadWrite.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/utils/ContentReadWrite.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.utils +package org.appdevforall.codeonthego.editor.utils import io.github.rosemoe.sora.text.CharArrayWrapper import io.github.rosemoe.sora.text.Content diff --git a/editor/src/main/java/com/itsaky/androidide/editor/utils/OperatorSelection.kt b/editor/src/main/java/org/appdevforall/codeonthego/editor/utils/OperatorSelection.kt similarity index 98% rename from editor/src/main/java/com/itsaky/androidide/editor/utils/OperatorSelection.kt rename to editor/src/main/java/org/appdevforall/codeonthego/editor/utils/OperatorSelection.kt index 5fa1fc8c19..9403ed2efc 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/utils/OperatorSelection.kt +++ b/editor/src/main/java/org/appdevforall/codeonthego/editor/utils/OperatorSelection.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.editor.utils +package org.appdevforall.codeonthego.editor.utils import io.github.rosemoe.sora.text.Content diff --git a/editor/src/main/res/layout/layout_code_editor.xml b/editor/src/main/res/layout/layout_code_editor.xml index 4d09d196b2..22f7bbc39c 100644 --- a/editor/src/main/res/layout/layout_code_editor.xml +++ b/editor/src/main/res/layout/layout_code_editor.xml @@ -33,7 +33,7 @@ app:layout_constraintTop_toTopOf="parent" tools:progress="50" /> - + tools:text="org.appdevforall.codeonthego.activities.MainActivity" /> . */ -package com.itsaky.androidide.editor.schemes.internal.parser +package org.appdevforall.codeonthego.editor.schemes.internal.parser import android.graphics.Color import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.editor.schemes.IDEColorScheme +import org.appdevforall.codeonthego.editor.schemes.IDEColorScheme import io.github.rosemoe.sora.widget.schemes.EditorColorScheme import org.junit.Test import org.junit.runner.RunWith diff --git a/editor/src/test/java/com/itsaky/androidide/editor/ui/SignatureHelpWindowTest.kt b/editor/src/test/java/org/appdevforall/codeonthego/editor/ui/SignatureHelpWindowTest.kt similarity index 85% rename from editor/src/test/java/com/itsaky/androidide/editor/ui/SignatureHelpWindowTest.kt rename to editor/src/test/java/org/appdevforall/codeonthego/editor/ui/SignatureHelpWindowTest.kt index 45c31312ba..b433dd4402 100644 --- a/editor/src/test/java/com/itsaky/androidide/editor/ui/SignatureHelpWindowTest.kt +++ b/editor/src/test/java/org/appdevforall/codeonthego/editor/ui/SignatureHelpWindowTest.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.editor.ui +package org.appdevforall.codeonthego.editor.ui import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.models.MarkupContent -import com.itsaky.androidide.lsp.models.ParameterInformation -import com.itsaky.androidide.lsp.models.SignatureInformation +import org.appdevforall.codeonthego.lsp.models.MarkupContent +import org.appdevforall.codeonthego.lsp.models.ParameterInformation +import org.appdevforall.codeonthego.lsp.models.SignatureInformation import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner diff --git a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/BuildEvent.kt b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/BuildEvent.kt similarity index 68% rename from eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/BuildEvent.kt rename to eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/BuildEvent.kt index 916a0954e6..77e625c503 100644 --- a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/BuildEvent.kt +++ b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/BuildEvent.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.eventbus.events +package org.appdevforall.codeonthego.eventbus.events -import com.itsaky.androidide.tooling.api.messages.BuildId -import com.itsaky.androidide.tooling.api.messages.result.BuildInfo -import com.itsaky.androidide.tooling.api.messages.result.BuildResult +import org.appdevforall.codeonthego.tooling.api.messages.BuildId +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildInfo +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildResult /** * Events dispatched from the IDE's build service. diff --git a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/Event.java b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/Event.java similarity index 95% rename from eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/Event.java rename to eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/Event.java index 3a47ac6fb7..432ac22542 100644 --- a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/Event.java +++ b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/Event.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.eventbus.events; +package org.appdevforall.codeonthego.eventbus.events; import java.util.HashMap; import java.util.Map; diff --git a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/EventReceiver.kt b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/EventReceiver.kt similarity index 95% rename from eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/EventReceiver.kt rename to eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/EventReceiver.kt index 87e0911e29..b4cc4e0add 100644 --- a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/EventReceiver.kt +++ b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/EventReceiver.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.eventbus.events +package org.appdevforall.codeonthego.eventbus.events import org.greenrobot.eventbus.EventBus diff --git a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/editor/ActivityLifecycleEvents.kt b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/editor/ActivityLifecycleEvents.kt similarity index 93% rename from eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/editor/ActivityLifecycleEvents.kt rename to eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/editor/ActivityLifecycleEvents.kt index f1e57a8a8f..3dbb87de75 100644 --- a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/editor/ActivityLifecycleEvents.kt +++ b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/editor/ActivityLifecycleEvents.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.eventbus.events.editor +package org.appdevforall.codeonthego.eventbus.events.editor -import com.itsaky.androidide.eventbus.events.Event +import org.appdevforall.codeonthego.eventbus.events.Event abstract class EditorActivityLifecycleEvent : Event() diff --git a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/editor/DocumentEvents.kt b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/editor/DocumentEvents.kt similarity index 95% rename from eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/editor/DocumentEvents.kt rename to eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/editor/DocumentEvents.kt index a5b74a6457..3fde1c2dd2 100644 --- a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/editor/DocumentEvents.kt +++ b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/editor/DocumentEvents.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.eventbus.events.editor +package org.appdevforall.codeonthego.eventbus.events.editor -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.models.Range import java.net.URI import java.nio.file.Path diff --git a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/editor/EditorEvents.kt b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/editor/EditorEvents.kt similarity index 89% rename from eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/editor/EditorEvents.kt rename to eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/editor/EditorEvents.kt index f8e4ee8001..8f72d36ec1 100644 --- a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/editor/EditorEvents.kt +++ b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/editor/EditorEvents.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.eventbus.events.editor +package org.appdevforall.codeonthego.eventbus.events.editor -import com.itsaky.androidide.eventbus.events.Event +import org.appdevforall.codeonthego.eventbus.events.Event /** * Dispatched when the color schemes has been reloaded. Listeners should update any UI which use diff --git a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/editor/LayoutEditorEvents.kt b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/editor/LayoutEditorEvents.kt similarity index 83% rename from eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/editor/LayoutEditorEvents.kt rename to eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/editor/LayoutEditorEvents.kt index e5e875c643..babbedffe6 100644 --- a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/editor/LayoutEditorEvents.kt +++ b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/editor/LayoutEditorEvents.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.eventbus.events.editor +package org.appdevforall.codeonthego.eventbus.events.editor /** * Event to report *caught* (non-fatal) exceptions via EventBus, diff --git a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/file/FileEvents.kt b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/file/FileEvents.kt similarity index 92% rename from eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/file/FileEvents.kt rename to eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/file/FileEvents.kt index 69bc361925..81b6f31c71 100644 --- a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/file/FileEvents.kt +++ b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/file/FileEvents.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.eventbus.events.file +package org.appdevforall.codeonthego.eventbus.events.file -import com.itsaky.androidide.eventbus.events.Event +import org.appdevforall.codeonthego.eventbus.events.Event import java.io.File /** Base class for file events. */ diff --git a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/filetree/FileTreeEvents.kt b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/filetree/FileTreeEvents.kt similarity index 91% rename from eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/filetree/FileTreeEvents.kt rename to eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/filetree/FileTreeEvents.kt index 5d1c031b67..a3b246ce6d 100644 --- a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/filetree/FileTreeEvents.kt +++ b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/filetree/FileTreeEvents.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.eventbus.events.filetree +package org.appdevforall.codeonthego.eventbus.events.filetree -import com.itsaky.androidide.eventbus.events.Event +import org.appdevforall.codeonthego.eventbus.events.Event import java.io.File /** diff --git a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/plugin/PluginCrashedEvent.kt b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/plugin/PluginCrashedEvent.kt similarity index 59% rename from eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/plugin/PluginCrashedEvent.kt rename to eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/plugin/PluginCrashedEvent.kt index 1ce884e4c3..e42820e1b4 100644 --- a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/plugin/PluginCrashedEvent.kt +++ b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/plugin/PluginCrashedEvent.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.eventbus.events.plugin +package org.appdevforall.codeonthego.eventbus.events.plugin -import com.itsaky.androidide.eventbus.events.Event +import org.appdevforall.codeonthego.eventbus.events.Event class PluginCrashedEvent( val pluginId: String, diff --git a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/preferences/PreferenceEvents.kt b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/preferences/PreferenceEvents.kt similarity index 90% rename from eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/preferences/PreferenceEvents.kt rename to eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/preferences/PreferenceEvents.kt index 933ae6af04..a604da8908 100644 --- a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/preferences/PreferenceEvents.kt +++ b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/preferences/PreferenceEvents.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.eventbus.events.preferences +package org.appdevforall.codeonthego.eventbus.events.preferences -import com.itsaky.androidide.eventbus.events.Event +import org.appdevforall.codeonthego.eventbus.events.Event /** * Dispatched when a preference's is value changed in IDE preferences. diff --git a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/project/ProjectEvents.kt b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/project/ProjectEvents.kt similarity index 88% rename from eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/project/ProjectEvents.kt rename to eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/project/ProjectEvents.kt index c47bf5106a..390bbce5c7 100644 --- a/eventbus-events/src/main/java/com/itsaky/androidide/eventbus/events/project/ProjectEvents.kt +++ b/eventbus-events/src/main/java/org/appdevforall/codeonthego/eventbus/events/project/ProjectEvents.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.eventbus.events.project +package org.appdevforall.codeonthego.eventbus.events.project -import com.itsaky.androidide.eventbus.events.Event +import org.appdevforall.codeonthego.eventbus.events.Event /** * Event dispatched when the project is initialized. A project instance is provided with this event diff --git a/floating-window/src/main/java/com/itsaky/androidide/floating/fragment/OverlayFragmentHost.kt b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/fragment/OverlayFragmentHost.kt similarity index 97% rename from floating-window/src/main/java/com/itsaky/androidide/floating/fragment/OverlayFragmentHost.kt rename to floating-window/src/main/java/org/appdevforall/codeonthego/floating/fragment/OverlayFragmentHost.kt index 36f4bf23fc..183e40518b 100644 --- a/floating-window/src/main/java/com/itsaky/androidide/floating/fragment/OverlayFragmentHost.kt +++ b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/fragment/OverlayFragmentHost.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.floating.fragment +package org.appdevforall.codeonthego.floating.fragment import android.content.Context import android.os.Handler @@ -24,7 +24,7 @@ import androidx.lifecycle.ViewModelStoreOwner import androidx.savedstate.SavedStateRegistry import androidx.savedstate.SavedStateRegistryOwner import com.google.android.material.theme.MaterialComponentsViewInflater -import com.itsaky.androidide.floating.window.FloatingWindowHost +import org.appdevforall.codeonthego.floating.window.FloatingWindowHost /** * Hosts a single [Fragment] with no Activity, inside a floating overlay window. diff --git a/floating-window/src/main/java/com/itsaky/androidide/floating/model/ChromeControl.kt b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/model/ChromeControl.kt similarity index 57% rename from floating-window/src/main/java/com/itsaky/androidide/floating/model/ChromeControl.kt rename to floating-window/src/main/java/org/appdevforall/codeonthego/floating/model/ChromeControl.kt index 0cd55bae2e..4c83ac7851 100644 --- a/floating-window/src/main/java/com/itsaky/androidide/floating/model/ChromeControl.kt +++ b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/model/ChromeControl.kt @@ -1,5 +1,5 @@ -package com.itsaky.androidide.floating.model +package org.appdevforall.codeonthego.floating.model enum class ChromeControl { diff --git a/floating-window/src/main/java/com/itsaky/androidide/floating/model/DockAction.kt b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/model/DockAction.kt similarity index 96% rename from floating-window/src/main/java/com/itsaky/androidide/floating/model/DockAction.kt rename to floating-window/src/main/java/org/appdevforall/codeonthego/floating/model/DockAction.kt index 2dbc668a31..1353a13ebc 100644 --- a/floating-window/src/main/java/com/itsaky/androidide/floating/model/DockAction.kt +++ b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/model/DockAction.kt @@ -1,5 +1,5 @@ -package com.itsaky.androidide.floating.model +package org.appdevforall.codeonthego.floating.model import android.view.View import kotlinx.coroutines.flow.StateFlow diff --git a/floating-window/src/main/java/com/itsaky/androidide/floating/model/DockableContent.kt b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/model/DockableContent.kt similarity index 94% rename from floating-window/src/main/java/com/itsaky/androidide/floating/model/DockableContent.kt rename to floating-window/src/main/java/org/appdevforall/codeonthego/floating/model/DockableContent.kt index bc3bf2bd7c..bfc813cdc9 100644 --- a/floating-window/src/main/java/com/itsaky/androidide/floating/model/DockableContent.kt +++ b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/model/DockableContent.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.floating.model +package org.appdevforall.codeonthego.floating.model import android.content.Context import android.graphics.drawable.Drawable import android.view.View -import com.itsaky.androidide.floating.window.FloatingWindowHost +import org.appdevforall.codeonthego.floating.window.FloatingWindowHost import kotlinx.coroutines.flow.StateFlow /** diff --git a/floating-window/src/main/java/com/itsaky/androidide/floating/model/DockingEvent.kt b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/model/DockingEvent.kt similarity index 92% rename from floating-window/src/main/java/com/itsaky/androidide/floating/model/DockingEvent.kt rename to floating-window/src/main/java/org/appdevforall/codeonthego/floating/model/DockingEvent.kt index 49703504ea..4bf4d3b380 100644 --- a/floating-window/src/main/java/com/itsaky/androidide/floating/model/DockingEvent.kt +++ b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/model/DockingEvent.kt @@ -1,5 +1,5 @@ -package com.itsaky.androidide.floating.model +package org.appdevforall.codeonthego.floating.model /** * A one-shot intent emitted when a floating window leaves the floating set, telling the editor diff --git a/floating-window/src/main/java/com/itsaky/androidide/floating/model/DockingManager.kt b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/model/DockingManager.kt similarity index 92% rename from floating-window/src/main/java/com/itsaky/androidide/floating/model/DockingManager.kt rename to floating-window/src/main/java/org/appdevforall/codeonthego/floating/model/DockingManager.kt index c4699e05f6..c336766e4a 100644 --- a/floating-window/src/main/java/com/itsaky/androidide/floating/model/DockingManager.kt +++ b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/model/DockingManager.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.floating.model +package org.appdevforall.codeonthego.floating.model -import com.itsaky.androidide.floating.window.FloatingWindowState -import com.itsaky.androidide.floating.window.WindowBounds -import com.itsaky.androidide.floating.window.WindowMode +import org.appdevforall.codeonthego.floating.window.FloatingWindowState +import org.appdevforall.codeonthego.floating.window.WindowBounds +import org.appdevforall.codeonthego.floating.window.WindowMode import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharedFlow diff --git a/floating-window/src/main/java/com/itsaky/androidide/floating/model/FloatingTab.kt b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/model/FloatingTab.kt similarity index 63% rename from floating-window/src/main/java/com/itsaky/androidide/floating/model/FloatingTab.kt rename to floating-window/src/main/java/org/appdevforall/codeonthego/floating/model/FloatingTab.kt index fefc96fdfc..67ebfe434f 100644 --- a/floating-window/src/main/java/com/itsaky/androidide/floating/model/FloatingTab.kt +++ b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/model/FloatingTab.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.floating.model +package org.appdevforall.codeonthego.floating.model -import com.itsaky.androidide.floating.window.FloatingWindowState +import org.appdevforall.codeonthego.floating.window.FloatingWindowState /** A docked-content + window-state pair: one entry per live floating window. */ data class FloatingTab( diff --git a/floating-window/src/main/java/com/itsaky/androidide/floating/permission/OverlayPermission.kt b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/permission/OverlayPermission.kt similarity index 89% rename from floating-window/src/main/java/com/itsaky/androidide/floating/permission/OverlayPermission.kt rename to floating-window/src/main/java/org/appdevforall/codeonthego/floating/permission/OverlayPermission.kt index 1364b66345..7941a4cb21 100644 --- a/floating-window/src/main/java/com/itsaky/androidide/floating/permission/OverlayPermission.kt +++ b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/permission/OverlayPermission.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.floating.permission +package org.appdevforall.codeonthego.floating.permission import android.content.Context import android.content.Intent diff --git a/floating-window/src/main/java/com/itsaky/androidide/floating/service/FloatingTabService.kt b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/service/FloatingTabService.kt similarity index 95% rename from floating-window/src/main/java/com/itsaky/androidide/floating/service/FloatingTabService.kt rename to floating-window/src/main/java/org/appdevforall/codeonthego/floating/service/FloatingTabService.kt index e3ab84bba3..9d2e8bac9e 100644 --- a/floating-window/src/main/java/com/itsaky/androidide/floating/service/FloatingTabService.kt +++ b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/service/FloatingTabService.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.floating.service +package org.appdevforall.codeonthego.floating.service import android.app.Notification import android.app.NotificationChannel @@ -16,9 +16,9 @@ import android.view.Display import android.view.WindowManager import androidx.core.app.NotificationCompat import androidx.core.content.ContextCompat -import com.itsaky.androidide.floating.model.DockingManager -import com.itsaky.androidide.floating.model.FloatingTab -import com.itsaky.androidide.floating.window.FloatingWindow +import org.appdevforall.codeonthego.floating.model.DockingManager +import org.appdevforall.codeonthego.floating.model.FloatingTab +import org.appdevforall.codeonthego.floating.window.FloatingWindow import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job diff --git a/floating-window/src/main/java/com/itsaky/androidide/floating/ui/FloatingTheme.kt b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/ui/FloatingTheme.kt similarity index 94% rename from floating-window/src/main/java/com/itsaky/androidide/floating/ui/FloatingTheme.kt rename to floating-window/src/main/java/org/appdevforall/codeonthego/floating/ui/FloatingTheme.kt index 6061716a0b..2baa3ba558 100644 --- a/floating-window/src/main/java/com/itsaky/androidide/floating/ui/FloatingTheme.kt +++ b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/ui/FloatingTheme.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.floating.ui +package org.appdevforall.codeonthego.floating.ui import androidx.compose.material3.Typography import androidx.compose.runtime.Composable @@ -10,7 +10,7 @@ import androidx.compose.ui.text.font.Font import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontStyle import androidx.compose.ui.text.font.FontWeight -import com.itsaky.androidide.common.compose.IdeTheme +import org.appdevforall.codeonthego.common.compose.IdeTheme import com.itsaky.androidide.resources.R as ResR private val AtkinsonHyperlegible: FontFamily = diff --git a/floating-window/src/main/java/com/itsaky/androidide/floating/ui/FloatingWindowChrome.kt b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/ui/FloatingWindowChrome.kt similarity index 98% rename from floating-window/src/main/java/com/itsaky/androidide/floating/ui/FloatingWindowChrome.kt rename to floating-window/src/main/java/org/appdevforall/codeonthego/floating/ui/FloatingWindowChrome.kt index 2c3507e3f8..9de93a515d 100644 --- a/floating-window/src/main/java/com/itsaky/androidide/floating/ui/FloatingWindowChrome.kt +++ b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/ui/FloatingWindowChrome.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.floating.ui +package org.appdevforall.codeonthego.floating.ui import android.view.View import androidx.compose.animation.Crossfade @@ -53,8 +53,8 @@ import androidx.compose.ui.semantics.contentDescription import androidx.compose.ui.semantics.semantics import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp -import com.itsaky.androidide.floating.model.ChromeControl -import com.itsaky.androidide.floating.model.DockAction +import org.appdevforall.codeonthego.floating.model.ChromeControl +import org.appdevforall.codeonthego.floating.model.DockAction import com.itsaky.androidide.resources.R import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableStateFlow diff --git a/floating-window/src/main/java/com/itsaky/androidide/floating/window/FloatingWindow.kt b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/window/FloatingWindow.kt similarity index 96% rename from floating-window/src/main/java/com/itsaky/androidide/floating/window/FloatingWindow.kt rename to floating-window/src/main/java/org/appdevforall/codeonthego/floating/window/FloatingWindow.kt index 52aecd657f..7530de2be8 100644 --- a/floating-window/src/main/java/com/itsaky/androidide/floating/window/FloatingWindow.kt +++ b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/window/FloatingWindow.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.floating.window +package org.appdevforall.codeonthego.floating.window import android.animation.Animator import android.animation.AnimatorListenerAdapter @@ -24,11 +24,11 @@ import androidx.compose.ui.platform.ComposeView import androidx.compose.ui.viewinterop.AndroidView import androidx.core.view.ViewCompat import androidx.core.view.WindowInsetsCompat -import com.itsaky.androidide.floating.model.DockingManager -import com.itsaky.androidide.floating.model.FloatingTab -import com.itsaky.androidide.floating.ui.FloatingTheme -import com.itsaky.androidide.floating.ui.FloatingWindowChrome -import com.itsaky.androidide.floating.ui.MinimizedBubble +import org.appdevforall.codeonthego.floating.model.DockingManager +import org.appdevforall.codeonthego.floating.model.FloatingTab +import org.appdevforall.codeonthego.floating.ui.FloatingTheme +import org.appdevforall.codeonthego.floating.ui.FloatingWindowChrome +import org.appdevforall.codeonthego.floating.ui.MinimizedBubble import org.slf4j.LoggerFactory import kotlin.math.roundToInt diff --git a/floating-window/src/main/java/com/itsaky/androidide/floating/window/FloatingWindowHost.kt b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/window/FloatingWindowHost.kt similarity index 98% rename from floating-window/src/main/java/com/itsaky/androidide/floating/window/FloatingWindowHost.kt rename to floating-window/src/main/java/org/appdevforall/codeonthego/floating/window/FloatingWindowHost.kt index 46dd0b6adc..210665af4c 100644 --- a/floating-window/src/main/java/com/itsaky/androidide/floating/window/FloatingWindowHost.kt +++ b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/window/FloatingWindowHost.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.floating.window +package org.appdevforall.codeonthego.floating.window import android.view.View import androidx.activity.OnBackPressedDispatcher diff --git a/floating-window/src/main/java/com/itsaky/androidide/floating/window/FloatingWindowState.kt b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/window/FloatingWindowState.kt similarity index 79% rename from floating-window/src/main/java/com/itsaky/androidide/floating/window/FloatingWindowState.kt rename to floating-window/src/main/java/org/appdevforall/codeonthego/floating/window/FloatingWindowState.kt index 82075edb4f..dc2852bacc 100644 --- a/floating-window/src/main/java/com/itsaky/androidide/floating/window/FloatingWindowState.kt +++ b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/window/FloatingWindowState.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.floating.window +package org.appdevforall.codeonthego.floating.window /** Position and size of a floating window, in absolute screen pixels. */ data class WindowBounds( @@ -19,7 +19,7 @@ enum class WindowMode { /** * Immutable state of a single floating window, owned by - * [com.itsaky.androidide.floating.model.DockingManager] and reconciled into a live overlay by the + * [org.appdevforall.codeonthego.floating.model.DockingManager] and reconciled into a live overlay by the * floating window service. * * [restoreBounds] remembers the [NORMAL]-mode bounds to return to after leaving [MAXIMIZED] or diff --git a/floating-window/src/main/java/com/itsaky/androidide/floating/window/InitialBounds.kt b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/window/InitialBounds.kt similarity index 95% rename from floating-window/src/main/java/com/itsaky/androidide/floating/window/InitialBounds.kt rename to floating-window/src/main/java/org/appdevforall/codeonthego/floating/window/InitialBounds.kt index 04836446b9..0214932e4f 100644 --- a/floating-window/src/main/java/com/itsaky/androidide/floating/window/InitialBounds.kt +++ b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/window/InitialBounds.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.floating.window +package org.appdevforall.codeonthego.floating.window import android.content.Context import kotlin.math.roundToInt diff --git a/floating-window/src/main/java/com/itsaky/androidide/floating/window/OverlayDialogs.kt b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/window/OverlayDialogs.kt similarity index 88% rename from floating-window/src/main/java/com/itsaky/androidide/floating/window/OverlayDialogs.kt rename to floating-window/src/main/java/org/appdevforall/codeonthego/floating/window/OverlayDialogs.kt index c62f08fbad..d4fa7db14b 100644 --- a/floating-window/src/main/java/com/itsaky/androidide/floating/window/OverlayDialogs.kt +++ b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/window/OverlayDialogs.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.floating.window +package org.appdevforall.codeonthego.floating.window import android.app.Dialog -import com.itsaky.androidide.floating.model.DockingManager -import com.itsaky.androidide.floating.permission.OverlayPermission +import org.appdevforall.codeonthego.floating.model.DockingManager +import org.appdevforall.codeonthego.floating.permission.OverlayPermission /** * Shows a host [Dialog] above any floating overlay windows. diff --git a/floating-window/src/main/java/com/itsaky/androidide/floating/window/OverlayLayoutParams.kt b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/window/OverlayLayoutParams.kt similarity index 96% rename from floating-window/src/main/java/com/itsaky/androidide/floating/window/OverlayLayoutParams.kt rename to floating-window/src/main/java/org/appdevforall/codeonthego/floating/window/OverlayLayoutParams.kt index 2f68b799c9..2196b4ea21 100644 --- a/floating-window/src/main/java/com/itsaky/androidide/floating/window/OverlayLayoutParams.kt +++ b/floating-window/src/main/java/org/appdevforall/codeonthego/floating/window/OverlayLayoutParams.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.floating.window +package org.appdevforall.codeonthego.floating.window import android.graphics.PixelFormat import android.os.Build diff --git a/git-core/build.gradle.kts b/git-core/build.gradle.kts index 75cf61b01d..3e3e1d3322 100644 --- a/git-core/build.gradle.kts +++ b/git-core/build.gradle.kts @@ -4,7 +4,7 @@ plugins { } android { - namespace = "com.itsaky.androidide.git.core" + namespace = "org.appdevforall.codeonthego.git.core" } dependencies { diff --git a/git-core/src/main/java/com/itsaky/androidide/git/core/CryptoManager.kt b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/CryptoManager.kt similarity index 98% rename from git-core/src/main/java/com/itsaky/androidide/git/core/CryptoManager.kt rename to git-core/src/main/java/org/appdevforall/codeonthego/git/core/CryptoManager.kt index b206dcb2b1..cb217ddc0f 100644 --- a/git-core/src/main/java/com/itsaky/androidide/git/core/CryptoManager.kt +++ b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/CryptoManager.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.git.core +package org.appdevforall.codeonthego.git.core import android.security.keystore.KeyGenParameterSpec import android.security.keystore.KeyProperties diff --git a/git-core/src/main/java/com/itsaky/androidide/git/core/GitCredentialsManager.kt b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/GitCredentialsManager.kt similarity index 98% rename from git-core/src/main/java/com/itsaky/androidide/git/core/GitCredentialsManager.kt rename to git-core/src/main/java/org/appdevforall/codeonthego/git/core/GitCredentialsManager.kt index 707217eb38..63633e5f56 100644 --- a/git-core/src/main/java/com/itsaky/androidide/git/core/GitCredentialsManager.kt +++ b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/GitCredentialsManager.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.git.core +package org.appdevforall.codeonthego.git.core import android.content.Context import android.content.SharedPreferences diff --git a/git-core/src/main/java/com/itsaky/androidide/git/core/GitRepository.kt b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/GitRepository.kt similarity index 91% rename from git-core/src/main/java/com/itsaky/androidide/git/core/GitRepository.kt rename to git-core/src/main/java/org/appdevforall/codeonthego/git/core/GitRepository.kt index 5fc87f92f0..cce4f2112b 100644 --- a/git-core/src/main/java/com/itsaky/androidide/git/core/GitRepository.kt +++ b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/GitRepository.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.git.core +package org.appdevforall.codeonthego.git.core -import com.itsaky.androidide.git.core.models.GitBranch -import com.itsaky.androidide.git.core.models.GitCommit -import com.itsaky.androidide.git.core.models.GitStatus +import org.appdevforall.codeonthego.git.core.models.GitBranch +import org.appdevforall.codeonthego.git.core.models.GitCommit +import org.appdevforall.codeonthego.git.core.models.GitStatus import org.eclipse.jgit.api.MergeResult import org.eclipse.jgit.api.PullResult import org.eclipse.jgit.lib.ProgressMonitor diff --git a/git-core/src/main/java/com/itsaky/androidide/git/core/GitRepositoryManager.kt b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/GitRepositoryManager.kt similarity index 98% rename from git-core/src/main/java/com/itsaky/androidide/git/core/GitRepositoryManager.kt rename to git-core/src/main/java/org/appdevforall/codeonthego/git/core/GitRepositoryManager.kt index e385b405f2..37f653f266 100644 --- a/git-core/src/main/java/com/itsaky/androidide/git/core/GitRepositoryManager.kt +++ b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/GitRepositoryManager.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.git.core +package org.appdevforall.codeonthego.git.core import android.util.Log import kotlinx.coroutines.Dispatchers diff --git a/git-core/src/main/java/com/itsaky/androidide/git/core/GitRepositoryUrls.kt b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/GitRepositoryUrls.kt similarity index 95% rename from git-core/src/main/java/com/itsaky/androidide/git/core/GitRepositoryUrls.kt rename to git-core/src/main/java/org/appdevforall/codeonthego/git/core/GitRepositoryUrls.kt index a088892d92..5780753b63 100644 --- a/git-core/src/main/java/com/itsaky/androidide/git/core/GitRepositoryUrls.kt +++ b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/GitRepositoryUrls.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.git.core +package org.appdevforall.codeonthego.git.core import android.util.Log import org.eclipse.jgit.transport.URIish diff --git a/git-core/src/main/java/com/itsaky/androidide/git/core/JGitRepository.kt b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/JGitRepository.kt similarity index 97% rename from git-core/src/main/java/com/itsaky/androidide/git/core/JGitRepository.kt rename to git-core/src/main/java/org/appdevforall/codeonthego/git/core/JGitRepository.kt index e517605f9c..0cfb0be966 100644 --- a/git-core/src/main/java/com/itsaky/androidide/git/core/JGitRepository.kt +++ b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/JGitRepository.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.git.core +package org.appdevforall.codeonthego.git.core -import com.itsaky.androidide.git.core.models.ChangeType -import com.itsaky.androidide.git.core.models.FileChange -import com.itsaky.androidide.git.core.models.GitBranch -import com.itsaky.androidide.git.core.models.GitCommit -import com.itsaky.androidide.git.core.models.GitStatus +import org.appdevforall.codeonthego.git.core.models.ChangeType +import org.appdevforall.codeonthego.git.core.models.FileChange +import org.appdevforall.codeonthego.git.core.models.GitBranch +import org.appdevforall.codeonthego.git.core.models.GitCommit +import org.appdevforall.codeonthego.git.core.models.GitStatus import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock diff --git a/git-core/src/main/java/com/itsaky/androidide/git/core/models/CloneRepoUiState.kt b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/models/CloneRepoUiState.kt similarity index 94% rename from git-core/src/main/java/com/itsaky/androidide/git/core/models/CloneRepoUiState.kt rename to git-core/src/main/java/org/appdevforall/codeonthego/git/core/models/CloneRepoUiState.kt index 75dc76e09d..c6f7a786eb 100644 --- a/git-core/src/main/java/com/itsaky/androidide/git/core/models/CloneRepoUiState.kt +++ b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/models/CloneRepoUiState.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.git.core.models +package org.appdevforall.codeonthego.git.core.models import androidx.annotation.StringRes diff --git a/git-core/src/main/java/com/itsaky/androidide/git/core/models/CommitHistoryUiState.kt b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/models/CommitHistoryUiState.kt similarity index 91% rename from git-core/src/main/java/com/itsaky/androidide/git/core/models/CommitHistoryUiState.kt rename to git-core/src/main/java/org/appdevforall/codeonthego/git/core/models/CommitHistoryUiState.kt index 4a8e40bff9..82962e26a2 100644 --- a/git-core/src/main/java/com/itsaky/androidide/git/core/models/CommitHistoryUiState.kt +++ b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/models/CommitHistoryUiState.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.git.core.models +package org.appdevforall.codeonthego.git.core.models sealed interface CommitHistoryUiState { /** diff --git a/git-core/src/main/java/com/itsaky/androidide/git/core/models/FileChange.kt b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/models/FileChange.kt similarity index 86% rename from git-core/src/main/java/com/itsaky/androidide/git/core/models/FileChange.kt rename to git-core/src/main/java/org/appdevforall/codeonthego/git/core/models/FileChange.kt index 0d56ea733b..4e7d41017c 100644 --- a/git-core/src/main/java/com/itsaky/androidide/git/core/models/FileChange.kt +++ b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/models/FileChange.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.git.core.models +package org.appdevforall.codeonthego.git.core.models /** * Represents the type of change in a file tracked by Git. diff --git a/git-core/src/main/java/com/itsaky/androidide/git/core/models/GitBranch.kt b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/models/GitBranch.kt similarity index 78% rename from git-core/src/main/java/com/itsaky/androidide/git/core/models/GitBranch.kt rename to git-core/src/main/java/org/appdevforall/codeonthego/git/core/models/GitBranch.kt index c01044cc12..57f065a064 100644 --- a/git-core/src/main/java/com/itsaky/androidide/git/core/models/GitBranch.kt +++ b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/models/GitBranch.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.git.core.models +package org.appdevforall.codeonthego.git.core.models /** * Represents a Git branch. diff --git a/git-core/src/main/java/com/itsaky/androidide/git/core/models/GitCommit.kt b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/models/GitCommit.kt similarity index 84% rename from git-core/src/main/java/com/itsaky/androidide/git/core/models/GitCommit.kt rename to git-core/src/main/java/org/appdevforall/codeonthego/git/core/models/GitCommit.kt index 0d1f54cb28..5c50461b25 100644 --- a/git-core/src/main/java/com/itsaky/androidide/git/core/models/GitCommit.kt +++ b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/models/GitCommit.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.git.core.models +package org.appdevforall.codeonthego.git.core.models /** * Represents a Git commit. diff --git a/git-core/src/main/java/com/itsaky/androidide/git/core/models/GitStatus.kt b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/models/GitStatus.kt similarity index 92% rename from git-core/src/main/java/com/itsaky/androidide/git/core/models/GitStatus.kt rename to git-core/src/main/java/org/appdevforall/codeonthego/git/core/models/GitStatus.kt index 4aa57c2a84..5c9eb1474d 100644 --- a/git-core/src/main/java/com/itsaky/androidide/git/core/models/GitStatus.kt +++ b/git-core/src/main/java/org/appdevforall/codeonthego/git/core/models/GitStatus.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.git.core.models +package org.appdevforall.codeonthego.git.core.models /** * Represents the aggregate status of a Git repository. diff --git a/git-core/src/test/java/com/itsaky/androidide/git/core/GitModelsTest.kt b/git-core/src/test/java/org/appdevforall/codeonthego/git/core/GitModelsTest.kt similarity index 94% rename from git-core/src/test/java/com/itsaky/androidide/git/core/GitModelsTest.kt rename to git-core/src/test/java/org/appdevforall/codeonthego/git/core/GitModelsTest.kt index ce983a9770..7bd0028af0 100644 --- a/git-core/src/test/java/com/itsaky/androidide/git/core/GitModelsTest.kt +++ b/git-core/src/test/java/org/appdevforall/codeonthego/git/core/GitModelsTest.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.git.core +package org.appdevforall.codeonthego.git.core -import com.itsaky.androidide.git.core.models.* +import org.appdevforall.codeonthego.git.core.models.* import org.junit.Assert.* import org.junit.Test diff --git a/git-core/src/test/java/com/itsaky/androidide/git/core/GitRepositoryManagerTest.kt b/git-core/src/test/java/org/appdevforall/codeonthego/git/core/GitRepositoryManagerTest.kt similarity index 97% rename from git-core/src/test/java/com/itsaky/androidide/git/core/GitRepositoryManagerTest.kt rename to git-core/src/test/java/org/appdevforall/codeonthego/git/core/GitRepositoryManagerTest.kt index 14cb1394fb..e5e9c67a1f 100644 --- a/git-core/src/test/java/com/itsaky/androidide/git/core/GitRepositoryManagerTest.kt +++ b/git-core/src/test/java/org/appdevforall/codeonthego/git/core/GitRepositoryManagerTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.git.core +package org.appdevforall.codeonthego.git.core import io.mockk.every import io.mockk.mockkStatic diff --git a/git-core/src/test/java/com/itsaky/androidide/git/core/JGitRepositoryTest.kt b/git-core/src/test/java/org/appdevforall/codeonthego/git/core/JGitRepositoryTest.kt similarity index 99% rename from git-core/src/test/java/com/itsaky/androidide/git/core/JGitRepositoryTest.kt rename to git-core/src/test/java/org/appdevforall/codeonthego/git/core/JGitRepositoryTest.kt index 7f62367ca6..2df587b2ff 100644 --- a/git-core/src/test/java/com/itsaky/androidide/git/core/JGitRepositoryTest.kt +++ b/git-core/src/test/java/org/appdevforall/codeonthego/git/core/JGitRepositoryTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.git.core +package org.appdevforall.codeonthego.git.core import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.async diff --git a/gradle-plugin-config/src/main/java/com/itsaky/androidide/tooling/api/GradlePluginConfig.java b/gradle-plugin-config/src/main/java/org/appdevforall/codeonthego/tooling/api/GradlePluginConfig.java similarity index 98% rename from gradle-plugin-config/src/main/java/com/itsaky/androidide/tooling/api/GradlePluginConfig.java rename to gradle-plugin-config/src/main/java/org/appdevforall/codeonthego/tooling/api/GradlePluginConfig.java index 5ef74fc090..6c3f6d5352 100644 --- a/gradle-plugin-config/src/main/java/com/itsaky/androidide/tooling/api/GradlePluginConfig.java +++ b/gradle-plugin-config/src/main/java/org/appdevforall/codeonthego/tooling/api/GradlePluginConfig.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api; +package org.appdevforall.codeonthego.tooling.api; /** * Configuration options for the Gradle plugin. diff --git a/gradle-plugin-config/src/main/java/com/itsaky/androidide/tooling/api/ToolingConfig.java b/gradle-plugin-config/src/main/java/org/appdevforall/codeonthego/tooling/api/ToolingConfig.java similarity index 94% rename from gradle-plugin-config/src/main/java/com/itsaky/androidide/tooling/api/ToolingConfig.java rename to gradle-plugin-config/src/main/java/org/appdevforall/codeonthego/tooling/api/ToolingConfig.java index 18490bc6c3..32edb35f94 100644 --- a/gradle-plugin-config/src/main/java/com/itsaky/androidide/tooling/api/ToolingConfig.java +++ b/gradle-plugin-config/src/main/java/org/appdevforall/codeonthego/tooling/api/ToolingConfig.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api; +package org.appdevforall.codeonthego.tooling.api; /** * Configuration options for the Tooling API. diff --git a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/AndroidIDEGradlePlugin.kt b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/AndroidIDEGradlePlugin.kt similarity index 88% rename from gradle-plugin/src/main/java/com/itsaky/androidide/gradle/AndroidIDEGradlePlugin.kt rename to gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/AndroidIDEGradlePlugin.kt index 0a880dfeff..65e63cecc1 100644 --- a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/AndroidIDEGradlePlugin.kt +++ b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/AndroidIDEGradlePlugin.kt @@ -16,10 +16,10 @@ */ package com.itsaky.androidide.gradle -import com.itsaky.androidide.tooling.api.GradlePluginConfig.PROPERTY_JDWP_ENABLED -import com.itsaky.androidide.tooling.api.GradlePluginConfig.PROPERTY_LOG_SENDER_ENABLED -import com.itsaky.androidide.tooling.api.GradlePluginConfig.PROPERTY_PROFILEABLE_ENABLED -import com.itsaky.androidide.tooling.api.GradlePluginConfig.PROPERTY_QUICK_BUILD_ENABLED +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_JDWP_ENABLED +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_LOG_SENDER_ENABLED +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_PROFILEABLE_ENABLED +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_QUICK_BUILD_ENABLED import org.gradle.api.GradleException import org.gradle.api.Plugin import org.gradle.api.Project diff --git a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/AndroidIDEInitScriptPlugin.kt b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/AndroidIDEInitScriptPlugin.kt similarity index 100% rename from gradle-plugin/src/main/java/com/itsaky/androidide/gradle/AndroidIDEInitScriptPlugin.kt rename to gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/AndroidIDEInitScriptPlugin.kt diff --git a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/COTGSettingsPlugin.kt b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/COTGSettingsPlugin.kt similarity index 96% rename from gradle-plugin/src/main/java/com/itsaky/androidide/gradle/COTGSettingsPlugin.kt rename to gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/COTGSettingsPlugin.kt index b3ca1123b2..fa5645abde 100644 --- a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/COTGSettingsPlugin.kt +++ b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/COTGSettingsPlugin.kt @@ -1,7 +1,7 @@ package com.itsaky.androidide.gradle -import com.itsaky.androidide.tooling.api.GradlePluginConfig._PROPERTY_IS_TEST_ENV -import com.itsaky.androidide.tooling.api.GradlePluginConfig._PROPERTY_MAVEN_LOCAL_REPOSITORY +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig._PROPERTY_IS_TEST_ENV +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig._PROPERTY_MAVEN_LOCAL_REPOSITORY import org.adfa.constants.MAVEN_LOCAL_REPOSITORY import org.gradle.StartParameter import org.gradle.api.Plugin diff --git a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/JdwpPlugin.kt b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/JdwpPlugin.kt similarity index 100% rename from gradle-plugin/src/main/java/com/itsaky/androidide/gradle/JdwpPlugin.kt rename to gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/JdwpPlugin.kt diff --git a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/LogSenderPlugin.kt b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/LogSenderPlugin.kt similarity index 97% rename from gradle-plugin/src/main/java/com/itsaky/androidide/gradle/LogSenderPlugin.kt rename to gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/LogSenderPlugin.kt index 4819ca0dd9..4c9b9fb9f5 100644 --- a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/LogSenderPlugin.kt +++ b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/LogSenderPlugin.kt @@ -21,7 +21,7 @@ import com.android.build.api.component.analytics.AnalyticsEnabledApplicationVari import com.android.build.api.variant.ApplicationAndroidComponentsExtension import com.android.build.api.variant.ApplicationVariant import com.android.build.api.variant.impl.ApplicationVariantImpl -import com.itsaky.androidide.tooling.api.GradlePluginConfig.PROPERTY_LOG_SENDER_AAR +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_LOG_SENDER_AAR import org.gradle.api.GradleException import org.gradle.api.Plugin import org.gradle.api.Project diff --git a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/ProfilerPlugin.kt b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/ProfilerPlugin.kt similarity index 97% rename from gradle-plugin/src/main/java/com/itsaky/androidide/gradle/ProfilerPlugin.kt rename to gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/ProfilerPlugin.kt index 7f98842f20..6b97bb8abc 100644 --- a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/ProfilerPlugin.kt +++ b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/ProfilerPlugin.kt @@ -22,7 +22,7 @@ import javax.xml.transform.stream.StreamResult * transforming the merged manifest to contain `` under the * `` element. * - * Applied by [AndroidIDEGradlePlugin] when [com.itsaky.androidide.tooling.api.GradlePluginConfig.PROPERTY_PROFILEABLE_ENABLED] is set. + * Applied by [AndroidIDEGradlePlugin] when [org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_PROFILEABLE_ENABLED] is set. * * @author Akash Yadav */ diff --git a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/QuickBuildPlugin.kt b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/QuickBuildPlugin.kt similarity index 98% rename from gradle-plugin/src/main/java/com/itsaky/androidide/gradle/QuickBuildPlugin.kt rename to gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/QuickBuildPlugin.kt index f60eea8204..6cdb14616f 100644 --- a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/QuickBuildPlugin.kt +++ b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/QuickBuildPlugin.kt @@ -14,9 +14,9 @@ import com.itsaky.androidide.gradle.quickbuild.QuickBuildGenerateSourcesTask import com.itsaky.androidide.gradle.quickbuild.QuickBuildPayloadDexTask import com.itsaky.androidide.gradle.quickbuild.QuickBuildPayloadTransformTask import com.itsaky.androidide.gradle.quickbuild.QuickBuildProxyAppReportTask -import com.itsaky.androidide.tooling.api.GradlePluginConfig.PROPERTY_LOG_SENDER_AAR -import com.itsaky.androidide.tooling.api.GradlePluginConfig.PROPERTY_QUICK_BUILD_BASELINE_GENERATION -import com.itsaky.androidide.tooling.api.GradlePluginConfig.PROPERTY_QUICK_BUILD_RUNTIME_AAR +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_LOG_SENDER_AAR +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_QUICK_BUILD_BASELINE_GENERATION +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_QUICK_BUILD_RUNTIME_AAR import org.gradle.api.GradleException import org.gradle.api.Plugin import org.gradle.api.Project @@ -41,7 +41,7 @@ class QuickBuildPlugin : Plugin { /** The runtime's factory; instantiates components from the current payload generation. */ const val APP_COMPONENT_FACTORY = - "com.itsaky.androidide.quickbuild.runtime.QuickBuildAppComponentFactory" + "org.appdevforall.codeonthego.quickbuild.runtime.QuickBuildAppComponentFactory" /** * Floor for the payload dex, NOT the device floor: Quick Build supports API 28+ diff --git a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/common.kt b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/common.kt similarity index 97% rename from gradle-plugin/src/main/java/com/itsaky/androidide/gradle/common.kt rename to gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/common.kt index 1c216b2f69..09ed46b34f 100644 --- a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/common.kt +++ b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/common.kt @@ -21,7 +21,7 @@ import com.android.build.api.variant.ApplicationAndroidComponentsExtension import com.android.build.api.variant.ApplicationVariant import com.android.build.api.variant.Variant import com.itsaky.androidide.buildinfo.BuildInfo -import com.itsaky.androidide.tooling.api.GradlePluginConfig._PROPERTY_IS_TEST_ENV +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig._PROPERTY_IS_TEST_ENV import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.artifacts.Dependency diff --git a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/BaselineGenerationAsset.kt b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/BaselineGenerationAsset.kt similarity index 100% rename from gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/BaselineGenerationAsset.kt rename to gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/BaselineGenerationAsset.kt diff --git a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/ClassOpener.kt b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/ClassOpener.kt similarity index 100% rename from gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/ClassOpener.kt rename to gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/ClassOpener.kt diff --git a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/ComponentProxiabilityResolver.kt b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/ComponentProxiabilityResolver.kt similarity index 99% rename from gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/ComponentProxiabilityResolver.kt rename to gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/ComponentProxiabilityResolver.kt index ba9e0201f2..0e971b42fa 100644 --- a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/ComponentProxiabilityResolver.kt +++ b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/ComponentProxiabilityResolver.kt @@ -117,7 +117,7 @@ class ComponentProxiabilityResolver( "androidx.profileinstaller.ProfileInstallReceiver" to "library plumbing whose class never travels in the payload; skipping keeps it out " + "of the component list and the deploy policy's restart rule", - "com.itsaky.androidide.quickbuild.runtime.QuickBuildKeepAliveService" to + "org.appdevforall.codeonthego.quickbuild.runtime.QuickBuildKeepAliveService" to "the quick-build runtime's own keep-alive, not user code; skipping keeps it out " + "of the component list and the deploy policy's restart rule", "com.google.firebase.components.ComponentDiscoveryService" to diff --git a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/ProxySourceGenerator.kt b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/ProxySourceGenerator.kt similarity index 98% rename from gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/ProxySourceGenerator.kt rename to gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/ProxySourceGenerator.kt index 2d7184bce1..3a79ab754f 100644 --- a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/ProxySourceGenerator.kt +++ b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/ProxySourceGenerator.kt @@ -14,7 +14,7 @@ object ProxySourceGenerator { * override (see QuickBuildClassLoaders' doc for why the override is * needed at all). */ - private const val CLASS_LOADERS_CLASS = "com.itsaky.androidide.quickbuild.runtime.QuickBuildClassLoaders" + private const val CLASS_LOADERS_CLASS = "org.appdevforall.codeonthego.quickbuild.runtime.QuickBuildClassLoaders" /** * Every word Java refuses as an identifier: the reserved words plus the three literals, diff --git a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/QuickBuildJson.kt b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/QuickBuildJson.kt similarity index 100% rename from gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/QuickBuildJson.kt rename to gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/QuickBuildJson.kt diff --git a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/QuickBuildManifestTransformer.kt b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/QuickBuildManifestTransformer.kt similarity index 100% rename from gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/QuickBuildManifestTransformer.kt rename to gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/QuickBuildManifestTransformer.kt diff --git a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/QuickBuildTasks.kt b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/QuickBuildTasks.kt similarity index 99% rename from gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/QuickBuildTasks.kt rename to gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/QuickBuildTasks.kt index 5e5827b87f..046046dc55 100644 --- a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/QuickBuildTasks.kt +++ b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/QuickBuildTasks.kt @@ -219,7 +219,7 @@ abstract class QuickBuildPayloadTransformTask : DefaultTask() { val seen = HashSet() JarOutputStream(outputJar.get().asFile.outputStream()).use { out -> // A zip must contain at least one entry even when no R classes exist. - out.putNextEntry(JarEntry("META-INF/com.itsaky.androidide.quickbuild.diverted")) + out.putNextEntry(JarEntry("META-INF/org.appdevforall.codeonthego.quickbuild.diverted")) out.closeEntry() directories.forEach { dir -> diff --git a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/RuntimeClassesExtractor.kt b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/RuntimeClassesExtractor.kt similarity index 100% rename from gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/RuntimeClassesExtractor.kt rename to gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/RuntimeClassesExtractor.kt diff --git a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/SupertypeResolver.kt b/gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/SupertypeResolver.kt similarity index 100% rename from gradle-plugin/src/main/java/com/itsaky/androidide/gradle/quickbuild/SupertypeResolver.kt rename to gradle-plugin/src/main/java/org/appdevforall/codeonthego/gradle/quickbuild/SupertypeResolver.kt diff --git a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/AndroidIDEInitScriptPluginTest.kt b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/AndroidIDEInitScriptPluginTest.kt similarity index 100% rename from gradle-plugin/src/test/java/com/itsaky/androidide/gradle/AndroidIDEInitScriptPluginTest.kt rename to gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/AndroidIDEInitScriptPluginTest.kt diff --git a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/AndroidIDEPluginTest.kt b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/AndroidIDEPluginTest.kt similarity index 95% rename from gradle-plugin/src/test/java/com/itsaky/androidide/gradle/AndroidIDEPluginTest.kt rename to gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/AndroidIDEPluginTest.kt index adcba9ae01..d827a28c7c 100644 --- a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/AndroidIDEPluginTest.kt +++ b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/AndroidIDEPluginTest.kt @@ -18,7 +18,7 @@ package com.itsaky.androidide.gradle import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.tooling.api.GradlePluginConfig.PROPERTY_LOG_SENDER_ENABLED +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_LOG_SENDER_ENABLED import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test import org.junit.jupiter.api.io.TempDir diff --git a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/InitScriptClasspathTest.kt b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/InitScriptClasspathTest.kt similarity index 100% rename from gradle-plugin/src/test/java/com/itsaky/androidide/gradle/InitScriptClasspathTest.kt rename to gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/InitScriptClasspathTest.kt diff --git a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/InstallTaskReplacementTest.kt b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/InstallTaskReplacementTest.kt similarity index 97% rename from gradle-plugin/src/test/java/com/itsaky/androidide/gradle/InstallTaskReplacementTest.kt rename to gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/InstallTaskReplacementTest.kt index 495d4d406a..ed9bdbf99a 100644 --- a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/InstallTaskReplacementTest.kt +++ b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/InstallTaskReplacementTest.kt @@ -3,7 +3,7 @@ package com.itsaky.androidide.gradle import com.android.build.gradle.internal.tasks.InstallVariantTask import com.android.build.gradle.internal.tasks.UninstallTask import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.tooling.api.GradlePluginConfig.PROPERTY_LOG_SENDER_ENABLED +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_LOG_SENDER_ENABLED import org.gradle.api.DefaultTask import org.gradle.api.GradleException import org.gradle.api.Project diff --git a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/QuickBuildPluginTest.kt b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/QuickBuildPluginTest.kt similarity index 100% rename from gradle-plugin/src/test/java/com/itsaky/androidide/gradle/QuickBuildPluginTest.kt rename to gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/QuickBuildPluginTest.kt diff --git a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/QuickBuildProxyAppBuildTest.kt b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/QuickBuildProxyAppBuildTest.kt similarity index 96% rename from gradle-plugin/src/test/java/com/itsaky/androidide/gradle/QuickBuildProxyAppBuildTest.kt rename to gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/QuickBuildProxyAppBuildTest.kt index 24090db06f..fbaecdc609 100644 --- a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/QuickBuildProxyAppBuildTest.kt +++ b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/QuickBuildProxyAppBuildTest.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.gradle import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.tooling.api.GradlePluginConfig.PROPERTY_QUICK_BUILD_BASELINE_GENERATION -import com.itsaky.androidide.tooling.api.GradlePluginConfig.PROPERTY_QUICK_BUILD_ENABLED -import com.itsaky.androidide.tooling.api.GradlePluginConfig.PROPERTY_QUICK_BUILD_RUNTIME_AAR +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_QUICK_BUILD_BASELINE_GENERATION +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_QUICK_BUILD_ENABLED +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_QUICK_BUILD_RUNTIME_AAR import org.junit.jupiter.api.Test import java.io.File diff --git a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/BaselineGenerationAssetTest.kt b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/BaselineGenerationAssetTest.kt similarity index 100% rename from gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/BaselineGenerationAssetTest.kt rename to gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/BaselineGenerationAssetTest.kt diff --git a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/ClassOpenerTest.kt b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/ClassOpenerTest.kt similarity index 100% rename from gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/ClassOpenerTest.kt rename to gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/ClassOpenerTest.kt diff --git a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/ComponentProxiabilityResolverTest.kt b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/ComponentProxiabilityResolverTest.kt similarity index 100% rename from gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/ComponentProxiabilityResolverTest.kt rename to gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/ComponentProxiabilityResolverTest.kt diff --git a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/ProxySourceGeneratorTest.kt b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/ProxySourceGeneratorTest.kt similarity index 98% rename from gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/ProxySourceGeneratorTest.kt rename to gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/ProxySourceGeneratorTest.kt index f6ba1688ba..df688a9ec2 100644 --- a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/ProxySourceGeneratorTest.kt +++ b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/ProxySourceGeneratorTest.kt @@ -32,7 +32,7 @@ class ProxySourceGeneratorTest { assertThat(source).contains("public ClassLoader getClassLoader()") assertThat(source).contains( - "com.itsaky.androidide.quickbuild.runtime.QuickBuildClassLoaders" + + "org.appdevforall.codeonthego.quickbuild.runtime.QuickBuildClassLoaders" + ".forActivity(super.getClassLoader());", ) } diff --git a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/QuickBuildJsonTest.kt b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/QuickBuildJsonTest.kt similarity index 100% rename from gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/QuickBuildJsonTest.kt rename to gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/QuickBuildJsonTest.kt diff --git a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/QuickBuildManifestTransformerTest.kt b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/QuickBuildManifestTransformerTest.kt similarity index 99% rename from gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/QuickBuildManifestTransformerTest.kt rename to gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/QuickBuildManifestTransformerTest.kt index 2c766e0987..f76e8e53b9 100644 --- a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/QuickBuildManifestTransformerTest.kt +++ b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/QuickBuildManifestTransformerTest.kt @@ -11,7 +11,7 @@ import java.io.File class QuickBuildManifestTransformerTest { private val proxyPackage = "com.example.app.quickbuild.proxies" - private val factory = "com.itsaky.androidide.quickbuild.runtime.QuickBuildAppComponentFactory" + private val factory = "org.appdevforall.codeonthego.quickbuild.runtime.QuickBuildAppComponentFactory" private val proxyAppId = "com.example.app.quickbuild" private fun transformer() = QuickBuildManifestTransformer(proxyPackage, factory) @@ -475,7 +475,7 @@ class QuickBuildManifestTransformerTest { transformer.transform( manifest( launcherActivity + "\n" + - """""", ).byteInputStream(), ) @@ -489,7 +489,7 @@ class QuickBuildManifestTransformerTest { assertThat(written).contains("@mipmap/ic_launcher") // The injected (library) service is recorded like any other - uniform rule. assertThat(result.components.single { it.type == ComponentType.SERVICE }.userClass) - .isEqualTo("com.itsaky.androidide.logsender.LogSenderService") + .isEqualTo("org.appdevforall.codeonthego.logsender.LogSenderService") } /** @@ -859,7 +859,7 @@ class QuickBuildManifestTransformerTest { // cached-app freezer. Renamed to a proxy, the bind resolves to nothing, the app is // frozen ~1 min after it leaves the foreground, and every save then fails the deploy // timeout - the whole edit loop dies a minute in. - val keepAlive = "com.itsaky.androidide.quickbuild.runtime.QuickBuildKeepAliveService" + val keepAlive = "org.appdevforall.codeonthego.quickbuild.runtime.QuickBuildKeepAliveService" val result = transformer().transform( manifest( diff --git a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/QuickBuildPayloadTransformTaskTest.kt b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/QuickBuildPayloadTransformTaskTest.kt similarity index 100% rename from gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/QuickBuildPayloadTransformTaskTest.kt rename to gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/QuickBuildPayloadTransformTaskTest.kt diff --git a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/QuickBuildProxyAppReportTaskTest.kt b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/QuickBuildProxyAppReportTaskTest.kt similarity index 100% rename from gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/QuickBuildProxyAppReportTaskTest.kt rename to gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/QuickBuildProxyAppReportTaskTest.kt diff --git a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/RuntimeClassesExtractorTest.kt b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/RuntimeClassesExtractorTest.kt similarity index 100% rename from gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/RuntimeClassesExtractorTest.kt rename to gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/RuntimeClassesExtractorTest.kt diff --git a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/SupertypeResolverTest.kt b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/SupertypeResolverTest.kt similarity index 100% rename from gradle-plugin/src/test/java/com/itsaky/androidide/gradle/quickbuild/SupertypeResolverTest.kt rename to gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/quickbuild/SupertypeResolverTest.kt diff --git a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/utils.kt b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/utils.kt similarity index 96% rename from gradle-plugin/src/test/java/com/itsaky/androidide/gradle/utils.kt rename to gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/utils.kt index ade8511fd2..b5ef563da4 100644 --- a/gradle-plugin/src/test/java/com/itsaky/androidide/gradle/utils.kt +++ b/gradle-plugin/src/test/java/org/appdevforall/codeonthego/gradle/utils.kt @@ -18,9 +18,9 @@ package com.itsaky.androidide.gradle import com.itsaky.androidide.buildinfo.BuildInfo -import com.itsaky.androidide.tooling.api.GradlePluginConfig -import com.itsaky.androidide.utils.FileProvider -import com.itsaky.androidide.utils.SharedEnvironment +import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig +import org.appdevforall.codeonthego.utils.FileProvider +import org.appdevforall.codeonthego.utils.SharedEnvironment import org.gradle.testkit.runner.BuildResult import org.gradle.testkit.runner.GradleRunner import org.gradle.testkit.runner.internal.PluginUnderTestMetadataReading diff --git a/idetooltips/src/main/java/com/itsaky/androidide/idetooltips/DatabaseCorruptionException.kt b/idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/DatabaseCorruptionException.kt similarity index 86% rename from idetooltips/src/main/java/com/itsaky/androidide/idetooltips/DatabaseCorruptionException.kt rename to idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/DatabaseCorruptionException.kt index b51a4e7111..931fefd610 100644 --- a/idetooltips/src/main/java/com/itsaky/androidide/idetooltips/DatabaseCorruptionException.kt +++ b/idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/DatabaseCorruptionException.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.idetooltips +package org.appdevforall.codeonthego.idetooltips /** * Exception thrown when the database contains corrupted data. diff --git a/idetooltips/src/main/java/com/itsaky/androidide/idetooltips/DialogExtensions.kt b/idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/DialogExtensions.kt similarity index 93% rename from idetooltips/src/main/java/com/itsaky/androidide/idetooltips/DialogExtensions.kt rename to idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/DialogExtensions.kt index a27505c412..01bab0025e 100644 --- a/idetooltips/src/main/java/com/itsaky/androidide/idetooltips/DialogExtensions.kt +++ b/idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/DialogExtensions.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.idetooltips +package org.appdevforall.codeonthego.idetooltips import android.annotation.SuppressLint import android.app.Activity @@ -11,8 +11,8 @@ import android.view.inputmethod.InputMethodManager import android.widget.AdapterView import android.widget.EditText import androidx.appcompat.app.AlertDialog -import com.itsaky.androidide.utils.applyLongPressRecursively -import com.itsaky.androidide.utils.forEachViewRecursively +import org.appdevforall.codeonthego.utils.applyLongPressRecursively +import org.appdevforall.codeonthego.utils.forEachViewRecursively import androidx.appcompat.R as AndroidR private tailrec fun Context.findActivity(): Activity? = diff --git a/idetooltips/src/main/java/com/itsaky/androidide/idetooltips/IDETooltipItem.kt b/idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/IDETooltipItem.kt similarity index 95% rename from idetooltips/src/main/java/com/itsaky/androidide/idetooltips/IDETooltipItem.kt rename to idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/IDETooltipItem.kt index 7868c80b49..19bec43cd6 100644 --- a/idetooltips/src/main/java/com/itsaky/androidide/idetooltips/IDETooltipItem.kt +++ b/idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/IDETooltipItem.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.idetooltips +package org.appdevforall.codeonthego.idetooltips data class IDETooltipItem( val rowId: Int, diff --git a/idetooltips/src/main/java/com/itsaky/androidide/idetooltips/NoTooltipFoundException.kt b/idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/NoTooltipFoundException.kt similarity index 86% rename from idetooltips/src/main/java/com/itsaky/androidide/idetooltips/NoTooltipFoundException.kt rename to idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/NoTooltipFoundException.kt index 4cc0f2bb42..06cbd467f7 100644 --- a/idetooltips/src/main/java/com/itsaky/androidide/idetooltips/NoTooltipFoundException.kt +++ b/idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/NoTooltipFoundException.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.idetooltips +package org.appdevforall.codeonthego.idetooltips /** * Exception thrown when a tooltip is requested but not found in the database. diff --git a/idetooltips/src/main/java/com/itsaky/androidide/idetooltips/ToolTipManager.kt b/idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/ToolTipManager.kt similarity index 96% rename from idetooltips/src/main/java/com/itsaky/androidide/idetooltips/ToolTipManager.kt rename to idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/ToolTipManager.kt index 6e2e4de7b3..82fa88c2c6 100644 --- a/idetooltips/src/main/java/com/itsaky/androidide/idetooltips/ToolTipManager.kt +++ b/idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/ToolTipManager.kt @@ -1,5 +1,7 @@ -package com.itsaky.androidide.idetooltips +package org.appdevforall.codeonthego.idetooltips + +import com.itsaky.androidide.idetooltips.R import android.annotation.SuppressLint import android.app.Activity import android.content.Context @@ -27,13 +29,13 @@ import android.view.InputDevice import android.view.MotionEvent import androidx.appcompat.app.AlertDialog import androidx.core.content.ContextCompat.getColor -import com.itsaky.androidide.activities.editor.HelpActivity -import com.itsaky.androidide.utils.DatabaseVersionResolver -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.FeedbackManager -import com.itsaky.androidide.utils.UrlManager -import com.itsaky.androidide.utils.isSystemInDarkMode -import com.itsaky.androidide.utils.toCssHex +import org.appdevforall.codeonthego.activities.editor.HelpActivity +import org.appdevforall.codeonthego.utils.DatabaseVersionResolver +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.FeedbackManager +import org.appdevforall.codeonthego.utils.UrlManager +import org.appdevforall.codeonthego.utils.isSystemInDarkMode +import org.appdevforall.codeonthego.utils.toCssHex import com.itsaky.androidide.resources.R as ResR import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope @@ -255,7 +257,7 @@ object TooltipManager { /** * Whether a popup anchored to [view] can actually be shown right now. * - * Internal so [com.itsaky.androidide.utils.showTooltipIfPresent] can ask before it plays the + * Internal so [org.appdevforall.codeonthego.utils.showTooltipIfPresent] can ask before it plays the * long-press haptic. Asking after is too late: the buzz is the user's signal that help arrived, * and a hold that completes 800ms after its window has gone fired it for a tooltip that never * appeared. diff --git a/idetooltips/src/main/java/com/itsaky/androidide/idetooltips/TooltipCategory.kt b/idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/TooltipCategory.kt similarity index 78% rename from idetooltips/src/main/java/com/itsaky/androidide/idetooltips/TooltipCategory.kt rename to idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/TooltipCategory.kt index a9001e5a37..ff9547a8e6 100644 --- a/idetooltips/src/main/java/com/itsaky/androidide/idetooltips/TooltipCategory.kt +++ b/idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/TooltipCategory.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.idetooltips +package org.appdevforall.codeonthego.idetooltips object TooltipCategory { const val CATEGORY_IDE = "ide" diff --git a/idetooltips/src/main/java/com/itsaky/androidide/idetooltips/TooltipTag.kt b/idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/TooltipTag.kt similarity index 99% rename from idetooltips/src/main/java/com/itsaky/androidide/idetooltips/TooltipTag.kt rename to idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/TooltipTag.kt index 9b304ed645..1a54e42500 100644 --- a/idetooltips/src/main/java/com/itsaky/androidide/idetooltips/TooltipTag.kt +++ b/idetooltips/src/main/java/org/appdevforall/codeonthego/idetooltips/TooltipTag.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.idetooltips +package org.appdevforall.codeonthego.idetooltips object TooltipTag { const val BUILD_VARIANT_SIDEBAR = "project.sidebar.buildvariants" diff --git a/idetooltips/src/main/java/com/itsaky/androidide/utils/ViewUtils.kt b/idetooltips/src/main/java/org/appdevforall/codeonthego/utils/ViewUtils.kt similarity index 98% rename from idetooltips/src/main/java/com/itsaky/androidide/utils/ViewUtils.kt rename to idetooltips/src/main/java/org/appdevforall/codeonthego/utils/ViewUtils.kt index 304270eac2..9bd764c979 100644 --- a/idetooltips/src/main/java/com/itsaky/androidide/utils/ViewUtils.kt +++ b/idetooltips/src/main/java/org/appdevforall/codeonthego/utils/ViewUtils.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import android.content.Context import android.os.Handler @@ -9,8 +9,8 @@ import android.view.View import android.view.ViewConfiguration import android.view.ViewGroup import com.itsaky.androidide.idetooltips.R -import com.itsaky.androidide.idetooltips.TooltipCategory -import com.itsaky.androidide.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipCategory +import org.appdevforall.codeonthego.idetooltips.TooltipManager /** * Shows [tag]'s tooltip (under [category]) anchored to [anchor], or does nothing if [tag] is diff --git a/idetooltips/src/test/java/com/itsaky/androidide/idetooltips/GradleTaskTooltipTagTest.kt b/idetooltips/src/test/java/org/appdevforall/codeonthego/idetooltips/GradleTaskTooltipTagTest.kt similarity index 96% rename from idetooltips/src/test/java/com/itsaky/androidide/idetooltips/GradleTaskTooltipTagTest.kt rename to idetooltips/src/test/java/org/appdevforall/codeonthego/idetooltips/GradleTaskTooltipTagTest.kt index 5309177d82..29107a4549 100644 --- a/idetooltips/src/test/java/com/itsaky/androidide/idetooltips/GradleTaskTooltipTagTest.kt +++ b/idetooltips/src/test/java/org/appdevforall/codeonthego/idetooltips/GradleTaskTooltipTagTest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.idetooltips +package org.appdevforall.codeonthego.idetooltips import org.junit.Assert.assertEquals import org.junit.Test diff --git a/lexers/src/test/java/com/itsaky/androidide/lexers/BaseLexerTest.kt b/lexers/src/test/java/org/appdevforall/codeonthego/lexers/BaseLexerTest.kt similarity index 96% rename from lexers/src/test/java/com/itsaky/androidide/lexers/BaseLexerTest.kt rename to lexers/src/test/java/org/appdevforall/codeonthego/lexers/BaseLexerTest.kt index 6dd6248c49..6b490990cb 100644 --- a/lexers/src/test/java/com/itsaky/androidide/lexers/BaseLexerTest.kt +++ b/lexers/src/test/java/org/appdevforall/codeonthego/lexers/BaseLexerTest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lexers +package org.appdevforall.codeonthego.lexers import com.google.common.truth.Truth.assertThat import org.antlr.v4.runtime.CharStream diff --git a/lexers/src/test/java/com/itsaky/androidide/lexers/xml/XMLLexerTest.kt b/lexers/src/test/java/org/appdevforall/codeonthego/lexers/xml/XMLLexerTest.kt similarity index 98% rename from lexers/src/test/java/com/itsaky/androidide/lexers/xml/XMLLexerTest.kt rename to lexers/src/test/java/org/appdevforall/codeonthego/lexers/xml/XMLLexerTest.kt index 12a7566198..48b1e21c5b 100644 --- a/lexers/src/test/java/com/itsaky/androidide/lexers/xml/XMLLexerTest.kt +++ b/lexers/src/test/java/org/appdevforall/codeonthego/lexers/xml/XMLLexerTest.kt @@ -17,7 +17,7 @@ package com.itsaky.androidide.lexers.xml import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lexers.BaseLexerTest +import org.appdevforall.codeonthego.lexers.BaseLexerTest import com.itsaky.androidide.lexers.xml.XMLLexer.CLOSE import com.itsaky.androidide.lexers.xml.XMLLexer.COMMENT import com.itsaky.androidide.lexers.xml.XMLLexer.COMMENT_END diff --git a/logger/src/main/java/com/itsaky/androidide/logging/provider/IdeGlobalLogBuffer.kt b/logger/src/main/java/org/appdevforall/codeonthego/logging/provider/IdeGlobalLogBuffer.kt similarity index 98% rename from logger/src/main/java/com/itsaky/androidide/logging/provider/IdeGlobalLogBuffer.kt rename to logger/src/main/java/org/appdevforall/codeonthego/logging/provider/IdeGlobalLogBuffer.kt index f4434c4eaf..79699d5d3d 100644 --- a/logger/src/main/java/com/itsaky/androidide/logging/provider/IdeGlobalLogBuffer.kt +++ b/logger/src/main/java/org/appdevforall/codeonthego/logging/provider/IdeGlobalLogBuffer.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logging.provider +package org.appdevforall.codeonthego.logging.provider import org.slf4j.event.Level import java.util.concurrent.ConcurrentLinkedQueue diff --git a/logger/src/main/java/com/itsaky/androidide/logging/provider/IdeLogFormatter.kt b/logger/src/main/java/org/appdevforall/codeonthego/logging/provider/IdeLogFormatter.kt similarity index 97% rename from logger/src/main/java/com/itsaky/androidide/logging/provider/IdeLogFormatter.kt rename to logger/src/main/java/org/appdevforall/codeonthego/logging/provider/IdeLogFormatter.kt index acd47543d2..0cdc17dbf0 100644 --- a/logger/src/main/java/com/itsaky/androidide/logging/provider/IdeLogFormatter.kt +++ b/logger/src/main/java/org/appdevforall/codeonthego/logging/provider/IdeLogFormatter.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logging.provider +package org.appdevforall.codeonthego.logging.provider import org.slf4j.event.Level import java.time.LocalDateTime diff --git a/logger/src/main/java/com/itsaky/androidide/logging/provider/IdeLogSink.kt b/logger/src/main/java/org/appdevforall/codeonthego/logging/provider/IdeLogSink.kt similarity index 94% rename from logger/src/main/java/com/itsaky/androidide/logging/provider/IdeLogSink.kt rename to logger/src/main/java/org/appdevforall/codeonthego/logging/provider/IdeLogSink.kt index 6181190e58..4f5d9dffc1 100644 --- a/logger/src/main/java/com/itsaky/androidide/logging/provider/IdeLogSink.kt +++ b/logger/src/main/java/org/appdevforall/codeonthego/logging/provider/IdeLogSink.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logging.provider +package org.appdevforall.codeonthego.logging.provider -import com.itsaky.androidide.logging.utils.LogUtils +import org.appdevforall.codeonthego.logging.utils.LogUtils import org.slf4j.event.Level import java.util.concurrent.CopyOnWriteArrayList @@ -43,7 +43,7 @@ object IdeLogRouter { /** * System property that toggles [System.err] output in a plain JVM process (default `true`). - * Used by [com.itsaky.androidide.services.builder.ToolingServerRunner] to pass the app's + * Used by [org.appdevforall.codeonthego.services.builder.ToolingServerRunner] to pass the app's * debug-logging preference into the standalone tooling-api JVM process it launches. */ const val PROP_JVM_STDERR_ENABLED = "ide.logging.jvmStdErrAppenderEnabled" diff --git a/logger/src/main/java/com/itsaky/androidide/logging/provider/IdeLogger.kt b/logger/src/main/java/org/appdevforall/codeonthego/logging/provider/IdeLogger.kt similarity index 97% rename from logger/src/main/java/com/itsaky/androidide/logging/provider/IdeLogger.kt rename to logger/src/main/java/org/appdevforall/codeonthego/logging/provider/IdeLogger.kt index 6517b340cc..38d2b40ac7 100644 --- a/logger/src/main/java/com/itsaky/androidide/logging/provider/IdeLogger.kt +++ b/logger/src/main/java/org/appdevforall/codeonthego/logging/provider/IdeLogger.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logging.provider +package org.appdevforall.codeonthego.logging.provider import org.slf4j.Marker import org.slf4j.event.Level diff --git a/logger/src/main/java/com/itsaky/androidide/logging/provider/IdeLoggerFactory.kt b/logger/src/main/java/org/appdevforall/codeonthego/logging/provider/IdeLoggerFactory.kt similarity index 95% rename from logger/src/main/java/com/itsaky/androidide/logging/provider/IdeLoggerFactory.kt rename to logger/src/main/java/org/appdevforall/codeonthego/logging/provider/IdeLoggerFactory.kt index 359d6487d6..89bf94a7c8 100644 --- a/logger/src/main/java/com/itsaky/androidide/logging/provider/IdeLoggerFactory.kt +++ b/logger/src/main/java/org/appdevforall/codeonthego/logging/provider/IdeLoggerFactory.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logging.provider +package org.appdevforall.codeonthego.logging.provider import org.slf4j.ILoggerFactory import org.slf4j.Logger diff --git a/logger/src/main/java/com/itsaky/androidide/logging/provider/IdeSlf4jServiceProvider.kt b/logger/src/main/java/org/appdevforall/codeonthego/logging/provider/IdeSlf4jServiceProvider.kt similarity index 96% rename from logger/src/main/java/com/itsaky/androidide/logging/provider/IdeSlf4jServiceProvider.kt rename to logger/src/main/java/org/appdevforall/codeonthego/logging/provider/IdeSlf4jServiceProvider.kt index 24e5173f38..4b2de1a491 100644 --- a/logger/src/main/java/com/itsaky/androidide/logging/provider/IdeSlf4jServiceProvider.kt +++ b/logger/src/main/java/org/appdevforall/codeonthego/logging/provider/IdeSlf4jServiceProvider.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logging.provider +package org.appdevforall.codeonthego.logging.provider import com.google.auto.service.AutoService import org.slf4j.IMarkerFactory diff --git a/logger/src/main/java/com/itsaky/androidide/logging/utils/LogUtils.java b/logger/src/main/java/org/appdevforall/codeonthego/logging/utils/LogUtils.java similarity index 93% rename from logger/src/main/java/com/itsaky/androidide/logging/utils/LogUtils.java rename to logger/src/main/java/org/appdevforall/codeonthego/logging/utils/LogUtils.java index ccd94235d7..2f8e0f2e33 100644 --- a/logger/src/main/java/com/itsaky/androidide/logging/utils/LogUtils.java +++ b/logger/src/main/java/org/appdevforall/codeonthego/logging/utils/LogUtils.java @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logging.utils; +package org.appdevforall.codeonthego.logging.utils; -import com.itsaky.androidide.utils.LogTagUtils; +import org.appdevforall.codeonthego.utils.LogTagUtils; import java.util.regex.Pattern; diff --git a/logger/src/main/java/com/itsaky/androidide/utils/ILogger.java b/logger/src/main/java/org/appdevforall/codeonthego/utils/ILogger.java similarity index 92% rename from logger/src/main/java/com/itsaky/androidide/utils/ILogger.java rename to logger/src/main/java/org/appdevforall/codeonthego/utils/ILogger.java index 97a7fa4905..a65a1874c4 100644 --- a/logger/src/main/java/com/itsaky/androidide/utils/ILogger.java +++ b/logger/src/main/java/org/appdevforall/codeonthego/utils/ILogger.java @@ -1,105 +1,105 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - * - */ -package com.itsaky.androidide.utils; - -import com.itsaky.androidide.buildinfo.BuildInfo; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Logger for the IDE. - * - *

If a {@link Throwable} is passed to any of the logging methods, whole stack trace of the - * throwable is printed. Any modifications to this class will affect every log message in the IDE. - * - * @author Akash Yadav - */ -public abstract class ILogger { - - public static final Logger ROOT = LoggerFactory.getLogger(BuildInfo.PACKAGE_NAME); - - public static final String MSG_SEPARATOR = " "; // Separate messages with a space. - - protected final String TAG; - - protected boolean isEnabled = true; - - protected ILogger(String tag) { - TAG = com.itsaky.androidide.logging.utils.LogUtils.processLogTag(tag); - } - - /** - * Logging level. - */ - public enum Level { - - DEBUG('D'), - WARNING('W'), - ERROR('E'), - INFO('I'), - VERBOSE('V'); - - public final char levelChar; - - Level(char levelChar) { - this.levelChar = levelChar; - } - - public static Level forChar(char c) { - c = Character.toUpperCase(c); - if (c == 'T') { - // trace - return VERBOSE; - } - - for (Level value : values()) { - if (value.levelChar == c) { - return value; - } - } - - throw new IllegalArgumentException("Invalid level char " + c); - } - } - - /** - * A listener which can be used to listen to log events. - */ - public interface LogListener { - - void log(Level level, String tag, String message); - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + * + */ +package org.appdevforall.codeonthego.utils; + +import com.itsaky.androidide.buildinfo.BuildInfo; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Logger for the IDE. + * + *

If a {@link Throwable} is passed to any of the logging methods, whole stack trace of the + * throwable is printed. Any modifications to this class will affect every log message in the IDE. + * + * @author Akash Yadav + */ +public abstract class ILogger { + + public static final Logger ROOT = LoggerFactory.getLogger(BuildInfo.PACKAGE_NAME); + + public static final String MSG_SEPARATOR = " "; // Separate messages with a space. + + protected final String TAG; + + protected boolean isEnabled = true; + + protected ILogger(String tag) { + TAG = org.appdevforall.codeonthego.logging.utils.LogUtils.processLogTag(tag); + } + + /** + * Logging level. + */ + public enum Level { + + DEBUG('D'), + WARNING('W'), + ERROR('E'), + INFO('I'), + VERBOSE('V'); + + public final char levelChar; + + Level(char levelChar) { + this.levelChar = levelChar; + } + + public static Level forChar(char c) { + c = Character.toUpperCase(c); + if (c == 'T') { + // trace + return VERBOSE; + } + + for (Level value : values()) { + if (value.levelChar == c) { + return value; + } + } + + throw new IllegalArgumentException("Invalid level char " + c); + } + } + + /** + * A listener which can be used to listen to log events. + */ + public interface LogListener { + + void log(Level level, String tag, String message); + } +} diff --git a/logger/src/main/java/com/itsaky/androidide/utils/LogTagUtils.java b/logger/src/main/java/org/appdevforall/codeonthego/utils/LogTagUtils.java similarity index 96% rename from logger/src/main/java/com/itsaky/androidide/utils/LogTagUtils.java rename to logger/src/main/java/org/appdevforall/codeonthego/utils/LogTagUtils.java index e330ee89e1..796670dc54 100644 --- a/logger/src/main/java/com/itsaky/androidide/utils/LogTagUtils.java +++ b/logger/src/main/java/org/appdevforall/codeonthego/utils/LogTagUtils.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; /** * @author Akash Yadav diff --git a/logger/src/main/java/com/itsaky/androidide/utils/StacktraceUtils.java b/logger/src/main/java/org/appdevforall/codeonthego/utils/StacktraceUtils.java similarity index 96% rename from logger/src/main/java/com/itsaky/androidide/utils/StacktraceUtils.java rename to logger/src/main/java/org/appdevforall/codeonthego/utils/StacktraceUtils.java index f16b3b5c2e..ec50066d10 100644 --- a/logger/src/main/java/com/itsaky/androidide/utils/StacktraceUtils.java +++ b/logger/src/main/java/org/appdevforall/codeonthego/utils/StacktraceUtils.java @@ -1,101 +1,101 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.utils; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - -/** - * Utility class for {@link ILogger}. - * - * @author Akash Yadav - */ -public class StacktraceUtils { - private static final String LINE_SEP = System.getProperty("line.separator"); - - public static String getFullStackTrace(Throwable throwable) { - final List throwableList = new ArrayList<>(); - while (throwable != null && !throwableList.contains(throwable)) { - throwableList.add(throwable); - throwable = throwable.getCause(); - } - final int size = throwableList.size(); - final List frames = new ArrayList<>(); - List nextTrace = getStackFrameList(throwableList.get(size - 1)); - for (int i = size; --i >= 0; ) { - final List trace = nextTrace; - if (i != 0) { - nextTrace = getStackFrameList(throwableList.get(i - 1)); - removeCommonFrames(trace, nextTrace); - } - if (i == size - 1) { - frames.add(throwableList.get(i).toString()); - } else { - frames.add(" Caused by: " + throwableList.get(i).toString()); - } - frames.addAll(trace); - } - StringBuilder sb = new StringBuilder(); - for (final String element : frames) { - sb.append(element).append(LINE_SEP); - } - return sb.toString(); - } - - private static List getStackFrameList(final Throwable throwable) { - final StringWriter sw = new StringWriter(); - final PrintWriter pw = new PrintWriter(sw, true); - throwable.printStackTrace(pw); - final String stackTrace = sw.toString(); - final StringTokenizer frames = new StringTokenizer(stackTrace, LINE_SEP); - final List list = new ArrayList<>(); - boolean traceStarted = false; - while (frames.hasMoreTokens()) { - final String token = frames.nextToken(); - // Determine if the line starts with at - final int at = token.indexOf("at"); - if (at != -1 && token.substring(0, at).trim().isEmpty()) { - traceStarted = true; - list.add(token); - } else if (traceStarted) { - break; - } - } - return list; - } - - private static void removeCommonFrames( - final List causeFrames, final List wrapperFrames) { - int causeFrameIndex = causeFrames.size() - 1; - int wrapperFrameIndex = wrapperFrames.size() - 1; - while (causeFrameIndex >= 0 && wrapperFrameIndex >= 0) { - // Remove the frame from the cause trace if it is the same - // as in the wrapper trace - final String causeFrame = causeFrames.get(causeFrameIndex); - final String wrapperFrame = wrapperFrames.get(wrapperFrameIndex); - if (causeFrame.equals(wrapperFrame)) { - causeFrames.remove(causeFrameIndex); - } - causeFrameIndex--; - wrapperFrameIndex--; - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.utils; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + +/** + * Utility class for {@link ILogger}. + * + * @author Akash Yadav + */ +public class StacktraceUtils { + private static final String LINE_SEP = System.getProperty("line.separator"); + + public static String getFullStackTrace(Throwable throwable) { + final List throwableList = new ArrayList<>(); + while (throwable != null && !throwableList.contains(throwable)) { + throwableList.add(throwable); + throwable = throwable.getCause(); + } + final int size = throwableList.size(); + final List frames = new ArrayList<>(); + List nextTrace = getStackFrameList(throwableList.get(size - 1)); + for (int i = size; --i >= 0; ) { + final List trace = nextTrace; + if (i != 0) { + nextTrace = getStackFrameList(throwableList.get(i - 1)); + removeCommonFrames(trace, nextTrace); + } + if (i == size - 1) { + frames.add(throwableList.get(i).toString()); + } else { + frames.add(" Caused by: " + throwableList.get(i).toString()); + } + frames.addAll(trace); + } + StringBuilder sb = new StringBuilder(); + for (final String element : frames) { + sb.append(element).append(LINE_SEP); + } + return sb.toString(); + } + + private static List getStackFrameList(final Throwable throwable) { + final StringWriter sw = new StringWriter(); + final PrintWriter pw = new PrintWriter(sw, true); + throwable.printStackTrace(pw); + final String stackTrace = sw.toString(); + final StringTokenizer frames = new StringTokenizer(stackTrace, LINE_SEP); + final List list = new ArrayList<>(); + boolean traceStarted = false; + while (frames.hasMoreTokens()) { + final String token = frames.nextToken(); + // Determine if the line starts with at + final int at = token.indexOf("at"); + if (at != -1 && token.substring(0, at).trim().isEmpty()) { + traceStarted = true; + list.add(token); + } else if (traceStarted) { + break; + } + } + return list; + } + + private static void removeCommonFrames( + final List causeFrames, final List wrapperFrames) { + int causeFrameIndex = causeFrames.size() - 1; + int wrapperFrameIndex = wrapperFrames.size() - 1; + while (causeFrameIndex >= 0 && wrapperFrameIndex >= 0) { + // Remove the frame from the cause trace if it is the same + // as in the wrapper trace + final String causeFrame = causeFrames.get(causeFrameIndex); + final String wrapperFrame = wrapperFrames.get(wrapperFrameIndex); + if (causeFrame.equals(wrapperFrame)) { + causeFrames.remove(causeFrameIndex); + } + causeFrameIndex--; + wrapperFrameIndex--; + } + } +} diff --git a/logger/src/test/java/com/itsaky/androidide/logging/provider/IdeGlobalLogBufferTest.kt b/logger/src/test/java/org/appdevforall/codeonthego/logging/provider/IdeGlobalLogBufferTest.kt similarity index 98% rename from logger/src/test/java/com/itsaky/androidide/logging/provider/IdeGlobalLogBufferTest.kt rename to logger/src/test/java/org/appdevforall/codeonthego/logging/provider/IdeGlobalLogBufferTest.kt index 20819545c1..e8a58319b8 100644 --- a/logger/src/test/java/com/itsaky/androidide/logging/provider/IdeGlobalLogBufferTest.kt +++ b/logger/src/test/java/org/appdevforall/codeonthego/logging/provider/IdeGlobalLogBufferTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.logging.provider +package org.appdevforall.codeonthego.logging.provider import com.google.common.truth.Truth.assertThat import org.junit.Test diff --git a/logger/src/test/java/com/itsaky/androidide/logging/provider/IdeLogFormatterTest.kt b/logger/src/test/java/org/appdevforall/codeonthego/logging/provider/IdeLogFormatterTest.kt similarity index 82% rename from logger/src/test/java/com/itsaky/androidide/logging/provider/IdeLogFormatterTest.kt rename to logger/src/test/java/org/appdevforall/codeonthego/logging/provider/IdeLogFormatterTest.kt index 859b0f88f7..c0ccf15395 100644 --- a/logger/src/test/java/com/itsaky/androidide/logging/provider/IdeLogFormatterTest.kt +++ b/logger/src/test/java/org/appdevforall/codeonthego/logging/provider/IdeLogFormatterTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.logging.provider +package org.appdevforall.codeonthego.logging.provider import com.google.common.truth.Truth.assertThat import org.junit.Test @@ -10,7 +10,7 @@ import org.slf4j.event.Level class IdeLogFormatterTest { @Test fun `abbreviateLoggerName returns last segment of a qualified name`() { - assertThat(IdeLogFormatter.abbreviateLoggerName("com.itsaky.androidide.Foo")).isEqualTo("Foo") + assertThat(IdeLogFormatter.abbreviateLoggerName("org.appdevforall.codeonthego.Foo")).isEqualTo("Foo") } @Test @@ -20,7 +20,7 @@ class IdeLogFormatterTest { @Test fun `format includes the level, thread, tag and message`() { - val formatted = IdeLogFormatter.format(Level.WARN, "com.itsaky.androidide.Foo", "hello world") + val formatted = IdeLogFormatter.format(Level.WARN, "org.appdevforall.codeonthego.Foo", "hello world") assertThat(formatted).contains("WARN") assertThat(formatted).contains(Thread.currentThread().name) @@ -35,7 +35,7 @@ class IdeLogFormatterTest { @Test fun `format with omitMessage drops the message but keeps the header`() { - val formatted = IdeLogFormatter.format(Level.ERROR, "com.itsaky.androidide.Foo", "should not appear", omitMessage = true) + val formatted = IdeLogFormatter.format(Level.ERROR, "org.appdevforall.codeonthego.Foo", "should not appear", omitMessage = true) assertThat(formatted).doesNotContain("should not appear") assertThat(formatted).contains("ERROR") diff --git a/logger/src/test/java/com/itsaky/androidide/logging/provider/IdeLogRouterTest.kt b/logger/src/test/java/org/appdevforall/codeonthego/logging/provider/IdeLogRouterTest.kt similarity index 90% rename from logger/src/test/java/com/itsaky/androidide/logging/provider/IdeLogRouterTest.kt rename to logger/src/test/java/org/appdevforall/codeonthego/logging/provider/IdeLogRouterTest.kt index 86586f0609..5c7d66316d 100644 --- a/logger/src/test/java/com/itsaky/androidide/logging/provider/IdeLogRouterTest.kt +++ b/logger/src/test/java/org/appdevforall/codeonthego/logging/provider/IdeLogRouterTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.logging.provider +package org.appdevforall.codeonthego.logging.provider import com.google.common.truth.Truth.assertThat import org.junit.Test @@ -27,12 +27,12 @@ class IdeLogRouterTest { IdeLogRouter.addSink(sink) try { - IdeLogRouter.dispatch(Level.INFO, "com.itsaky.androidide.Foo", "hello", null) + IdeLogRouter.dispatch(Level.INFO, "org.appdevforall.codeonthego.Foo", "hello", null) } finally { IdeLogRouter.removeSink(sink) } - assertThat(received).contains(Received(Level.INFO, "com.itsaky.androidide.Foo", "hello", null)) + assertThat(received).contains(Received(Level.INFO, "org.appdevforall.codeonthego.Foo", "hello", null)) } @Test diff --git a/logger/src/test/java/com/itsaky/androidide/logging/utils/LogUtilsTest.kt b/logger/src/test/java/org/appdevforall/codeonthego/logging/utils/LogUtilsTest.kt similarity index 96% rename from logger/src/test/java/com/itsaky/androidide/logging/utils/LogUtilsTest.kt rename to logger/src/test/java/org/appdevforall/codeonthego/logging/utils/LogUtilsTest.kt index 7a8977c511..b0d8373078 100644 --- a/logger/src/test/java/com/itsaky/androidide/logging/utils/LogUtilsTest.kt +++ b/logger/src/test/java/org/appdevforall/codeonthego/logging/utils/LogUtilsTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.logging.utils +package org.appdevforall.codeonthego.logging.utils import com.google.common.truth.Truth.assertThat import org.junit.Test diff --git a/logsender-sample/src/main/java/com/itsaky/androidide/logsender/sample/MainActivity.java b/logsender-sample/src/main/java/org/appdevforall/codeonthego/logsender/sample/MainActivity.java similarity index 94% rename from logsender-sample/src/main/java/com/itsaky/androidide/logsender/sample/MainActivity.java rename to logsender-sample/src/main/java/org/appdevforall/codeonthego/logsender/sample/MainActivity.java index cbfe1ca331..8a6124b053 100644 --- a/logsender-sample/src/main/java/com/itsaky/androidide/logsender/sample/MainActivity.java +++ b/logsender-sample/src/main/java/org/appdevforall/codeonthego/logsender/sample/MainActivity.java @@ -15,7 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logsender.sample; +package org.appdevforall.codeonthego.logsender.sample; + +import com.itsaky.androidide.logsender.sample.R; import android.os.Bundle; import android.os.Handler; diff --git a/logsender/src/main/AndroidManifest.xml b/logsender/src/main/AndroidManifest.xml index e8da4ecdd3..e6cdf549b5 100644 --- a/logsender/src/main/AndroidManifest.xml +++ b/logsender/src/main/AndroidManifest.xml @@ -22,7 +22,7 @@ - + diff --git a/logsender/src/main/aidl/com/itsaky/androidide/logsender/ILogReceiver.aidl b/logsender/src/main/aidl/org/appdevforall/codeonthego/logsender/ILogReceiver.aidl similarity index 81% rename from logsender/src/main/aidl/com/itsaky/androidide/logsender/ILogReceiver.aidl rename to logsender/src/main/aidl/org/appdevforall/codeonthego/logsender/ILogReceiver.aidl index c6eae9aff1..f415b399a4 100644 --- a/logsender/src/main/aidl/com/itsaky/androidide/logsender/ILogReceiver.aidl +++ b/logsender/src/main/aidl/org/appdevforall/codeonthego/logsender/ILogReceiver.aidl @@ -1,6 +1,6 @@ -package com.itsaky.androidide.logsender; +package org.appdevforall.codeonthego.logsender; -import com.itsaky.androidide.logsender.ILogSender; +import org.appdevforall.codeonthego.logsender.ILogSender; /** * The LogReceiver interface. diff --git a/logsender/src/main/aidl/com/itsaky/androidide/logsender/ILogSender.aidl b/logsender/src/main/aidl/org/appdevforall/codeonthego/logsender/ILogSender.aidl similarity index 92% rename from logsender/src/main/aidl/com/itsaky/androidide/logsender/ILogSender.aidl rename to logsender/src/main/aidl/org/appdevforall/codeonthego/logsender/ILogSender.aidl index 0b1fa8cd3d..581fefd6fe 100644 --- a/logsender/src/main/aidl/com/itsaky/androidide/logsender/ILogSender.aidl +++ b/logsender/src/main/aidl/org/appdevforall/codeonthego/logsender/ILogSender.aidl @@ -1,4 +1,4 @@ -package com.itsaky.androidide.logsender; +package org.appdevforall.codeonthego.logsender; /** * The LogSender interface. diff --git a/logsender/src/main/java/com/itsaky/androidide/logsender/LogSender.java b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/LogSender.java similarity index 95% rename from logsender/src/main/java/com/itsaky/androidide/logsender/LogSender.java rename to logsender/src/main/java/org/appdevforall/codeonthego/logsender/LogSender.java index 361b559700..627e1ba0d6 100644 --- a/logsender/src/main/java/com/itsaky/androidide/logsender/LogSender.java +++ b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/LogSender.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logsender; +package org.appdevforall.codeonthego.logsender; import android.content.ComponentName; import android.content.Context; @@ -25,8 +25,8 @@ import android.os.Process; import android.os.RemoteException; import android.util.Log; -import com.itsaky.androidide.logsender.utils.LogReader; -import com.itsaky.androidide.logsender.utils.Logger; +import org.appdevforall.codeonthego.logsender.utils.LogReader; +import org.appdevforall.codeonthego.logsender.utils.Logger; import java.util.UUID; import java.util.concurrent.atomic.AtomicBoolean; @@ -40,7 +40,7 @@ public final class LogSender extends ILogSender.Stub implements ServiceConnectio /** * Action for the LogSender service. */ - public static final String SERVICE_ACTION = "com.itsaky.androidide.LOG_SERVICE_ACTION"; + public static final String SERVICE_ACTION = "org.appdevforall.codeonthego.LOG_SERVICE_ACTION"; /** * Constant used to indicate that the package name of the application cannot be determined. */ diff --git a/logsender/src/main/java/com/itsaky/androidide/logsender/LogSenderService.java b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/LogSenderService.java similarity index 97% rename from logsender/src/main/java/com/itsaky/androidide/logsender/LogSenderService.java rename to logsender/src/main/java/org/appdevforall/codeonthego/logsender/LogSenderService.java index 80ced1cee8..5a9b691a32 100644 --- a/logsender/src/main/java/com/itsaky/androidide/logsender/LogSenderService.java +++ b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/LogSenderService.java @@ -15,7 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logsender; +package org.appdevforall.codeonthego.logsender; + +import com.itsaky.androidide.logsender.R; import android.app.Notification; import android.app.Notification.BigTextStyle; @@ -31,7 +33,7 @@ import android.os.Build.VERSION_CODES; import android.os.IBinder; import android.widget.Toast; -import com.itsaky.androidide.logsender.utils.Logger; +import org.appdevforall.codeonthego.logsender.utils.Logger; /** * A {@link Service} which runs in the background and sends logs to AndroidIDE. diff --git a/logsender/src/main/java/com/itsaky/androidide/logsender/socket/AbstractSocketCommand.java b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/socket/AbstractSocketCommand.java similarity index 96% rename from logsender/src/main/java/com/itsaky/androidide/logsender/socket/AbstractSocketCommand.java rename to logsender/src/main/java/org/appdevforall/codeonthego/logsender/socket/AbstractSocketCommand.java index 2699285df7..f9dfe6057a 100644 --- a/logsender/src/main/java/com/itsaky/androidide/logsender/socket/AbstractSocketCommand.java +++ b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/socket/AbstractSocketCommand.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logsender.socket; +package org.appdevforall.codeonthego.logsender.socket; /** * Base class for socket commands. diff --git a/logsender/src/main/java/com/itsaky/androidide/logsender/socket/ISocketCommand.java b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/socket/ISocketCommand.java similarity index 94% rename from logsender/src/main/java/com/itsaky/androidide/logsender/socket/ISocketCommand.java rename to logsender/src/main/java/org/appdevforall/codeonthego/logsender/socket/ISocketCommand.java index e2263e4db0..3f5f50e448 100644 --- a/logsender/src/main/java/com/itsaky/androidide/logsender/socket/ISocketCommand.java +++ b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/socket/ISocketCommand.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logsender.socket; +package org.appdevforall.codeonthego.logsender.socket; import java.io.File; diff --git a/logsender/src/main/java/com/itsaky/androidide/logsender/socket/SenderInfoCommand.java b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/socket/SenderInfoCommand.java similarity index 95% rename from logsender/src/main/java/com/itsaky/androidide/logsender/socket/SenderInfoCommand.java rename to logsender/src/main/java/org/appdevforall/codeonthego/logsender/socket/SenderInfoCommand.java index 00d6bbf169..16631f63f7 100644 --- a/logsender/src/main/java/com/itsaky/androidide/logsender/socket/SenderInfoCommand.java +++ b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/socket/SenderInfoCommand.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logsender.socket; +package org.appdevforall.codeonthego.logsender.socket; /** * Command containing information about the log sender. diff --git a/logsender/src/main/java/com/itsaky/androidide/logsender/socket/SignalCommand.java b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/socket/SignalCommand.java similarity index 96% rename from logsender/src/main/java/com/itsaky/androidide/logsender/socket/SignalCommand.java rename to logsender/src/main/java/org/appdevforall/codeonthego/logsender/socket/SignalCommand.java index 5c8fda9296..821b834e15 100644 --- a/logsender/src/main/java/com/itsaky/androidide/logsender/socket/SignalCommand.java +++ b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/socket/SignalCommand.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logsender.socket; +package org.appdevforall.codeonthego.logsender.socket; import java.util.Objects; diff --git a/logsender/src/main/java/com/itsaky/androidide/logsender/socket/SocketCommandParser.java b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/socket/SocketCommandParser.java similarity index 97% rename from logsender/src/main/java/com/itsaky/androidide/logsender/socket/SocketCommandParser.java rename to logsender/src/main/java/org/appdevforall/codeonthego/logsender/socket/SocketCommandParser.java index 97bb24b953..e48bdf84aa 100644 --- a/logsender/src/main/java/com/itsaky/androidide/logsender/socket/SocketCommandParser.java +++ b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/socket/SocketCommandParser.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logsender.socket; +package org.appdevforall.codeonthego.logsender.socket; import java.util.UUID; diff --git a/logsender/src/main/java/com/itsaky/androidide/logsender/utils/LogReader.java b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/utils/LogReader.java similarity index 94% rename from logsender/src/main/java/com/itsaky/androidide/logsender/utils/LogReader.java rename to logsender/src/main/java/org/appdevforall/codeonthego/logsender/utils/LogReader.java index 62e0770c78..6debefc710 100644 --- a/logsender/src/main/java/com/itsaky/androidide/logsender/utils/LogReader.java +++ b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/utils/LogReader.java @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logsender.utils; +package org.appdevforall.codeonthego.logsender.utils; -import com.itsaky.androidide.logsender.socket.ISocketCommand; -import com.itsaky.androidide.logsender.socket.SenderInfoCommand; +import org.appdevforall.codeonthego.logsender.socket.ISocketCommand; +import org.appdevforall.codeonthego.logsender.socket.SenderInfoCommand; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; diff --git a/logsender/src/main/java/com/itsaky/androidide/logsender/utils/LogSenderInstaller.java b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/utils/LogSenderInstaller.java similarity index 92% rename from logsender/src/main/java/com/itsaky/androidide/logsender/utils/LogSenderInstaller.java rename to logsender/src/main/java/org/appdevforall/codeonthego/logsender/utils/LogSenderInstaller.java index 79520d26b4..e30cf4aab2 100644 --- a/logsender/src/main/java/com/itsaky/androidide/logsender/utils/LogSenderInstaller.java +++ b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/utils/LogSenderInstaller.java @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logsender.utils; +package org.appdevforall.codeonthego.logsender.utils; -import static com.itsaky.androidide.logsender.LogSender.PACKAGE_ANDROIDIDE; +import static org.appdevforall.codeonthego.logsender.LogSender.PACKAGE_ANDROIDIDE; import android.app.Application; import android.app.BackgroundServiceStartNotAllowedException; @@ -29,8 +29,8 @@ import android.os.Build; import android.os.Build.VERSION; import android.os.Build.VERSION_CODES; -import com.itsaky.androidide.logsender.LogSender; -import com.itsaky.androidide.logsender.LogSenderService; +import org.appdevforall.codeonthego.logsender.LogSender; +import org.appdevforall.codeonthego.logsender.LogSenderService; /** * Content providers are loaded before the application class is created. {@link LogSenderInstaller} diff --git a/logsender/src/main/java/com/itsaky/androidide/logsender/utils/Logger.java b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/utils/Logger.java similarity index 98% rename from logsender/src/main/java/com/itsaky/androidide/logsender/utils/Logger.java rename to logsender/src/main/java/org/appdevforall/codeonthego/logsender/utils/Logger.java index f6e3f28731..d562b9b90a 100644 --- a/logsender/src/main/java/com/itsaky/androidide/logsender/utils/Logger.java +++ b/logsender/src/main/java/org/appdevforall/codeonthego/logsender/utils/Logger.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.logsender.utils; +package org.appdevforall.codeonthego.logsender.utils; import android.util.Log; import java.io.PrintWriter; diff --git a/lookup/src/main/java/com/itsaky/androidide/lookup/ForwardingLookup.kt b/lookup/src/main/java/org/appdevforall/codeonthego/lookup/ForwardingLookup.kt similarity index 95% rename from lookup/src/main/java/com/itsaky/androidide/lookup/ForwardingLookup.kt rename to lookup/src/main/java/org/appdevforall/codeonthego/lookup/ForwardingLookup.kt index bafbd26efa..0b53a53378 100644 --- a/lookup/src/main/java/com/itsaky/androidide/lookup/ForwardingLookup.kt +++ b/lookup/src/main/java/org/appdevforall/codeonthego/lookup/ForwardingLookup.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lookup +package org.appdevforall.codeonthego.lookup /** * Forwards all calls to the provided lookup instance. diff --git a/lookup/src/main/java/com/itsaky/androidide/lookup/Lookup.java b/lookup/src/main/java/org/appdevforall/codeonthego/lookup/Lookup.java similarity index 98% rename from lookup/src/main/java/com/itsaky/androidide/lookup/Lookup.java rename to lookup/src/main/java/org/appdevforall/codeonthego/lookup/Lookup.java index f62383f6eb..94bda575a5 100644 --- a/lookup/src/main/java/com/itsaky/androidide/lookup/Lookup.java +++ b/lookup/src/main/java/org/appdevforall/codeonthego/lookup/Lookup.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lookup; +package org.appdevforall.codeonthego.lookup; import org.jetbrains.annotations.Nullable; diff --git a/lookup/src/main/java/com/itsaky/androidide/lookup/LookupProvider.java b/lookup/src/main/java/org/appdevforall/codeonthego/lookup/LookupProvider.java similarity index 85% rename from lookup/src/main/java/com/itsaky/androidide/lookup/LookupProvider.java rename to lookup/src/main/java/org/appdevforall/codeonthego/lookup/LookupProvider.java index e0212896ff..cf2ab5535d 100644 --- a/lookup/src/main/java/com/itsaky/androidide/lookup/LookupProvider.java +++ b/lookup/src/main/java/org/appdevforall/codeonthego/lookup/LookupProvider.java @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lookup; +package org.appdevforall.codeonthego.lookup; -import com.itsaky.androidide.lookup.internal.DefaultLookup; -import com.itsaky.androidide.utils.ServiceLoader; -import com.itsaky.androidide.utils.VMUtils; +import org.appdevforall.codeonthego.lookup.internal.DefaultLookup; +import org.appdevforall.codeonthego.utils.ServiceLoader; +import org.appdevforall.codeonthego.utils.VMUtils; /** * Provides instance of {@link Lookup}. diff --git a/lookup/src/main/java/com/itsaky/androidide/lookup/ServiceRegisteredException.java b/lookup/src/main/java/org/appdevforall/codeonthego/lookup/ServiceRegisteredException.java similarity index 95% rename from lookup/src/main/java/com/itsaky/androidide/lookup/ServiceRegisteredException.java rename to lookup/src/main/java/org/appdevforall/codeonthego/lookup/ServiceRegisteredException.java index 8a871f2d21..6439ca6d68 100644 --- a/lookup/src/main/java/com/itsaky/androidide/lookup/ServiceRegisteredException.java +++ b/lookup/src/main/java/org/appdevforall/codeonthego/lookup/ServiceRegisteredException.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lookup; +package org.appdevforall.codeonthego.lookup; /** * Thrown when a service trying to register a service and it is already registered. diff --git a/lookup/src/main/java/com/itsaky/androidide/lookup/internal/DefaultLookup.java b/lookup/src/main/java/org/appdevforall/codeonthego/lookup/internal/DefaultLookup.java similarity index 93% rename from lookup/src/main/java/com/itsaky/androidide/lookup/internal/DefaultLookup.java rename to lookup/src/main/java/org/appdevforall/codeonthego/lookup/internal/DefaultLookup.java index 5ab099a6a1..ce18a94e6c 100644 --- a/lookup/src/main/java/com/itsaky/androidide/lookup/internal/DefaultLookup.java +++ b/lookup/src/main/java/org/appdevforall/codeonthego/lookup/internal/DefaultLookup.java @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lookup.internal; +package org.appdevforall.codeonthego.lookup.internal; import androidx.annotation.VisibleForTesting; import com.google.auto.service.AutoService; -import com.itsaky.androidide.lookup.Lookup; -import com.itsaky.androidide.lookup.ServiceRegisteredException; +import org.appdevforall.codeonthego.lookup.Lookup; +import org.appdevforall.codeonthego.lookup.ServiceRegisteredException; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/lookup/src/test/java/com/itsaky/androidide/lookup/LookupTest.kt b/lookup/src/test/java/org/appdevforall/codeonthego/lookup/LookupTest.kt similarity index 93% rename from lookup/src/test/java/com/itsaky/androidide/lookup/LookupTest.kt rename to lookup/src/test/java/org/appdevforall/codeonthego/lookup/LookupTest.kt index 9ad381d197..808957435b 100644 --- a/lookup/src/test/java/com/itsaky/androidide/lookup/LookupTest.kt +++ b/lookup/src/test/java/org/appdevforall/codeonthego/lookup/LookupTest.kt @@ -14,11 +14,11 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lookup +package org.appdevforall.codeonthego.lookup import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lookup.Lookup.Key -import com.itsaky.androidide.lookup.internal.DefaultLookup +import org.appdevforall.codeonthego.lookup.Lookup.Key +import org.appdevforall.codeonthego.lookup.internal.DefaultLookup import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.JUnit4 diff --git a/lookup/src/test/java/com/itsaky/androidide/lookup/internal/DefaultLookupTest.kt b/lookup/src/test/java/org/appdevforall/codeonthego/lookup/internal/DefaultLookupTest.kt similarity index 80% rename from lookup/src/test/java/com/itsaky/androidide/lookup/internal/DefaultLookupTest.kt rename to lookup/src/test/java/org/appdevforall/codeonthego/lookup/internal/DefaultLookupTest.kt index 0b05a810af..6f22ab772e 100644 --- a/lookup/src/test/java/com/itsaky/androidide/lookup/internal/DefaultLookupTest.kt +++ b/lookup/src/test/java/org/appdevforall/codeonthego/lookup/internal/DefaultLookupTest.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.lookup.internal +package org.appdevforall.codeonthego.lookup.internal import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lookup.LookupTest.TestService -import com.itsaky.androidide.lookup.LookupTest.TestServiceImpl -import com.itsaky.androidide.lookup.ServiceRegisteredException +import org.appdevforall.codeonthego.lookup.LookupTest.TestService +import org.appdevforall.codeonthego.lookup.LookupTest.TestServiceImpl +import org.appdevforall.codeonthego.lookup.ServiceRegisteredException import org.junit.Assert.assertThrows import org.junit.Test import org.junit.runner.RunWith diff --git a/lsp/api/consumer-rules.pro b/lsp/api/consumer-rules.pro index 1b141b3b07..ba5202067a 100644 --- a/lsp/api/consumer-rules.pro +++ b/lsp/api/consumer-rules.pro @@ -1 +1 @@ --keep class com.itsaky.androidide.lsp.debug.model.ThreadState { *; } \ No newline at end of file +-keep class org.appdevforall.codeonthego.lsp.debug.model.ThreadState { *; } \ No newline at end of file diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/events/BreakpointHitEvent.kt b/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/events/BreakpointHitEvent.kt deleted file mode 100644 index 569b5c8232..0000000000 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/events/BreakpointHitEvent.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.itsaky.androidide.lsp.debug.events - -import com.itsaky.androidide.lsp.debug.RemoteClient -import com.itsaky.androidide.lsp.debug.model.HasThreadInfo -import com.itsaky.androidide.lsp.debug.model.LocatableEvent -import com.itsaky.androidide.lsp.debug.model.Location - -/** - * Parameters for when a breakpoint is hit in a target application. - * - * @author Akash Yadav - */ -data class BreakpointHitEvent( - override val remoteClient: RemoteClient, - override val threadId: String, - override val location: Location, -): EventOrResponse, LocatableEvent, HasThreadInfo - diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/actions/CommentLineAction.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/actions/CommentLineAction.kt similarity index 83% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/actions/CommentLineAction.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/actions/CommentLineAction.kt index cd5b5eff56..56b284aa2c 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/actions/CommentLineAction.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/actions/CommentLineAction.kt @@ -14,18 +14,18 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.actions +package org.appdevforall.codeonthego.lsp.actions import android.content.Context import android.graphics.drawable.Drawable -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.EditorActionItem -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.actions.requireEditor -import com.itsaky.androidide.actions.requireFile +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.EditorActionItem +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.actions.requireEditor +import org.appdevforall.codeonthego.actions.requireFile import com.itsaky.androidide.resources.R import io.github.rosemoe.sora.text.batchEdit import java.io.File diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/actions/IActionsMenuProvider.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/actions/IActionsMenuProvider.kt similarity index 89% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/actions/IActionsMenuProvider.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/actions/IActionsMenuProvider.kt index 7191a1aa40..bce484327a 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/actions/IActionsMenuProvider.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/actions/IActionsMenuProvider.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.actions +package org.appdevforall.codeonthego.lsp.actions -import com.itsaky.androidide.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionItem /** * Provides code actions for the language implementation. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/actions/SurroundWithTryCatch.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/actions/SurroundWithTryCatch.kt similarity index 93% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/actions/SurroundWithTryCatch.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/actions/SurroundWithTryCatch.kt index 7bc52473cf..ecf75bf40e 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/actions/SurroundWithTryCatch.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/actions/SurroundWithTryCatch.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.lsp.actions +package org.appdevforall.codeonthego.lsp.actions -import com.itsaky.androidide.lsp.models.TextEdit -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.lsp.models.TextEdit +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range /** * Resolves an editor selection (cursor left/right line+column) to the whole-line diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/actions/SurroundWithTryCatchAction.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/actions/SurroundWithTryCatchAction.kt similarity index 77% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/actions/SurroundWithTryCatchAction.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/actions/SurroundWithTryCatchAction.kt index d5fc107e98..e6ea345cee 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/actions/SurroundWithTryCatchAction.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/actions/SurroundWithTryCatchAction.kt @@ -1,21 +1,21 @@ -package com.itsaky.androidide.lsp.actions +package org.appdevforall.codeonthego.lsp.actions import android.content.Context import android.graphics.drawable.Drawable -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.EditorActionItem -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.actions.requireEditor -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.lsp.api.ILanguageServerRegistry -import com.itsaky.androidide.lsp.models.CodeActionItem -import com.itsaky.androidide.lsp.models.CodeActionKind -import com.itsaky.androidide.lsp.models.Command -import com.itsaky.androidide.lsp.models.DocumentChange -import com.itsaky.androidide.lsp.models.TextEdit +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.EditorActionItem +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.actions.requireEditor +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.lsp.api.ILanguageServerRegistry +import org.appdevforall.codeonthego.lsp.models.CodeActionItem +import org.appdevforall.codeonthego.lsp.models.CodeActionKind +import org.appdevforall.codeonthego.lsp.models.Command +import org.appdevforall.codeonthego.lsp.models.DocumentChange +import org.appdevforall.codeonthego.lsp.models.TextEdit import com.itsaky.androidide.resources.R import org.slf4j.LoggerFactory import java.io.File diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/actions/UncommentLineAction.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/actions/UncommentLineAction.kt similarity index 84% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/actions/UncommentLineAction.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/actions/UncommentLineAction.kt index 9a271012f6..0b5c3017c6 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/actions/UncommentLineAction.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/actions/UncommentLineAction.kt @@ -14,18 +14,18 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.actions +package org.appdevforall.codeonthego.lsp.actions import android.content.Context import android.graphics.drawable.Drawable -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.EditorActionItem -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.actions.requireEditor -import com.itsaky.androidide.actions.requireFile +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.EditorActionItem +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.actions.requireEditor +import org.appdevforall.codeonthego.actions.requireFile import com.itsaky.androidide.resources.R import io.github.rosemoe.sora.text.batchEdit import java.io.File diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/api/AbstractServiceProvider.java b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/AbstractServiceProvider.java similarity index 91% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/api/AbstractServiceProvider.java rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/AbstractServiceProvider.java index c62298e82b..c405b8dd4c 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/api/AbstractServiceProvider.java +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/AbstractServiceProvider.java @@ -14,9 +14,9 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.api; +package org.appdevforall.codeonthego.lsp.api; -import com.itsaky.androidide.lsp.util.DefaultServerSettings; +import org.appdevforall.codeonthego.lsp.util.DefaultServerSettings; /** * @author Akash Yadav diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/api/ConfigurableServiceProvider.java b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/ConfigurableServiceProvider.java similarity index 88% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/api/ConfigurableServiceProvider.java rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/ConfigurableServiceProvider.java index ec3f1f05db..8496a06a51 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/api/ConfigurableServiceProvider.java +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/ConfigurableServiceProvider.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.api; +package org.appdevforall.codeonthego.lsp.api; /** * Base class for service providers which can be configured using {@link IServerSettings}. @@ -28,7 +28,7 @@ public interface ConfigurableServiceProvider { * Apply the given settings to this service provider. * * @param settings The settings to apply. If {@code null}, {@link - * com.itsaky.androidide.lsp.util.DefaultServerSettings} should be used. + * org.appdevforall.codeonthego.lsp.util.DefaultServerSettings} should be used. */ void applySettings(IServerSettings settings); } diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/api/DefaultLanguageServerRegistry.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/DefaultLanguageServerRegistry.kt similarity index 93% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/api/DefaultLanguageServerRegistry.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/DefaultLanguageServerRegistry.kt index f9ddbb2e20..c8a4565be4 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/api/DefaultLanguageServerRegistry.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/DefaultLanguageServerRegistry.kt @@ -14,12 +14,12 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.api +package org.appdevforall.codeonthego.lsp.api -import com.itsaky.androidide.eventbus.events.project.ProjectInitializedEvent -import com.itsaky.androidide.lsp.debug.DebugClientConnectionResult -import com.itsaky.androidide.lsp.debug.IDebugClient -import com.itsaky.androidide.projects.api.Workspace +import org.appdevforall.codeonthego.eventbus.events.project.ProjectInitializedEvent +import org.appdevforall.codeonthego.lsp.debug.DebugClientConnectionResult +import org.appdevforall.codeonthego.lsp.debug.IDebugClient +import org.appdevforall.codeonthego.projects.api.Workspace import kotlinx.coroutines.CancellationException import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.Subscribe diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/api/ICompletionProvider.java b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/ICompletionProvider.java similarity index 84% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/api/ICompletionProvider.java rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/ICompletionProvider.java index a496060e8c..d89175f611 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/api/ICompletionProvider.java +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/ICompletionProvider.java @@ -1,86 +1,86 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.api; - -import androidx.annotation.NonNull; -import com.itsaky.androidide.lookup.Lookup; -import com.itsaky.androidide.lsp.models.CompletionItem; -import com.itsaky.androidide.lsp.models.CompletionParams; -import com.itsaky.androidide.lsp.models.CompletionResult; -import com.itsaky.androidide.lsp.models.CompletionsKt; -import com.itsaky.androidide.lsp.models.MatchLevel; -import com.itsaky.androidide.progress.ICancelChecker; -import java.nio.file.Files; -import java.nio.file.Path; - -/** - * A completion provider provides completions at the given line and column. - * - * @author Akash Yadav - */ -public interface ICompletionProvider { - - default boolean canComplete(Path file) { - return file != null && Files.exists(file) && !Files.isDirectory(file); - } - - /** Abort the completion process if cancelled. */ - default void abortCompletionIfCancelled() { - final var checker = Lookup.getDefault().lookup(ICancelChecker.class); - if (checker != null) { - checker.abortIfCancelled(); - } - } - - default MatchLevel matchLevel(CharSequence candidate, CharSequence partial) { - var matchRatio = CompletionsKt.DEFAULT_MIN_MATCH_RATIO; - if (this instanceof AbstractServiceProvider) { - matchRatio = ((AbstractServiceProvider) this).getSettings().completionFuzzyMatchMinRatio(); - } - - if (matchRatio < 0 || matchRatio > 100) matchRatio = CompletionsKt.DEFAULT_MIN_MATCH_RATIO; - - return CompletionItem.matchLevel(candidate.toString(), partial.toString(), matchRatio); - } - - /** - * Compute completions using the given params and return the given completion result. - * - * @param params The params that can be used to compute completion items. - * @return The completion result. Must not be null. - */ - @NonNull - CompletionResult complete(CompletionParams params); -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.api; + +import androidx.annotation.NonNull; +import org.appdevforall.codeonthego.lookup.Lookup; +import org.appdevforall.codeonthego.lsp.models.CompletionItem; +import org.appdevforall.codeonthego.lsp.models.CompletionParams; +import org.appdevforall.codeonthego.lsp.models.CompletionResult; +import org.appdevforall.codeonthego.lsp.models.CompletionsKt; +import org.appdevforall.codeonthego.lsp.models.MatchLevel; +import org.appdevforall.codeonthego.progress.ICancelChecker; +import java.nio.file.Files; +import java.nio.file.Path; + +/** + * A completion provider provides completions at the given line and column. + * + * @author Akash Yadav + */ +public interface ICompletionProvider { + + default boolean canComplete(Path file) { + return file != null && Files.exists(file) && !Files.isDirectory(file); + } + + /** Abort the completion process if cancelled. */ + default void abortCompletionIfCancelled() { + final var checker = Lookup.getDefault().lookup(ICancelChecker.class); + if (checker != null) { + checker.abortIfCancelled(); + } + } + + default MatchLevel matchLevel(CharSequence candidate, CharSequence partial) { + var matchRatio = CompletionsKt.DEFAULT_MIN_MATCH_RATIO; + if (this instanceof AbstractServiceProvider) { + matchRatio = ((AbstractServiceProvider) this).getSettings().completionFuzzyMatchMinRatio(); + } + + if (matchRatio < 0 || matchRatio > 100) matchRatio = CompletionsKt.DEFAULT_MIN_MATCH_RATIO; + + return CompletionItem.matchLevel(candidate.toString(), partial.toString(), matchRatio); + } + + /** + * Compute completions using the given params and return the given completion result. + * + * @param params The params that can be used to compute completion items. + * @return The completion result. Must not be null. + */ + @NonNull + CompletionResult complete(CompletionParams params); +} diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/api/ILanguageClient.java b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/ILanguageClient.java similarity index 85% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/api/ILanguageClient.java rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/ILanguageClient.java index c693fb5e7b..8cc6b99ee0 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/api/ILanguageClient.java +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/ILanguageClient.java @@ -15,19 +15,19 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.api; +package org.appdevforall.codeonthego.lsp.api; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.itsaky.androidide.lsp.debug.IDebugClient; -import com.itsaky.androidide.lsp.models.CodeActionItem; -import com.itsaky.androidide.lsp.models.DiagnosticItem; -import com.itsaky.androidide.lsp.models.DiagnosticResult; -import com.itsaky.androidide.lsp.models.PerformCodeActionParams; -import com.itsaky.androidide.lsp.models.ShowDocumentParams; -import com.itsaky.androidide.lsp.models.ShowDocumentResult; -import com.itsaky.androidide.models.Location; -import com.itsaky.androidide.models.Range; +import org.appdevforall.codeonthego.lsp.debug.IDebugClient; +import org.appdevforall.codeonthego.lsp.models.CodeActionItem; +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem; +import org.appdevforall.codeonthego.lsp.models.DiagnosticResult; +import org.appdevforall.codeonthego.lsp.models.PerformCodeActionParams; +import org.appdevforall.codeonthego.lsp.models.ShowDocumentParams; +import org.appdevforall.codeonthego.lsp.models.ShowDocumentResult; +import org.appdevforall.codeonthego.models.Location; +import org.appdevforall.codeonthego.models.Range; import java.io.File; import java.util.Collections; import java.util.List; diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/api/ILanguageServer.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/ILanguageServer.kt similarity index 80% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/api/ILanguageServer.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/ILanguageServer.kt index 2e0cd7e558..8d499d7fd5 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/api/ILanguageServer.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/ILanguageServer.kt @@ -14,26 +14,26 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.api - -import com.itsaky.androidide.lsp.debug.DebugClientConnectionResult -import com.itsaky.androidide.lsp.debug.IDebugAdapter -import com.itsaky.androidide.lsp.debug.IDebugClient -import com.itsaky.androidide.lsp.models.CodeFormatResult -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.DefinitionParams -import com.itsaky.androidide.lsp.models.DefinitionResult -import com.itsaky.androidide.lsp.models.DiagnosticResult -import com.itsaky.androidide.lsp.models.ExpandSelectionParams -import com.itsaky.androidide.lsp.models.FormatCodeParams -import com.itsaky.androidide.lsp.models.LSPFailure -import com.itsaky.androidide.lsp.models.ReferenceParams -import com.itsaky.androidide.lsp.models.ReferenceResult -import com.itsaky.androidide.lsp.models.SignatureHelp -import com.itsaky.androidide.lsp.models.SignatureHelpParams -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.projects.api.Workspace +package org.appdevforall.codeonthego.lsp.api + +import org.appdevforall.codeonthego.lsp.debug.DebugClientConnectionResult +import org.appdevforall.codeonthego.lsp.debug.IDebugAdapter +import org.appdevforall.codeonthego.lsp.debug.IDebugClient +import org.appdevforall.codeonthego.lsp.models.CodeFormatResult +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.DefinitionParams +import org.appdevforall.codeonthego.lsp.models.DefinitionResult +import org.appdevforall.codeonthego.lsp.models.DiagnosticResult +import org.appdevforall.codeonthego.lsp.models.ExpandSelectionParams +import org.appdevforall.codeonthego.lsp.models.FormatCodeParams +import org.appdevforall.codeonthego.lsp.models.LSPFailure +import org.appdevforall.codeonthego.lsp.models.ReferenceParams +import org.appdevforall.codeonthego.lsp.models.ReferenceResult +import org.appdevforall.codeonthego.lsp.models.SignatureHelp +import org.appdevforall.codeonthego.lsp.models.SignatureHelpParams +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.projects.api.Workspace import java.nio.file.Path /** @@ -107,7 +107,7 @@ interface ILanguageServer { /** * Setup this language server with the given project. Servers are not expected to keep a reference * to the provided project. Instead, use - * [getRootProject()][com.itsaky.androidide.projects.IProjectManager.workspace] to + * [getRootProject()][org.appdevforall.codeonthego.projects.IProjectManager.workspace] to * obtain the project instance. * * @param workspace The initialized project. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/api/ILanguageServerRegistry.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/ILanguageServerRegistry.kt similarity index 92% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/api/ILanguageServerRegistry.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/ILanguageServerRegistry.kt index acd4c84323..c7c9b53018 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/api/ILanguageServerRegistry.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/ILanguageServerRegistry.kt @@ -14,10 +14,10 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.api +package org.appdevforall.codeonthego.lsp.api -import com.itsaky.androidide.lsp.debug.DebugClientConnectionResult -import com.itsaky.androidide.lsp.debug.IDebugClient +import org.appdevforall.codeonthego.lsp.debug.DebugClientConnectionResult +import org.appdevforall.codeonthego.lsp.debug.IDebugClient /** * A language server registry which keeps track of registered language servers. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/api/IServerSettings.java b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/IServerSettings.java similarity index 94% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/api/IServerSettings.java rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/IServerSettings.java index 1fa269dd33..cf500ae177 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/api/IServerSettings.java +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/IServerSettings.java @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.api; +package org.appdevforall.codeonthego.lsp.api; -import com.itsaky.androidide.lsp.models.CompletionsKt; -import com.itsaky.androidide.preferences.internal.EditorPreferences; +import org.appdevforall.codeonthego.lsp.models.CompletionsKt; +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences; /** * Settings contain preferences for the language server. Clients can use settings to enable/disable diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/api/helpers.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/helpers.kt similarity index 90% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/api/helpers.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/helpers.kt index 398b40b97c..2c10c35405 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/api/helpers.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/api/helpers.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.api +package org.appdevforall.codeonthego.lsp.api -import com.itsaky.androidide.lsp.models.SnippetDescription +import org.appdevforall.codeonthego.lsp.models.SnippetDescription import io.github.rosemoe.sora.lang.completion.snippet.CodeSnippet @JvmOverloads diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/DebugClientConnectionResult.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/DebugClientConnectionResult.kt similarity index 91% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/DebugClientConnectionResult.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/DebugClientConnectionResult.kt index 39bb5aec26..c698424413 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/DebugClientConnectionResult.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/DebugClientConnectionResult.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.debug +package org.appdevforall.codeonthego.lsp.debug import androidx.annotation.StringRes diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/IDebugAdapter.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/IDebugAdapter.kt similarity index 80% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/IDebugAdapter.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/IDebugAdapter.kt index 9870313fa4..69749609be 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/IDebugAdapter.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/IDebugAdapter.kt @@ -1,13 +1,13 @@ -package com.itsaky.androidide.lsp.debug +package org.appdevforall.codeonthego.lsp.debug -import com.itsaky.androidide.lsp.debug.model.BreakpointRequest -import com.itsaky.androidide.lsp.debug.model.BreakpointResponse -import com.itsaky.androidide.lsp.debug.model.StepRequestParams -import com.itsaky.androidide.lsp.debug.model.StepResponse -import com.itsaky.androidide.lsp.debug.model.ThreadInfoRequestParams -import com.itsaky.androidide.lsp.debug.model.ThreadInfoResponse -import com.itsaky.androidide.lsp.debug.model.ThreadListRequestParams -import com.itsaky.androidide.lsp.debug.model.ThreadListResponse +import org.appdevforall.codeonthego.lsp.debug.model.BreakpointRequest +import org.appdevforall.codeonthego.lsp.debug.model.BreakpointResponse +import org.appdevforall.codeonthego.lsp.debug.model.StepRequestParams +import org.appdevforall.codeonthego.lsp.debug.model.StepResponse +import org.appdevforall.codeonthego.lsp.debug.model.ThreadInfoRequestParams +import org.appdevforall.codeonthego.lsp.debug.model.ThreadInfoResponse +import org.appdevforall.codeonthego.lsp.debug.model.ThreadListRequestParams +import org.appdevforall.codeonthego.lsp.debug.model.ThreadListResponse /** * A debug adapter provides support for debugging a given type of file. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/IDebugClient.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/IDebugClient.kt similarity index 91% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/IDebugClient.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/IDebugClient.kt index 640b8606e3..6a75104958 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/IDebugClient.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/IDebugClient.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.debug +package org.appdevforall.codeonthego.lsp.debug /** * Represents a debugger client, usually the IDE. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/IDebugEventHandler.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/IDebugEventHandler.kt similarity index 68% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/IDebugEventHandler.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/IDebugEventHandler.kt index 1d27642b9e..d9334cfd7e 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/IDebugEventHandler.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/IDebugEventHandler.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.lsp.debug +package org.appdevforall.codeonthego.lsp.debug -import com.itsaky.androidide.lsp.debug.events.BreakpointHitEvent -import com.itsaky.androidide.lsp.debug.events.StepEvent -import com.itsaky.androidide.lsp.debug.events.StepEventResponse +import org.appdevforall.codeonthego.lsp.debug.events.BreakpointHitEvent +import org.appdevforall.codeonthego.lsp.debug.events.StepEvent +import org.appdevforall.codeonthego.lsp.debug.events.StepEventResponse /** * A debug event handler consumes debug events for debugging applications. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/RemoteClient.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/RemoteClient.kt similarity index 96% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/RemoteClient.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/RemoteClient.kt index 00c23f1186..1fd5d52f1c 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/RemoteClient.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/RemoteClient.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.debug +package org.appdevforall.codeonthego.lsp.debug /** * Metadata about the remove client being debugged. diff --git a/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/events/BreakpointHitEvent.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/events/BreakpointHitEvent.kt new file mode 100644 index 0000000000..5fb7a21f6a --- /dev/null +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/events/BreakpointHitEvent.kt @@ -0,0 +1,18 @@ +package org.appdevforall.codeonthego.lsp.debug.events + +import org.appdevforall.codeonthego.lsp.debug.RemoteClient +import org.appdevforall.codeonthego.lsp.debug.model.HasThreadInfo +import org.appdevforall.codeonthego.lsp.debug.model.LocatableEvent +import org.appdevforall.codeonthego.lsp.debug.model.Location + +/** + * Parameters for when a breakpoint is hit in a target application. + * + * @author Akash Yadav + */ +data class BreakpointHitEvent( + override val remoteClient: RemoteClient, + override val threadId: String, + override val location: Location, +): EventOrResponse, LocatableEvent, HasThreadInfo + diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/events/EventOrResponse.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/events/EventOrResponse.kt similarity index 76% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/events/EventOrResponse.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/events/EventOrResponse.kt index 0b276382e8..22cbc7933c 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/events/EventOrResponse.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/events/EventOrResponse.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.debug.events +package org.appdevforall.codeonthego.lsp.debug.events -import com.itsaky.androidide.lsp.debug.RemoteClient +import org.appdevforall.codeonthego.lsp.debug.RemoteClient /** * An event or response to a debugger event. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/events/StepEvent.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/events/StepEvent.kt similarity index 52% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/events/StepEvent.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/events/StepEvent.kt index 63c20364d0..e15fe5f76f 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/events/StepEvent.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/events/StepEvent.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.lsp.debug.events +package org.appdevforall.codeonthego.lsp.debug.events -import com.itsaky.androidide.lsp.debug.RemoteClient -import com.itsaky.androidide.lsp.debug.model.HasThreadInfo -import com.itsaky.androidide.lsp.debug.model.LocatableEvent -import com.itsaky.androidide.lsp.debug.model.Location +import org.appdevforall.codeonthego.lsp.debug.RemoteClient +import org.appdevforall.codeonthego.lsp.debug.model.HasThreadInfo +import org.appdevforall.codeonthego.lsp.debug.model.LocatableEvent +import org.appdevforall.codeonthego.lsp.debug.model.Location /** * Describes a step event in a client. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/events/StoppedEvent.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/events/StoppedEvent.kt similarity index 87% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/events/StoppedEvent.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/events/StoppedEvent.kt index 8d232e6f6b..f377dcd4b0 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/events/StoppedEvent.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/events/StoppedEvent.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.debug.events +package org.appdevforall.codeonthego.lsp.debug.events -import com.itsaky.androidide.lsp.debug.RemoteClient +import org.appdevforall.codeonthego.lsp.debug.RemoteClient /** * An event notifying the debug client that the execution of the program has been stopped. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/BreakpointRequest.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/BreakpointRequest.kt similarity index 96% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/BreakpointRequest.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/BreakpointRequest.kt index 32cb48d2e3..1959c72cda 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/BreakpointRequest.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/BreakpointRequest.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.lsp.debug.model +package org.appdevforall.codeonthego.lsp.debug.model import com.google.gson.annotations.SerializedName -import com.itsaky.androidide.lsp.debug.RemoteClient +import org.appdevforall.codeonthego.lsp.debug.RemoteClient enum class SuspendPolicy { /** diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/BreakpointResponse.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/BreakpointResponse.kt similarity index 95% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/BreakpointResponse.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/BreakpointResponse.kt index 99c150846a..0ca4ccf097 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/BreakpointResponse.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/BreakpointResponse.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.debug.model +package org.appdevforall.codeonthego.lsp.debug.model /** * Result of a single breakpoint request. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/DapRequest.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/DapRequest.kt similarity index 66% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/DapRequest.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/DapRequest.kt index 385d961d51..959b3a786f 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/DapRequest.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/DapRequest.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.debug.model +package org.appdevforall.codeonthego.lsp.debug.model -import com.itsaky.androidide.lsp.debug.RemoteClient +import org.appdevforall.codeonthego.lsp.debug.RemoteClient /** * Base interface for all Debug Adapter Protocol (DAP) requests. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/DapResponse.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/DapResponse.kt similarity index 69% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/DapResponse.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/DapResponse.kt index 19765dc83c..e804c23aa6 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/DapResponse.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/DapResponse.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.debug.model +package org.appdevforall.codeonthego.lsp.debug.model /** * Base interface for all Debug Adapter Protocol (DAP) responses. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/Location.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/Location.kt similarity index 88% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/Location.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/Location.kt index 9fab997899..5d7ba64ac6 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/Location.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/Location.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.debug.model +package org.appdevforall.codeonthego.lsp.debug.model /** * An event that has a location. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/Source.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/Source.kt similarity index 81% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/Source.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/Source.kt index a24566bb32..a39a37424d 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/Source.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/Source.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.debug.model +package org.appdevforall.codeonthego.lsp.debug.model /** * Data about a source file. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/StepRequest.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/StepRequest.kt similarity index 77% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/StepRequest.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/StepRequest.kt index 058e548caa..605877d9b7 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/StepRequest.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/StepRequest.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.debug.model +package org.appdevforall.codeonthego.lsp.debug.model -import com.itsaky.androidide.lsp.debug.RemoteClient +import org.appdevforall.codeonthego.lsp.debug.RemoteClient /** * The type of step request. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/StepResponse.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/StepResponse.kt similarity index 91% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/StepResponse.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/StepResponse.kt index 7f492e7cfa..f730212b31 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/StepResponse.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/StepResponse.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.debug.model +package org.appdevforall.codeonthego.lsp.debug.model /** * Result of a [StepResponse]. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/ThreadInfo.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/ThreadInfo.kt similarity index 97% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/ThreadInfo.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/ThreadInfo.kt index e52e4f92ff..0674eff0b1 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/ThreadInfo.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/ThreadInfo.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.debug.model +package org.appdevforall.codeonthego.lsp.debug.model import java.util.Stack diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/ThreadInfoRequest.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/ThreadInfoRequest.kt similarity index 91% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/ThreadInfoRequest.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/ThreadInfoRequest.kt index 313249656e..fa968756c2 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/ThreadInfoRequest.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/ThreadInfoRequest.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.debug.model +package org.appdevforall.codeonthego.lsp.debug.model -import com.itsaky.androidide.lsp.debug.RemoteClient +import org.appdevforall.codeonthego.lsp.debug.RemoteClient /** * Result in a [ThreadInfoResponse]. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/Variables.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/Variables.kt similarity index 98% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/Variables.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/Variables.kt index 3fee2fabbf..52aa58eadb 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/model/Variables.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/model/Variables.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.debug.model +package org.appdevforall.codeonthego.lsp.debug.model /** * The kind of [Variable]. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/utils/BreakpointNotFoundException.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/utils/BreakpointNotFoundException.kt similarity index 81% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/utils/BreakpointNotFoundException.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/utils/BreakpointNotFoundException.kt index 44d6789681..f84bdfe57b 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/debug/utils/BreakpointNotFoundException.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/debug/utils/BreakpointNotFoundException.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.debug.utils +package org.appdevforall.codeonthego.lsp.debug.utils /** * Thrown/returned when the debug adapter cannot find a given breakpoint. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/internal/model/CachedCompletion.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/internal/model/CachedCompletion.kt similarity index 84% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/internal/model/CachedCompletion.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/internal/model/CachedCompletion.kt index bac6e94097..5c6cf8c786 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/internal/model/CachedCompletion.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/internal/model/CachedCompletion.kt @@ -1,114 +1,114 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.internal.model - -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.progress.ICancelChecker -import com.itsaky.androidide.utils.DocumentUtils -import org.slf4j.LoggerFactory -import java.nio.file.Paths - -/** - * Cached version of a completion result. Keeps only required properties from [params]. - * - * @author Akash Yadav - */ -class CachedCompletion -private constructor( - val params: CompletionParams, - val result: com.itsaky.androidide.lsp.models.CompletionResult -) { - - companion object { - - private val log = LoggerFactory.getLogger(CachedCompletion::class.java) - - /** Empty cached completion. Could be used to represent "no cache available". */ - @JvmField - val EMPTY = - cache( - CompletionParams( - com.itsaky.androidide.models.Position.NONE, - Paths.get(""), ICancelChecker.CANCELLED - ), - com.itsaky.androidide.lsp.models.CompletionResult.EMPTY - ) - - /** - * Creates cached version of the result from the given params and result. - * - * @param _params The [CompletionParams] used to trigger the completion request. A shallow copy - * of this request is created. - * @param result The result of the completion to cache. - */ - @JvmStatic - fun cache( - _params: CompletionParams, - result: com.itsaky.androidide.lsp.models.CompletionResult - ): CachedCompletion { - val params = - CompletionParams(_params.position, _params.file, ICancelChecker.CANCELLED).apply { - prefix = _params.prefix ?: "" - content = "" - } - - return CachedCompletion(params, result) - } - } - - fun canUseCache(params: CompletionParams): Boolean { - val partial = params.requirePrefix() - val position = this.params.position - val file = this.params.file - val prefix = this.params.requirePrefix() - - // The change in the length of the prefix - val deltaPrefix = prefix.length - params.prefix!!.length - - // The change in the column index - val deltaColumn = position.column - params.position.column - - // The changes must be of same length - if (deltaPrefix != deltaColumn) { - log.info("...unequal change in prefix and column") - return false - } - - if (position.line == -1 || position.column == -1) { - log.info("...invalid cached completion position") - return false - } - - if (position.line != params.position.line || position.column > params.position.column) { - log.info("...cursor line changed") - return false - } - - if (!DocumentUtils.isSameFile(file, params.file)) { - log.info("...no cache available for current file") - return false - } - - if (!partial.startsWith(prefix) || partial.endsWith(".")) { - log.info("...incompatible partial identifier") - return false - } - - return true - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.internal.model + +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.progress.ICancelChecker +import org.appdevforall.codeonthego.utils.DocumentUtils +import org.slf4j.LoggerFactory +import java.nio.file.Paths + +/** + * Cached version of a completion result. Keeps only required properties from [params]. + * + * @author Akash Yadav + */ +class CachedCompletion +private constructor( + val params: CompletionParams, + val result: org.appdevforall.codeonthego.lsp.models.CompletionResult +) { + + companion object { + + private val log = LoggerFactory.getLogger(CachedCompletion::class.java) + + /** Empty cached completion. Could be used to represent "no cache available". */ + @JvmField + val EMPTY = + cache( + CompletionParams( + org.appdevforall.codeonthego.models.Position.NONE, + Paths.get(""), ICancelChecker.CANCELLED + ), + org.appdevforall.codeonthego.lsp.models.CompletionResult.EMPTY + ) + + /** + * Creates cached version of the result from the given params and result. + * + * @param _params The [CompletionParams] used to trigger the completion request. A shallow copy + * of this request is created. + * @param result The result of the completion to cache. + */ + @JvmStatic + fun cache( + _params: CompletionParams, + result: org.appdevforall.codeonthego.lsp.models.CompletionResult + ): CachedCompletion { + val params = + CompletionParams(_params.position, _params.file, ICancelChecker.CANCELLED).apply { + prefix = _params.prefix ?: "" + content = "" + } + + return CachedCompletion(params, result) + } + } + + fun canUseCache(params: CompletionParams): Boolean { + val partial = params.requirePrefix() + val position = this.params.position + val file = this.params.file + val prefix = this.params.requirePrefix() + + // The change in the length of the prefix + val deltaPrefix = prefix.length - params.prefix!!.length + + // The change in the column index + val deltaColumn = position.column - params.position.column + + // The changes must be of same length + if (deltaPrefix != deltaColumn) { + log.info("...unequal change in prefix and column") + return false + } + + if (position.line == -1 || position.column == -1) { + log.info("...invalid cached completion position") + return false + } + + if (position.line != params.position.line || position.column > params.position.column) { + log.info("...cursor line changed") + return false + } + + if (!DocumentUtils.isSameFile(file, params.file)) { + log.info("...no cache available for current file") + return false + } + + if (!partial.startsWith(prefix) || partial.endsWith(".")) { + log.info("...incompatible partial identifier") + return false + } + + return true + } +} diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/DefaultSnippet.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/DefaultSnippet.kt similarity index 96% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/DefaultSnippet.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/DefaultSnippet.kt index 46cdb0cc9a..5ca8f417c3 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/DefaultSnippet.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/DefaultSnippet.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.snippets +package org.appdevforall.codeonthego.lsp.snippets /** * Java snippet. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/ISnippet.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/ISnippet.kt similarity index 95% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/ISnippet.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/ISnippet.kt index 2d9cfb208c..6db1768b93 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/ISnippet.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/ISnippet.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.snippets +package org.appdevforall.codeonthego.lsp.snippets /** * A snippet item. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/ISnippetScope.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/ISnippetScope.kt similarity index 95% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/ISnippetScope.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/ISnippetScope.kt index 5bd00e67a4..2e77825ea3 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/ISnippetScope.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/ISnippetScope.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.snippets +package org.appdevforall.codeonthego.lsp.snippets /** * Marker interface for snippet scopes. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/SnippetLanguage.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/SnippetLanguage.kt similarity index 88% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/SnippetLanguage.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/SnippetLanguage.kt index 6e9c9d5a4c..8d5103fc52 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/SnippetLanguage.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/SnippetLanguage.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.snippets +package org.appdevforall.codeonthego.lsp.snippets enum class SnippetLanguage( val id: String, diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/SnippetParser.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/SnippetParser.kt similarity index 94% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/SnippetParser.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/SnippetParser.kt index d8d825c672..665fba61c0 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/SnippetParser.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/SnippetParser.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.snippets +package org.appdevforall.codeonthego.lsp.snippets import com.google.gson.JsonParseException import com.google.gson.stream.JsonReader -import com.itsaky.androidide.app.BaseApplication -import com.itsaky.androidide.tasks.executeAsyncProvideError -import com.itsaky.androidide.utils.VMUtils +import org.appdevforall.codeonthego.app.BaseApplication +import org.appdevforall.codeonthego.tasks.executeAsyncProvideError +import org.appdevforall.codeonthego.utils.VMUtils import org.slf4j.LoggerFactory import java.io.IOException import java.io.Reader diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/SnippetRegistry.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/SnippetRegistry.kt similarity index 97% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/SnippetRegistry.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/SnippetRegistry.kt index 993e84e289..4b99d52df6 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/SnippetRegistry.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/SnippetRegistry.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.snippets +package org.appdevforall.codeonthego.lsp.snippets import java.util.concurrent.locks.ReentrantReadWriteLock import kotlin.concurrent.read diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/UserSnippetLoader.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/UserSnippetLoader.kt similarity index 91% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/UserSnippetLoader.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/UserSnippetLoader.kt index 38e9af7f77..ba0bec7ff7 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/snippets/UserSnippetLoader.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/snippets/UserSnippetLoader.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.lsp.snippets +package org.appdevforall.codeonthego.lsp.snippets import com.google.gson.JsonParseException -import com.itsaky.androidide.utils.Environment +import org.appdevforall.codeonthego.utils.Environment import org.slf4j.LoggerFactory import java.io.File import java.io.IOException diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/util/DefaultServerSettings.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/DefaultServerSettings.kt similarity index 92% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/util/DefaultServerSettings.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/DefaultServerSettings.kt index a893b71bec..82738373a2 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/util/DefaultServerSettings.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/DefaultServerSettings.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.util +package org.appdevforall.codeonthego.lsp.util -import com.itsaky.androidide.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.api.IServerSettings /** * Default settings for a language server. diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/util/DiagnosticUtil.java b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/DiagnosticUtil.java similarity index 94% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/util/DiagnosticUtil.java rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/DiagnosticUtil.java index 604e127a85..9a7031319e 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/util/DiagnosticUtil.java +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/DiagnosticUtil.java @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.util; +package org.appdevforall.codeonthego.lsp.util; import androidx.annotation.NonNull; -import com.itsaky.androidide.lsp.models.DiagnosticItem; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/util/DocumentationReferenceProvider.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/DocumentationReferenceProvider.kt similarity index 87% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/util/DocumentationReferenceProvider.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/DocumentationReferenceProvider.kt index 726b88b311..45ca9c10cb 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/util/DocumentationReferenceProvider.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/DocumentationReferenceProvider.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.util +package org.appdevforall.codeonthego.lsp.util -import com.itsaky.androidide.lsp.models.ClassCompletionData -import com.itsaky.androidide.lsp.models.ICompletionData -import com.itsaky.androidide.lsp.models.MemberCompletionData -import com.itsaky.androidide.lsp.models.MethodCompletionData +import org.appdevforall.codeonthego.lsp.models.ClassCompletionData +import org.appdevforall.codeonthego.lsp.models.ICompletionData +import org.appdevforall.codeonthego.lsp.models.MemberCompletionData +import org.appdevforall.codeonthego.lsp.models.MethodCompletionData import org.slf4j.LoggerFactory /** diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/util/LSPEditorActions.java b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/LSPEditorActions.java similarity index 77% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/util/LSPEditorActions.java rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/LSPEditorActions.java index e379b54edc..a66b713ffa 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/util/LSPEditorActions.java +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/LSPEditorActions.java @@ -1,50 +1,50 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.util; - -import com.itsaky.androidide.actions.ActionItem; -import com.itsaky.androidide.actions.ActionMenu; -import com.itsaky.androidide.actions.ActionsRegistry; -import com.itsaky.androidide.actions.locations.CodeActionsMenu; -import com.itsaky.androidide.lsp.actions.IActionsMenuProvider; -import com.itsaky.androidide.utils.ILogger; - -/** - * @author Akash Yadav - */ -public class LSPEditorActions { - - public static void ensureActionsMenuRegistered(IActionsMenuProvider provider) { - final var registry = ActionsRegistry.getInstance(); - final var action = - registry.findAction(ActionItem.Location.EDITOR_TEXT_ACTIONS, CodeActionsMenu.ID); - - if (action == null) { - ILogger.ROOT.error("[LSPEditorActions] Cannot find registered editor actions menu"); - return; - } - - final var editorActions = (ActionMenu) action; - for (final var item : provider.getActions()) { - if (editorActions.findAction(item.getId()) != null) { - continue; - } - editorActions.addAction(item); - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.util; + +import org.appdevforall.codeonthego.actions.ActionItem; +import org.appdevforall.codeonthego.actions.ActionMenu; +import org.appdevforall.codeonthego.actions.ActionsRegistry; +import org.appdevforall.codeonthego.actions.locations.CodeActionsMenu; +import org.appdevforall.codeonthego.lsp.actions.IActionsMenuProvider; +import org.appdevforall.codeonthego.utils.ILogger; + +/** + * @author Akash Yadav + */ +public class LSPEditorActions { + + public static void ensureActionsMenuRegistered(IActionsMenuProvider provider) { + final var registry = ActionsRegistry.getInstance(); + final var action = + registry.findAction(ActionItem.Location.EDITOR_TEXT_ACTIONS, CodeActionsMenu.ID); + + if (action == null) { + ILogger.ROOT.error("[LSPEditorActions] Cannot find registered editor actions menu"); + return; + } + + final var editorActions = (ActionMenu) action; + for (final var item : provider.getActions()) { + if (editorActions.findAction(item.getId()) != null) { + continue; + } + editorActions.addAction(item); + } + } +} diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/util/NoCompletionsProvider.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/NoCompletionsProvider.kt similarity index 70% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/util/NoCompletionsProvider.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/NoCompletionsProvider.kt index 2af592db3f..514d460efb 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/util/NoCompletionsProvider.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/NoCompletionsProvider.kt @@ -1,25 +1,25 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.util - -import com.itsaky.androidide.lsp.api.ICompletionProvider - -/** @author Akash Yadav */ -class NoCompletionsProvider : ICompletionProvider { - override fun complete(params: com.itsaky.androidide.lsp.models.CompletionParams?): com.itsaky.androidide.lsp.models.CompletionResult = com.itsaky.androidide.lsp.models.CompletionResult.EMPTY -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.util + +import org.appdevforall.codeonthego.lsp.api.ICompletionProvider + +/** @author Akash Yadav */ +class NoCompletionsProvider : ICompletionProvider { + override fun complete(params: org.appdevforall.codeonthego.lsp.models.CompletionParams?): org.appdevforall.codeonthego.lsp.models.CompletionResult = org.appdevforall.codeonthego.lsp.models.CompletionResult.EMPTY +} diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/util/PrefBasedServerSettings.java b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/PrefBasedServerSettings.java similarity index 79% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/util/PrefBasedServerSettings.java rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/PrefBasedServerSettings.java index 65f6ffc8f9..b3ca405e65 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/util/PrefBasedServerSettings.java +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/PrefBasedServerSettings.java @@ -1,55 +1,55 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.util; - -import androidx.annotation.Nullable; -import com.itsaky.androidide.app.BaseApplication; -import com.itsaky.androidide.lsp.api.IServerSettings; -import com.itsaky.androidide.managers.PreferenceManager; - -/** - * {@link IServerSettings} implementation which uses {@link - * com.itsaky.androidide.managers.PreferenceManager PreferencesManager} to read common settings. - * - * @author Akash Yadav - */ -public abstract class PrefBasedServerSettings extends DefaultServerSettings { - - private PreferenceManager prefs; - - @Override - public boolean shouldMatchAllLowerCase() { - final var prefs = getPrefs(); - if (prefs != null) { - return prefs.getBoolean(KEY_COMPLETIONS_MATCH_LOWER, true); - } - - return false; - } - - @Nullable - public PreferenceManager getPrefs() { - if (prefs == null) { - final var app = BaseApplication.getBaseInstance(); - if (app != null) { - prefs = app.getPrefManager(); - } - } - return prefs; - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.util; + +import androidx.annotation.Nullable; +import org.appdevforall.codeonthego.app.BaseApplication; +import org.appdevforall.codeonthego.lsp.api.IServerSettings; +import org.appdevforall.codeonthego.managers.PreferenceManager; + +/** + * {@link IServerSettings} implementation which uses {@link + * org.appdevforall.codeonthego.managers.PreferenceManager PreferencesManager} to read common settings. + * + * @author Akash Yadav + */ +public abstract class PrefBasedServerSettings extends DefaultServerSettings { + + private PreferenceManager prefs; + + @Override + public boolean shouldMatchAllLowerCase() { + final var prefs = getPrefs(); + if (prefs != null) { + return prefs.getBoolean(KEY_COMPLETIONS_MATCH_LOWER, true); + } + + return false; + } + + @Nullable + public PreferenceManager getPrefs() { + if (prefs == null) { + final var app = BaseApplication.getBaseInstance(); + if (app != null) { + prefs = app.getPrefManager(); + } + } + return prefs; + } +} diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/util/StringUtils.java b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/StringUtils.java similarity index 95% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/util/StringUtils.java rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/StringUtils.java index f70267a13e..9311ca7de4 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/util/StringUtils.java +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/StringUtils.java @@ -1,110 +1,110 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.util; - -import com.itsaky.androidide.fuzzysearch.FuzzySearch; -import java.util.Locale; - -/** - * @author Akash Yadav - */ -public class StringUtils { - - public static boolean matchesFuzzy(CharSequence candidate, CharSequence partialName) { - return matchesFuzzy(candidate, partialName, false); - } - - public static boolean matchesFuzzy( - CharSequence candidate, CharSequence partialName, boolean allLower) { - return fuzzySearchRatio(candidate, partialName, allLower) > 0; - } - - public static int fuzzySearchRatio( - CharSequence candidate, CharSequence partial, boolean allLower) { - return fuzzySearchRatio(candidate, partial, allLower, true); - } - - public static int fuzzySearchRatio( - CharSequence candidate, CharSequence partialName, boolean allLower, boolean partial) { - - if (candidate == null || partialName == null || candidate.length() < partialName.length()) { - return 0; - } - - var first = candidate.toString(); - var second = partialName.toString(); - - if (allLower) { - first = first.toLowerCase(Locale.ROOT); - second = first.toLowerCase(Locale.ROOT); - } - - if (partial) { - return FuzzySearch.partialRatio(first, second); - } else { - return FuzzySearch.ratio(first, second); - } - } - - public static int fuzzySearchTokenSortPartialRatio( - CharSequence candidate, CharSequence partialName, boolean allLower) { - if (candidate == null || partialName == null || candidate.length() < partialName.length()) { - return 0; - } - - var first = candidate.toString(); - var second = partialName.toString(); - - if (allLower) { - first = first.toLowerCase(Locale.ROOT); - second = first.toLowerCase(Locale.ROOT); - } - return FuzzySearch.tokenSetPartialRatio(first, second); - } - - public static boolean matchesPartialName(String name, String partialName) { - return matchesPartialName(name, partialName, false); - } - - public static boolean matchesPartialName( - CharSequence candidate, CharSequence partialName, boolean allLower) { - if (candidate == null || partialName == null || candidate.length() < partialName.length()) { - return false; - } - - for (int i = 0; i < partialName.length(); i++) { - char char1 = candidate.charAt(i); - char char2 = partialName.charAt(i); - - // Match by keeping the first character of the partial name and candidate as is - // Then make all the characters lower case - // So if the first character is upper case, we could assume that the user is expecting a - // class name - // Otherwise a variable name - if (allLower || i != 0) { - char1 = Character.toLowerCase(char1); - char2 = Character.toLowerCase(char2); - } - - if (char1 != char2) { - return false; - } - } - return true; - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.util; + +import com.itsaky.androidide.fuzzysearch.FuzzySearch; +import java.util.Locale; + +/** + * @author Akash Yadav + */ +public class StringUtils { + + public static boolean matchesFuzzy(CharSequence candidate, CharSequence partialName) { + return matchesFuzzy(candidate, partialName, false); + } + + public static boolean matchesFuzzy( + CharSequence candidate, CharSequence partialName, boolean allLower) { + return fuzzySearchRatio(candidate, partialName, allLower) > 0; + } + + public static int fuzzySearchRatio( + CharSequence candidate, CharSequence partial, boolean allLower) { + return fuzzySearchRatio(candidate, partial, allLower, true); + } + + public static int fuzzySearchRatio( + CharSequence candidate, CharSequence partialName, boolean allLower, boolean partial) { + + if (candidate == null || partialName == null || candidate.length() < partialName.length()) { + return 0; + } + + var first = candidate.toString(); + var second = partialName.toString(); + + if (allLower) { + first = first.toLowerCase(Locale.ROOT); + second = first.toLowerCase(Locale.ROOT); + } + + if (partial) { + return FuzzySearch.partialRatio(first, second); + } else { + return FuzzySearch.ratio(first, second); + } + } + + public static int fuzzySearchTokenSortPartialRatio( + CharSequence candidate, CharSequence partialName, boolean allLower) { + if (candidate == null || partialName == null || candidate.length() < partialName.length()) { + return 0; + } + + var first = candidate.toString(); + var second = partialName.toString(); + + if (allLower) { + first = first.toLowerCase(Locale.ROOT); + second = first.toLowerCase(Locale.ROOT); + } + return FuzzySearch.tokenSetPartialRatio(first, second); + } + + public static boolean matchesPartialName(String name, String partialName) { + return matchesPartialName(name, partialName, false); + } + + public static boolean matchesPartialName( + CharSequence candidate, CharSequence partialName, boolean allLower) { + if (candidate == null || partialName == null || candidate.length() < partialName.length()) { + return false; + } + + for (int i = 0; i < partialName.length(); i++) { + char char1 = candidate.charAt(i); + char char2 = partialName.charAt(i); + + // Match by keeping the first character of the partial name and candidate as is + // Then make all the characters lower case + // So if the first character is upper case, we could assume that the user is expecting a + // class name + // Otherwise a variable name + if (allLower || i != 0) { + char1 = Character.toLowerCase(char1); + char2 = Character.toLowerCase(char2); + } + + if (char1 != char2) { + return false; + } + } + return true; + } +} diff --git a/lsp/api/src/main/java/com/itsaky/androidide/lsp/util/commonCompletionUtils.kt b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/commonCompletionUtils.kt similarity index 81% rename from lsp/api/src/main/java/com/itsaky/androidide/lsp/util/commonCompletionUtils.kt rename to lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/commonCompletionUtils.kt index fc18c3ab04..ec3d413699 100644 --- a/lsp/api/src/main/java/com/itsaky/androidide/lsp/util/commonCompletionUtils.kt +++ b/lsp/api/src/main/java/org/appdevforall/codeonthego/lsp/util/commonCompletionUtils.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.util +package org.appdevforall.codeonthego.lsp.util -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.api.AndroidModule -import com.itsaky.androidide.projects.api.ModuleProject -import com.itsaky.androidide.xml.resources.ResourceTableRegistry -import com.itsaky.androidide.xml.versions.ApiVersions -import com.itsaky.androidide.xml.widgets.WidgetTable +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.api.AndroidModule +import org.appdevforall.codeonthego.projects.api.ModuleProject +import org.appdevforall.codeonthego.xml.resources.ResourceTableRegistry +import org.appdevforall.codeonthego.xml.versions.ApiVersions +import org.appdevforall.codeonthego.xml.widgets.WidgetTable import java.io.File import java.nio.file.Path diff --git a/lsp/api/src/test/java/com/itsaky/androidide/lsp/actions/SurroundWithTryCatchTest.kt b/lsp/api/src/test/java/org/appdevforall/codeonthego/lsp/actions/SurroundWithTryCatchTest.kt similarity index 97% rename from lsp/api/src/test/java/com/itsaky/androidide/lsp/actions/SurroundWithTryCatchTest.kt rename to lsp/api/src/test/java/org/appdevforall/codeonthego/lsp/actions/SurroundWithTryCatchTest.kt index ef714b9fa8..4278fecf0c 100644 --- a/lsp/api/src/test/java/com/itsaky/androidide/lsp/actions/SurroundWithTryCatchTest.kt +++ b/lsp/api/src/test/java/org/appdevforall/codeonthego/lsp/actions/SurroundWithTryCatchTest.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.lsp.actions +package org.appdevforall.codeonthego.lsp.actions import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.JUnit4 diff --git a/lsp/api/src/test/java/com/itsaky/androidide/lsp/api/DefaultLanguageServerRegistryTest.kt b/lsp/api/src/test/java/org/appdevforall/codeonthego/lsp/api/DefaultLanguageServerRegistryTest.kt similarity index 67% rename from lsp/api/src/test/java/com/itsaky/androidide/lsp/api/DefaultLanguageServerRegistryTest.kt rename to lsp/api/src/test/java/org/appdevforall/codeonthego/lsp/api/DefaultLanguageServerRegistryTest.kt index 18f8e9f075..f674cdd0be 100644 --- a/lsp/api/src/test/java/com/itsaky/androidide/lsp/api/DefaultLanguageServerRegistryTest.kt +++ b/lsp/api/src/test/java/org/appdevforall/codeonthego/lsp/api/DefaultLanguageServerRegistryTest.kt @@ -1,23 +1,23 @@ -package com.itsaky.androidide.lsp.api +package org.appdevforall.codeonthego.lsp.api import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.DefinitionParams -import com.itsaky.androidide.lsp.models.DefinitionResult -import com.itsaky.androidide.lsp.models.DiagnosticItem -import com.itsaky.androidide.lsp.models.DiagnosticResult -import com.itsaky.androidide.lsp.models.ExpandSelectionParams -import com.itsaky.androidide.lsp.models.PerformCodeActionParams -import com.itsaky.androidide.lsp.models.ReferenceParams -import com.itsaky.androidide.lsp.models.ReferenceResult -import com.itsaky.androidide.lsp.models.ShowDocumentParams -import com.itsaky.androidide.lsp.models.ShowDocumentResult -import com.itsaky.androidide.lsp.models.SignatureHelp -import com.itsaky.androidide.lsp.models.SignatureHelpParams -import com.itsaky.androidide.models.Location -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.projects.api.Workspace +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.DefinitionParams +import org.appdevforall.codeonthego.lsp.models.DefinitionResult +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem +import org.appdevforall.codeonthego.lsp.models.DiagnosticResult +import org.appdevforall.codeonthego.lsp.models.ExpandSelectionParams +import org.appdevforall.codeonthego.lsp.models.PerformCodeActionParams +import org.appdevforall.codeonthego.lsp.models.ReferenceParams +import org.appdevforall.codeonthego.lsp.models.ReferenceResult +import org.appdevforall.codeonthego.lsp.models.ShowDocumentParams +import org.appdevforall.codeonthego.lsp.models.ShowDocumentResult +import org.appdevforall.codeonthego.lsp.models.SignatureHelp +import org.appdevforall.codeonthego.lsp.models.SignatureHelpParams +import org.appdevforall.codeonthego.models.Location +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.projects.api.Workspace import org.junit.Test import java.io.File import java.nio.file.Path diff --git a/lsp/api/src/test/java/com/itsaky/androidide/lsp/util/DiagnosticUtilTest.kt b/lsp/api/src/test/java/org/appdevforall/codeonthego/lsp/util/DiagnosticUtilTest.kt similarity index 93% rename from lsp/api/src/test/java/com/itsaky/androidide/lsp/util/DiagnosticUtilTest.kt rename to lsp/api/src/test/java/org/appdevforall/codeonthego/lsp/util/DiagnosticUtilTest.kt index bde9e5850e..18b36c0648 100644 --- a/lsp/api/src/test/java/com/itsaky/androidide/lsp/util/DiagnosticUtilTest.kt +++ b/lsp/api/src/test/java/org/appdevforall/codeonthego/lsp/util/DiagnosticUtilTest.kt @@ -14,13 +14,13 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.util +package org.appdevforall.codeonthego.lsp.util import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.models.DiagnosticItem -import com.itsaky.androidide.lsp.models.DiagnosticSeverity -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem +import org.appdevforall.codeonthego.lsp.models.DiagnosticSeverity +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.JUnit4 diff --git a/lsp/external/src/main/java/com/itsaky/androidide/lsp/external/ExternalLanguageServer.kt b/lsp/external/src/main/java/org/appdevforall/codeonthego/lsp/external/ExternalLanguageServer.kt similarity index 92% rename from lsp/external/src/main/java/com/itsaky/androidide/lsp/external/ExternalLanguageServer.kt rename to lsp/external/src/main/java/org/appdevforall/codeonthego/lsp/external/ExternalLanguageServer.kt index 87d5a10c76..514f14ca1e 100644 --- a/lsp/external/src/main/java/com/itsaky/androidide/lsp/external/ExternalLanguageServer.kt +++ b/lsp/external/src/main/java/org/appdevforall/codeonthego/lsp/external/ExternalLanguageServer.kt @@ -1,30 +1,30 @@ -package com.itsaky.androidide.lsp.external - -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentCloseEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentOpenEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentSaveEvent -import com.itsaky.androidide.lsp.api.ILanguageClient -import com.itsaky.androidide.lsp.api.ILanguageServer -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.models.CodeFormatResult -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.DefinitionParams -import com.itsaky.androidide.lsp.models.DefinitionResult -import com.itsaky.androidide.lsp.models.DiagnosticResult -import com.itsaky.androidide.lsp.models.ExpandSelectionParams -import com.itsaky.androidide.lsp.models.FormatCodeParams -import com.itsaky.androidide.lsp.models.MatchLevel -import com.itsaky.androidide.lsp.models.ReferenceParams -import com.itsaky.androidide.lsp.models.ReferenceResult -import com.itsaky.androidide.lsp.models.SignatureHelp -import com.itsaky.androidide.lsp.models.SignatureHelpParams -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.progress.ICancelChecker -import com.itsaky.androidide.projects.FileManager -import com.itsaky.androidide.projects.api.Workspace -import com.itsaky.androidide.projects.models.projectDir +package org.appdevforall.codeonthego.lsp.external + +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentCloseEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentOpenEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentSaveEvent +import org.appdevforall.codeonthego.lsp.api.ILanguageClient +import org.appdevforall.codeonthego.lsp.api.ILanguageServer +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.models.CodeFormatResult +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.DefinitionParams +import org.appdevforall.codeonthego.lsp.models.DefinitionResult +import org.appdevforall.codeonthego.lsp.models.DiagnosticResult +import org.appdevforall.codeonthego.lsp.models.ExpandSelectionParams +import org.appdevforall.codeonthego.lsp.models.FormatCodeParams +import org.appdevforall.codeonthego.lsp.models.MatchLevel +import org.appdevforall.codeonthego.lsp.models.ReferenceParams +import org.appdevforall.codeonthego.lsp.models.ReferenceResult +import org.appdevforall.codeonthego.lsp.models.SignatureHelp +import org.appdevforall.codeonthego.lsp.models.SignatureHelpParams +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.progress.ICancelChecker +import org.appdevforall.codeonthego.projects.FileManager +import org.appdevforall.codeonthego.projects.api.Workspace +import org.appdevforall.codeonthego.projects.models.projectDir import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.eclipse.lsp4j.ClientCapabilities diff --git a/lsp/external/src/main/java/com/itsaky/androidide/lsp/external/Lsp4jConversions.kt b/lsp/external/src/main/java/org/appdevforall/codeonthego/lsp/external/Lsp4jConversions.kt similarity index 86% rename from lsp/external/src/main/java/com/itsaky/androidide/lsp/external/Lsp4jConversions.kt rename to lsp/external/src/main/java/org/appdevforall/codeonthego/lsp/external/Lsp4jConversions.kt index a3c2becb0b..5c95c9fa94 100644 --- a/lsp/external/src/main/java/com/itsaky/androidide/lsp/external/Lsp4jConversions.kt +++ b/lsp/external/src/main/java/org/appdevforall/codeonthego/lsp/external/Lsp4jConversions.kt @@ -1,19 +1,19 @@ -package com.itsaky.androidide.lsp.external - -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionItemKind -import com.itsaky.androidide.lsp.models.DiagnosticItem -import com.itsaky.androidide.lsp.models.DiagnosticResult -import com.itsaky.androidide.lsp.models.DiagnosticSeverity -import com.itsaky.androidide.lsp.models.IndexedTextEdit -import com.itsaky.androidide.lsp.models.MarkupContent -import com.itsaky.androidide.lsp.models.MarkupKind -import com.itsaky.androidide.lsp.models.ParameterInformation -import com.itsaky.androidide.lsp.models.SignatureHelp -import com.itsaky.androidide.lsp.models.SignatureInformation -import com.itsaky.androidide.models.Location -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range +package org.appdevforall.codeonthego.lsp.external + +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem +import org.appdevforall.codeonthego.lsp.models.DiagnosticResult +import org.appdevforall.codeonthego.lsp.models.DiagnosticSeverity +import org.appdevforall.codeonthego.lsp.models.IndexedTextEdit +import org.appdevforall.codeonthego.lsp.models.MarkupContent +import org.appdevforall.codeonthego.lsp.models.MarkupKind +import org.appdevforall.codeonthego.lsp.models.ParameterInformation +import org.appdevforall.codeonthego.lsp.models.SignatureHelp +import org.appdevforall.codeonthego.lsp.models.SignatureInformation +import org.appdevforall.codeonthego.models.Location +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range import org.eclipse.lsp4j.jsonrpc.messages.Either import java.net.URI import java.nio.file.Path diff --git a/lsp/external/src/test/java/com/itsaky/androidide/lsp/external/ExternalLanguageServerTest.kt b/lsp/external/src/test/java/org/appdevforall/codeonthego/lsp/external/ExternalLanguageServerTest.kt similarity index 91% rename from lsp/external/src/test/java/com/itsaky/androidide/lsp/external/ExternalLanguageServerTest.kt rename to lsp/external/src/test/java/org/appdevforall/codeonthego/lsp/external/ExternalLanguageServerTest.kt index 6bbc4170de..f14405c743 100644 --- a/lsp/external/src/test/java/com/itsaky/androidide/lsp/external/ExternalLanguageServerTest.kt +++ b/lsp/external/src/test/java/org/appdevforall/codeonthego/lsp/external/ExternalLanguageServerTest.kt @@ -1,23 +1,23 @@ -package com.itsaky.androidide.lsp.external +package org.appdevforall.codeonthego.lsp.external import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.eventbus.events.editor.ChangeType -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentOpenEvent -import com.itsaky.androidide.lsp.api.ILanguageClient -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.DiagnosticItem -import com.itsaky.androidide.lsp.models.DiagnosticResult -import com.itsaky.androidide.lsp.models.FormatCodeParams -import com.itsaky.androidide.lsp.models.PerformCodeActionParams -import com.itsaky.androidide.lsp.models.ShowDocumentParams -import com.itsaky.androidide.lsp.models.ShowDocumentResult -import com.itsaky.androidide.models.Location -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.progress.ICancelChecker -import com.itsaky.androidide.projects.FileManager +import org.appdevforall.codeonthego.eventbus.events.editor.ChangeType +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentOpenEvent +import org.appdevforall.codeonthego.lsp.api.ILanguageClient +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem +import org.appdevforall.codeonthego.lsp.models.DiagnosticResult +import org.appdevforall.codeonthego.lsp.models.FormatCodeParams +import org.appdevforall.codeonthego.lsp.models.PerformCodeActionParams +import org.appdevforall.codeonthego.lsp.models.ShowDocumentParams +import org.appdevforall.codeonthego.lsp.models.ShowDocumentResult +import org.appdevforall.codeonthego.models.Location +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.progress.ICancelChecker +import org.appdevforall.codeonthego.projects.FileManager import org.eclipse.lsp4j.CompletionItem import org.eclipse.lsp4j.CompletionList import org.eclipse.lsp4j.CompletionOptions diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/JavaCodeActionsMenu.kt b/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/JavaCodeActionsMenu.kt deleted file mode 100644 index 052705d8b2..0000000000 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/JavaCodeActionsMenu.kt +++ /dev/null @@ -1,99 +0,0 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.actions - -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.actions.CommentLineAction -import com.itsaky.androidide.lsp.actions.IActionsMenuProvider -import com.itsaky.androidide.lsp.actions.SurroundWithTryCatchAction -import com.itsaky.androidide.lsp.actions.UncommentLineAction -import com.itsaky.androidide.lsp.java.JavaLanguageServer -import com.itsaky.androidide.lsp.java.actions.common.FindReferencesAction -import com.itsaky.androidide.lsp.java.actions.common.GoToDefinitionAction -import com.itsaky.androidide.lsp.java.actions.common.OrganizeImportsAction -import com.itsaky.androidide.lsp.java.actions.common.RemoveUnusedImportsAction -import com.itsaky.androidide.lsp.java.actions.diagnostics.AddImportAction -import com.itsaky.androidide.lsp.java.actions.diagnostics.AddThrowsAction -import com.itsaky.androidide.lsp.java.actions.diagnostics.AutoFixImportsAction -import com.itsaky.androidide.lsp.java.actions.diagnostics.CreateMissingMethodAction -import com.itsaky.androidide.lsp.java.actions.diagnostics.FieldToBlockAction -import com.itsaky.androidide.lsp.java.actions.diagnostics.ImplementAbstractMethodsAction -import com.itsaky.androidide.lsp.java.actions.diagnostics.RemoveClassAction -import com.itsaky.androidide.lsp.java.actions.diagnostics.RemoveMethodAction -import com.itsaky.androidide.lsp.java.actions.diagnostics.RemoveUnusedThrowsAction -import com.itsaky.androidide.lsp.java.actions.diagnostics.SuppressUncheckedWarningAction -import com.itsaky.androidide.lsp.java.actions.diagnostics.VariableToStatementAction -import com.itsaky.androidide.lsp.java.actions.generators.GenerateConstructorAction -import com.itsaky.androidide.lsp.java.actions.generators.GenerateMissingConstructorAction -import com.itsaky.androidide.lsp.java.actions.generators.GenerateSettersAndGettersAction -import com.itsaky.androidide.lsp.java.actions.generators.GenerateToStringMethodAction -import com.itsaky.androidide.lsp.java.actions.generators.OverrideSuperclassMethodsAction - -/** - * Java code actions. - * @author Akash Yadav - */ -object JavaCodeActionsMenu : IActionsMenuProvider { - private const val LANG = "java" - private const val EXT = "java" - private const val LINE_COMMENT_TOKEN = "//" - private const val CATCH_CLAUSE = "catch (Exception e)" - private const val CATCH_BODY = "e.printStackTrace();" - - override val actions: List = - listOf( - CommentLineAction(LANG, EXT, LINE_COMMENT_TOKEN, TooltipTag.EDITOR_CODE_ACTIONS_COMMENT), - UncommentLineAction( - LANG, - EXT, - LINE_COMMENT_TOKEN, - TooltipTag.EDITOR_CODE_ACTIONS_UNCOMMENT, - ), - GoToDefinitionAction(), - FindReferencesAction(), - AddImportAction(), - AutoFixImportsAction(), - ImplementAbstractMethodsAction(), - VariableToStatementAction(), - FieldToBlockAction(), - RemoveClassAction(), - RemoveMethodAction(), - RemoveUnusedThrowsAction(), - CreateMissingMethodAction(), - SuppressUncheckedWarningAction(), - AddThrowsAction(), - GenerateSettersAndGettersAction(), - OverrideSuperclassMethodsAction(), - GenerateMissingConstructorAction(), - GenerateConstructorAction(), - GenerateToStringMethodAction(), - RemoveUnusedImportsAction(), - OrganizeImportsAction(), - SurroundWithTryCatchAction( - LANG, - EXT, - JavaLanguageServer.SERVER_ID, - CATCH_CLAUSE, - CATCH_BODY, - TooltipTag.EDITOR_CODE_ACTIONS_TRY_CATCH, - ), - ExtractVariableAction(), - ExtractMethodAction(), - ) -} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/CompilationCancellationException.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/CompilationCancellationException.kt similarity index 95% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/CompilationCancellationException.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/CompilationCancellationException.kt index 82e42d24c5..ee322ea431 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/CompilationCancellationException.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/CompilationCancellationException.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java +package org.appdevforall.codeonthego.lsp.java import java.util.concurrent.CancellationException diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/JavaCompilerProvider.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/JavaCompilerProvider.java similarity index 95% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/JavaCompilerProvider.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/JavaCompilerProvider.java index 106d35bf83..89b706ce98 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/JavaCompilerProvider.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/JavaCompilerProvider.java @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java; +package org.appdevforall.codeonthego.lsp.java; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService; -import com.itsaky.androidide.projects.api.ModuleProject; +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService; +import org.appdevforall.codeonthego.projects.api.ModuleProject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/JavaLanguageServer.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/JavaLanguageServer.kt similarity index 71% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/JavaLanguageServer.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/JavaLanguageServer.kt index fc94ebbc84..9ce8e3f9c3 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/JavaLanguageServer.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/JavaLanguageServer.kt @@ -14,63 +14,63 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java +package org.appdevforall.codeonthego.lsp.java import androidx.annotation.RestrictTo -import com.itsaky.androidide.app.BaseApplication -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentCloseEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentOpenEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentSelectedEvent -import com.itsaky.androidide.javac.services.fs.CacheFSInfoSingleton -import com.itsaky.androidide.javac.services.fs.CachingJarFileSystemProvider.clearCache -import com.itsaky.androidide.javac.services.fs.CachingJarFileSystemProvider.clearCachesForPaths -import com.itsaky.androidide.lsp.api.ILanguageClient -import com.itsaky.androidide.lsp.api.ILanguageServer -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.debug.DebugClientConnectionResult -import com.itsaky.androidide.lsp.debug.IDebugAdapter -import com.itsaky.androidide.lsp.debug.IDebugClient -import com.itsaky.androidide.lsp.internal.model.CachedCompletion -import com.itsaky.androidide.lsp.java.actions.JavaCodeActionsMenu -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.java.compiler.SourceFileManager -import com.itsaky.androidide.lsp.java.debug.JavaDebugAdapter -import com.itsaky.androidide.lsp.java.debug.JdwpOptions -import com.itsaky.androidide.lsp.java.models.JavaServerSettings -import com.itsaky.androidide.lsp.java.providers.CodeFormatProvider -import com.itsaky.androidide.lsp.java.providers.CompletionProvider -import com.itsaky.androidide.lsp.java.providers.DefinitionProvider -import com.itsaky.androidide.lsp.java.providers.JavaDiagnosticProvider -import com.itsaky.androidide.lsp.java.providers.JavaSelectionProvider -import com.itsaky.androidide.lsp.java.providers.ReferenceProvider -import com.itsaky.androidide.lsp.java.providers.SignatureProvider -import com.itsaky.androidide.lsp.java.providers.snippet.JavaSnippetRepository -import com.itsaky.androidide.lsp.java.utils.AnalyzeTimer -import com.itsaky.androidide.lsp.java.utils.CancelChecker.Companion.isCancelled -import com.itsaky.androidide.lsp.models.CodeFormatResult -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.DefinitionParams -import com.itsaky.androidide.lsp.models.DefinitionResult -import com.itsaky.androidide.lsp.models.DiagnosticResult -import com.itsaky.androidide.lsp.models.ExpandSelectionParams -import com.itsaky.androidide.lsp.models.FailureType -import com.itsaky.androidide.lsp.models.FormatCodeParams -import com.itsaky.androidide.lsp.models.LSPFailure -import com.itsaky.androidide.lsp.models.ReferenceParams -import com.itsaky.androidide.lsp.models.ReferenceResult -import com.itsaky.androidide.lsp.models.SignatureHelp -import com.itsaky.androidide.lsp.models.SignatureHelpParams -import com.itsaky.androidide.lsp.util.LSPEditorActions -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.projects.FileManager.getActiveDocumentCount -import com.itsaky.androidide.projects.IProjectManager.Companion.getInstance -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.projects.api.ModuleProject -import com.itsaky.androidide.projects.api.Workspace -import com.itsaky.androidide.utils.DocumentUtils -import com.itsaky.androidide.utils.VMUtils +import org.appdevforall.codeonthego.app.BaseApplication +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentCloseEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentOpenEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentSelectedEvent +import org.appdevforall.codeonthego.javac.services.fs.CacheFSInfoSingleton +import org.appdevforall.codeonthego.javac.services.fs.CachingJarFileSystemProvider.clearCache +import org.appdevforall.codeonthego.javac.services.fs.CachingJarFileSystemProvider.clearCachesForPaths +import org.appdevforall.codeonthego.lsp.api.ILanguageClient +import org.appdevforall.codeonthego.lsp.api.ILanguageServer +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.debug.DebugClientConnectionResult +import org.appdevforall.codeonthego.lsp.debug.IDebugAdapter +import org.appdevforall.codeonthego.lsp.debug.IDebugClient +import org.appdevforall.codeonthego.lsp.internal.model.CachedCompletion +import org.appdevforall.codeonthego.lsp.java.actions.JavaCodeActionsMenu +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.java.compiler.SourceFileManager +import org.appdevforall.codeonthego.lsp.java.debug.JavaDebugAdapter +import org.appdevforall.codeonthego.lsp.java.debug.JdwpOptions +import org.appdevforall.codeonthego.lsp.java.models.JavaServerSettings +import org.appdevforall.codeonthego.lsp.java.providers.CodeFormatProvider +import org.appdevforall.codeonthego.lsp.java.providers.CompletionProvider +import org.appdevforall.codeonthego.lsp.java.providers.DefinitionProvider +import org.appdevforall.codeonthego.lsp.java.providers.JavaDiagnosticProvider +import org.appdevforall.codeonthego.lsp.java.providers.JavaSelectionProvider +import org.appdevforall.codeonthego.lsp.java.providers.ReferenceProvider +import org.appdevforall.codeonthego.lsp.java.providers.SignatureProvider +import org.appdevforall.codeonthego.lsp.java.providers.snippet.JavaSnippetRepository +import org.appdevforall.codeonthego.lsp.java.utils.AnalyzeTimer +import org.appdevforall.codeonthego.lsp.java.utils.CancelChecker.Companion.isCancelled +import org.appdevforall.codeonthego.lsp.models.CodeFormatResult +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.DefinitionParams +import org.appdevforall.codeonthego.lsp.models.DefinitionResult +import org.appdevforall.codeonthego.lsp.models.DiagnosticResult +import org.appdevforall.codeonthego.lsp.models.ExpandSelectionParams +import org.appdevforall.codeonthego.lsp.models.FailureType +import org.appdevforall.codeonthego.lsp.models.FormatCodeParams +import org.appdevforall.codeonthego.lsp.models.LSPFailure +import org.appdevforall.codeonthego.lsp.models.ReferenceParams +import org.appdevforall.codeonthego.lsp.models.ReferenceResult +import org.appdevforall.codeonthego.lsp.models.SignatureHelp +import org.appdevforall.codeonthego.lsp.models.SignatureHelpParams +import org.appdevforall.codeonthego.lsp.util.LSPEditorActions +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.projects.FileManager.getActiveDocumentCount +import org.appdevforall.codeonthego.projects.IProjectManager.Companion.getInstance +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.projects.api.ModuleProject +import org.appdevforall.codeonthego.projects.api.Workspace +import org.appdevforall.codeonthego.utils.DocumentUtils +import org.appdevforall.codeonthego.utils.VMUtils import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/BaseJavaCodeAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/BaseJavaCodeAction.kt similarity index 75% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/BaseJavaCodeAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/BaseJavaCodeAction.kt index fd9c7647b8..c11a5688fb 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/BaseJavaCodeAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/BaseJavaCodeAction.kt @@ -1,117 +1,117 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.actions - -import android.content.Context -import android.graphics.drawable.Drawable -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.EditorActionItem -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.lsp.api.ILanguageClient -import com.itsaky.androidide.lsp.api.ILanguageServerRegistry -import com.itsaky.androidide.lsp.java.JavaCompilerProvider -import com.itsaky.androidide.lsp.java.JavaLanguageServer -import com.itsaky.androidide.lsp.java.R -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.java.rewrite.Rewrite -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.utils.DocumentUtils -import com.itsaky.androidide.utils.ILogger -import com.itsaky.androidide.utils.flashError -import java.io.File - -/** - * Base class for java code actions - * - * @author Akash Yadav - */ -abstract class BaseJavaCodeAction : EditorActionItem { - - override var visible: Boolean = true - override var enabled: Boolean = true - override var icon: Drawable? = null - override var requiresUIThread: Boolean = false - override var location: ActionItem.Location = ActionItem.Location.EDITOR_CODE_ACTIONS - - protected abstract val titleTextRes: Int - - override fun prepare(data: ActionData) { - super.prepare(data) - if ( - !data.hasRequiredData(Context::class.java, JavaLanguageServer::class.java, File::class.java) - ) { - markInvisible() - return - } - - if (titleTextRes != -1) { - label = data[Context::class.java]!!.getString(titleTextRes) - } - - val file = data.requireFile() - val isJava = DocumentUtils.isJavaFile(file.toPath()) - val module = IProjectManager.getInstance().findModuleForFile(file, false) - - visible = isJava - enabled = isJava && module != null - } - - fun performCodeAction(data: ActionData, result: Rewrite) { - val compiler = data.requireCompiler() - - val actions = - try { - result.asCodeActions(compiler, label) - } catch (e: Exception) { - flashError(e.cause?.message ?: e.message) - ILogger.ROOT.error(e.cause?.message ?: e.message, e) - return - } - - if (actions == null) { - onPerformCodeActionFailed(data) - return - } - - data.getLanguageClient()?.performCodeAction(actions) - } - - protected open fun onPerformCodeActionFailed(data: ActionData) { - flashError(R.string.msg_codeaction_failed) - } - - protected fun ActionData.requireLanguageServer(): JavaLanguageServer { - return ILanguageServerRegistry.default.getServer(JavaLanguageServer.SERVER_ID) - as JavaLanguageServer - } - - protected fun ActionData.getLanguageClient(): ILanguageClient? { - return requireLanguageServer().client - } - - protected fun ActionData.requireCompiler(): JavaCompilerService { - val module = IProjectManager.getInstance().findModuleForFile(requireFile(), false) - requireNotNull(module) { - "Cannot get compiler instance. Unable to find module for file: ${requireFile().name}" - } - return JavaCompilerProvider.get(module) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.actions + +import android.content.Context +import android.graphics.drawable.Drawable +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.EditorActionItem +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.lsp.api.ILanguageClient +import org.appdevforall.codeonthego.lsp.api.ILanguageServerRegistry +import org.appdevforall.codeonthego.lsp.java.JavaCompilerProvider +import org.appdevforall.codeonthego.lsp.java.JavaLanguageServer +import com.itsaky.androidide.lsp.java.R +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.java.rewrite.Rewrite +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.utils.DocumentUtils +import org.appdevforall.codeonthego.utils.ILogger +import org.appdevforall.codeonthego.utils.flashError +import java.io.File + +/** + * Base class for java code actions + * + * @author Akash Yadav + */ +abstract class BaseJavaCodeAction : EditorActionItem { + + override var visible: Boolean = true + override var enabled: Boolean = true + override var icon: Drawable? = null + override var requiresUIThread: Boolean = false + override var location: ActionItem.Location = ActionItem.Location.EDITOR_CODE_ACTIONS + + protected abstract val titleTextRes: Int + + override fun prepare(data: ActionData) { + super.prepare(data) + if ( + !data.hasRequiredData(Context::class.java, JavaLanguageServer::class.java, File::class.java) + ) { + markInvisible() + return + } + + if (titleTextRes != -1) { + label = data[Context::class.java]!!.getString(titleTextRes) + } + + val file = data.requireFile() + val isJava = DocumentUtils.isJavaFile(file.toPath()) + val module = IProjectManager.getInstance().findModuleForFile(file, false) + + visible = isJava + enabled = isJava && module != null + } + + fun performCodeAction(data: ActionData, result: Rewrite) { + val compiler = data.requireCompiler() + + val actions = + try { + result.asCodeActions(compiler, label) + } catch (e: Exception) { + flashError(e.cause?.message ?: e.message) + ILogger.ROOT.error(e.cause?.message ?: e.message, e) + return + } + + if (actions == null) { + onPerformCodeActionFailed(data) + return + } + + data.getLanguageClient()?.performCodeAction(actions) + } + + protected open fun onPerformCodeActionFailed(data: ActionData) { + flashError(R.string.msg_codeaction_failed) + } + + protected fun ActionData.requireLanguageServer(): JavaLanguageServer { + return ILanguageServerRegistry.default.getServer(JavaLanguageServer.SERVER_ID) + as JavaLanguageServer + } + + protected fun ActionData.getLanguageClient(): ILanguageClient? { + return requireLanguageServer().client + } + + protected fun ActionData.requireCompiler(): JavaCompilerService { + val module = IProjectManager.getInstance().findModuleForFile(requireFile(), false) + requireNotNull(module) { + "Cannot get compiler instance. Unable to find module for file: ${requireFile().name}" + } + return JavaCompilerProvider.get(module) + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/ExtractMethodAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/ExtractMethodAction.kt similarity index 82% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/ExtractMethodAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/ExtractMethodAction.kt index cd3dc08c1d..964639fa26 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/ExtractMethodAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/ExtractMethodAction.kt @@ -1,31 +1,31 @@ -package com.itsaky.androidide.lsp.java.actions +package org.appdevforall.codeonthego.lsp.java.actions import android.content.Context -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.actions.requireEditor -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.java.refactor.ExtractMethodPlan -import com.itsaky.androidide.lsp.java.refactor.ExtractionRefusal -import com.itsaky.androidide.lsp.java.refactor.JAVA_KEYWORDS -import com.itsaky.androidide.lsp.java.refactor.JAVA_NAME_MESSAGES -import com.itsaky.androidide.lsp.java.refactor.buildExtractMethodPlan -import com.itsaky.androidide.lsp.java.refactor.buildExtractMethodRewrites -import com.itsaky.androidide.lsp.java.refactor.candidateFor -import com.itsaky.androidide.lsp.java.refactor.toMethodCandidateViews -import com.itsaky.androidide.lsp.models.CodeActionItem -import com.itsaky.androidide.lsp.models.CodeActionKind -import com.itsaky.androidide.lsp.models.Command -import com.itsaky.androidide.lsp.models.DocumentChange -import com.itsaky.androidide.lsp.refactor.toTextEdit -import com.itsaky.androidide.lsp.ui.ExtractMethodSelection -import com.itsaky.androidide.lsp.ui.ExtractMethodSheet -import com.itsaky.androidide.lsp.ui.findFragmentActivity -import com.itsaky.androidide.projects.FileManager +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.actions.requireEditor +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.java.refactor.ExtractMethodPlan +import org.appdevforall.codeonthego.lsp.java.refactor.ExtractionRefusal +import org.appdevforall.codeonthego.lsp.java.refactor.JAVA_KEYWORDS +import org.appdevforall.codeonthego.lsp.java.refactor.JAVA_NAME_MESSAGES +import org.appdevforall.codeonthego.lsp.java.refactor.buildExtractMethodPlan +import org.appdevforall.codeonthego.lsp.java.refactor.buildExtractMethodRewrites +import org.appdevforall.codeonthego.lsp.java.refactor.candidateFor +import org.appdevforall.codeonthego.lsp.java.refactor.toMethodCandidateViews +import org.appdevforall.codeonthego.lsp.models.CodeActionItem +import org.appdevforall.codeonthego.lsp.models.CodeActionKind +import org.appdevforall.codeonthego.lsp.models.Command +import org.appdevforall.codeonthego.lsp.models.DocumentChange +import org.appdevforall.codeonthego.lsp.refactor.toTextEdit +import org.appdevforall.codeonthego.lsp.ui.ExtractMethodSelection +import org.appdevforall.codeonthego.lsp.ui.ExtractMethodSheet +import org.appdevforall.codeonthego.lsp.ui.findFragmentActivity +import org.appdevforall.codeonthego.projects.FileManager import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashInfo +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashInfo import org.slf4j.LoggerFactory import java.nio.file.Path import kotlin.coroutines.cancellation.CancellationException diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/ExtractVariableAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/ExtractVariableAction.kt similarity index 78% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/ExtractVariableAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/ExtractVariableAction.kt index de4f0d9350..ba1a6fa445 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/ExtractVariableAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/ExtractVariableAction.kt @@ -1,29 +1,29 @@ -package com.itsaky.androidide.lsp.java.actions - -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.actions.requireEditor -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.java.refactor.ExtractionPlan -import com.itsaky.androidide.lsp.java.refactor.JAVA_KEYWORDS -import com.itsaky.androidide.lsp.java.refactor.JAVA_NAME_MESSAGES -import com.itsaky.androidide.lsp.java.refactor.buildExtractVariableRewrite -import com.itsaky.androidide.lsp.java.refactor.buildExtractionPlan -import com.itsaky.androidide.lsp.java.refactor.candidateAndScopeFor -import com.itsaky.androidide.lsp.java.refactor.toCandidateViews -import com.itsaky.androidide.lsp.models.CodeActionItem -import com.itsaky.androidide.lsp.models.CodeActionKind -import com.itsaky.androidide.lsp.models.Command -import com.itsaky.androidide.lsp.models.DocumentChange -import com.itsaky.androidide.lsp.refactor.toTextEdit -import com.itsaky.androidide.lsp.ui.ExtractVariableSelection -import com.itsaky.androidide.lsp.ui.ExtractVariableSheet -import com.itsaky.androidide.lsp.ui.findFragmentActivity -import com.itsaky.androidide.projects.FileManager +package org.appdevforall.codeonthego.lsp.java.actions + +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.actions.requireEditor +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.java.refactor.ExtractionPlan +import org.appdevforall.codeonthego.lsp.java.refactor.JAVA_KEYWORDS +import org.appdevforall.codeonthego.lsp.java.refactor.JAVA_NAME_MESSAGES +import org.appdevforall.codeonthego.lsp.java.refactor.buildExtractVariableRewrite +import org.appdevforall.codeonthego.lsp.java.refactor.buildExtractionPlan +import org.appdevforall.codeonthego.lsp.java.refactor.candidateAndScopeFor +import org.appdevforall.codeonthego.lsp.java.refactor.toCandidateViews +import org.appdevforall.codeonthego.lsp.models.CodeActionItem +import org.appdevforall.codeonthego.lsp.models.CodeActionKind +import org.appdevforall.codeonthego.lsp.models.Command +import org.appdevforall.codeonthego.lsp.models.DocumentChange +import org.appdevforall.codeonthego.lsp.refactor.toTextEdit +import org.appdevforall.codeonthego.lsp.ui.ExtractVariableSelection +import org.appdevforall.codeonthego.lsp.ui.ExtractVariableSheet +import org.appdevforall.codeonthego.lsp.ui.findFragmentActivity +import org.appdevforall.codeonthego.projects.FileManager import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashInfo +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashInfo import org.slf4j.LoggerFactory import java.nio.file.Path import kotlin.coroutines.cancellation.CancellationException diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/FieldBasedAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/FieldBasedAction.kt similarity index 82% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/FieldBasedAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/FieldBasedAction.kt index 5e7ccfc7f1..1de1fb51a4 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/FieldBasedAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/FieldBasedAction.kt @@ -15,32 +15,32 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.actions +package org.appdevforall.codeonthego.lsp.java.actions import android.content.Context import android.view.View -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.newDialogBuilder -import com.itsaky.androidide.actions.requirePath -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag.EDITOR_CODE_ACTIONS_GEN_CONSTRUCTOR_DIALOG -import com.itsaky.androidide.idetooltips.TooltipTag.EDITOR_CODE_ACTIONS_GEN_TO_STRING_DIALOG -import com.itsaky.androidide.idetooltips.TooltipTag.EDITOR_CODE_ACTIONS_SETTER_GETTER_DIALOG -import com.itsaky.androidide.lsp.java.JavaCompilerProvider -import com.itsaky.androidide.lsp.java.actions.FieldBasedAction.ActionId.CONSTRUCTOR -import com.itsaky.androidide.lsp.java.actions.FieldBasedAction.ActionId.GETTER_SETTER -import com.itsaky.androidide.lsp.java.actions.FieldBasedAction.ActionId.TO_STRING -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.visitors.FindTypeDeclarationAt -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.projects.IProjectManager +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.newDialogBuilder +import org.appdevforall.codeonthego.actions.requirePath +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag.EDITOR_CODE_ACTIONS_GEN_CONSTRUCTOR_DIALOG +import org.appdevforall.codeonthego.idetooltips.TooltipTag.EDITOR_CODE_ACTIONS_GEN_TO_STRING_DIALOG +import org.appdevforall.codeonthego.idetooltips.TooltipTag.EDITOR_CODE_ACTIONS_SETTER_GETTER_DIALOG +import org.appdevforall.codeonthego.lsp.java.JavaCompilerProvider +import org.appdevforall.codeonthego.lsp.java.actions.FieldBasedAction.ActionId.CONSTRUCTOR +import org.appdevforall.codeonthego.lsp.java.actions.FieldBasedAction.ActionId.GETTER_SETTER +import org.appdevforall.codeonthego.lsp.java.actions.FieldBasedAction.ActionId.TO_STRING +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.visitors.FindTypeDeclarationAt +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.projects.IProjectManager import com.itsaky.androidide.resources.R -import com.itsaky.androidide.tasks.runOnUiThread -import com.itsaky.androidide.utils.applyLongPressRecursively -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashInfo +import org.appdevforall.codeonthego.tasks.runOnUiThread +import org.appdevforall.codeonthego.utils.applyLongPressRecursively +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashInfo import io.github.rosemoe.sora.widget.CodeEditor import jdkx.lang.model.element.Modifier.STATIC import openjdk.source.tree.ClassTree diff --git a/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/JavaCodeActionsMenu.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/JavaCodeActionsMenu.kt new file mode 100644 index 0000000000..0ded86c0b4 --- /dev/null +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/JavaCodeActionsMenu.kt @@ -0,0 +1,99 @@ +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.actions + +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.actions.CommentLineAction +import org.appdevforall.codeonthego.lsp.actions.IActionsMenuProvider +import org.appdevforall.codeonthego.lsp.actions.SurroundWithTryCatchAction +import org.appdevforall.codeonthego.lsp.actions.UncommentLineAction +import org.appdevforall.codeonthego.lsp.java.JavaLanguageServer +import org.appdevforall.codeonthego.lsp.java.actions.common.FindReferencesAction +import org.appdevforall.codeonthego.lsp.java.actions.common.GoToDefinitionAction +import org.appdevforall.codeonthego.lsp.java.actions.common.OrganizeImportsAction +import org.appdevforall.codeonthego.lsp.java.actions.common.RemoveUnusedImportsAction +import org.appdevforall.codeonthego.lsp.java.actions.diagnostics.AddImportAction +import org.appdevforall.codeonthego.lsp.java.actions.diagnostics.AddThrowsAction +import org.appdevforall.codeonthego.lsp.java.actions.diagnostics.AutoFixImportsAction +import org.appdevforall.codeonthego.lsp.java.actions.diagnostics.CreateMissingMethodAction +import org.appdevforall.codeonthego.lsp.java.actions.diagnostics.FieldToBlockAction +import org.appdevforall.codeonthego.lsp.java.actions.diagnostics.ImplementAbstractMethodsAction +import org.appdevforall.codeonthego.lsp.java.actions.diagnostics.RemoveClassAction +import org.appdevforall.codeonthego.lsp.java.actions.diagnostics.RemoveMethodAction +import org.appdevforall.codeonthego.lsp.java.actions.diagnostics.RemoveUnusedThrowsAction +import org.appdevforall.codeonthego.lsp.java.actions.diagnostics.SuppressUncheckedWarningAction +import org.appdevforall.codeonthego.lsp.java.actions.diagnostics.VariableToStatementAction +import org.appdevforall.codeonthego.lsp.java.actions.generators.GenerateConstructorAction +import org.appdevforall.codeonthego.lsp.java.actions.generators.GenerateMissingConstructorAction +import org.appdevforall.codeonthego.lsp.java.actions.generators.GenerateSettersAndGettersAction +import org.appdevforall.codeonthego.lsp.java.actions.generators.GenerateToStringMethodAction +import org.appdevforall.codeonthego.lsp.java.actions.generators.OverrideSuperclassMethodsAction + +/** + * Java code actions. + * @author Akash Yadav + */ +object JavaCodeActionsMenu : IActionsMenuProvider { + private const val LANG = "java" + private const val EXT = "java" + private const val LINE_COMMENT_TOKEN = "//" + private const val CATCH_CLAUSE = "catch (Exception e)" + private const val CATCH_BODY = "e.printStackTrace();" + + override val actions: List = + listOf( + CommentLineAction(LANG, EXT, LINE_COMMENT_TOKEN, TooltipTag.EDITOR_CODE_ACTIONS_COMMENT), + UncommentLineAction( + LANG, + EXT, + LINE_COMMENT_TOKEN, + TooltipTag.EDITOR_CODE_ACTIONS_UNCOMMENT, + ), + GoToDefinitionAction(), + FindReferencesAction(), + AddImportAction(), + AutoFixImportsAction(), + ImplementAbstractMethodsAction(), + VariableToStatementAction(), + FieldToBlockAction(), + RemoveClassAction(), + RemoveMethodAction(), + RemoveUnusedThrowsAction(), + CreateMissingMethodAction(), + SuppressUncheckedWarningAction(), + AddThrowsAction(), + GenerateSettersAndGettersAction(), + OverrideSuperclassMethodsAction(), + GenerateMissingConstructorAction(), + GenerateConstructorAction(), + GenerateToStringMethodAction(), + RemoveUnusedImportsAction(), + OrganizeImportsAction(), + SurroundWithTryCatchAction( + LANG, + EXT, + JavaLanguageServer.SERVER_ID, + CATCH_CLAUSE, + CATCH_BODY, + TooltipTag.EDITOR_CODE_ACTIONS_TRY_CATCH, + ), + ExtractVariableAction(), + ExtractMethodAction(), + ) +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/common/FindReferencesAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/common/FindReferencesAction.kt similarity index 79% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/common/FindReferencesAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/common/FindReferencesAction.kt index 2f5fd243b0..7bd53a8cf6 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/common/FindReferencesAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/common/FindReferencesAction.kt @@ -1,55 +1,55 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.java.actions.common - -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.editor.api.ILspEditor -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.java.actions.BaseJavaCodeAction -import com.itsaky.androidide.resources.R -import io.github.rosemoe.sora.widget.CodeEditor -import java.io.File - -/** - * Action that allows the user to find references to a variable, field, method or class. - * - * @author Akash Yadav - */ -class FindReferencesAction : BaseJavaCodeAction() { - - override val titleTextRes: Int = R.string.action_find_references - override val id: String = "ide.editor.lsp.java.findReferences" - override var label: String = "" - override var requiresUIThread: Boolean = true - override var tooltipTag: String = TooltipTag.EDITOR_CODE_ACTIONS_FIND_REFS - - override fun prepare(data: ActionData) { - super.prepare(data) - - if (!visible || !data.hasRequiredData(CodeEditor::class.java, File::class.java)) { - markInvisible() - return - } - } - - override suspend fun execAction(data: ActionData): Any { - val editor = data[CodeEditor::class.java]!! - return (editor as? ILspEditor)?.findReferences() ?: false - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.java.actions.common + +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.editor.api.ILspEditor +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.java.actions.BaseJavaCodeAction +import com.itsaky.androidide.resources.R +import io.github.rosemoe.sora.widget.CodeEditor +import java.io.File + +/** + * Action that allows the user to find references to a variable, field, method or class. + * + * @author Akash Yadav + */ +class FindReferencesAction : BaseJavaCodeAction() { + + override val titleTextRes: Int = R.string.action_find_references + override val id: String = "ide.editor.lsp.java.findReferences" + override var label: String = "" + override var requiresUIThread: Boolean = true + override var tooltipTag: String = TooltipTag.EDITOR_CODE_ACTIONS_FIND_REFS + + override fun prepare(data: ActionData) { + super.prepare(data) + + if (!visible || !data.hasRequiredData(CodeEditor::class.java, File::class.java)) { + markInvisible() + return + } + } + + override suspend fun execAction(data: ActionData): Any { + val editor = data[CodeEditor::class.java]!! + return (editor as? ILspEditor)?.findReferences() ?: false + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/common/GoToDefinitionAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/common/GoToDefinitionAction.kt similarity index 79% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/common/GoToDefinitionAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/common/GoToDefinitionAction.kt index 90c6d7a8bf..07ffaa98c4 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/common/GoToDefinitionAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/common/GoToDefinitionAction.kt @@ -1,56 +1,56 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.java.actions.common - -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.editor.api.ILspEditor -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.java.actions.BaseJavaCodeAction -import com.itsaky.androidide.resources.R -import io.github.rosemoe.sora.widget.CodeEditor -import java.io.File - -/** - * Action that allows the user to navigate to the definition of a variable, field, method, class, - * etc. - * - * @author Akash Yadav - */ -class GoToDefinitionAction : BaseJavaCodeAction() { - - override val titleTextRes: Int = R.string.action_goto_definition - override val id: String = "ide.editor.lsp.java.gotoDefinition" - override var label: String = "" - override var requiresUIThread: Boolean = true - override var tooltipTag: String = TooltipTag.EDITOR_CODE_ACTIONS_GOTO_DEF - - override fun prepare(data: ActionData) { - super.prepare(data) - - if (!visible || !data.hasRequiredData(CodeEditor::class.java, File::class.java)) { - markInvisible() - return - } - } - - override suspend fun execAction(data: ActionData): Any { - val editor = data[CodeEditor::class.java]!! - return (editor as? ILspEditor)?.findDefinition() ?: false - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.java.actions.common + +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.editor.api.ILspEditor +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.java.actions.BaseJavaCodeAction +import com.itsaky.androidide.resources.R +import io.github.rosemoe.sora.widget.CodeEditor +import java.io.File + +/** + * Action that allows the user to navigate to the definition of a variable, field, method, class, + * etc. + * + * @author Akash Yadav + */ +class GoToDefinitionAction : BaseJavaCodeAction() { + + override val titleTextRes: Int = R.string.action_goto_definition + override val id: String = "ide.editor.lsp.java.gotoDefinition" + override var label: String = "" + override var requiresUIThread: Boolean = true + override var tooltipTag: String = TooltipTag.EDITOR_CODE_ACTIONS_GOTO_DEF + + override fun prepare(data: ActionData) { + super.prepare(data) + + if (!visible || !data.hasRequiredData(CodeEditor::class.java, File::class.java)) { + markInvisible() + return + } + } + + override suspend fun execAction(data: ActionData): Any { + val editor = data[CodeEditor::class.java]!! + return (editor as? ILspEditor)?.findDefinition() ?: false + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/common/OrganizeImportsAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/common/OrganizeImportsAction.kt similarity index 73% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/common/OrganizeImportsAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/common/OrganizeImportsAction.kt index f1850d6e26..249c9d7e52 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/common/OrganizeImportsAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/common/OrganizeImportsAction.kt @@ -1,80 +1,80 @@ -package com.itsaky.androidide.lsp.java.actions.common - -import com.google.googlejavaformat.java.FormatterException -import com.google.googlejavaformat.java.ImportOrderer -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireEditor -import com.itsaky.androidide.editor.api.IEditor -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.java.JavaLanguageServer -import com.itsaky.androidide.lsp.java.actions.BaseJavaCodeAction -import com.itsaky.androidide.lsp.java.models.JavaServerSettings -import com.itsaky.androidide.resources.R.string -import io.github.rosemoe.sora.widget.CodeEditor -import org.slf4j.LoggerFactory - -class OrganizeImportsAction : BaseJavaCodeAction() { - - override val id: String = "lsp_java_organizeImports" - override var label: String = "" - override val titleTextRes: Int = string.action_organize_imports - override var tooltipTag: String = TooltipTag.EDITOR_CODE_ACTIONS_ORGANIZE_IMPORTS - - companion object { - - private val log = LoggerFactory.getLogger(OrganizeImportsAction::class.java) - } - - override fun prepare(data: ActionData) { - super.prepare(data) - if (!visible) { - return - } - - if (!data.hasRequiredData(CodeEditor::class.java)) { - markInvisible() - return - } - - visible = true - enabled = true - } - - override suspend fun execAction(data: ActionData): Any { - val watch = com.itsaky.androidide.utils.StopWatch("Organize imports") - return try { - val editor = data.requireEditor() - val content = editor.text - val server = data[JavaLanguageServer::class.java] - val settings = server!!.settings as JavaServerSettings - val output = ImportOrderer.reorderImports(content.toString(), settings.style) - watch.log() - output - } catch (e: FormatterException) { - log.error("Failed to reorder imports", e) - false - } - } - - override fun postExec(data: ActionData, result: Any) { - super.postExec(data, result) - if (result is String) { - if (result.isNotEmpty()) { - val editor = data.requireEditor() - val cursor = editor.cursor.left() - - editor.text.apply { - val endLine = getLine(lineCount - 1) - replace(0, 0, lineCount - 1, endLine.length + endLine.lineSeparator.length, result) - } - - (editor as? IEditor?)?.also { - it.setSelectionAround(cursor) - editor.ensureSelectionVisible() - } - } - } - } -} +package org.appdevforall.codeonthego.lsp.java.actions.common + +import com.google.googlejavaformat.java.FormatterException +import com.google.googlejavaformat.java.ImportOrderer +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireEditor +import org.appdevforall.codeonthego.editor.api.IEditor +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.java.JavaLanguageServer +import org.appdevforall.codeonthego.lsp.java.actions.BaseJavaCodeAction +import org.appdevforall.codeonthego.lsp.java.models.JavaServerSettings +import com.itsaky.androidide.resources.R.string +import io.github.rosemoe.sora.widget.CodeEditor +import org.slf4j.LoggerFactory + +class OrganizeImportsAction : BaseJavaCodeAction() { + + override val id: String = "lsp_java_organizeImports" + override var label: String = "" + override val titleTextRes: Int = string.action_organize_imports + override var tooltipTag: String = TooltipTag.EDITOR_CODE_ACTIONS_ORGANIZE_IMPORTS + + companion object { + + private val log = LoggerFactory.getLogger(OrganizeImportsAction::class.java) + } + + override fun prepare(data: ActionData) { + super.prepare(data) + if (!visible) { + return + } + + if (!data.hasRequiredData(CodeEditor::class.java)) { + markInvisible() + return + } + + visible = true + enabled = true + } + + override suspend fun execAction(data: ActionData): Any { + val watch = org.appdevforall.codeonthego.utils.StopWatch("Organize imports") + return try { + val editor = data.requireEditor() + val content = editor.text + val server = data[JavaLanguageServer::class.java] + val settings = server!!.settings as JavaServerSettings + val output = ImportOrderer.reorderImports(content.toString(), settings.style) + watch.log() + output + } catch (e: FormatterException) { + log.error("Failed to reorder imports", e) + false + } + } + + override fun postExec(data: ActionData, result: Any) { + super.postExec(data, result) + if (result is String) { + if (result.isNotEmpty()) { + val editor = data.requireEditor() + val cursor = editor.cursor.left() + + editor.text.apply { + val endLine = getLine(lineCount - 1) + replace(0, 0, lineCount - 1, endLine.length + endLine.lineSeparator.length, result) + } + + (editor as? IEditor?)?.also { + it.setSelectionAround(cursor) + editor.ensureSelectionVisible() + } + } + } + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/common/RemoveUnusedImportsAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/common/RemoveUnusedImportsAction.kt similarity index 74% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/common/RemoveUnusedImportsAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/common/RemoveUnusedImportsAction.kt index 00c6f92af4..ce14a35d8d 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/common/RemoveUnusedImportsAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/common/RemoveUnusedImportsAction.kt @@ -1,62 +1,62 @@ -package com.itsaky.androidide.lsp.java.actions.common - -import com.google.googlejavaformat.java.FormatterException -import com.google.googlejavaformat.java.RemoveUnusedImports -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireEditor -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.java.actions.BaseJavaCodeAction -import com.itsaky.androidide.resources.R.string -import io.github.rosemoe.sora.widget.CodeEditor -import org.slf4j.LoggerFactory - -class RemoveUnusedImportsAction : BaseJavaCodeAction() { - - override val id: String = "ide.editor.lsp.java.removeUnusedImports" - override var label: String = "" - override val titleTextRes: Int = string.action_remove_unused_imports - override var tooltipTag: String = TooltipTag.EDITOR_CODE_ACTIONS_UNUSED_IMPORTS - - companion object { - - private val log = LoggerFactory.getLogger(RemoveUnusedImportsAction::class.java) - } - - override fun prepare(data: ActionData) { - super.prepare(data) - if (!visible) { - return - } - - if (!data.hasRequiredData(CodeEditor::class.java)) { - markInvisible() - return - } - - visible = true - enabled = true - } - - override suspend fun execAction(data: ActionData): Any { - val watch = com.itsaky.androidide.utils.StopWatch("Remove unused imports") - return try { - val editor = data.requireEditor() - val content = editor.text - val output = RemoveUnusedImports.removeUnusedImports(content.toString()) - watch.log() - output - } catch (e: FormatterException) { - log.error("Failed to remove unused imports", e) - false - } - } - - override fun postExec(data: ActionData, result: Any) { - if (result is String && result.isNotEmpty()) { - val editor = data.requireEditor() - editor.setText(result) - } - } -} +package org.appdevforall.codeonthego.lsp.java.actions.common + +import com.google.googlejavaformat.java.FormatterException +import com.google.googlejavaformat.java.RemoveUnusedImports +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireEditor +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.java.actions.BaseJavaCodeAction +import com.itsaky.androidide.resources.R.string +import io.github.rosemoe.sora.widget.CodeEditor +import org.slf4j.LoggerFactory + +class RemoveUnusedImportsAction : BaseJavaCodeAction() { + + override val id: String = "ide.editor.lsp.java.removeUnusedImports" + override var label: String = "" + override val titleTextRes: Int = string.action_remove_unused_imports + override var tooltipTag: String = TooltipTag.EDITOR_CODE_ACTIONS_UNUSED_IMPORTS + + companion object { + + private val log = LoggerFactory.getLogger(RemoveUnusedImportsAction::class.java) + } + + override fun prepare(data: ActionData) { + super.prepare(data) + if (!visible) { + return + } + + if (!data.hasRequiredData(CodeEditor::class.java)) { + markInvisible() + return + } + + visible = true + enabled = true + } + + override suspend fun execAction(data: ActionData): Any { + val watch = org.appdevforall.codeonthego.utils.StopWatch("Remove unused imports") + return try { + val editor = data.requireEditor() + val content = editor.text + val output = RemoveUnusedImports.removeUnusedImports(content.toString()) + watch.log() + output + } catch (e: FormatterException) { + log.error("Failed to remove unused imports", e) + false + } + } + + override fun postExec(data: ActionData, result: Any) { + if (result is String && result.isNotEmpty()) { + val editor = data.requireEditor() + editor.setText(result) + } + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/AddImportAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/AddImportAction.kt similarity index 80% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/AddImportAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/AddImportAction.kt index 00e1e31549..5ed979ddb9 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/AddImportAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/AddImportAction.kt @@ -14,33 +14,33 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.actions.diagnostics +package org.appdevforall.codeonthego.lsp.java.actions.diagnostics import android.content.Context import android.view.View import android.widget.ListView import com.google.common.collect.Iterables.toArray -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.newDialogBuilder -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.actions.requirePath -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.javac.services.util.JavaDiagnosticUtils -import com.itsaky.androidide.lsp.api.ILanguageClient -import com.itsaky.androidide.lsp.java.JavaCompilerProvider -import com.itsaky.androidide.lsp.java.actions.BaseJavaCodeAction -import com.itsaky.androidide.lsp.java.models.DiagnosticCode -import com.itsaky.androidide.lsp.java.rewrite.AddImport -import com.itsaky.androidide.lsp.java.rewrite.Rewrite -import com.itsaky.androidide.lsp.models.CodeActionItem -import com.itsaky.androidide.lsp.models.DiagnosticItem -import com.itsaky.androidide.projects.IProjectManager +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.newDialogBuilder +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.actions.requirePath +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.javac.services.util.JavaDiagnosticUtils +import org.appdevforall.codeonthego.lsp.api.ILanguageClient +import org.appdevforall.codeonthego.lsp.java.JavaCompilerProvider +import org.appdevforall.codeonthego.lsp.java.actions.BaseJavaCodeAction +import org.appdevforall.codeonthego.lsp.java.models.DiagnosticCode +import org.appdevforall.codeonthego.lsp.java.rewrite.AddImport +import org.appdevforall.codeonthego.lsp.java.rewrite.Rewrite +import org.appdevforall.codeonthego.lsp.models.CodeActionItem +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem +import org.appdevforall.codeonthego.projects.IProjectManager import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.applyLongPressRecursively +import org.appdevforall.codeonthego.utils.applyLongPressRecursively import jdkx.tools.Diagnostic import jdkx.tools.JavaFileObject import org.slf4j.LoggerFactory diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/AddThrowsAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/AddThrowsAction.kt similarity index 74% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/AddThrowsAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/AddThrowsAction.kt index f52e48134b..a1b028fa0e 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/AddThrowsAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/AddThrowsAction.kt @@ -1,89 +1,89 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.java.actions.diagnostics - -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.actions.requirePath -import com.itsaky.androidide.lsp.java.JavaCompilerProvider -import com.itsaky.androidide.lsp.java.actions.BaseJavaCodeAction -import com.itsaky.androidide.lsp.java.models.DiagnosticCode -import com.itsaky.androidide.lsp.java.rewrite.AddException -import com.itsaky.androidide.lsp.java.utils.CodeActionUtils -import com.itsaky.androidide.lsp.models.DiagnosticItem -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.resources.R -import org.slf4j.LoggerFactory - -/** @author Akash Yadav */ -class AddThrowsAction : BaseJavaCodeAction() { - - override val id = "ide.editor.lsp.java.diagnostics.addThrows" - override var label: String = "" - private val diagnosticCode = DiagnosticCode.NOT_THROWN.id - - override val titleTextRes: Int = R.string.action_add_throws - - companion object { - - private val log = LoggerFactory.getLogger(AddThrowsAction::class.java) - } - - override fun prepare(data: ActionData) { - super.prepare(data) - - if (!visible || !data.hasRequiredData(DiagnosticItem::class.java)) { - markInvisible() - return - } - - val diagnostic = data[DiagnosticItem::class.java]!! - if (diagnosticCode != diagnostic.code) { - markInvisible() - return - } - } - - override suspend fun execAction(data: ActionData): Any { - val diagnostic = data[DiagnosticItem::class.java]!! - val compiler = - JavaCompilerProvider.get( - IProjectManager.getInstance().findModuleForFile(data.requireFile(), false) ?: return Any()) - val file = data.requirePath() - return compiler.compile(file).get { task -> - val needsThrow = CodeActionUtils.findMethod(task, diagnostic.range) - val exceptionName = CodeActionUtils.extractExceptionName(diagnostic.message) - return@get AddException( - needsThrow.className, - needsThrow.methodName, - needsThrow.erasedParameterTypes, - exceptionName - ) - } - } - - override fun postExec(data: ActionData, result: Any) { - if (result !is AddException) { - log.warn("Unable to add 'throws' expression") - return - } - - performCodeAction(data, result) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.java.actions.diagnostics + +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.actions.requirePath +import org.appdevforall.codeonthego.lsp.java.JavaCompilerProvider +import org.appdevforall.codeonthego.lsp.java.actions.BaseJavaCodeAction +import org.appdevforall.codeonthego.lsp.java.models.DiagnosticCode +import org.appdevforall.codeonthego.lsp.java.rewrite.AddException +import org.appdevforall.codeonthego.lsp.java.utils.CodeActionUtils +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem +import org.appdevforall.codeonthego.projects.IProjectManager +import com.itsaky.androidide.resources.R +import org.slf4j.LoggerFactory + +/** @author Akash Yadav */ +class AddThrowsAction : BaseJavaCodeAction() { + + override val id = "ide.editor.lsp.java.diagnostics.addThrows" + override var label: String = "" + private val diagnosticCode = DiagnosticCode.NOT_THROWN.id + + override val titleTextRes: Int = R.string.action_add_throws + + companion object { + + private val log = LoggerFactory.getLogger(AddThrowsAction::class.java) + } + + override fun prepare(data: ActionData) { + super.prepare(data) + + if (!visible || !data.hasRequiredData(DiagnosticItem::class.java)) { + markInvisible() + return + } + + val diagnostic = data[DiagnosticItem::class.java]!! + if (diagnosticCode != diagnostic.code) { + markInvisible() + return + } + } + + override suspend fun execAction(data: ActionData): Any { + val diagnostic = data[DiagnosticItem::class.java]!! + val compiler = + JavaCompilerProvider.get( + IProjectManager.getInstance().findModuleForFile(data.requireFile(), false) ?: return Any()) + val file = data.requirePath() + return compiler.compile(file).get { task -> + val needsThrow = CodeActionUtils.findMethod(task, diagnostic.range) + val exceptionName = CodeActionUtils.extractExceptionName(diagnostic.message) + return@get AddException( + needsThrow.className, + needsThrow.methodName, + needsThrow.erasedParameterTypes, + exceptionName + ) + } + } + + override fun postExec(data: ActionData, result: Any) { + if (result !is AddException) { + log.warn("Unable to add 'throws' expression") + return + } + + performCodeAction(data, result) + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/AutoFixImportsAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/AutoFixImportsAction.kt similarity index 86% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/AutoFixImportsAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/AutoFixImportsAction.kt index e89567953e..aced5d8b1d 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/AutoFixImportsAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/AutoFixImportsAction.kt @@ -15,29 +15,29 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.actions.diagnostics +package org.appdevforall.codeonthego.lsp.java.actions.diagnostics import android.content.Context import android.view.View import android.widget.ListView -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.actions.requirePath -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.actions.requirePath +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag import com.itsaky.androidide.lsp.java.R -import com.itsaky.androidide.lsp.java.actions.BaseJavaCodeAction -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.models.DiagnosticCode -import com.itsaky.androidide.lsp.java.utils.positionForImports -import com.itsaky.androidide.lsp.models.CodeActionItem -import com.itsaky.androidide.lsp.models.CodeActionKind -import com.itsaky.androidide.lsp.models.DocumentChange -import com.itsaky.androidide.lsp.models.TextEdit -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.utils.DialogUtils -import com.itsaky.androidide.utils.applyLongPressRecursively -import com.itsaky.androidide.utils.flashInfo +import org.appdevforall.codeonthego.lsp.java.actions.BaseJavaCodeAction +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.models.DiagnosticCode +import org.appdevforall.codeonthego.lsp.java.utils.positionForImports +import org.appdevforall.codeonthego.lsp.models.CodeActionItem +import org.appdevforall.codeonthego.lsp.models.CodeActionKind +import org.appdevforall.codeonthego.lsp.models.DocumentChange +import org.appdevforall.codeonthego.lsp.models.TextEdit +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.utils.DialogUtils +import org.appdevforall.codeonthego.utils.applyLongPressRecursively +import org.appdevforall.codeonthego.utils.flashInfo import org.slf4j.LoggerFactory import java.nio.file.Path diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/CreateMissingMethodAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/CreateMissingMethodAction.kt similarity index 65% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/CreateMissingMethodAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/CreateMissingMethodAction.kt index 75181aeac8..98ac8e09d9 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/CreateMissingMethodAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/CreateMissingMethodAction.kt @@ -1,84 +1,84 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.java.actions.diagnostics - -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.actions.requirePath -import com.itsaky.androidide.lsp.java.JavaCompilerProvider -import com.itsaky.androidide.lsp.java.actions.BaseJavaCodeAction -import com.itsaky.androidide.lsp.java.models.DiagnosticCode -import com.itsaky.androidide.lsp.java.rewrite.CreateMissingMethod -import com.itsaky.androidide.lsp.java.utils.CodeActionUtils.findPosition -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.resources.R -import org.slf4j.LoggerFactory - -/** @author Akash Yadav */ -class CreateMissingMethodAction : BaseJavaCodeAction() { - - override val id: String = "ide.editor.lsp.java.diagnostics.createMissingMethod" - override var label: String = "" - private val diagnosticCode = DiagnosticCode.MISSING_METHOD.id - - override val titleTextRes: Int = R.string.action_create_missing_method - - companion object { - - private val log = LoggerFactory.getLogger(CreateMissingMethodAction::class.java) - } - - override fun prepare(data: ActionData) { - super.prepare(data) - - if ( - !visible || - !data.hasRequiredData(com.itsaky.androidide.lsp.models.DiagnosticItem::class.java) - ) { - markInvisible() - return - } - - val diagnostic = data[com.itsaky.androidide.lsp.models.DiagnosticItem::class.java]!! - if (diagnosticCode != diagnostic.code) { - markInvisible() - return - } - } - - override suspend fun execAction(data: ActionData): Any { - val diagnostic = data[com.itsaky.androidide.lsp.models.DiagnosticItem::class.java]!! - val compiler = - JavaCompilerProvider.get( - IProjectManager.getInstance().findModuleForFile(data.requireFile(), false) ?: return Any()) - val file = data.requirePath() - return compiler.compile(file).get { - CreateMissingMethod(file, findPosition(it, diagnostic.range.start)) - } - } - - override fun postExec(data: ActionData, result: Any) { - if (result !is CreateMissingMethod) { - log.warn("Unable to create missing method") - return - } - - performCodeAction(data, result) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.java.actions.diagnostics + +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.actions.requirePath +import org.appdevforall.codeonthego.lsp.java.JavaCompilerProvider +import org.appdevforall.codeonthego.lsp.java.actions.BaseJavaCodeAction +import org.appdevforall.codeonthego.lsp.java.models.DiagnosticCode +import org.appdevforall.codeonthego.lsp.java.rewrite.CreateMissingMethod +import org.appdevforall.codeonthego.lsp.java.utils.CodeActionUtils.findPosition +import org.appdevforall.codeonthego.projects.IProjectManager +import com.itsaky.androidide.resources.R +import org.slf4j.LoggerFactory + +/** @author Akash Yadav */ +class CreateMissingMethodAction : BaseJavaCodeAction() { + + override val id: String = "ide.editor.lsp.java.diagnostics.createMissingMethod" + override var label: String = "" + private val diagnosticCode = DiagnosticCode.MISSING_METHOD.id + + override val titleTextRes: Int = R.string.action_create_missing_method + + companion object { + + private val log = LoggerFactory.getLogger(CreateMissingMethodAction::class.java) + } + + override fun prepare(data: ActionData) { + super.prepare(data) + + if ( + !visible || + !data.hasRequiredData(org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java) + ) { + markInvisible() + return + } + + val diagnostic = data[org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java]!! + if (diagnosticCode != diagnostic.code) { + markInvisible() + return + } + } + + override suspend fun execAction(data: ActionData): Any { + val diagnostic = data[org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java]!! + val compiler = + JavaCompilerProvider.get( + IProjectManager.getInstance().findModuleForFile(data.requireFile(), false) ?: return Any()) + val file = data.requirePath() + return compiler.compile(file).get { + CreateMissingMethod(file, findPosition(it, diagnostic.range.start)) + } + } + + override fun postExec(data: ActionData, result: Any) { + if (result !is CreateMissingMethod) { + log.warn("Unable to create missing method") + return + } + + performCodeAction(data, result) + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/FieldToBlockAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/FieldToBlockAction.kt similarity index 71% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/FieldToBlockAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/FieldToBlockAction.kt index b9588f52d5..c87daa4aba 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/FieldToBlockAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/FieldToBlockAction.kt @@ -14,20 +14,20 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.actions.diagnostics +package org.appdevforall.codeonthego.lsp.java.actions.diagnostics -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.actions.requirePath -import com.itsaky.androidide.lsp.java.JavaCompilerProvider -import com.itsaky.androidide.lsp.java.actions.BaseJavaCodeAction -import com.itsaky.androidide.lsp.java.models.DiagnosticCode -import com.itsaky.androidide.lsp.java.rewrite.ConvertFieldToBlock -import com.itsaky.androidide.lsp.java.utils.CodeActionUtils.findPosition -import com.itsaky.androidide.lsp.models.DiagnosticItem -import com.itsaky.androidide.projects.IProjectManager +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.actions.requirePath +import org.appdevforall.codeonthego.lsp.java.JavaCompilerProvider +import org.appdevforall.codeonthego.lsp.java.actions.BaseJavaCodeAction +import org.appdevforall.codeonthego.lsp.java.models.DiagnosticCode +import org.appdevforall.codeonthego.lsp.java.rewrite.ConvertFieldToBlock +import org.appdevforall.codeonthego.lsp.java.utils.CodeActionUtils.findPosition +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem +import org.appdevforall.codeonthego.projects.IProjectManager import com.itsaky.androidide.resources.R import org.slf4j.LoggerFactory diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/ImplementAbstractMethodsAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/ImplementAbstractMethodsAction.kt similarity index 72% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/ImplementAbstractMethodsAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/ImplementAbstractMethodsAction.kt index 76971f321f..a64d681549 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/ImplementAbstractMethodsAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/ImplementAbstractMethodsAction.kt @@ -1,94 +1,94 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.java.actions.diagnostics - -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.javac.services.util.JavaDiagnosticUtils -import com.itsaky.androidide.lsp.java.actions.BaseJavaCodeAction -import com.itsaky.androidide.lsp.java.models.DiagnosticCode -import com.itsaky.androidide.lsp.java.rewrite.ImplementAbstractMethods -import com.itsaky.androidide.resources.R -import jdkx.tools.Diagnostic -import jdkx.tools.JavaFileObject -import org.slf4j.LoggerFactory - -/** @author Akash Yadav */ -class ImplementAbstractMethodsAction : BaseJavaCodeAction() { - - override val id: String = "ide.editor.lsp.java.diagnostics.implementAbstractMethods" - override var label: String = "" - private var diagnosticCode = DiagnosticCode.DOES_NOT_OVERRIDE_ABSTRACT.id - - override val titleTextRes: Int = R.string.action_implement_abstract_methods - override var tooltipTag: String = TooltipTag.EDITOR_CODE_ACTIONS_OVERRIDE_SUPER - - companion object { - - private val log = LoggerFactory.getLogger(ImplementAbstractMethodsAction::class.java) - } - - @Suppress("UNCHECKED_CAST") - override fun prepare(data: ActionData) { - super.prepare(data) - - if (!visible) { - return - } - - if (!data.hasRequiredData(com.itsaky.androidide.lsp.models.DiagnosticItem::class.java)) { - markInvisible() - return - } - - val diagnostic = data.get(com.itsaky.androidide.lsp.models.DiagnosticItem::class.java)!! - if (diagnosticCode != diagnostic.code || diagnostic.extra !is Diagnostic<*>) { - markInvisible() - return - } - - JavaDiagnosticUtils.asJCDiagnostic(diagnostic.extra as Diagnostic) - ?: run { - markInvisible() - return - } - - visible = true - enabled = true - } - - @Suppress("UNCHECKED_CAST") - override suspend fun execAction(data: ActionData): Any { - val diagnostic = - JavaDiagnosticUtils.asJCDiagnostic( - data.get( - com.itsaky.androidide.lsp.models.DiagnosticItem::class.java)!!.extra as Diagnostic - ) - return ImplementAbstractMethods(diagnostic!!) - } - - override fun postExec(data: ActionData, result: Any) { - if (result !is ImplementAbstractMethods) { - log.warn("Unable to perform action. Invalid result from execAction(..)") - return - } - - performCodeAction(data, result) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.java.actions.diagnostics + +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.javac.services.util.JavaDiagnosticUtils +import org.appdevforall.codeonthego.lsp.java.actions.BaseJavaCodeAction +import org.appdevforall.codeonthego.lsp.java.models.DiagnosticCode +import org.appdevforall.codeonthego.lsp.java.rewrite.ImplementAbstractMethods +import com.itsaky.androidide.resources.R +import jdkx.tools.Diagnostic +import jdkx.tools.JavaFileObject +import org.slf4j.LoggerFactory + +/** @author Akash Yadav */ +class ImplementAbstractMethodsAction : BaseJavaCodeAction() { + + override val id: String = "ide.editor.lsp.java.diagnostics.implementAbstractMethods" + override var label: String = "" + private var diagnosticCode = DiagnosticCode.DOES_NOT_OVERRIDE_ABSTRACT.id + + override val titleTextRes: Int = R.string.action_implement_abstract_methods + override var tooltipTag: String = TooltipTag.EDITOR_CODE_ACTIONS_OVERRIDE_SUPER + + companion object { + + private val log = LoggerFactory.getLogger(ImplementAbstractMethodsAction::class.java) + } + + @Suppress("UNCHECKED_CAST") + override fun prepare(data: ActionData) { + super.prepare(data) + + if (!visible) { + return + } + + if (!data.hasRequiredData(org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java)) { + markInvisible() + return + } + + val diagnostic = data.get(org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java)!! + if (diagnosticCode != diagnostic.code || diagnostic.extra !is Diagnostic<*>) { + markInvisible() + return + } + + JavaDiagnosticUtils.asJCDiagnostic(diagnostic.extra as Diagnostic) + ?: run { + markInvisible() + return + } + + visible = true + enabled = true + } + + @Suppress("UNCHECKED_CAST") + override suspend fun execAction(data: ActionData): Any { + val diagnostic = + JavaDiagnosticUtils.asJCDiagnostic( + data.get( + org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java)!!.extra as Diagnostic + ) + return ImplementAbstractMethods(diagnostic!!) + } + + override fun postExec(data: ActionData, result: Any) { + if (result !is ImplementAbstractMethods) { + log.warn("Unable to perform action. Invalid result from execAction(..)") + return + } + + performCodeAction(data, result) + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/RemoveClassAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/RemoveClassAction.kt similarity index 66% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/RemoveClassAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/RemoveClassAction.kt index 221e5354e7..5c74db68de 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/RemoveClassAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/RemoveClassAction.kt @@ -1,84 +1,84 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.java.actions.diagnostics - -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.actions.requirePath -import com.itsaky.androidide.lsp.java.JavaCompilerProvider -import com.itsaky.androidide.lsp.java.actions.BaseJavaCodeAction -import com.itsaky.androidide.lsp.java.models.DiagnosticCode -import com.itsaky.androidide.lsp.java.rewrite.RemoveClass -import com.itsaky.androidide.lsp.java.utils.CodeActionUtils.findPosition -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.resources.R -import org.slf4j.LoggerFactory - -/** @author Akash Yadav */ -class RemoveClassAction : BaseJavaCodeAction() { - - override val id: String = "ide.editor.lsp.java.diagnostics.removeClass" - override var label: String = "" - private val diagnosticCode = DiagnosticCode.UNUSED_CLASS.id - - override val titleTextRes: Int = R.string.action_remove_class - - companion object { - - private val log = LoggerFactory.getLogger(RemoveClassAction::class.java) - } - - override fun prepare(data: ActionData) { - super.prepare(data) - - if (!visible || !data.hasRequiredData( - com.itsaky.androidide.lsp.models.DiagnosticItem::class.java) - ) { - markInvisible() - return - } - - val diagnostic = data[com.itsaky.androidide.lsp.models.DiagnosticItem::class.java]!! - if (diagnosticCode != diagnostic.code) { - markInvisible() - return - } - } - - override suspend fun execAction(data: ActionData): Any { - val diagnostic = data[com.itsaky.androidide.lsp.models.DiagnosticItem::class.java]!! - val compiler = - JavaCompilerProvider.get( - IProjectManager.getInstance().findModuleForFile(data.requireFile(), false) ?: return Any()) - val file = data.requirePath() - - return compiler.compile(file).get { - RemoveClass(file, findPosition(it, diagnostic.range.start)) - } - } - - override fun postExec(data: ActionData, result: Any) { - if (result !is RemoveClass) { - log.warn("Unable to remove class") - return - } - - performCodeAction(data, result) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.java.actions.diagnostics + +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.actions.requirePath +import org.appdevforall.codeonthego.lsp.java.JavaCompilerProvider +import org.appdevforall.codeonthego.lsp.java.actions.BaseJavaCodeAction +import org.appdevforall.codeonthego.lsp.java.models.DiagnosticCode +import org.appdevforall.codeonthego.lsp.java.rewrite.RemoveClass +import org.appdevforall.codeonthego.lsp.java.utils.CodeActionUtils.findPosition +import org.appdevforall.codeonthego.projects.IProjectManager +import com.itsaky.androidide.resources.R +import org.slf4j.LoggerFactory + +/** @author Akash Yadav */ +class RemoveClassAction : BaseJavaCodeAction() { + + override val id: String = "ide.editor.lsp.java.diagnostics.removeClass" + override var label: String = "" + private val diagnosticCode = DiagnosticCode.UNUSED_CLASS.id + + override val titleTextRes: Int = R.string.action_remove_class + + companion object { + + private val log = LoggerFactory.getLogger(RemoveClassAction::class.java) + } + + override fun prepare(data: ActionData) { + super.prepare(data) + + if (!visible || !data.hasRequiredData( + org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java) + ) { + markInvisible() + return + } + + val diagnostic = data[org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java]!! + if (diagnosticCode != diagnostic.code) { + markInvisible() + return + } + } + + override suspend fun execAction(data: ActionData): Any { + val diagnostic = data[org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java]!! + val compiler = + JavaCompilerProvider.get( + IProjectManager.getInstance().findModuleForFile(data.requireFile(), false) ?: return Any()) + val file = data.requirePath() + + return compiler.compile(file).get { + RemoveClass(file, findPosition(it, diagnostic.range.start)) + } + } + + override fun postExec(data: ActionData, result: Any) { + if (result !is RemoveClass) { + log.warn("Unable to remove class") + return + } + + performCodeAction(data, result) + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/RemoveMethodAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/RemoveMethodAction.kt similarity index 67% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/RemoveMethodAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/RemoveMethodAction.kt index b0aa7ef5a1..1763580dae 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/RemoveMethodAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/RemoveMethodAction.kt @@ -1,89 +1,89 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.java.actions.diagnostics - -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.actions.requirePath -import com.itsaky.androidide.lsp.java.JavaCompilerProvider -import com.itsaky.androidide.lsp.java.actions.BaseJavaCodeAction -import com.itsaky.androidide.lsp.java.models.DiagnosticCode -import com.itsaky.androidide.lsp.java.rewrite.RemoveMethod -import com.itsaky.androidide.lsp.java.utils.CodeActionUtils.findMethod -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.resources.R -import org.slf4j.LoggerFactory - -/** @author Akash Yadav */ -class RemoveMethodAction : BaseJavaCodeAction() { - - override val id: String = "ide.editor.lsp.java.diagnostics.removeMethod" - override var label: String = "" - private val diagnosticCode = DiagnosticCode.UNUSED_METHOD.id - - override val titleTextRes: Int = R.string.action_remove_method - - companion object { - - private val log = LoggerFactory.getLogger(RemoveMethodAction::class.java) - } - - override fun prepare(data: ActionData) { - super.prepare(data) - - if (!visible || !data.hasRequiredData( - com.itsaky.androidide.lsp.models.DiagnosticItem::class.java) - ) { - markInvisible() - return - } - - val diagnostic = data[com.itsaky.androidide.lsp.models.DiagnosticItem::class.java]!! - if (diagnosticCode != diagnostic.code) { - markInvisible() - return - } - } - - override suspend fun execAction(data: ActionData): Any { - val diagnostic = data[com.itsaky.androidide.lsp.models.DiagnosticItem::class.java]!! - val compiler = - JavaCompilerProvider.get( - IProjectManager.getInstance().findModuleForFile(data.requireFile(), false) ?: return Any()) - val file = data.requirePath() - - return compiler.compile(file).get { - val unusedMethod = findMethod(it, diagnostic.range) - RemoveMethod( - unusedMethod.className, - unusedMethod.methodName, - unusedMethod.erasedParameterTypes - ) - } - } - - override fun postExec(data: ActionData, result: Any) { - if (result !is RemoveMethod) { - log.warn("Unable to remove method") - return - } - - performCodeAction(data, result) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.java.actions.diagnostics + +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.actions.requirePath +import org.appdevforall.codeonthego.lsp.java.JavaCompilerProvider +import org.appdevforall.codeonthego.lsp.java.actions.BaseJavaCodeAction +import org.appdevforall.codeonthego.lsp.java.models.DiagnosticCode +import org.appdevforall.codeonthego.lsp.java.rewrite.RemoveMethod +import org.appdevforall.codeonthego.lsp.java.utils.CodeActionUtils.findMethod +import org.appdevforall.codeonthego.projects.IProjectManager +import com.itsaky.androidide.resources.R +import org.slf4j.LoggerFactory + +/** @author Akash Yadav */ +class RemoveMethodAction : BaseJavaCodeAction() { + + override val id: String = "ide.editor.lsp.java.diagnostics.removeMethod" + override var label: String = "" + private val diagnosticCode = DiagnosticCode.UNUSED_METHOD.id + + override val titleTextRes: Int = R.string.action_remove_method + + companion object { + + private val log = LoggerFactory.getLogger(RemoveMethodAction::class.java) + } + + override fun prepare(data: ActionData) { + super.prepare(data) + + if (!visible || !data.hasRequiredData( + org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java) + ) { + markInvisible() + return + } + + val diagnostic = data[org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java]!! + if (diagnosticCode != diagnostic.code) { + markInvisible() + return + } + } + + override suspend fun execAction(data: ActionData): Any { + val diagnostic = data[org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java]!! + val compiler = + JavaCompilerProvider.get( + IProjectManager.getInstance().findModuleForFile(data.requireFile(), false) ?: return Any()) + val file = data.requirePath() + + return compiler.compile(file).get { + val unusedMethod = findMethod(it, diagnostic.range) + RemoveMethod( + unusedMethod.className, + unusedMethod.methodName, + unusedMethod.erasedParameterTypes + ) + } + } + + override fun postExec(data: ActionData, result: Any) { + if (result !is RemoveMethod) { + log.warn("Unable to remove method") + return + } + + performCodeAction(data, result) + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/RemoveUnusedThrowsAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/RemoveUnusedThrowsAction.kt similarity index 69% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/RemoveUnusedThrowsAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/RemoveUnusedThrowsAction.kt index b1c3d35c33..0c1da253b8 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/RemoveUnusedThrowsAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/RemoveUnusedThrowsAction.kt @@ -1,92 +1,92 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.java.actions.diagnostics - -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.actions.requirePath -import com.itsaky.androidide.lsp.java.JavaCompilerProvider -import com.itsaky.androidide.lsp.java.actions.BaseJavaCodeAction -import com.itsaky.androidide.lsp.java.models.DiagnosticCode -import com.itsaky.androidide.lsp.java.rewrite.RemoveException -import com.itsaky.androidide.lsp.java.utils.CodeActionUtils -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.resources.R -import org.slf4j.LoggerFactory - -/** @author Akash Yadav */ -class RemoveUnusedThrowsAction : BaseJavaCodeAction() { - - override val id: String = "ide.editor.lsp.java.diagnostics.removeUnusedThrows" - override var label: String = "" - private val diagnosticCode = DiagnosticCode.UNUSED_THROWS.id - - override val titleTextRes: Int = R.string.action_remove_unused_throws - - companion object { - - private val log = LoggerFactory.getLogger(RemoveUnusedThrowsAction::class.java) - } - - override fun prepare(data: ActionData) { - super.prepare(data) - - if ( - !visible || - !data.hasRequiredData(com.itsaky.androidide.lsp.models.DiagnosticItem::class.java) - ) { - markInvisible() - return - } - - val diagnostic = data[com.itsaky.androidide.lsp.models.DiagnosticItem::class.java]!! - if (diagnosticCode != diagnostic.code) { - markInvisible() - return - } - } - - override suspend fun execAction(data: ActionData): Any { - val d = data[com.itsaky.androidide.lsp.models.DiagnosticItem::class.java]!! - val compiler = - JavaCompilerProvider.get( - IProjectManager.getInstance().findModuleForFile(data.requireFile(), false) ?: return Any()) - val file = data.requirePath() - return compiler.compile(file).get { task -> - val notThrown = CodeActionUtils.extractNotThrownExceptionName(d.message) - val methodWithExtraThrow = CodeActionUtils.findMethod(task, d.range) - - return@get RemoveException( - methodWithExtraThrow.className, - methodWithExtraThrow.methodName, - methodWithExtraThrow.erasedParameterTypes, - notThrown - ) - } - } - - override fun postExec(data: ActionData, result: Any) { - if (result !is RemoveException) { - log.warn("Unable to remove unused throws") - return - } - - performCodeAction(data, result) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.java.actions.diagnostics + +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.actions.requirePath +import org.appdevforall.codeonthego.lsp.java.JavaCompilerProvider +import org.appdevforall.codeonthego.lsp.java.actions.BaseJavaCodeAction +import org.appdevforall.codeonthego.lsp.java.models.DiagnosticCode +import org.appdevforall.codeonthego.lsp.java.rewrite.RemoveException +import org.appdevforall.codeonthego.lsp.java.utils.CodeActionUtils +import org.appdevforall.codeonthego.projects.IProjectManager +import com.itsaky.androidide.resources.R +import org.slf4j.LoggerFactory + +/** @author Akash Yadav */ +class RemoveUnusedThrowsAction : BaseJavaCodeAction() { + + override val id: String = "ide.editor.lsp.java.diagnostics.removeUnusedThrows" + override var label: String = "" + private val diagnosticCode = DiagnosticCode.UNUSED_THROWS.id + + override val titleTextRes: Int = R.string.action_remove_unused_throws + + companion object { + + private val log = LoggerFactory.getLogger(RemoveUnusedThrowsAction::class.java) + } + + override fun prepare(data: ActionData) { + super.prepare(data) + + if ( + !visible || + !data.hasRequiredData(org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java) + ) { + markInvisible() + return + } + + val diagnostic = data[org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java]!! + if (diagnosticCode != diagnostic.code) { + markInvisible() + return + } + } + + override suspend fun execAction(data: ActionData): Any { + val d = data[org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java]!! + val compiler = + JavaCompilerProvider.get( + IProjectManager.getInstance().findModuleForFile(data.requireFile(), false) ?: return Any()) + val file = data.requirePath() + return compiler.compile(file).get { task -> + val notThrown = CodeActionUtils.extractNotThrownExceptionName(d.message) + val methodWithExtraThrow = CodeActionUtils.findMethod(task, d.range) + + return@get RemoveException( + methodWithExtraThrow.className, + methodWithExtraThrow.methodName, + methodWithExtraThrow.erasedParameterTypes, + notThrown + ) + } + } + + override fun postExec(data: ActionData, result: Any) { + if (result !is RemoveException) { + log.warn("Unable to remove unused throws") + return + } + + performCodeAction(data, result) + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/SuppressUncheckedWarningAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/SuppressUncheckedWarningAction.kt similarity index 68% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/SuppressUncheckedWarningAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/SuppressUncheckedWarningAction.kt index b831e43def..1c4a1f75d0 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/SuppressUncheckedWarningAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/SuppressUncheckedWarningAction.kt @@ -1,88 +1,88 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.java.actions.diagnostics - -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.actions.requirePath -import com.itsaky.androidide.lsp.java.JavaCompilerProvider -import com.itsaky.androidide.lsp.java.actions.BaseJavaCodeAction -import com.itsaky.androidide.lsp.java.models.DiagnosticCode -import com.itsaky.androidide.lsp.java.rewrite.AddSuppressWarningAnnotation -import com.itsaky.androidide.lsp.java.utils.CodeActionUtils -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.resources.R -import org.slf4j.LoggerFactory - -/** @author Akash Yadav */ -class SuppressUncheckedWarningAction : BaseJavaCodeAction() { - - override val id = "ide.editor.lsp.java.diagnostics.suppressUncheckedWarning" - override var label: String = "" - private val diagnosticCode = DiagnosticCode.UNCHECKED.id - - override val titleTextRes: Int = R.string.action_suppress_unchecked_warning - - companion object { - - private val log = LoggerFactory.getLogger(SuppressUncheckedWarningAction::class.java) - } - - override fun prepare(data: ActionData) { - super.prepare(data) - - if (!visible || !data.hasRequiredData( - com.itsaky.androidide.lsp.models.DiagnosticItem::class.java) - ) { - markInvisible() - return - } - - val diagnostic = data[com.itsaky.androidide.lsp.models.DiagnosticItem::class.java]!! - if (diagnosticCode != diagnostic.code) { - markInvisible() - return - } - } - - override suspend fun execAction(data: ActionData): Any { - val diagnostic = data[com.itsaky.androidide.lsp.models.DiagnosticItem::class.java]!! - val compiler = - JavaCompilerProvider.get( - IProjectManager.getInstance().findModuleForFile(data.requireFile(), false) ?: return Any()) - val file = data.requirePath() - return compiler.compile(file).get { task -> - val warnedMethod = CodeActionUtils.findMethod(task, diagnostic.range) - return@get AddSuppressWarningAnnotation( - warnedMethod.className, - warnedMethod.methodName, - warnedMethod.erasedParameterTypes - ) - } - } - - override fun postExec(data: ActionData, result: Any) { - if (result !is AddSuppressWarningAnnotation) { - log.warn("Unable to suppress 'unchecked' warning") - return - } - - performCodeAction(data, result) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.java.actions.diagnostics + +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.actions.requirePath +import org.appdevforall.codeonthego.lsp.java.JavaCompilerProvider +import org.appdevforall.codeonthego.lsp.java.actions.BaseJavaCodeAction +import org.appdevforall.codeonthego.lsp.java.models.DiagnosticCode +import org.appdevforall.codeonthego.lsp.java.rewrite.AddSuppressWarningAnnotation +import org.appdevforall.codeonthego.lsp.java.utils.CodeActionUtils +import org.appdevforall.codeonthego.projects.IProjectManager +import com.itsaky.androidide.resources.R +import org.slf4j.LoggerFactory + +/** @author Akash Yadav */ +class SuppressUncheckedWarningAction : BaseJavaCodeAction() { + + override val id = "ide.editor.lsp.java.diagnostics.suppressUncheckedWarning" + override var label: String = "" + private val diagnosticCode = DiagnosticCode.UNCHECKED.id + + override val titleTextRes: Int = R.string.action_suppress_unchecked_warning + + companion object { + + private val log = LoggerFactory.getLogger(SuppressUncheckedWarningAction::class.java) + } + + override fun prepare(data: ActionData) { + super.prepare(data) + + if (!visible || !data.hasRequiredData( + org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java) + ) { + markInvisible() + return + } + + val diagnostic = data[org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java]!! + if (diagnosticCode != diagnostic.code) { + markInvisible() + return + } + } + + override suspend fun execAction(data: ActionData): Any { + val diagnostic = data[org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java]!! + val compiler = + JavaCompilerProvider.get( + IProjectManager.getInstance().findModuleForFile(data.requireFile(), false) ?: return Any()) + val file = data.requirePath() + return compiler.compile(file).get { task -> + val warnedMethod = CodeActionUtils.findMethod(task, diagnostic.range) + return@get AddSuppressWarningAnnotation( + warnedMethod.className, + warnedMethod.methodName, + warnedMethod.erasedParameterTypes + ) + } + } + + override fun postExec(data: ActionData, result: Any) { + if (result !is AddSuppressWarningAnnotation) { + log.warn("Unable to suppress 'unchecked' warning") + return + } + + performCodeAction(data, result) + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/VariableToStatementAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/VariableToStatementAction.kt similarity index 65% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/VariableToStatementAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/VariableToStatementAction.kt index d8288c81da..b30ca4410a 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/diagnostics/VariableToStatementAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/diagnostics/VariableToStatementAction.kt @@ -14,19 +14,19 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.actions.diagnostics +package org.appdevforall.codeonthego.lsp.java.actions.diagnostics -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.actions.requirePath -import com.itsaky.androidide.lsp.java.JavaCompilerProvider -import com.itsaky.androidide.lsp.java.actions.BaseJavaCodeAction -import com.itsaky.androidide.lsp.java.models.DiagnosticCode -import com.itsaky.androidide.lsp.java.rewrite.ConvertVariableToStatement -import com.itsaky.androidide.lsp.java.utils.CodeActionUtils.findPosition -import com.itsaky.androidide.projects.IProjectManager +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.actions.requirePath +import org.appdevforall.codeonthego.lsp.java.JavaCompilerProvider +import org.appdevforall.codeonthego.lsp.java.actions.BaseJavaCodeAction +import org.appdevforall.codeonthego.lsp.java.models.DiagnosticCode +import org.appdevforall.codeonthego.lsp.java.rewrite.ConvertVariableToStatement +import org.appdevforall.codeonthego.lsp.java.utils.CodeActionUtils.findPosition +import org.appdevforall.codeonthego.projects.IProjectManager import com.itsaky.androidide.resources.R import org.slf4j.LoggerFactory @@ -49,12 +49,12 @@ class VariableToStatementAction : BaseJavaCodeAction() { return } - if (!data.hasRequiredData(com.itsaky.androidide.lsp.models.DiagnosticItem::class.java)) { + if (!data.hasRequiredData(org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java)) { markInvisible() return } - val diagnostic = data.get(com.itsaky.androidide.lsp.models.DiagnosticItem::class.java)!! + val diagnostic = data.get(org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java)!! if (diagnosticCode != diagnostic.code) { markInvisible() return @@ -65,7 +65,7 @@ class VariableToStatementAction : BaseJavaCodeAction() { } override suspend fun execAction(data: ActionData): Any { - val diagnostic = data[com.itsaky.androidide.lsp.models.DiagnosticItem::class.java]!! + val diagnostic = data[org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java]!! val compiler = JavaCompilerProvider.get(IProjectManager.getInstance().findModuleForFile(data.requireFile(), false) ?: return Any()) val path = data.requirePath() diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/generators/GenerateConstructorAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/generators/GenerateConstructorAction.kt similarity index 84% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/generators/GenerateConstructorAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/generators/GenerateConstructorAction.kt index 91566a4570..c13dcde1fd 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/generators/GenerateConstructorAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/generators/GenerateConstructorAction.kt @@ -15,28 +15,28 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.actions.generators +package org.appdevforall.codeonthego.lsp.java.actions.generators import android.content.Context import com.github.javaparser.StaticJavaParser import com.github.javaparser.ast.Modifier import com.github.javaparser.ast.body.ConstructorDeclaration -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.actions.requirePath -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.java.JavaCompilerProvider -import com.itsaky.androidide.lsp.java.actions.FieldBasedAction -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.utils.EditHelper -import com.itsaky.androidide.lsp.java.utils.ShortTypePrinter.NO_PACKAGE -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.preferences.utils.indentationString -import com.itsaky.androidide.projects.IProjectManager +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.actions.requirePath +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.java.JavaCompilerProvider +import org.appdevforall.codeonthego.lsp.java.actions.FieldBasedAction +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.utils.EditHelper +import org.appdevforall.codeonthego.lsp.java.utils.ShortTypePrinter.NO_PACKAGE +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.preferences.utils.indentationString +import org.appdevforall.codeonthego.projects.IProjectManager import com.itsaky.androidide.resources.R.string -import com.itsaky.androidide.tasks.runOnUiThread -import com.itsaky.androidide.utils.StopWatch -import com.itsaky.androidide.utils.flashError +import org.appdevforall.codeonthego.tasks.runOnUiThread +import org.appdevforall.codeonthego.utils.StopWatch +import org.appdevforall.codeonthego.utils.flashError import io.github.rosemoe.sora.widget.CodeEditor import openjdk.source.tree.ClassTree import openjdk.source.tree.VariableTree diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/generators/GenerateMissingConstructorAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/generators/GenerateMissingConstructorAction.kt similarity index 67% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/generators/GenerateMissingConstructorAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/generators/GenerateMissingConstructorAction.kt index e4fb0a058e..a62e74043f 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/generators/GenerateMissingConstructorAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/generators/GenerateMissingConstructorAction.kt @@ -1,87 +1,87 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.java.actions.generators - -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.actions.requirePath -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.java.JavaCompilerProvider -import com.itsaky.androidide.lsp.java.actions.BaseJavaCodeAction -import com.itsaky.androidide.lsp.java.models.DiagnosticCode -import com.itsaky.androidide.lsp.java.rewrite.GenerateRecordConstructor -import com.itsaky.androidide.lsp.java.utils.CodeActionUtils -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.resources.R -import org.slf4j.LoggerFactory - -/** @author Akash Yadav */ -class GenerateMissingConstructorAction : BaseJavaCodeAction() { - - override val id = "ide.editor.lsp.java.generator.missingConstructor" - override var label: String = "" - private val diagnosticCode = DiagnosticCode.MISSING_CONSTRUCTOR.id - override val titleTextRes: Int = R.string.action_generate_missing_constructor - override var tooltipTag: String = TooltipTag.EDITOR_CODE_ACTIONS_GEN_CONSTRUCTOR - - companion object { - - private val log = LoggerFactory.getLogger(GenerateMissingConstructorAction::class.java) - } - - override fun prepare(data: ActionData) { - super.prepare(data) - - if ( - !visible || - !data.hasRequiredData(com.itsaky.androidide.lsp.models.DiagnosticItem::class.java) - ) { - markInvisible() - return - } - - val diagnostic = data[com.itsaky.androidide.lsp.models.DiagnosticItem::class.java]!! - if (diagnosticCode != diagnostic.code) { - markInvisible() - return - } - } - - override suspend fun execAction(data: ActionData): Any { - val diagnostic = data[com.itsaky.androidide.lsp.models.DiagnosticItem::class.java]!! - val compiler = - JavaCompilerProvider.get( - IProjectManager.getInstance().findModuleForFile(data.requireFile(), false) ?: return Any()) - val file = data.requirePath() - return compiler.compile(file).get { task -> - val needsConstructor = - CodeActionUtils.findClassNeedingConstructor(task, diagnostic.range) ?: return@get false - return@get GenerateRecordConstructor(needsConstructor) - } - } - - override fun postExec(data: ActionData, result: Any) { - if (result !is GenerateRecordConstructor) { - log.warn("Unable to generate constructor") - return - } - - performCodeAction(data, result) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.java.actions.generators + +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.actions.requirePath +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.java.JavaCompilerProvider +import org.appdevforall.codeonthego.lsp.java.actions.BaseJavaCodeAction +import org.appdevforall.codeonthego.lsp.java.models.DiagnosticCode +import org.appdevforall.codeonthego.lsp.java.rewrite.GenerateRecordConstructor +import org.appdevforall.codeonthego.lsp.java.utils.CodeActionUtils +import org.appdevforall.codeonthego.projects.IProjectManager +import com.itsaky.androidide.resources.R +import org.slf4j.LoggerFactory + +/** @author Akash Yadav */ +class GenerateMissingConstructorAction : BaseJavaCodeAction() { + + override val id = "ide.editor.lsp.java.generator.missingConstructor" + override var label: String = "" + private val diagnosticCode = DiagnosticCode.MISSING_CONSTRUCTOR.id + override val titleTextRes: Int = R.string.action_generate_missing_constructor + override var tooltipTag: String = TooltipTag.EDITOR_CODE_ACTIONS_GEN_CONSTRUCTOR + + companion object { + + private val log = LoggerFactory.getLogger(GenerateMissingConstructorAction::class.java) + } + + override fun prepare(data: ActionData) { + super.prepare(data) + + if ( + !visible || + !data.hasRequiredData(org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java) + ) { + markInvisible() + return + } + + val diagnostic = data[org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java]!! + if (diagnosticCode != diagnostic.code) { + markInvisible() + return + } + } + + override suspend fun execAction(data: ActionData): Any { + val diagnostic = data[org.appdevforall.codeonthego.lsp.models.DiagnosticItem::class.java]!! + val compiler = + JavaCompilerProvider.get( + IProjectManager.getInstance().findModuleForFile(data.requireFile(), false) ?: return Any()) + val file = data.requirePath() + return compiler.compile(file).get { task -> + val needsConstructor = + CodeActionUtils.findClassNeedingConstructor(task, diagnostic.range) ?: return@get false + return@get GenerateRecordConstructor(needsConstructor) + } + } + + override fun postExec(data: ActionData, result: Any) { + if (result !is GenerateRecordConstructor) { + log.warn("Unable to generate constructor") + return + } + + performCodeAction(data, result) + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/generators/GenerateSettersAndGettersAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/generators/GenerateSettersAndGettersAction.kt similarity index 84% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/generators/GenerateSettersAndGettersAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/generators/GenerateSettersAndGettersAction.kt index a06523af87..f9f2b141d7 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/generators/GenerateSettersAndGettersAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/generators/GenerateSettersAndGettersAction.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.actions.generators +package org.appdevforall.codeonthego.lsp.java.actions.generators import android.content.Context import com.github.javaparser.StaticJavaParser @@ -24,22 +24,22 @@ import com.github.javaparser.ast.expr.SimpleName import com.github.javaparser.ast.stmt.BlockStmt import com.github.javaparser.ast.type.Type import com.github.javaparser.ast.type.VoidType -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.actions.requirePath -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.java.JavaCompilerProvider -import com.itsaky.androidide.lsp.java.actions.FieldBasedAction -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.utils.EditHelper -import com.itsaky.androidide.lsp.java.utils.JavaParserUtils -import com.itsaky.androidide.lsp.java.utils.TypeUtils.toType -import com.itsaky.androidide.preferences.internal.EditorPreferences -import com.itsaky.androidide.preferences.utils.indentationString -import com.itsaky.androidide.projects.IProjectManager +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.actions.requirePath +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.java.JavaCompilerProvider +import org.appdevforall.codeonthego.lsp.java.actions.FieldBasedAction +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.utils.EditHelper +import org.appdevforall.codeonthego.lsp.java.utils.JavaParserUtils +import org.appdevforall.codeonthego.lsp.java.utils.TypeUtils.toType +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.preferences.utils.indentationString +import org.appdevforall.codeonthego.projects.IProjectManager import com.itsaky.androidide.resources.R -import com.itsaky.androidide.tasks.runOnUiThread -import com.itsaky.androidide.utils.flashError +import org.appdevforall.codeonthego.tasks.runOnUiThread +import org.appdevforall.codeonthego.utils.flashError import io.github.rosemoe.sora.widget.CodeEditor import jdkx.lang.model.element.Modifier.FINAL import jdkx.lang.model.element.VariableElement @@ -101,7 +101,7 @@ class GenerateSettersAndGettersAction : FieldBasedAction() { JavaCompilerProvider.get( IProjectManager.getInstance().findModuleForFile(data.requireFile(), false) ?: return, ) - val range = data[com.itsaky.androidide.models.Range::class.java]!! + val range = data[org.appdevforall.codeonthego.models.Range::class.java]!! val file = data.requirePath() compiler.compile(file).run { task -> diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/generators/GenerateToStringMethodAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/generators/GenerateToStringMethodAction.kt similarity index 85% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/generators/GenerateToStringMethodAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/generators/GenerateToStringMethodAction.kt index 3f90379f99..da72cf6992 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/generators/GenerateToStringMethodAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/generators/GenerateToStringMethodAction.kt @@ -14,28 +14,28 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.actions.generators +package org.appdevforall.codeonthego.lsp.java.actions.generators import android.content.Context import com.github.javaparser.StaticJavaParser import com.github.javaparser.ast.Modifier import com.github.javaparser.ast.body.MethodDeclaration import com.github.javaparser.ast.stmt.ReturnStmt -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.actions.requirePath -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.java.JavaCompilerProvider -import com.itsaky.androidide.lsp.java.actions.FieldBasedAction -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.utils.EditHelper -import com.itsaky.androidide.preferences.internal.EditorPreferences -import com.itsaky.androidide.preferences.utils.indentationString -import com.itsaky.androidide.projects.IProjectManager +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.actions.requirePath +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.java.JavaCompilerProvider +import org.appdevforall.codeonthego.lsp.java.actions.FieldBasedAction +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.utils.EditHelper +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.preferences.utils.indentationString +import org.appdevforall.codeonthego.projects.IProjectManager import com.itsaky.androidide.resources.R import com.itsaky.androidide.resources.R.string -import com.itsaky.androidide.tasks.runOnUiThread -import com.itsaky.androidide.utils.flashError +import org.appdevforall.codeonthego.tasks.runOnUiThread +import org.appdevforall.codeonthego.utils.flashError import io.github.rosemoe.sora.widget.CodeEditor import jdkx.lang.model.element.VariableElement import openjdk.source.tree.ClassTree @@ -94,7 +94,7 @@ class GenerateToStringMethodAction : FieldBasedAction() { JavaCompilerProvider.get( IProjectManager.getInstance().findModuleForFile(data.requireFile(), false) ?: return, ) - val range = data[com.itsaky.androidide.models.Range::class.java]!! + val range = data[org.appdevforall.codeonthego.models.Range::class.java]!! val file = data.requirePath() compiler.compile(file).run { task -> diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/generators/OverrideSuperclassMethodsAction.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/generators/OverrideSuperclassMethodsAction.kt similarity index 84% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/generators/OverrideSuperclassMethodsAction.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/generators/OverrideSuperclassMethodsAction.kt index 3229a89f09..468126c828 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/generators/OverrideSuperclassMethodsAction.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/actions/generators/OverrideSuperclassMethodsAction.kt @@ -14,37 +14,37 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.actions.generators +package org.appdevforall.codeonthego.lsp.java.actions.generators import android.content.Context import android.view.View -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.newDialogBuilder -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.actions.requirePath -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.java.JavaCompilerProvider -import com.itsaky.androidide.lsp.java.actions.BaseJavaCodeAction -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.compiler.CompilerProvider -import com.itsaky.androidide.lsp.java.parser.ParseTask -import com.itsaky.androidide.lsp.java.rewrite.AddImport -import com.itsaky.androidide.lsp.java.utils.EditHelper -import com.itsaky.androidide.lsp.java.utils.FindHelper -import com.itsaky.androidide.lsp.java.utils.JavaParserUtils -import com.itsaky.androidide.lsp.java.utils.MethodPtr -import com.itsaky.androidide.lsp.java.visitors.FindTypeDeclarationAt -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.preferences.internal.EditorPreferences -import com.itsaky.androidide.preferences.utils.indentationString -import com.itsaky.androidide.projects.IProjectManager +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.newDialogBuilder +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.actions.requirePath +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.java.JavaCompilerProvider +import org.appdevforall.codeonthego.lsp.java.actions.BaseJavaCodeAction +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.compiler.CompilerProvider +import org.appdevforall.codeonthego.lsp.java.parser.ParseTask +import org.appdevforall.codeonthego.lsp.java.rewrite.AddImport +import org.appdevforall.codeonthego.lsp.java.utils.EditHelper +import org.appdevforall.codeonthego.lsp.java.utils.FindHelper +import org.appdevforall.codeonthego.lsp.java.utils.JavaParserUtils +import org.appdevforall.codeonthego.lsp.java.utils.MethodPtr +import org.appdevforall.codeonthego.lsp.java.visitors.FindTypeDeclarationAt +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.preferences.utils.indentationString +import org.appdevforall.codeonthego.projects.IProjectManager import com.itsaky.androidide.resources.R -import com.itsaky.androidide.tasks.runOnUiThread -import com.itsaky.androidide.utils.applyLongPressRecursively -import com.itsaky.androidide.utils.flashError +import org.appdevforall.codeonthego.tasks.runOnUiThread +import org.appdevforall.codeonthego.utils.applyLongPressRecursively +import org.appdevforall.codeonthego.utils.flashError import io.github.rosemoe.sora.widget.CodeEditor import jdkx.lang.model.element.ElementKind import jdkx.lang.model.element.ExecutableElement @@ -82,7 +82,7 @@ class OverrideSuperclassMethodsAction : BaseJavaCodeAction() { if ( !visible || !data.hasRequiredData( - com.itsaky.androidide.models.Range::class.java, + org.appdevforall.codeonthego.models.Range::class.java, CodeEditor::class.java, ) ) { @@ -95,7 +95,7 @@ class OverrideSuperclassMethodsAction : BaseJavaCodeAction() { } override suspend fun execAction(data: ActionData): Any { - val range = data[com.itsaky.androidide.models.Range::class.java]!! + val range = data[org.appdevforall.codeonthego.models.Range::class.java]!! val compiler = JavaCompilerProvider.get( IProjectManager.getInstance().findModuleForFile(data.requireFile(), false) diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/CompilationTaskProcessor.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/CompilationTaskProcessor.kt similarity index 96% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/CompilationTaskProcessor.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/CompilationTaskProcessor.kt index 04f32e1ee8..0d19943868 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/CompilationTaskProcessor.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/CompilationTaskProcessor.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.compiler +package org.appdevforall.codeonthego.lsp.java.compiler import openjdk.source.tree.CompilationUnitTree import openjdk.tools.javac.api.JavacTaskImpl diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/CompileBatch.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/CompileBatch.java similarity index 91% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/CompileBatch.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/CompileBatch.java index c0b8022757..4a7d93d56d 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/CompileBatch.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/CompileBatch.java @@ -15,27 +15,27 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.compiler; +package org.appdevforall.codeonthego.lsp.java.compiler; import static com.itsaky.androidide.javac.config.JavacConfigProvider.PROP_ANDROIDIDE_JAVA_HOME; import static com.itsaky.androidide.javac.config.JavacConfigProvider.disableModules; import static com.itsaky.androidide.javac.config.JavacConfigProvider.enableModules; import static com.itsaky.androidide.javac.config.JavacConfigProvider.setLatestSourceVersion; import static com.itsaky.androidide.javac.config.JavacConfigProvider.setLatestSupportedSourceVersion; -import static com.itsaky.androidide.utils.Environment.JAVA_HOME; +import static org.appdevforall.codeonthego.utils.Environment.JAVA_HOME; import androidx.annotation.NonNull; import androidx.core.util.Pair; -import com.itsaky.androidide.javac.services.compiler.ReusableBorrow; -import com.itsaky.androidide.javac.services.partial.DiagnosticListenerImpl; -import com.itsaky.androidide.lsp.java.models.CompilationRequest; -import com.itsaky.androidide.lsp.java.visitors.MethodRangeScanner; -import com.itsaky.androidide.models.Range; -import com.itsaky.androidide.projects.api.ModuleProject; -import com.itsaky.androidide.projects.util.StringSearch; -import com.itsaky.androidide.utils.ClassTrie; -import com.itsaky.androidide.utils.SourceClassTrie; -import com.itsaky.androidide.utils.StopWatch; +import org.appdevforall.codeonthego.javac.services.compiler.ReusableBorrow; +import org.appdevforall.codeonthego.javac.services.partial.DiagnosticListenerImpl; +import org.appdevforall.codeonthego.lsp.java.models.CompilationRequest; +import org.appdevforall.codeonthego.lsp.java.visitors.MethodRangeScanner; +import org.appdevforall.codeonthego.models.Range; +import org.appdevforall.codeonthego.projects.api.ModuleProject; +import org.appdevforall.codeonthego.projects.util.StringSearch; +import org.appdevforall.codeonthego.utils.ClassTrie; +import org.appdevforall.codeonthego.utils.SourceClassTrie; +import org.appdevforall.codeonthego.utils.StopWatch; import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/CompileTask.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/CompileTask.java similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/CompileTask.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/CompileTask.java index dac24ba968..c4d053ea4e 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/CompileTask.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/CompileTask.java @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.compiler; +package org.appdevforall.codeonthego.lsp.java.compiler; import androidx.annotation.NonNull; -import com.itsaky.androidide.javac.services.partial.DiagnosticListenerImpl; +import org.appdevforall.codeonthego.javac.services.partial.DiagnosticListenerImpl; import java.nio.file.Path; import java.util.List; import jdkx.tools.Diagnostic; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/CompilerProvider.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/CompilerProvider.java similarity index 91% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/CompilerProvider.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/CompilerProvider.java index db23b4ee77..f88a784a12 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/CompilerProvider.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/CompilerProvider.java @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.compiler; +package org.appdevforall.codeonthego.lsp.java.compiler; -import com.itsaky.androidide.lsp.java.models.CompilationRequest; -import com.itsaky.androidide.lsp.java.parser.ParseTask; +import org.appdevforall.codeonthego.lsp.java.models.CompilationRequest; +import org.appdevforall.codeonthego.lsp.java.parser.ParseTask; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/DefaultCompilationTaskProcessor.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/DefaultCompilationTaskProcessor.kt similarity index 93% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/DefaultCompilationTaskProcessor.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/DefaultCompilationTaskProcessor.kt index bdd340baee..9ab2a6e7d9 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/DefaultCompilationTaskProcessor.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/DefaultCompilationTaskProcessor.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.compiler +package org.appdevforall.codeonthego.lsp.java.compiler -import com.itsaky.androidide.utils.StopWatch +import org.appdevforall.codeonthego.utils.StopWatch import openjdk.source.tree.CompilationUnitTree import openjdk.tools.javac.api.JavacTaskImpl import java.util.function.Consumer diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/JCReusableCompiler.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/JCReusableCompiler.kt similarity index 83% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/JCReusableCompiler.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/JCReusableCompiler.kt index ca821b9cc0..7e076ea3dc 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/JCReusableCompiler.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/JCReusableCompiler.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.compiler +package org.appdevforall.codeonthego.lsp.java.compiler -import com.itsaky.androidide.javac.services.compiler.ReusableCompiler -import com.itsaky.androidide.javac.services.compiler.ReusableContext +import org.appdevforall.codeonthego.javac.services.compiler.ReusableCompiler +import org.appdevforall.codeonthego.javac.services.compiler.ReusableContext /** * Implementation of the [ReusableCompiler] which replaces necessary components from the diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/JavaCompilerConfig.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/JavaCompilerConfig.kt similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/JavaCompilerConfig.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/JavaCompilerConfig.kt index 11d8ad1c45..2fe67e4a13 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/JavaCompilerConfig.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/JavaCompilerConfig.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.compiler +package org.appdevforall.codeonthego.lsp.java.compiler -import com.itsaky.androidide.models.Position +import org.appdevforall.codeonthego.models.Position import jdkx.tools.JavaFileObject import openjdk.tools.javac.util.Context diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/JavaCompilerImpl.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/JavaCompilerImpl.kt similarity index 83% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/JavaCompilerImpl.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/JavaCompilerImpl.kt index 960ccc74bc..95d1e68cf4 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/JavaCompilerImpl.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/JavaCompilerImpl.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.compiler +package org.appdevforall.codeonthego.lsp.java.compiler -import com.itsaky.androidide.javac.services.compiler.ReusableContext -import com.itsaky.androidide.javac.services.compiler.ReusableJavaCompiler -import com.itsaky.androidide.lsp.java.parser.ts.TSJavaParser -import com.itsaky.androidide.lsp.java.parser.ts.TSMethodPruner.prune -import com.itsaky.androidide.projects.FileManager -import com.itsaky.androidide.utils.VMUtils -import com.itsaky.androidide.utils.withStopWatch +import org.appdevforall.codeonthego.javac.services.compiler.ReusableContext +import org.appdevforall.codeonthego.javac.services.compiler.ReusableJavaCompiler +import org.appdevforall.codeonthego.lsp.java.parser.ts.TSJavaParser +import org.appdevforall.codeonthego.lsp.java.parser.ts.TSMethodPruner.prune +import org.appdevforall.codeonthego.projects.FileManager +import org.appdevforall.codeonthego.utils.VMUtils +import org.appdevforall.codeonthego.utils.withStopWatch import jdkx.tools.JavaFileObject import jdkx.tools.JavaFileObject.Kind.SOURCE import openjdk.tools.javac.api.ClientCodeWrapper diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/JavaCompilerService.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/JavaCompilerService.java similarity index 92% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/JavaCompilerService.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/JavaCompilerService.java index 8e7d5e2735..276965be0f 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/JavaCompilerService.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/JavaCompilerService.java @@ -15,33 +15,33 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.compiler; +package org.appdevforall.codeonthego.lsp.java.compiler; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.core.util.Pair; -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent; -import com.itsaky.androidide.javac.services.compiler.ReusableCompiler; -import com.itsaky.androidide.javac.services.partial.CompilationInfo; -import com.itsaky.androidide.javac.services.partial.PartialReparser; -import com.itsaky.androidide.javac.services.partial.PartialReparserImpl; -import com.itsaky.androidide.lsp.java.models.CompilationRequest; -import com.itsaky.androidide.lsp.java.models.PartialReparseRequest; -import com.itsaky.androidide.lsp.java.parser.ParseTask; -import com.itsaky.androidide.lsp.java.parser.Parser; -import com.itsaky.androidide.lsp.java.utils.Extractors; -import com.itsaky.androidide.lsp.java.visitors.FindTypeDeclarations; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; -import com.itsaky.androidide.projects.FileManager; -import com.itsaky.androidide.projects.api.AndroidModule; -import com.itsaky.androidide.projects.api.ModuleProject; -import com.itsaky.androidide.projects.util.BootClasspathProvider; -import com.itsaky.androidide.projects.util.StringSearch; -import com.itsaky.androidide.utils.Cache; -import com.itsaky.androidide.utils.Environment; -import com.itsaky.androidide.utils.SourceClassTrie; -import com.itsaky.androidide.utils.StopWatch; +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent; +import org.appdevforall.codeonthego.javac.services.compiler.ReusableCompiler; +import org.appdevforall.codeonthego.javac.services.partial.CompilationInfo; +import org.appdevforall.codeonthego.javac.services.partial.PartialReparser; +import org.appdevforall.codeonthego.javac.services.partial.PartialReparserImpl; +import org.appdevforall.codeonthego.lsp.java.models.CompilationRequest; +import org.appdevforall.codeonthego.lsp.java.models.PartialReparseRequest; +import org.appdevforall.codeonthego.lsp.java.parser.ParseTask; +import org.appdevforall.codeonthego.lsp.java.parser.Parser; +import org.appdevforall.codeonthego.lsp.java.utils.Extractors; +import org.appdevforall.codeonthego.lsp.java.visitors.FindTypeDeclarations; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; +import org.appdevforall.codeonthego.projects.FileManager; +import org.appdevforall.codeonthego.projects.api.AndroidModule; +import org.appdevforall.codeonthego.projects.api.ModuleProject; +import org.appdevforall.codeonthego.projects.util.BootClasspathProvider; +import org.appdevforall.codeonthego.projects.util.StringSearch; +import org.appdevforall.codeonthego.utils.Cache; +import org.appdevforall.codeonthego.utils.Environment; +import org.appdevforall.codeonthego.utils.SourceClassTrie; +import org.appdevforall.codeonthego.utils.StopWatch; import java.io.BufferedReader; import java.io.File; import java.io.IOException; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/SourceFileManager.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/SourceFileManager.java similarity index 93% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/SourceFileManager.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/SourceFileManager.java index 886645d8c4..e27198dcf8 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/SourceFileManager.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/SourceFileManager.java @@ -15,21 +15,21 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.compiler; +package org.appdevforall.codeonthego.lsp.java.compiler; import static java.util.Collections.emptyList; import static java.util.Collections.emptySet; import androidx.annotation.NonNull; import com.itsaky.androidide.javac.config.JavacConfigProvider; -import com.itsaky.androidide.javac.services.fs.AndroidFsProviderImpl; -import com.itsaky.androidide.projects.api.AndroidModule; -import com.itsaky.androidide.projects.api.ModuleProject; -import com.itsaky.androidide.projects.models.AndroidProjectExtsKt; -import com.itsaky.androidide.projects.util.StringSearch; -import com.itsaky.androidide.utils.ClassTrie; -import com.itsaky.androidide.utils.Environment; -import com.itsaky.androidide.utils.SourceClassTrie; +import org.appdevforall.codeonthego.javac.services.fs.AndroidFsProviderImpl; +import org.appdevforall.codeonthego.projects.api.AndroidModule; +import org.appdevforall.codeonthego.projects.api.ModuleProject; +import org.appdevforall.codeonthego.projects.models.AndroidProjectExtsKt; +import org.appdevforall.codeonthego.projects.util.StringSearch; +import org.appdevforall.codeonthego.utils.ClassTrie; +import org.appdevforall.codeonthego.utils.Environment; +import org.appdevforall.codeonthego.utils.SourceClassTrie; import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/SourceFileObject.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/SourceFileObject.java similarity index 96% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/SourceFileObject.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/SourceFileObject.java index af91d0c00b..9b418cae21 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/SourceFileObject.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/SourceFileObject.java @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.compiler; +package org.appdevforall.codeonthego.lsp.java.compiler; import com.google.common.base.MoreObjects; -import com.itsaky.androidide.projects.FileManager; -import com.itsaky.androidide.utils.DocumentUtils; +import org.appdevforall.codeonthego.projects.FileManager; +import org.appdevforall.codeonthego.utils.DocumentUtils; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.OutputStream; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/SynchronizedTask.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/SynchronizedTask.kt similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/SynchronizedTask.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/SynchronizedTask.kt index 102a38471c..232004a478 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/compiler/SynchronizedTask.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/compiler/SynchronizedTask.kt @@ -30,10 +30,10 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.compiler +package org.appdevforall.codeonthego.lsp.java.compiler -import com.itsaky.androidide.lsp.java.CompilationCancellationException -import com.itsaky.androidide.lsp.java.utils.CancelChecker.Companion.isCancelled +import org.appdevforall.codeonthego.lsp.java.CompilationCancellationException +import org.appdevforall.codeonthego.lsp.java.utils.CancelChecker.Companion.isCancelled import org.slf4j.LoggerFactory import java.util.concurrent.Semaphore diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/EventConsumer.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/EventConsumer.kt similarity index 96% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/EventConsumer.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/EventConsumer.kt index c5c5e0e649..720d20b5e7 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/EventConsumer.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/EventConsumer.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.debug +package org.appdevforall.codeonthego.lsp.java.debug import com.sun.jdi.event.BreakpointEvent import com.sun.jdi.event.ClassPrepareEvent diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/EventHandler.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/EventHandler.kt similarity index 98% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/EventHandler.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/EventHandler.kt index 11bc795056..280f977400 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/EventHandler.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/EventHandler.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.java.debug +package org.appdevforall.codeonthego.lsp.java.debug -import com.itsaky.androidide.lsp.java.debug.spec.EventRequestSpecList +import org.appdevforall.codeonthego.lsp.java.debug.spec.EventRequestSpecList import com.sun.jdi.ThreadReference import com.sun.jdi.VMDisconnectedException import com.sun.jdi.VirtualMachine diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/JavaDebugAdapter.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/JavaDebugAdapter.kt similarity index 90% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/JavaDebugAdapter.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/JavaDebugAdapter.kt index 1865fa14c0..b47e189bc8 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/JavaDebugAdapter.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/JavaDebugAdapter.kt @@ -1,39 +1,39 @@ -package com.itsaky.androidide.lsp.java.debug +package org.appdevforall.codeonthego.lsp.java.debug import android.system.ErrnoException import android.system.OsConstants import androidx.annotation.WorkerThread -import com.itsaky.androidide.lsp.api.ILanguageServerRegistry -import com.itsaky.androidide.lsp.debug.DebugClientConnectionResult -import com.itsaky.androidide.lsp.debug.IDebugAdapter -import com.itsaky.androidide.lsp.debug.IDebugClient -import com.itsaky.androidide.lsp.debug.RemoteClient -import com.itsaky.androidide.lsp.debug.RemoteClientCapabilities -import com.itsaky.androidide.lsp.debug.events.BreakpointHitEvent -import com.itsaky.androidide.lsp.debug.model.BreakpointRequest -import com.itsaky.androidide.lsp.debug.model.BreakpointResponse -import com.itsaky.androidide.lsp.debug.model.BreakpointResult -import com.itsaky.androidide.lsp.debug.model.MethodBreakpoint -import com.itsaky.androidide.lsp.debug.model.PositionalBreakpoint -import com.itsaky.androidide.lsp.debug.model.StepRequestParams -import com.itsaky.androidide.lsp.debug.model.StepResponse -import com.itsaky.androidide.lsp.debug.model.StepResult -import com.itsaky.androidide.lsp.debug.model.ThreadInfoRequestParams -import com.itsaky.androidide.lsp.debug.model.ThreadInfoResponse -import com.itsaky.androidide.lsp.debug.model.ThreadInfoResult -import com.itsaky.androidide.lsp.debug.model.ThreadListRequestParams -import com.itsaky.androidide.lsp.debug.model.ThreadListResponse -import com.itsaky.androidide.lsp.java.JavaLanguageServer -import com.itsaky.androidide.lsp.java.debug.spec.BreakpointSpec -import com.itsaky.androidide.lsp.java.debug.utils.asDepthInt -import com.itsaky.androidide.lsp.java.debug.utils.asJdiInt -import com.itsaky.androidide.lsp.java.debug.utils.asLspLocation -import com.itsaky.androidide.lsp.java.debug.utils.inlineCallSiteLineOrNull -import com.itsaky.androidide.lsp.java.debug.utils.isKotlinSource -import com.itsaky.androidide.lsp.java.debug.utils.kotlinBinaryNamesOf -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.projects.api.ModuleProject -import com.itsaky.androidide.utils.withStopWatch +import org.appdevforall.codeonthego.lsp.api.ILanguageServerRegistry +import org.appdevforall.codeonthego.lsp.debug.DebugClientConnectionResult +import org.appdevforall.codeonthego.lsp.debug.IDebugAdapter +import org.appdevforall.codeonthego.lsp.debug.IDebugClient +import org.appdevforall.codeonthego.lsp.debug.RemoteClient +import org.appdevforall.codeonthego.lsp.debug.RemoteClientCapabilities +import org.appdevforall.codeonthego.lsp.debug.events.BreakpointHitEvent +import org.appdevforall.codeonthego.lsp.debug.model.BreakpointRequest +import org.appdevforall.codeonthego.lsp.debug.model.BreakpointResponse +import org.appdevforall.codeonthego.lsp.debug.model.BreakpointResult +import org.appdevforall.codeonthego.lsp.debug.model.MethodBreakpoint +import org.appdevforall.codeonthego.lsp.debug.model.PositionalBreakpoint +import org.appdevforall.codeonthego.lsp.debug.model.StepRequestParams +import org.appdevforall.codeonthego.lsp.debug.model.StepResponse +import org.appdevforall.codeonthego.lsp.debug.model.StepResult +import org.appdevforall.codeonthego.lsp.debug.model.ThreadInfoRequestParams +import org.appdevforall.codeonthego.lsp.debug.model.ThreadInfoResponse +import org.appdevforall.codeonthego.lsp.debug.model.ThreadInfoResult +import org.appdevforall.codeonthego.lsp.debug.model.ThreadListRequestParams +import org.appdevforall.codeonthego.lsp.debug.model.ThreadListResponse +import org.appdevforall.codeonthego.lsp.java.JavaLanguageServer +import org.appdevforall.codeonthego.lsp.java.debug.spec.BreakpointSpec +import org.appdevforall.codeonthego.lsp.java.debug.utils.asDepthInt +import org.appdevforall.codeonthego.lsp.java.debug.utils.asJdiInt +import org.appdevforall.codeonthego.lsp.java.debug.utils.asLspLocation +import org.appdevforall.codeonthego.lsp.java.debug.utils.inlineCallSiteLineOrNull +import org.appdevforall.codeonthego.lsp.java.debug.utils.isKotlinSource +import org.appdevforall.codeonthego.lsp.java.debug.utils.kotlinBinaryNamesOf +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.projects.api.ModuleProject +import org.appdevforall.codeonthego.utils.withStopWatch import com.sun.jdi.Bootstrap import com.sun.jdi.Location import com.sun.jdi.ThreadReference @@ -55,7 +55,7 @@ import org.slf4j.LoggerFactory import java.net.SocketException import java.nio.file.Paths import java.util.concurrent.CopyOnWriteArraySet -import com.itsaky.androidide.lsp.debug.events.StepEvent as LspStepEvent +import org.appdevforall.codeonthego.lsp.debug.events.StepEvent as LspStepEvent /** * @author Akash Yadav diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/JdwpOptions.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/JdwpOptions.kt similarity index 97% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/JdwpOptions.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/JdwpOptions.kt index 6eb1da96d2..4ac3f7315b 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/JdwpOptions.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/JdwpOptions.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.debug +package org.appdevforall.codeonthego.lsp.java.debug import org.slf4j.LoggerFactory import kotlin.time.Duration.Companion.seconds diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/ListenerState.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/ListenerState.kt similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/ListenerState.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/ListenerState.kt index fc8639c381..404402c85f 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/ListenerState.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/ListenerState.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.lsp.java.debug +package org.appdevforall.codeonthego.lsp.java.debug import android.net.TrafficStats -import com.itsaky.androidide.lsp.debug.IDebugClient +import org.appdevforall.codeonthego.lsp.debug.IDebugClient import com.sun.jdi.VirtualMachine import com.sun.jdi.connect.Connector import com.sun.tools.jdi.SocketListeningConnector diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/LspThreadInfo.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/LspThreadInfo.kt similarity index 82% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/LspThreadInfo.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/LspThreadInfo.kt index d41194ae28..abf8bd3a48 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/LspThreadInfo.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/LspThreadInfo.kt @@ -1,19 +1,19 @@ -package com.itsaky.androidide.lsp.java.debug - -import com.itsaky.androidide.lsp.debug.model.PrimitiveKind -import com.itsaky.androidide.lsp.debug.model.PrimitiveValue -import com.itsaky.androidide.lsp.debug.model.StackFrameDescriptor -import com.itsaky.androidide.lsp.debug.model.ThreadDescriptor -import com.itsaky.androidide.lsp.debug.model.ThreadState -import com.itsaky.androidide.lsp.debug.model.Value -import com.itsaky.androidide.lsp.debug.model.Variable -import com.itsaky.androidide.lsp.debug.model.VariableKind -import com.itsaky.androidide.lsp.java.debug.utils.isOpaque -import com.itsaky.androidide.lsp.java.debug.utils.isSyntheticKotlinLocal -import com.itsaky.androidide.lsp.java.debug.utils.kotlinDisplayName -import com.itsaky.androidide.lsp.java.debug.utils.kotlinLambdaScopes -import com.itsaky.androidide.lsp.java.debug.utils.lineNumberInKotlin -import com.itsaky.androidide.lsp.java.debug.utils.sourceNameInKotlinOrNull +package org.appdevforall.codeonthego.lsp.java.debug + +import org.appdevforall.codeonthego.lsp.debug.model.PrimitiveKind +import org.appdevforall.codeonthego.lsp.debug.model.PrimitiveValue +import org.appdevforall.codeonthego.lsp.debug.model.StackFrameDescriptor +import org.appdevforall.codeonthego.lsp.debug.model.ThreadDescriptor +import org.appdevforall.codeonthego.lsp.debug.model.ThreadState +import org.appdevforall.codeonthego.lsp.debug.model.Value +import org.appdevforall.codeonthego.lsp.debug.model.Variable +import org.appdevforall.codeonthego.lsp.debug.model.VariableKind +import org.appdevforall.codeonthego.lsp.java.debug.utils.isOpaque +import org.appdevforall.codeonthego.lsp.java.debug.utils.isSyntheticKotlinLocal +import org.appdevforall.codeonthego.lsp.java.debug.utils.kotlinDisplayName +import org.appdevforall.codeonthego.lsp.java.debug.utils.kotlinLambdaScopes +import org.appdevforall.codeonthego.lsp.java.debug.utils.lineNumberInKotlin +import org.appdevforall.codeonthego.lsp.java.debug.utils.sourceNameInKotlinOrNull import com.sun.jdi.Location import com.sun.jdi.Method import com.sun.jdi.ObjectCollectedException @@ -23,10 +23,10 @@ import com.sun.jdi.VMDisconnectedException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.slf4j.LoggerFactory -import com.itsaky.androidide.lsp.debug.model.StackFrame as LspStackFrame -import com.itsaky.androidide.lsp.debug.model.ThreadInfo as LspThreadInfo -import com.itsaky.androidide.lsp.debug.model.ThreadState as LspThreadState -import com.itsaky.androidide.lsp.debug.model.Variable as LspVariable +import org.appdevforall.codeonthego.lsp.debug.model.StackFrame as LspStackFrame +import org.appdevforall.codeonthego.lsp.debug.model.ThreadInfo as LspThreadInfo +import org.appdevforall.codeonthego.lsp.debug.model.ThreadState as LspThreadState +import org.appdevforall.codeonthego.lsp.debug.model.Variable as LspVariable class JavaStackFrame( val thread: ThreadReference, diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/ThreadState.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/ThreadState.kt similarity index 98% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/ThreadState.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/ThreadState.kt index dbe273c791..9e78072303 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/ThreadState.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/ThreadState.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.debug +package org.appdevforall.codeonthego.lsp.java.debug import com.sun.jdi.StackFrame import com.sun.jdi.ThreadGroupReference @@ -6,7 +6,7 @@ import com.sun.jdi.ThreadReference import com.sun.jdi.VirtualMachine import org.slf4j.LoggerFactory import java.util.Collections -import com.itsaky.androidide.lsp.debug.model.ThreadInfo as LspThreadInfo +import org.appdevforall.codeonthego.lsp.debug.model.ThreadInfo as LspThreadInfo /** * Information about a thread. diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/Variables.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/Variables.kt similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/Variables.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/Variables.kt index 8566db64f6..3490693fc2 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/Variables.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/Variables.kt @@ -1,13 +1,13 @@ -package com.itsaky.androidide.lsp.java.debug - -import com.itsaky.androidide.lsp.debug.model.ArrayLikeValue -import com.itsaky.androidide.lsp.debug.model.PrimitiveKind -import com.itsaky.androidide.lsp.debug.model.PrimitiveVariable -import com.itsaky.androidide.lsp.debug.model.Variable -import com.itsaky.androidide.lsp.debug.model.VariableDescriptor -import com.itsaky.androidide.lsp.debug.model.VariableKind -import com.itsaky.androidide.lsp.java.debug.utils.VariableValues -import com.itsaky.androidide.lsp.java.debug.utils.mirrorOf +package org.appdevforall.codeonthego.lsp.java.debug + +import org.appdevforall.codeonthego.lsp.debug.model.ArrayLikeValue +import org.appdevforall.codeonthego.lsp.debug.model.PrimitiveKind +import org.appdevforall.codeonthego.lsp.debug.model.PrimitiveVariable +import org.appdevforall.codeonthego.lsp.debug.model.Variable +import org.appdevforall.codeonthego.lsp.debug.model.VariableDescriptor +import org.appdevforall.codeonthego.lsp.debug.model.VariableKind +import org.appdevforall.codeonthego.lsp.java.debug.utils.VariableValues +import org.appdevforall.codeonthego.lsp.java.debug.utils.mirrorOf import com.sun.jdi.ArrayReference import com.sun.jdi.ArrayType import com.sun.jdi.BooleanType @@ -34,9 +34,9 @@ import com.sun.jdi.VMDisconnectedException import com.sun.jdi.Value import com.sun.jdi.VoidValue import org.slf4j.LoggerFactory -import com.itsaky.androidide.lsp.debug.model.PrimitiveValue as LspPrimitiveValue -import com.itsaky.androidide.lsp.debug.model.ReferenceValue as LspReferenceValue -import com.itsaky.androidide.lsp.debug.model.Value as LspValue +import org.appdevforall.codeonthego.lsp.debug.model.PrimitiveValue as LspPrimitiveValue +import org.appdevforall.codeonthego.lsp.debug.model.ReferenceValue as LspReferenceValue +import org.appdevforall.codeonthego.lsp.debug.model.Value as LspValue // Must be called in an EvaluationContext // this method must ensure that it does not start another evaluation in EvaluationContext in order diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/VmConnection.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/VmConnection.kt similarity index 80% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/VmConnection.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/VmConnection.kt index 90a3cd66ec..374f3755a0 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/VmConnection.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/VmConnection.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.lsp.java.debug +package org.appdevforall.codeonthego.lsp.java.debug import androidx.annotation.WorkerThread -import com.itsaky.androidide.lsp.debug.RemoteClient -import com.itsaky.androidide.lsp.java.debug.spec.EventRequestSpecList -import com.itsaky.androidide.lsp.java.debug.utils.EvaluationContext +import org.appdevforall.codeonthego.lsp.debug.RemoteClient +import org.appdevforall.codeonthego.lsp.java.debug.spec.EventRequestSpecList +import org.appdevforall.codeonthego.lsp.java.debug.utils.EvaluationContext import com.sun.jdi.VirtualMachine /** diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/BreakpointSpec.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/BreakpointSpec.kt similarity index 95% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/BreakpointSpec.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/BreakpointSpec.kt index 06a1be29f5..c756f4a184 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/BreakpointSpec.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/BreakpointSpec.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.lsp.java.debug.spec +package org.appdevforall.codeonthego.lsp.java.debug.spec -import com.itsaky.androidide.lsp.debug.model.BreakpointDefinition -import com.itsaky.androidide.lsp.debug.model.MethodBreakpoint -import com.itsaky.androidide.lsp.debug.model.PositionalBreakpoint -import com.itsaky.androidide.lsp.java.debug.utils.locationsOfLineInSource -import com.itsaky.androidide.utils.StringUtil.isJavaIdentifier +import org.appdevforall.codeonthego.lsp.debug.model.BreakpointDefinition +import org.appdevforall.codeonthego.lsp.debug.model.MethodBreakpoint +import org.appdevforall.codeonthego.lsp.debug.model.PositionalBreakpoint +import org.appdevforall.codeonthego.lsp.java.debug.utils.locationsOfLineInSource +import org.appdevforall.codeonthego.utils.StringUtil.isJavaIdentifier import com.sun.jdi.AbsentInformationException import com.sun.jdi.InvalidTypeException import com.sun.jdi.Location diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/ClassPatternReferenceTypeSpec.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/ClassPatternReferenceTypeSpec.kt similarity index 96% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/ClassPatternReferenceTypeSpec.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/ClassPatternReferenceTypeSpec.kt index e868f9a46f..4dfc63d420 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/ClassPatternReferenceTypeSpec.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/ClassPatternReferenceTypeSpec.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.java.debug.spec +package org.appdevforall.codeonthego.lsp.java.debug.spec -import com.itsaky.androidide.lsp.java.debug.utils.isJavaIdentifier +import org.appdevforall.codeonthego.lsp.java.debug.utils.isJavaIdentifier import com.sun.jdi.ReferenceType import com.sun.jdi.VirtualMachine import com.sun.jdi.request.ClassPrepareRequest diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/DebugEnv.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/DebugEnv.kt similarity index 95% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/DebugEnv.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/DebugEnv.kt index 8f8e1173b9..f466ddc4a5 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/DebugEnv.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/DebugEnv.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.debug.spec +package org.appdevforall.codeonthego.lsp.java.debug.spec import com.sun.jdi.ReferenceType import com.sun.jdi.VirtualMachine diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/EventRequestSpec.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/EventRequestSpec.kt similarity index 99% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/EventRequestSpec.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/EventRequestSpec.kt index b7925c6d39..8aca89b09a 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/EventRequestSpec.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/EventRequestSpec.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.debug.spec +package org.appdevforall.codeonthego.lsp.java.debug.spec import com.sun.jdi.ReferenceType import com.sun.jdi.VirtualMachine diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/EventRequestSpecList.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/EventRequestSpecList.kt similarity index 96% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/EventRequestSpecList.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/EventRequestSpecList.kt index 4540430ad3..73bbb7416d 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/EventRequestSpecList.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/EventRequestSpecList.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.java.debug.spec +package org.appdevforall.codeonthego.lsp.java.debug.spec -import com.itsaky.androidide.lsp.debug.model.Source +import org.appdevforall.codeonthego.lsp.debug.model.Source import com.sun.jdi.ThreadReference import com.sun.jdi.VirtualMachine import com.sun.jdi.event.ClassPrepareEvent diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/Exceptions.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/Exceptions.kt similarity index 74% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/Exceptions.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/Exceptions.kt index 4e15c3438c..5e49637360 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/Exceptions.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/Exceptions.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.debug.spec +package org.appdevforall.codeonthego.lsp.java.debug.spec internal class AmbiguousMethodException(message: String? = null) : Exception(message) internal class LineNotFoundException(message: String? = null) : Exception(message) \ No newline at end of file diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/PatternReferenceTypeSpec.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/PatternReferenceTypeSpec.kt similarity index 92% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/PatternReferenceTypeSpec.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/PatternReferenceTypeSpec.kt index da20ebdb0b..80bf1f8b77 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/PatternReferenceTypeSpec.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/PatternReferenceTypeSpec.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.debug.spec +package org.appdevforall.codeonthego.lsp.java.debug.spec import com.sun.jdi.ReferenceType import com.sun.jdi.VirtualMachine diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/ReferenceTypeSpec.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/ReferenceTypeSpec.kt similarity index 91% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/ReferenceTypeSpec.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/ReferenceTypeSpec.kt index 291e48ec02..e683cfaef3 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/ReferenceTypeSpec.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/ReferenceTypeSpec.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.debug.spec +package org.appdevforall.codeonthego.lsp.java.debug.spec import com.sun.jdi.ReferenceType import com.sun.jdi.VirtualMachine diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/SourceReferenceTypeSpec.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/SourceReferenceTypeSpec.kt similarity index 75% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/SourceReferenceTypeSpec.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/SourceReferenceTypeSpec.kt index 757b3bdb33..7b853bdefa 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/spec/SourceReferenceTypeSpec.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/spec/SourceReferenceTypeSpec.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.lsp.java.debug.spec +package org.appdevforall.codeonthego.lsp.java.debug.spec -import com.itsaky.androidide.lsp.debug.model.Source -import com.itsaky.androidide.lsp.java.debug.utils.matchesSourcePath -import com.itsaky.androidide.lsp.java.debug.utils.sourcePathOrNull +import org.appdevforall.codeonthego.lsp.debug.model.Source +import org.appdevforall.codeonthego.lsp.java.debug.utils.matchesSourcePath +import org.appdevforall.codeonthego.lsp.java.debug.utils.sourcePathOrNull import com.sun.jdi.ReferenceType import com.sun.jdi.VirtualMachine import com.sun.jdi.request.ClassPrepareRequest diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/EvaluationContext.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/EvaluationContext.kt similarity index 98% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/EvaluationContext.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/EvaluationContext.kt index e5dc67e9a3..ba4dad67eb 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/EvaluationContext.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/EvaluationContext.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.debug.utils +package org.appdevforall.codeonthego.lsp.java.debug.utils import com.sun.jdi.ThreadReference import kotlinx.coroutines.CancellationException diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/JdiTypes.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/JdiTypes.kt similarity index 95% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/JdiTypes.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/JdiTypes.kt index 56a3f5b33d..c5c6484b5f 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/JdiTypes.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/JdiTypes.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.java.debug.utils +package org.appdevforall.codeonthego.lsp.java.debug.utils -import com.itsaky.androidide.lsp.java.debug.JavaDebugAdapter +import org.appdevforall.codeonthego.lsp.java.debug.JavaDebugAdapter import com.sun.jdi.ClassType import com.sun.jdi.ObjectReference import com.sun.jdi.ReferenceType diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/KotlinClassNames.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/KotlinClassNames.kt similarity index 96% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/KotlinClassNames.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/KotlinClassNames.kt index 50f102d8d4..ce9413260f 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/KotlinClassNames.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/KotlinClassNames.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.java.debug.utils +package org.appdevforall.codeonthego.lsp.java.debug.utils -import com.itsaky.androidide.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.projects.ProjectManagerImpl import org.appdevforall.codeonthego.indexing.jvm.KT_SOURCE_FILE_META_INDEX_KEY import org.slf4j.LoggerFactory import java.nio.file.Path diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/KotlinLocals.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/KotlinLocals.kt similarity index 98% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/KotlinLocals.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/KotlinLocals.kt index 852530d971..8108b51800 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/KotlinLocals.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/KotlinLocals.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.debug.utils +package org.appdevforall.codeonthego.lsp.java.debug.utils import org.jetbrains.kotlin.codegen.AsmUtil.INLINE_DECLARATION_SITE_THIS import org.jetbrains.kotlin.codegen.AsmUtil.THIS_IN_DEFAULT_IMPLS diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/MirrorExts.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/MirrorExts.kt similarity index 95% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/MirrorExts.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/MirrorExts.kt index 3a77edbb24..906c77bbe0 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/MirrorExts.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/MirrorExts.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.debug.utils +package org.appdevforall.codeonthego.lsp.java.debug.utils import com.sun.jdi.BooleanValue import com.sun.jdi.ByteValue diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/MiscExts.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/MiscExts.kt similarity index 76% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/MiscExts.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/MiscExts.kt index ddc006418a..feb0f2f9dc 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/MiscExts.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/MiscExts.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.lsp.java.debug.utils +package org.appdevforall.codeonthego.lsp.java.debug.utils -import com.itsaky.androidide.lsp.debug.model.StepType -import com.itsaky.androidide.lsp.debug.model.SuspendPolicy +import org.appdevforall.codeonthego.lsp.debug.model.StepType +import org.appdevforall.codeonthego.lsp.debug.model.SuspendPolicy import com.sun.jdi.request.EventRequest import com.sun.jdi.request.StepRequest diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/ModelUtils.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/ModelUtils.kt similarity index 91% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/ModelUtils.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/ModelUtils.kt index aaa8d71717..692130d49a 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/ModelUtils.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/ModelUtils.kt @@ -1,17 +1,17 @@ -package com.itsaky.androidide.lsp.java.debug.utils +package org.appdevforall.codeonthego.lsp.java.debug.utils -import com.itsaky.androidide.lsp.debug.model.Source -import com.itsaky.androidide.lsp.java.JavaCompilerProvider -import com.itsaky.androidide.lsp.java.compiler.SourceFileObject -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.projects.api.ModuleProject +import org.appdevforall.codeonthego.lsp.debug.model.Source +import org.appdevforall.codeonthego.lsp.java.JavaCompilerProvider +import org.appdevforall.codeonthego.lsp.java.compiler.SourceFileObject +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.projects.api.ModuleProject import com.sun.jdi.Location import jdkx.tools.JavaFileObject import org.appdevforall.codeonthego.indexing.jvm.KT_SOURCE_FILE_META_INDEX_KEY import org.slf4j.LoggerFactory import java.io.File import kotlin.jvm.optionals.getOrNull -import com.itsaky.androidide.lsp.debug.model.Location as LspLocation +import org.appdevforall.codeonthego.lsp.debug.model.Location as LspLocation private val logger = LoggerFactory.getLogger("ModelUtilsKt") diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/Strata.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/Strata.kt similarity index 99% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/Strata.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/Strata.kt index 675e750536..dec04188d6 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/Strata.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/Strata.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.debug.utils +package org.appdevforall.codeonthego.lsp.java.debug.utils import com.sun.jdi.AbsentInformationException import com.sun.jdi.Location diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/StringUtils.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/StringUtils.kt similarity index 88% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/StringUtils.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/StringUtils.kt index 91ede2a6ed..a0ffb31a2c 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/StringUtils.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/StringUtils.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.debug.utils +package org.appdevforall.codeonthego.lsp.java.debug.utils internal fun String.isJavaIdentifier(): Boolean { if (isEmpty()) { diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/VariableValues.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/VariableValues.kt similarity index 96% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/VariableValues.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/VariableValues.kt index f65226c6ee..9f0a8e7665 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/VariableValues.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/VariableValues.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.java.debug.utils +package org.appdevforall.codeonthego.lsp.java.debug.utils -import com.itsaky.androidide.lsp.java.debug.utils.JdiTypes.createBoxedPrimitive +import org.appdevforall.codeonthego.lsp.java.debug.utils.JdiTypes.createBoxedPrimitive import com.sun.jdi.BooleanType import com.sun.jdi.ByteType import com.sun.jdi.CharType diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/VmUtils.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/VmUtils.kt similarity index 93% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/VmUtils.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/VmUtils.kt index b87a47b0b0..071ce67b93 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/debug/utils/VmUtils.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/debug/utils/VmUtils.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.debug.utils +package org.appdevforall.codeonthego.lsp.java.debug.utils import com.sun.jdi.Method import com.sun.jdi.VMDisconnectedException diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/edits/AdvancedJavaEditHandler.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/edits/AdvancedJavaEditHandler.kt similarity index 84% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/edits/AdvancedJavaEditHandler.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/edits/AdvancedJavaEditHandler.kt index 387d546cb4..1143b354ca 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/edits/AdvancedJavaEditHandler.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/edits/AdvancedJavaEditHandler.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.edits +package org.appdevforall.codeonthego.lsp.java.edits -import com.itsaky.androidide.lsp.java.JavaCompilerProvider -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.projects.IProjectManager +import org.appdevforall.codeonthego.lsp.java.JavaCompilerProvider +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.projects.IProjectManager import io.github.rosemoe.sora.text.Content import io.github.rosemoe.sora.widget.CodeEditor import java.nio.file.Path diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/edits/BaseJavaEditHandler.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/edits/BaseJavaEditHandler.kt similarity index 83% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/edits/BaseJavaEditHandler.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/edits/BaseJavaEditHandler.kt index 4f12c45336..4395080f8b 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/edits/BaseJavaEditHandler.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/edits/BaseJavaEditHandler.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.edits +package org.appdevforall.codeonthego.lsp.java.edits -import com.itsaky.androidide.editor.api.ILspEditor -import com.itsaky.androidide.lsp.edits.DefaultEditHandler -import com.itsaky.androidide.lsp.models.Command +import org.appdevforall.codeonthego.editor.api.ILspEditor +import org.appdevforall.codeonthego.lsp.edits.DefaultEditHandler +import org.appdevforall.codeonthego.lsp.models.Command import io.github.rosemoe.sora.widget.CodeEditor /** diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/edits/ClassImportEditHandler.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/edits/ClassImportEditHandler.kt similarity index 79% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/edits/ClassImportEditHandler.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/edits/ClassImportEditHandler.kt index d78a8e673d..c66ab8055f 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/edits/ClassImportEditHandler.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/edits/ClassImportEditHandler.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.edits +package org.appdevforall.codeonthego.lsp.java.edits -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.java.utils.EditHelper -import com.itsaky.androidide.lsp.models.ClassCompletionData -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.util.RewriteHelper +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.java.utils.EditHelper +import org.appdevforall.codeonthego.lsp.models.ClassCompletionData +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.util.RewriteHelper import io.github.rosemoe.sora.widget.CodeEditor import java.nio.file.Path diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/edits/MultipleClassImportEditHandler.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/edits/MultipleClassImportEditHandler.kt similarity index 79% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/edits/MultipleClassImportEditHandler.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/edits/MultipleClassImportEditHandler.kt index 8b9886bb34..a6493d7aa3 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/edits/MultipleClassImportEditHandler.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/edits/MultipleClassImportEditHandler.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.edits +package org.appdevforall.codeonthego.lsp.java.edits -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.java.utils.EditHelper +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.java.utils.EditHelper import io.github.rosemoe.sora.widget.CodeEditor import org.slf4j.LoggerFactory import java.nio.file.Path @@ -44,9 +44,9 @@ class MultipleClassImportEditHandler( override fun performEdits( compiler: JavaCompilerService, editor: CodeEditor, - completionItem: com.itsaky.androidide.lsp.models.CompletionItem + completionItem: org.appdevforall.codeonthego.lsp.models.CompletionItem ) { - val edits = mutableListOf() + val edits = mutableListOf() for (className in classes) { try { edits.addAll(EditHelper.addImportIfNeeded(compiler, file, imported, className)) @@ -54,6 +54,6 @@ class MultipleClassImportEditHandler( log.error("Unable to compute edits to perform import for class: {}", className) } } - com.itsaky.androidide.lsp.util.RewriteHelper.performEdits(edits, editor) + org.appdevforall.codeonthego.lsp.util.RewriteHelper.performEdits(edits, editor) } } diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/models/CompilationRequest.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/models/CompilationRequest.kt similarity index 87% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/models/CompilationRequest.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/models/CompilationRequest.kt index e50cf4ef32..c939f55d10 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/models/CompilationRequest.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/models/CompilationRequest.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.models +package org.appdevforall.codeonthego.lsp.java.models -import com.itsaky.androidide.lsp.java.compiler.CompilationTaskProcessor -import com.itsaky.androidide.lsp.java.compiler.DefaultCompilationTaskProcessor +import org.appdevforall.codeonthego.lsp.java.compiler.CompilationTaskProcessor +import org.appdevforall.codeonthego.lsp.java.compiler.DefaultCompilationTaskProcessor import jdkx.tools.JavaFileObject import openjdk.tools.javac.util.Context import java.util.function.Consumer diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/models/DiagnosticCode.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/models/DiagnosticCode.kt similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/models/DiagnosticCode.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/models/DiagnosticCode.kt index d112687f7f..4818e1db93 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/models/DiagnosticCode.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/models/DiagnosticCode.kt @@ -1,66 +1,66 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.models - -/** - * Diagnostic codes are unique IDs for java diagnostic types. - * - * @author Akash Yadav - */ -enum class DiagnosticCode(val id: String) { - - // -------- Warnings generated by the IDE -------------- - /** Unused method parameter. */ - UNUSED_PARAM("ide.java.unused.param"), - - /** Unused local variable. */ - UNUSED_LOCAL("ide.java.unused.local"), - - /** Unused field. */ - UNUSED_FIELD("ide.java.unused.field"), - - /** Unused method. */ - UNUSED_METHOD("ide.java.unused.method"), - - /** Unused class. */ - UNUSED_CLASS("ide.java.unused.class"), - - /** Exception not thrown in method body. */ - UNUSED_THROWS("ide.java.unused.throws"), - - /** Unknown unused element. */ - UNUSED_OTHER("ide.java.unused.other"), - - /** A block with no statements i.e. an empty block */ - EMPTY_BLOCK("ide.java.empty.block"), - - // ------------ Compiler warnings and errors ------------ - UNCHECKED("compiler.warn.unchecked.call.mbr.of.raw.type"), - DOES_NOT_OVERRIDE_ABSTRACT("compiler.err.does.not.override.abstract"), - NOT_IMPORTED("compiler.err.cant.resolve.location"), - NOT_THROWN("compiler.err.unreported.exception.need.to.catch.or.throw"), - MISSING_CONSTRUCTOR("compiler.err.var.not.initialized.in.default.constructor"), - MISSING_METHOD("compiler.err.cant.resolve.location.args"); - - companion object { - @JvmStatic - fun forId(id: String): DiagnosticCode { - return values().first { id == it.id } - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.models + +/** + * Diagnostic codes are unique IDs for java diagnostic types. + * + * @author Akash Yadav + */ +enum class DiagnosticCode(val id: String) { + + // -------- Warnings generated by the IDE -------------- + /** Unused method parameter. */ + UNUSED_PARAM("ide.java.unused.param"), + + /** Unused local variable. */ + UNUSED_LOCAL("ide.java.unused.local"), + + /** Unused field. */ + UNUSED_FIELD("ide.java.unused.field"), + + /** Unused method. */ + UNUSED_METHOD("ide.java.unused.method"), + + /** Unused class. */ + UNUSED_CLASS("ide.java.unused.class"), + + /** Exception not thrown in method body. */ + UNUSED_THROWS("ide.java.unused.throws"), + + /** Unknown unused element. */ + UNUSED_OTHER("ide.java.unused.other"), + + /** A block with no statements i.e. an empty block */ + EMPTY_BLOCK("ide.java.empty.block"), + + // ------------ Compiler warnings and errors ------------ + UNCHECKED("compiler.warn.unchecked.call.mbr.of.raw.type"), + DOES_NOT_OVERRIDE_ABSTRACT("compiler.err.does.not.override.abstract"), + NOT_IMPORTED("compiler.err.cant.resolve.location"), + NOT_THROWN("compiler.err.unreported.exception.need.to.catch.or.throw"), + MISSING_CONSTRUCTOR("compiler.err.var.not.initialized.in.default.constructor"), + MISSING_METHOD("compiler.err.cant.resolve.location.args"); + + companion object { + @JvmStatic + fun forId(id: String): DiagnosticCode { + return values().first { id == it.id } + } + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/models/JavaCompletionItem.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/models/JavaCompletionItem.kt similarity index 73% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/models/JavaCompletionItem.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/models/JavaCompletionItem.kt index af0ea85203..60bc5e5ae2 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/models/JavaCompletionItem.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/models/JavaCompletionItem.kt @@ -15,17 +15,17 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.models +package org.appdevforall.codeonthego.lsp.java.models -import com.itsaky.androidide.lsp.edits.IEditHandler -import com.itsaky.androidide.lsp.java.edits.BaseJavaEditHandler -import com.itsaky.androidide.lsp.models.Command -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionItemKind -import com.itsaky.androidide.lsp.models.ICompletionData -import com.itsaky.androidide.lsp.models.InsertTextFormat -import com.itsaky.androidide.lsp.models.MatchLevel -import com.itsaky.androidide.lsp.models.TextEdit +import org.appdevforall.codeonthego.lsp.edits.IEditHandler +import org.appdevforall.codeonthego.lsp.java.edits.BaseJavaEditHandler +import org.appdevforall.codeonthego.lsp.models.Command +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind +import org.appdevforall.codeonthego.lsp.models.ICompletionData +import org.appdevforall.codeonthego.lsp.models.InsertTextFormat +import org.appdevforall.codeonthego.lsp.models.MatchLevel +import org.appdevforall.codeonthego.lsp.models.TextEdit /** * Completion item model for java completion items. diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/models/JavaServerConfiguration.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/models/JavaServerConfiguration.java similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/models/JavaServerConfiguration.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/models/JavaServerConfiguration.java index 5d6bad8dfe..4527bf223f 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/models/JavaServerConfiguration.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/models/JavaServerConfiguration.java @@ -1,81 +1,81 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.models; - -import androidx.annotation.NonNull; -import java.nio.file.Path; -import java.util.Collections; -import java.util.Objects; -import java.util.Set; - -/** - * Configuration for the java language server. - * - * @author Akash Yadav - */ -public class JavaServerConfiguration { - - private Set classPaths; - private Set sourceDirs; - - public JavaServerConfiguration() { - this(Collections.emptySet(), Collections.emptySet()); - } - - public JavaServerConfiguration(Set classPaths, Set sourcePaths) { - this.classPaths = classPaths; - this.sourceDirs = sourcePaths; - } - - @Override - public int hashCode() { - return Objects.hash(getClassPaths()); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - JavaServerConfiguration that = (JavaServerConfiguration) o; - return Objects.equals(getClassPaths(), that.getClassPaths()); - } - - @NonNull - @Override - public String toString() { - return "JavaServerConfiguration{" + "classPaths=" + classPaths + '}'; - } - - public Set getClassPaths() { - return classPaths; - } - - public JavaServerConfiguration setClassPaths(Set classPaths) { - this.classPaths = classPaths; - return this; - } - - public Set getSourceDirs() { - return sourceDirs; - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.models; + +import androidx.annotation.NonNull; +import java.nio.file.Path; +import java.util.Collections; +import java.util.Objects; +import java.util.Set; + +/** + * Configuration for the java language server. + * + * @author Akash Yadav + */ +public class JavaServerConfiguration { + + private Set classPaths; + private Set sourceDirs; + + public JavaServerConfiguration() { + this(Collections.emptySet(), Collections.emptySet()); + } + + public JavaServerConfiguration(Set classPaths, Set sourcePaths) { + this.classPaths = classPaths; + this.sourceDirs = sourcePaths; + } + + @Override + public int hashCode() { + return Objects.hash(getClassPaths()); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + JavaServerConfiguration that = (JavaServerConfiguration) o; + return Objects.equals(getClassPaths(), that.getClassPaths()); + } + + @NonNull + @Override + public String toString() { + return "JavaServerConfiguration{" + "classPaths=" + classPaths + '}'; + } + + public Set getClassPaths() { + return classPaths; + } + + public JavaServerConfiguration setClassPaths(Set classPaths) { + this.classPaths = classPaths; + return this; + } + + public Set getSourceDirs() { + return sourceDirs; + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/models/JavaServerSettings.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/models/JavaServerSettings.java similarity index 85% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/models/JavaServerSettings.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/models/JavaServerSettings.java index c4e296204e..0e9cc81dfb 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/models/JavaServerSettings.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/models/JavaServerSettings.java @@ -1,75 +1,75 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.java.models; - -import androidx.annotation.NonNull; -import com.google.googlejavaformat.java.JavaFormatterOptions; -import com.itsaky.androidide.lsp.util.PrefBasedServerSettings; -import com.itsaky.androidide.managers.PreferenceManager; -import com.itsaky.androidide.preferences.internal.JavaPreferences; -import com.itsaky.androidide.utils.VMUtils; - -/** - * Server settings for the java language server. - * - * @author Akash Yadav - */ -public class JavaServerSettings extends PrefBasedServerSettings { - - public static final String KEY_JAVA_PREF_GOOGLE_CODE_STYLE = JavaPreferences.GOOGLE_CODE_STYLE; - public static final int CODE_STYLE_AOSP = 0; - public static final int CODE_STYLE_GOOGLE = 1; - private static JavaServerSettings instance; - - @NonNull - public static JavaServerSettings getInstance() { - if (instance == null) { - instance = new JavaServerSettings(); - } - - return instance; - } - - @Override - public boolean diagnosticsEnabled() { - return true; - } - - public JavaFormatterOptions getFormatterOptions() { - return JavaFormatterOptions.builder().formatJavadoc(true).style(getStyle()).build(); - } - - public JavaFormatterOptions.Style getStyle() { - if (getCodeStyle() == JavaServerSettings.CODE_STYLE_AOSP) { - - return JavaFormatterOptions.Style.AOSP; - } - - return JavaFormatterOptions.Style.GOOGLE; - } - - private int getCodeStyle() { - final PreferenceManager prefs = getPrefs(); - if (prefs != null) { - if (prefs.getBoolean(KEY_JAVA_PREF_GOOGLE_CODE_STYLE, false)) { - return CODE_STYLE_GOOGLE; - } - } - - return CODE_STYLE_AOSP; - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.java.models; + +import androidx.annotation.NonNull; +import com.google.googlejavaformat.java.JavaFormatterOptions; +import org.appdevforall.codeonthego.lsp.util.PrefBasedServerSettings; +import org.appdevforall.codeonthego.managers.PreferenceManager; +import org.appdevforall.codeonthego.preferences.internal.JavaPreferences; +import org.appdevforall.codeonthego.utils.VMUtils; + +/** + * Server settings for the java language server. + * + * @author Akash Yadav + */ +public class JavaServerSettings extends PrefBasedServerSettings { + + public static final String KEY_JAVA_PREF_GOOGLE_CODE_STYLE = JavaPreferences.GOOGLE_CODE_STYLE; + public static final int CODE_STYLE_AOSP = 0; + public static final int CODE_STYLE_GOOGLE = 1; + private static JavaServerSettings instance; + + @NonNull + public static JavaServerSettings getInstance() { + if (instance == null) { + instance = new JavaServerSettings(); + } + + return instance; + } + + @Override + public boolean diagnosticsEnabled() { + return true; + } + + public JavaFormatterOptions getFormatterOptions() { + return JavaFormatterOptions.builder().formatJavadoc(true).style(getStyle()).build(); + } + + public JavaFormatterOptions.Style getStyle() { + if (getCodeStyle() == JavaServerSettings.CODE_STYLE_AOSP) { + + return JavaFormatterOptions.Style.AOSP; + } + + return JavaFormatterOptions.Style.GOOGLE; + } + + private int getCodeStyle() { + final PreferenceManager prefs = getPrefs(); + if (prefs != null) { + if (prefs.getBoolean(KEY_JAVA_PREF_GOOGLE_CODE_STYLE, false)) { + return CODE_STYLE_GOOGLE; + } + } + + return CODE_STYLE_AOSP; + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/models/PartialReparseRequest.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/models/PartialReparseRequest.kt similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/models/PartialReparseRequest.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/models/PartialReparseRequest.kt index 8c66b9ab8a..8c84cc212f 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/models/PartialReparseRequest.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/models/PartialReparseRequest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.models +package org.appdevforall.codeonthego.lsp.java.models /** * Data provided to the compiler to request a partial reparse if needed. diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/IJavaParser.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/IJavaParser.kt similarity index 95% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/IJavaParser.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/IJavaParser.kt index 714f4914a5..1c664f5cd6 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/IJavaParser.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/IJavaParser.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.parser +package org.appdevforall.codeonthego.lsp.java.parser import jdkx.tools.JavaFileObject diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/ParseTask.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/ParseTask.java similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/ParseTask.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/ParseTask.java index 86830877c1..e38ed37816 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/ParseTask.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/ParseTask.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.parser; +package org.appdevforall.codeonthego.lsp.java.parser; import openjdk.source.tree.CompilationUnitTree; import openjdk.source.util.JavacTask; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/Parser.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/Parser.java similarity index 92% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/Parser.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/Parser.java index 8a6ba9cc7d..2394ddf809 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/Parser.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/Parser.java @@ -1,239 +1,239 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.parser; - -import com.itsaky.androidide.lsp.java.compiler.SourceFileManager; -import com.itsaky.androidide.lsp.java.compiler.SourceFileObject; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; -import com.itsaky.androidide.projects.IProjectManager; -import com.itsaky.androidide.projects.api.ModuleProject; -import java.io.IOException; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Collections; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import jdkx.tools.JavaCompiler; -import jdkx.tools.JavaFileObject; -import openjdk.source.tree.ClassTree; -import openjdk.source.tree.CompilationUnitTree; -import openjdk.source.tree.LineMap; -import openjdk.source.tree.MemberSelectTree; -import openjdk.source.tree.MethodTree; -import openjdk.source.tree.VariableTree; -import openjdk.source.util.JavacTask; -import openjdk.source.util.SourcePositions; -import openjdk.source.util.TreePath; -import openjdk.source.util.Trees; -import openjdk.tools.javac.api.JavacTool; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Parser { - - private static final JavaCompiler COMPILER = JavacTool.create(); - private static SourceFileManager FILE_MANAGER = SourceFileManager.NO_MODULE; - private static final Logger LOG = LoggerFactory.getLogger(Parser.class); - private static Parser cachedParse; - private static long cachedModified = -1; - public final JavaFileObject file; - public final String contents; - public final JavacTask task; - public final CompilationUnitTree root; - public final Trees trees; - - private Parser(JavaFileObject file) { - this.file = file; - try { - this.contents = file.getCharContent(false).toString(); - } catch (IOException e) { - throw new RuntimeException(e); - } - this.task = singleFileTask(file); - try { - this.root = task.parse().iterator().next(); - } catch (IOException e) { - throw new RuntimeException(e); - } - this.trees = Trees.instance(task); - } - - /** - * Create a task that compiles a single file - */ - private static JavacTask singleFileTask(JavaFileObject file) { - final ModuleProject module = IProjectManager.getInstance() - .findModuleForFile(Paths.get(file.toUri())); - if (module != null) { - FILE_MANAGER = SourceFileManager.forModule(module); - } - - return (JavacTask) - COMPILER.getTask( - null, - FILE_MANAGER, - Parser::ignoreError, - Collections.emptyList(), - Collections.emptyList(), - Collections.singletonList(file)); - } - - private static void ignoreError(jdkx.tools.Diagnostic __) { - // Too noisy, this only comes up in parse tasks which tend to be less important - // LOG.warning(err.getMessage(Locale.getDefault())); - } - - public static Parser parseFile(Path file) { - return parseJavaFileObject(new SourceFileObject(file)); - } - - public static Parser parseJavaFileObject(JavaFileObject file) { - if (needsParse(file)) { - loadParse(file); - } - return cachedParse; - } - - private static boolean needsParse(JavaFileObject file) { - if (cachedParse == null) { - return true; - } - if (!cachedParse.file.equals(file)) { - return true; - } - - return file.getLastModified() > cachedModified; - } - - private static void loadParse(JavaFileObject file) { - cachedParse = new Parser(file); - cachedModified = file.getLastModified(); - } - - public static Range range(JavacTask task, CharSequence contents, TreePath path) { - // Find start position - Trees trees = Trees.instance(task); - SourcePositions pos = trees.getSourcePositions(); - CompilationUnitTree root = path.getCompilationUnit(); - LineMap lines = root.getLineMap(); - int start = (int) pos.getStartPosition(root, path.getLeaf()); - int end = (int) pos.getEndPosition(root, path.getLeaf()); - - // If start is -1, give up - if (start == -1) { - LOG.warn("Couldn't locate `{}`", path.getLeaf()); - return Range.NONE; - } - // If end is bad, guess based on start - if (end == -1) { - end = start + path.getLeaf().toString().length(); - } - - if (path.getLeaf() instanceof ClassTree) { - ClassTree cls = (ClassTree) path.getLeaf(); - - // If class has annotations, skip over them - if (!cls.getModifiers().getAnnotations().isEmpty()) { - start = (int) pos.getEndPosition(root, cls.getModifiers()); - } - - // Find position of class name - String name = cls.getSimpleName().toString(); - start = indexOf(contents, name, start); - if (start == -1) { - LOG.warn("Couldn't find identifier `{}` in `{}`", name, path.getLeaf()); - return Range.NONE; - } - end = start + name.length(); - } - if (path.getLeaf() instanceof MethodTree) { - MethodTree method = (MethodTree) path.getLeaf(); - - // If method has annotations, skip over them - if (!method.getModifiers().getAnnotations().isEmpty()) { - start = (int) pos.getEndPosition(root, method.getModifiers()); - } - - // Find position of method name - String name = method.getName().toString(); - if (name.equals("")) { - name = className(path); - } - start = indexOf(contents, name, start); - if (start == -1) { - LOG.warn("Couldn't find identifier `{}` in `{}`", name, path.getLeaf()); - return Range.NONE; - } - end = start + name.length(); - } - if (path.getLeaf() instanceof VariableTree) { - VariableTree field = (VariableTree) path.getLeaf(); - - // If field has annotations, skip over them - if (!field.getModifiers().getAnnotations().isEmpty()) { - start = (int) pos.getEndPosition(root, field.getModifiers()); - } - - // Find position of method name - String name = field.getName().toString(); - start = indexOf(contents, name, start); - if (start == -1) { - LOG.warn("Couldn't find identifier `{}` in `{}`", name, path.getLeaf()); - return Range.NONE; - } - end = start + name.length(); - } - if (path.getLeaf() instanceof MemberSelectTree) { - MemberSelectTree member = (MemberSelectTree) path.getLeaf(); - String name = member.getIdentifier().toString(); - start = indexOf(contents, name, start); - if (start == -1) { - LOG.warn("Couldn't find identifier `{}` in `{}`", name, path.getLeaf()); - return Range.NONE; - } - end = start + name.length(); - } - int startLine = (int) lines.getLineNumber(start); - int startCol = (int) lines.getColumnNumber(start); - int endLine = (int) lines.getLineNumber(end); - int endCol = (int) lines.getColumnNumber(end); - - return new Range( - new Position(startLine - 1, startCol - 1), new Position(endLine - 1, endCol - 1)); - } - - private static int indexOf(CharSequence contents, String name, int start) { - Matcher matcher = Pattern.compile("\\b" + name + "\\b").matcher(contents); - if (matcher.find(start)) { - return matcher.start(); - } - return -1; - } - - static String className(TreePath t) { - while (t != null) { - if (t.getLeaf() instanceof ClassTree) { - ClassTree cls = (ClassTree) t.getLeaf(); - return cls.getSimpleName().toString(); - } - t = t.getParentPath(); - } - return ""; - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.parser; + +import org.appdevforall.codeonthego.lsp.java.compiler.SourceFileManager; +import org.appdevforall.codeonthego.lsp.java.compiler.SourceFileObject; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; +import org.appdevforall.codeonthego.projects.IProjectManager; +import org.appdevforall.codeonthego.projects.api.ModuleProject; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Collections; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import jdkx.tools.JavaCompiler; +import jdkx.tools.JavaFileObject; +import openjdk.source.tree.ClassTree; +import openjdk.source.tree.CompilationUnitTree; +import openjdk.source.tree.LineMap; +import openjdk.source.tree.MemberSelectTree; +import openjdk.source.tree.MethodTree; +import openjdk.source.tree.VariableTree; +import openjdk.source.util.JavacTask; +import openjdk.source.util.SourcePositions; +import openjdk.source.util.TreePath; +import openjdk.source.util.Trees; +import openjdk.tools.javac.api.JavacTool; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Parser { + + private static final JavaCompiler COMPILER = JavacTool.create(); + private static SourceFileManager FILE_MANAGER = SourceFileManager.NO_MODULE; + private static final Logger LOG = LoggerFactory.getLogger(Parser.class); + private static Parser cachedParse; + private static long cachedModified = -1; + public final JavaFileObject file; + public final String contents; + public final JavacTask task; + public final CompilationUnitTree root; + public final Trees trees; + + private Parser(JavaFileObject file) { + this.file = file; + try { + this.contents = file.getCharContent(false).toString(); + } catch (IOException e) { + throw new RuntimeException(e); + } + this.task = singleFileTask(file); + try { + this.root = task.parse().iterator().next(); + } catch (IOException e) { + throw new RuntimeException(e); + } + this.trees = Trees.instance(task); + } + + /** + * Create a task that compiles a single file + */ + private static JavacTask singleFileTask(JavaFileObject file) { + final ModuleProject module = IProjectManager.getInstance() + .findModuleForFile(Paths.get(file.toUri())); + if (module != null) { + FILE_MANAGER = SourceFileManager.forModule(module); + } + + return (JavacTask) + COMPILER.getTask( + null, + FILE_MANAGER, + Parser::ignoreError, + Collections.emptyList(), + Collections.emptyList(), + Collections.singletonList(file)); + } + + private static void ignoreError(jdkx.tools.Diagnostic __) { + // Too noisy, this only comes up in parse tasks which tend to be less important + // LOG.warning(err.getMessage(Locale.getDefault())); + } + + public static Parser parseFile(Path file) { + return parseJavaFileObject(new SourceFileObject(file)); + } + + public static Parser parseJavaFileObject(JavaFileObject file) { + if (needsParse(file)) { + loadParse(file); + } + return cachedParse; + } + + private static boolean needsParse(JavaFileObject file) { + if (cachedParse == null) { + return true; + } + if (!cachedParse.file.equals(file)) { + return true; + } + + return file.getLastModified() > cachedModified; + } + + private static void loadParse(JavaFileObject file) { + cachedParse = new Parser(file); + cachedModified = file.getLastModified(); + } + + public static Range range(JavacTask task, CharSequence contents, TreePath path) { + // Find start position + Trees trees = Trees.instance(task); + SourcePositions pos = trees.getSourcePositions(); + CompilationUnitTree root = path.getCompilationUnit(); + LineMap lines = root.getLineMap(); + int start = (int) pos.getStartPosition(root, path.getLeaf()); + int end = (int) pos.getEndPosition(root, path.getLeaf()); + + // If start is -1, give up + if (start == -1) { + LOG.warn("Couldn't locate `{}`", path.getLeaf()); + return Range.NONE; + } + // If end is bad, guess based on start + if (end == -1) { + end = start + path.getLeaf().toString().length(); + } + + if (path.getLeaf() instanceof ClassTree) { + ClassTree cls = (ClassTree) path.getLeaf(); + + // If class has annotations, skip over them + if (!cls.getModifiers().getAnnotations().isEmpty()) { + start = (int) pos.getEndPosition(root, cls.getModifiers()); + } + + // Find position of class name + String name = cls.getSimpleName().toString(); + start = indexOf(contents, name, start); + if (start == -1) { + LOG.warn("Couldn't find identifier `{}` in `{}`", name, path.getLeaf()); + return Range.NONE; + } + end = start + name.length(); + } + if (path.getLeaf() instanceof MethodTree) { + MethodTree method = (MethodTree) path.getLeaf(); + + // If method has annotations, skip over them + if (!method.getModifiers().getAnnotations().isEmpty()) { + start = (int) pos.getEndPosition(root, method.getModifiers()); + } + + // Find position of method name + String name = method.getName().toString(); + if (name.equals("")) { + name = className(path); + } + start = indexOf(contents, name, start); + if (start == -1) { + LOG.warn("Couldn't find identifier `{}` in `{}`", name, path.getLeaf()); + return Range.NONE; + } + end = start + name.length(); + } + if (path.getLeaf() instanceof VariableTree) { + VariableTree field = (VariableTree) path.getLeaf(); + + // If field has annotations, skip over them + if (!field.getModifiers().getAnnotations().isEmpty()) { + start = (int) pos.getEndPosition(root, field.getModifiers()); + } + + // Find position of method name + String name = field.getName().toString(); + start = indexOf(contents, name, start); + if (start == -1) { + LOG.warn("Couldn't find identifier `{}` in `{}`", name, path.getLeaf()); + return Range.NONE; + } + end = start + name.length(); + } + if (path.getLeaf() instanceof MemberSelectTree) { + MemberSelectTree member = (MemberSelectTree) path.getLeaf(); + String name = member.getIdentifier().toString(); + start = indexOf(contents, name, start); + if (start == -1) { + LOG.warn("Couldn't find identifier `{}` in `{}`", name, path.getLeaf()); + return Range.NONE; + } + end = start + name.length(); + } + int startLine = (int) lines.getLineNumber(start); + int startCol = (int) lines.getColumnNumber(start); + int endLine = (int) lines.getLineNumber(end); + int endCol = (int) lines.getColumnNumber(end); + + return new Range( + new Position(startLine - 1, startCol - 1), new Position(endLine - 1, endCol - 1)); + } + + private static int indexOf(CharSequence contents, String name, int start) { + Matcher matcher = Pattern.compile("\\b" + name + "\\b").matcher(contents); + if (matcher.find(start)) { + return matcher.start(); + } + return -1; + } + + static String className(TreePath t) { + while (t != null) { + if (t.getLeaf() instanceof ClassTree) { + ClassTree cls = (ClassTree) t.getLeaf(); + return cls.getSimpleName().toString(); + } + t = t.getParentPath(); + } + return ""; + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/ts/TSJavaParser.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/ts/TSJavaParser.kt similarity index 90% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/ts/TSJavaParser.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/ts/TSJavaParser.kt index 9f9f277c27..7bb063c77b 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/ts/TSJavaParser.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/ts/TSJavaParser.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.parser.ts +package org.appdevforall.codeonthego.lsp.java.parser.ts -import com.itsaky.androidide.eventbus.events.file.FileDeletionEvent -import com.itsaky.androidide.eventbus.events.file.FileRenameEvent -import com.itsaky.androidide.lsp.java.parser.IJavaParser +import org.appdevforall.codeonthego.eventbus.events.file.FileDeletionEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileRenameEvent +import org.appdevforall.codeonthego.lsp.java.parser.IJavaParser import com.itsaky.androidide.treesitter.TSParser import com.itsaky.androidide.treesitter.java.TSLanguageJava -import com.itsaky.androidide.utils.StopWatch +import org.appdevforall.codeonthego.utils.StopWatch import jdkx.tools.JavaFileObject import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.Subscribe diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/ts/TSMethodPruner.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/ts/TSMethodPruner.kt similarity index 97% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/ts/TSMethodPruner.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/ts/TSMethodPruner.kt index 921e638fe5..ed29b729a7 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/ts/TSMethodPruner.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/ts/TSMethodPruner.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.parser.ts +package org.appdevforall.codeonthego.lsp.java.parser.ts import com.itsaky.androidide.treesitter.TSQuery import com.itsaky.androidide.treesitter.TSQueryCursor diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/ts/TSParseCache.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/ts/TSParseCache.kt similarity index 95% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/ts/TSParseCache.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/ts/TSParseCache.kt index bc09de9837..1a08a1acc8 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/ts/TSParseCache.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/ts/TSParseCache.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.parser.ts +package org.appdevforall.codeonthego.lsp.java.parser.ts import androidx.collection.LruCache import java.net.URI diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/ts/TSParseResult.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/ts/TSParseResult.kt similarity index 95% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/ts/TSParseResult.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/ts/TSParseResult.kt index 870d494b0d..4963711b59 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/parser/ts/TSParseResult.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/parser/ts/TSParseResult.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.parser.ts +package org.appdevforall.codeonthego.lsp.java.parser.ts import com.itsaky.androidide.treesitter.TSTree import jdkx.tools.JavaFileObject diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/BaseJavaServiceProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/BaseJavaServiceProvider.kt similarity index 76% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/BaseJavaServiceProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/BaseJavaServiceProvider.kt index 84950ef873..cada8d832a 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/BaseJavaServiceProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/BaseJavaServiceProvider.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.providers +package org.appdevforall.codeonthego.lsp.java.providers -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.progress.ICancelChecker -import com.itsaky.androidide.progress.ProgressManager +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.progress.ICancelChecker +import org.appdevforall.codeonthego.progress.ProgressManager import java.nio.file.Path /** diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/CancelableServiceProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/CancelableServiceProvider.kt similarity index 88% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/CancelableServiceProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/CancelableServiceProvider.kt index acdd03aa2a..8f0fc344eb 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/CancelableServiceProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/CancelableServiceProvider.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.providers +package org.appdevforall.codeonthego.lsp.java.providers -import com.itsaky.androidide.progress.ICancelChecker +import org.appdevforall.codeonthego.progress.ICancelChecker /** * A service provider which supports cancellation. diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/CodeFormatProvider.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/CodeFormatProvider.java similarity index 86% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/CodeFormatProvider.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/CodeFormatProvider.java index f73e2ab3c5..fe892e69a1 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/CodeFormatProvider.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/CodeFormatProvider.java @@ -1,113 +1,113 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.providers; - -import static com.google.common.collect.Range.closedOpen; - -import androidx.annotation.NonNull; -import com.google.common.collect.ImmutableList; -import com.google.googlejavaformat.java.Formatter; -import com.google.googlejavaformat.java.FormatterException; -import com.google.googlejavaformat.java.Replacement; -import com.itsaky.androidide.lsp.api.IServerSettings; -import com.itsaky.androidide.lsp.java.models.JavaServerSettings; -import com.itsaky.androidide.lsp.models.CodeFormatResult; -import com.itsaky.androidide.lsp.models.FormatCodeParams; -import com.itsaky.androidide.lsp.models.IndexedTextEdit; -import com.itsaky.androidide.models.Range; -import com.itsaky.androidide.utils.StopWatch; -import java.util.Collection; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Formats Java code using Google Java Format. - * - * @author Akash Yadav - */ -public class CodeFormatProvider { - - private static final Logger LOG = LoggerFactory.getLogger(CodeFormatProvider.class); - - private final JavaServerSettings settings; - - public CodeFormatProvider(IServerSettings settings) { - assert settings instanceof JavaServerSettings; - this.settings = (JavaServerSettings) settings; - } - - public CodeFormatResult format(FormatCodeParams params) { - try { - final StopWatch watch = new StopWatch("Code formatting"); - final String content = params.getContent().toString(); - final Formatter formatter = new Formatter(settings.getFormatterOptions()); - - if (params.getRange() == Range.NONE) { - String formatted; - try { - formatted = formatter.formatSource(content); - } catch (FormatterException e) { - e.printStackTrace(); - formatted = content; - } - return CodeFormatResult.forWholeContent(content, formatted); - } - - final Collection> ranges = - getCharRanges(content, params.getRange()); - - final ImmutableList replacements = - formatter.getFormatReplacements(content, ranges); - - watch.log(); - return createResult(replacements); - } catch (Throwable e) { - LOG.error("Failed to format code.", e); - return CodeFormatResult.NONE; - } - } - - private CodeFormatResult createResult(final ImmutableList replacements) { - final CodeFormatResult result = new CodeFormatResult(true); - for (final Replacement replacement : replacements) { - final com.google.common.collect.Range range = replacement.getReplaceRange(); - final IndexedTextEdit edit = new IndexedTextEdit(); - edit.setNewText(replacement.getReplacementString()); - edit.setStart(range.lowerEndpoint()); - edit.setEnd(range.upperEndpoint()); - result.getIndexedTextEdits().add(edit); - } - return result; - } - - @NonNull - private Collection> getCharRanges( - final String content, @NonNull final Range range) { - - int start, end; - if (range == Range.NONE) { - start = 0; - end = content.length(); - } else { - start = range.getStart().requireIndex(); - end = range.getEnd().requireIndex(); - } - - return ImmutableList.of(closedOpen(start, end)); - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.providers; + +import static com.google.common.collect.Range.closedOpen; + +import androidx.annotation.NonNull; +import com.google.common.collect.ImmutableList; +import com.google.googlejavaformat.java.Formatter; +import com.google.googlejavaformat.java.FormatterException; +import com.google.googlejavaformat.java.Replacement; +import org.appdevforall.codeonthego.lsp.api.IServerSettings; +import org.appdevforall.codeonthego.lsp.java.models.JavaServerSettings; +import org.appdevforall.codeonthego.lsp.models.CodeFormatResult; +import org.appdevforall.codeonthego.lsp.models.FormatCodeParams; +import org.appdevforall.codeonthego.lsp.models.IndexedTextEdit; +import org.appdevforall.codeonthego.models.Range; +import org.appdevforall.codeonthego.utils.StopWatch; +import java.util.Collection; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Formats Java code using Google Java Format. + * + * @author Akash Yadav + */ +public class CodeFormatProvider { + + private static final Logger LOG = LoggerFactory.getLogger(CodeFormatProvider.class); + + private final JavaServerSettings settings; + + public CodeFormatProvider(IServerSettings settings) { + assert settings instanceof JavaServerSettings; + this.settings = (JavaServerSettings) settings; + } + + public CodeFormatResult format(FormatCodeParams params) { + try { + final StopWatch watch = new StopWatch("Code formatting"); + final String content = params.getContent().toString(); + final Formatter formatter = new Formatter(settings.getFormatterOptions()); + + if (params.getRange() == Range.NONE) { + String formatted; + try { + formatted = formatter.formatSource(content); + } catch (FormatterException e) { + e.printStackTrace(); + formatted = content; + } + return CodeFormatResult.forWholeContent(content, formatted); + } + + final Collection> ranges = + getCharRanges(content, params.getRange()); + + final ImmutableList replacements = + formatter.getFormatReplacements(content, ranges); + + watch.log(); + return createResult(replacements); + } catch (Throwable e) { + LOG.error("Failed to format code.", e); + return CodeFormatResult.NONE; + } + } + + private CodeFormatResult createResult(final ImmutableList replacements) { + final CodeFormatResult result = new CodeFormatResult(true); + for (final Replacement replacement : replacements) { + final com.google.common.collect.Range range = replacement.getReplaceRange(); + final IndexedTextEdit edit = new IndexedTextEdit(); + edit.setNewText(replacement.getReplacementString()); + edit.setStart(range.lowerEndpoint()); + edit.setEnd(range.upperEndpoint()); + result.getIndexedTextEdits().add(edit); + } + return result; + } + + @NonNull + private Collection> getCharRanges( + final String content, @NonNull final Range range) { + + int start, end; + if (range == Range.NONE) { + start = 0; + end = content.length(); + } else { + start = range.getStart().requireIndex(); + end = range.getEnd().requireIndex(); + } + + return ImmutableList.of(closedOpen(start, end)); + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/CompletionProvider.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/CompletionProvider.java similarity index 83% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/CompletionProvider.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/CompletionProvider.java index 6e1bb5110a..b9fc803529 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/CompletionProvider.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/CompletionProvider.java @@ -15,36 +15,36 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.providers; +package org.appdevforall.codeonthego.lsp.java.providers; -import static com.itsaky.androidide.lsp.api.HelpersKt.describeSnippet; +import static org.appdevforall.codeonthego.lsp.api.HelpersKt.describeSnippet; import androidx.annotation.NonNull; -import com.itsaky.androidide.lsp.api.AbstractServiceProvider; -import com.itsaky.androidide.lsp.api.ICompletionProvider; -import com.itsaky.androidide.lsp.api.IServerSettings; -import com.itsaky.androidide.lsp.internal.model.CachedCompletion; -import com.itsaky.androidide.lsp.java.compiler.CompileTask; -import com.itsaky.androidide.lsp.java.compiler.CompletionInfo; -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerConfig; -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService; -import com.itsaky.androidide.lsp.java.compiler.SourceFileObject; -import com.itsaky.androidide.lsp.java.compiler.SynchronizedTask; -import com.itsaky.androidide.lsp.java.models.CompilationRequest; -import com.itsaky.androidide.lsp.java.models.PartialReparseRequest; -import com.itsaky.androidide.lsp.java.providers.completion.IJavaCompletionProvider; -import com.itsaky.androidide.lsp.java.providers.completion.IdentifierCompletionProvider; -import com.itsaky.androidide.lsp.java.providers.completion.ImportCompletionProvider; -import com.itsaky.androidide.lsp.java.providers.completion.KeywordCompletionProvider; -import com.itsaky.androidide.lsp.java.providers.completion.MemberReferenceCompletionProvider; -import com.itsaky.androidide.lsp.java.providers.completion.MemberSelectCompletionProvider; -import com.itsaky.androidide.lsp.java.providers.completion.SwitchConstantCompletionProvider; -import com.itsaky.androidide.lsp.java.utils.ASTFixer; -import com.itsaky.androidide.lsp.java.utils.CancelChecker; -import com.itsaky.androidide.lsp.java.visitors.FindCompletionsAt; -import com.itsaky.androidide.lsp.models.CompletionParams; -import com.itsaky.androidide.lsp.models.CompletionResult; -import com.itsaky.androidide.utils.DocumentUtils; +import org.appdevforall.codeonthego.lsp.api.AbstractServiceProvider; +import org.appdevforall.codeonthego.lsp.api.ICompletionProvider; +import org.appdevforall.codeonthego.lsp.api.IServerSettings; +import org.appdevforall.codeonthego.lsp.internal.model.CachedCompletion; +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask; +import org.appdevforall.codeonthego.lsp.java.compiler.CompletionInfo; +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerConfig; +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService; +import org.appdevforall.codeonthego.lsp.java.compiler.SourceFileObject; +import org.appdevforall.codeonthego.lsp.java.compiler.SynchronizedTask; +import org.appdevforall.codeonthego.lsp.java.models.CompilationRequest; +import org.appdevforall.codeonthego.lsp.java.models.PartialReparseRequest; +import org.appdevforall.codeonthego.lsp.java.providers.completion.IJavaCompletionProvider; +import org.appdevforall.codeonthego.lsp.java.providers.completion.IdentifierCompletionProvider; +import org.appdevforall.codeonthego.lsp.java.providers.completion.ImportCompletionProvider; +import org.appdevforall.codeonthego.lsp.java.providers.completion.KeywordCompletionProvider; +import org.appdevforall.codeonthego.lsp.java.providers.completion.MemberReferenceCompletionProvider; +import org.appdevforall.codeonthego.lsp.java.providers.completion.MemberSelectCompletionProvider; +import org.appdevforall.codeonthego.lsp.java.providers.completion.SwitchConstantCompletionProvider; +import org.appdevforall.codeonthego.lsp.java.utils.ASTFixer; +import org.appdevforall.codeonthego.lsp.java.utils.CancelChecker; +import org.appdevforall.codeonthego.lsp.java.visitors.FindCompletionsAt; +import org.appdevforall.codeonthego.lsp.models.CompletionParams; +import org.appdevforall.codeonthego.lsp.models.CompletionResult; +import org.appdevforall.codeonthego.utils.DocumentUtils; import io.github.rosemoe.sora.lang.completion.snippet.CodeSnippet; import java.nio.file.Path; import java.time.Duration; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/DefinitionProvider.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/DefinitionProvider.java similarity index 79% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/DefinitionProvider.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/DefinitionProvider.java index ae62e81758..56bc6f0429 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/DefinitionProvider.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/DefinitionProvider.java @@ -15,24 +15,24 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.providers; +package org.appdevforall.codeonthego.lsp.java.providers; import android.text.TextUtils; import androidx.annotation.NonNull; -import com.itsaky.androidide.lsp.api.IServerSettings; -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService; -import com.itsaky.androidide.lsp.java.compiler.SynchronizedTask; -import com.itsaky.androidide.lsp.java.providers.definition.ErroneousDefinitionProvider; -import com.itsaky.androidide.lsp.java.providers.definition.IJavaDefinitionProvider; -import com.itsaky.androidide.lsp.java.providers.definition.LocalDefinitionProvider; -import com.itsaky.androidide.lsp.java.providers.definition.RemoteDefinitionProvider; -import com.itsaky.androidide.lsp.java.utils.NavigationHelper; -import com.itsaky.androidide.lsp.models.DefinitionParams; -import com.itsaky.androidide.lsp.models.DefinitionResult; -import com.itsaky.androidide.models.Location; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.progress.ICancelChecker; -import com.itsaky.androidide.utils.DocumentUtils; +import org.appdevforall.codeonthego.lsp.api.IServerSettings; +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService; +import org.appdevforall.codeonthego.lsp.java.compiler.SynchronizedTask; +import org.appdevforall.codeonthego.lsp.java.providers.definition.ErroneousDefinitionProvider; +import org.appdevforall.codeonthego.lsp.java.providers.definition.IJavaDefinitionProvider; +import org.appdevforall.codeonthego.lsp.java.providers.definition.LocalDefinitionProvider; +import org.appdevforall.codeonthego.lsp.java.providers.definition.RemoteDefinitionProvider; +import org.appdevforall.codeonthego.lsp.java.utils.NavigationHelper; +import org.appdevforall.codeonthego.lsp.models.DefinitionParams; +import org.appdevforall.codeonthego.lsp.models.DefinitionResult; +import org.appdevforall.codeonthego.models.Location; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.progress.ICancelChecker; +import org.appdevforall.codeonthego.utils.DocumentUtils; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Collections; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/DiagnosticsProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/DiagnosticsProvider.kt similarity index 88% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/DiagnosticsProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/DiagnosticsProvider.kt index abb6a33168..c15b6c23c6 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/DiagnosticsProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/DiagnosticsProvider.kt @@ -1,318 +1,318 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.java.providers - -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.models.DiagnosticCode -import com.itsaky.androidide.lsp.java.models.DiagnosticCode.EMPTY_BLOCK -import com.itsaky.androidide.lsp.java.models.DiagnosticCode.UNUSED_THROWS -import com.itsaky.androidide.lsp.java.visitors.DiagnosticVisitor -import com.itsaky.androidide.lsp.models.DiagnosticItem -import com.itsaky.androidide.lsp.models.DiagnosticSeverity -import com.itsaky.androidide.lsp.models.DiagnosticSeverity.WARNING -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.progress.ProgressManager.Companion.abortIfCancelled -import com.itsaky.androidide.projects.FileManager -import com.itsaky.androidide.utils.DocumentUtils.isSameFile -import jdkx.lang.model.element.Element -import jdkx.tools.Diagnostic -import jdkx.tools.JavaFileObject -import openjdk.source.tree.BlockTree -import openjdk.source.tree.ClassTree -import openjdk.source.tree.CompilationUnitTree -import openjdk.source.tree.LineMap -import openjdk.source.tree.MethodTree -import openjdk.source.tree.VariableTree -import openjdk.source.util.TreePath -import openjdk.source.util.Trees -import java.nio.file.Path -import java.nio.file.Paths -import java.util.Locale -import java.util.regex.Pattern - -/** - * Finds errors and warnings from a compilation task. - * - * @author Akash Yadav - */ -object DiagnosticsProvider { - /** - * Finds diagnostics from the given task (only the diagnostics for the given file). The task - * should be a valid task. - * - * As the file might be too long, the diagnostics list must be sorted so we can quickly binary - * search the list when needed. - * - * @param task The compilation task to get diagnostics from. - * @param file The file of which the diagnostics must be extracted. - * @return The list of diagnostics retrieved from the task. Never null. - */ - @JvmStatic - fun findDiagnostics(task: CompileTask, file: Path?): List { - val result = mutableListOf() - var root: CompilationUnitTree? = null - for (tree in task.roots) { - abortIfCancelled() - val path = Paths.get(tree.sourceFile.toUri()) - if (isSameFile(path, file!!)) { - root = tree - break - } - } - - abortIfCancelled() - - if (root == null) { - // CompilationUnitTree for the file was not found - // Can't do anything... - return result - } - - addCompilerErrors(task, root, result) - abortIfCancelled() - addDiagnosticsByVisiting(task, root, result) - abortIfCancelled() - return result - } - - private fun addDiagnosticsByVisiting( - task: CompileTask, - root: CompilationUnitTree, - result: MutableList - ) { - val notThrown = mutableMapOf() - val scanner = DiagnosticVisitor(task.task) - scanner.scan(root, notThrown) - for (unusedEl in scanner.notUsed()) { - warnUnused(task, unusedEl)?.also { result.add(it) } - } - - for (location in notThrown.keys) { - result.add(warnNotThrown(task, notThrown[location], location!!)) - } - - for (path in scanner.emptyBlocks.keys) { - result.add(warnEmptyBlock(task, path, scanner.emptyBlocks[path]!!)) - } - } - - private fun warnEmptyBlock(task: CompileTask, path: TreePath, name: String): DiagnosticItem { - val trees = Trees.instance(task.task) - val thisTree = path.leaf - val code = EMPTY_BLOCK - - val root = task.root() - val lines = task.root().lineMap - val positions = trees.sourcePositions - val start = positions.getStartPosition(root, thisTree) - val end = positions.getEndPosition(root, thisTree) - return DiagnosticItem( - source = "", - code = code.id, - message = "'$name' statement has empty body", - severity = WARNING, - range = - Range(getPosition(start, lines), getPosition(end, lines)).apply { - this.start.index = start.toInt() - this.end.index = end.toInt() - } - ) - } - - private fun addCompilerErrors( - task: CompileTask, - root: CompilationUnitTree, - result: MutableList - ) { - for (diagnostic in task.diagnostics) { - if (diagnostic.source == null || diagnostic.source!!.toUri() != root.sourceFile.toUri()) { - continue - } - if (diagnostic.startPosition == -1L || diagnostic.endPosition == -1L) { - continue - } - result.add(asDiagnosticItem(diagnostic, root.lineMap)) - } - } - - private fun warnNotThrown(task: CompileTask, name: String?, path: TreePath): DiagnosticItem { - val trees = Trees.instance(task.task) - val pos = trees.sourcePositions - val root = path.compilationUnit - val lines = root.lineMap - val start = pos.getStartPosition(root, path.leaf) - val end = pos.getEndPosition(root, path.leaf) - return DiagnosticItem( - message = String.format("'%s' is not thrown in the body of the method", name), - range = - Range(getPosition(start, lines), getPosition(end, lines)).apply { - this.start.index = start.toInt() - this.end.index = end.toInt() - }, - code = UNUSED_THROWS.id, - severity = DiagnosticSeverity.INFO, - source = "" - ) - } - - private fun warnUnused(task: CompileTask, unusedEl: Element): DiagnosticItem? { - val trees = Trees.instance(task.task) - val path = trees.getPath(unusedEl) ?: throw RuntimeException("$unusedEl has no path") - val root = path.compilationUnit - val leaf = path.leaf - val pos = trees.sourcePositions - var start = pos.getStartPosition(root, leaf).toInt() - var end = pos.getEndPosition(root, leaf).toInt() - - if (leaf is VariableTree) { - val offset = pos.getEndPosition(root, leaf.type).toInt() - if (offset != -1) { - start = offset - } - } - - val file = Paths.get(root.sourceFile.toUri()) - val contents = FileManager.getDocumentContents(file) - var name = unusedEl.simpleName - if (name.contentEquals("")) { - name = unusedEl.enclosingElement.simpleName - } - - val region = try { - contents.subSequence(start, end) - } catch (err: IndexOutOfBoundsException) { - // might happen if the file contents were changed after the file was compiled for analysis - return null - } - - val matcher = Pattern.compile("\\b$name\\b").matcher(region) - if (matcher.find()) { - start += matcher.start() - end = start + name.length - } - - val message = String.format("'%s' is not used", name) - val code: DiagnosticCode - val severity: DiagnosticSeverity - when (leaf) { - is VariableTree -> { - when (path.parentPath.leaf) { - is MethodTree -> { - code = DiagnosticCode.UNUSED_PARAM - severity = DiagnosticSeverity.HINT - } - is BlockTree -> { - code = DiagnosticCode.UNUSED_LOCAL - severity = DiagnosticSeverity.INFO - } - is ClassTree -> { - code = DiagnosticCode.UNUSED_FIELD - severity = DiagnosticSeverity.INFO - } - else -> { - code = DiagnosticCode.UNUSED_OTHER - severity = DiagnosticSeverity.HINT - } - } - } - is MethodTree -> { - code = DiagnosticCode.UNUSED_METHOD - severity = DiagnosticSeverity.INFO - } - is ClassTree -> { - code = DiagnosticCode.UNUSED_CLASS - severity = DiagnosticSeverity.INFO - } - else -> { - code = DiagnosticCode.UNUSED_OTHER - severity = DiagnosticSeverity.INFO - } - } - - return asDiagnosticItem(severity, code.id, message, start.toLong(), end.toLong(), root) - } - - private fun asDiagnosticItem( - severity: DiagnosticSeverity, - code: String, - message: String, - start: Long, - end: Long, - root: CompilationUnitTree - ): DiagnosticItem { - return DiagnosticItem( - message = message, - code = code, - severity = severity, - range = - Range(getPosition(start, root.lineMap), getPosition(end, root.lineMap)).apply { - this.start.index = start.toInt() - this.end.index = end.toInt() - }, - source = "" - ) - } - - private fun asDiagnosticItem( - diagnostic: Diagnostic, - lines: LineMap - ): DiagnosticItem { - abortIfCancelled() - val result = - DiagnosticItem( - range = getDiagnosticRange(diagnostic, lines), - severity = severityFor(diagnostic.kind), - code = diagnostic.code, - message = diagnostic.getMessage(Locale.getDefault()), - source = "" - ) - result.range.start.index = diagnostic.startPosition.toInt() - result.range.end.index = diagnostic.endPosition.toInt() - result.extra = diagnostic - return result - } - - private fun getDiagnosticRange( - diagnostic: Diagnostic, - lines: LineMap - ): Range { - abortIfCancelled() - val start = getPosition(diagnostic.startPosition, lines) - val end = getPosition(diagnostic.endPosition, lines) - return Range(start, end) - } - - private fun getPosition(position: Long, lines: LineMap): com.itsaky.androidide.models.Position { - abortIfCancelled() - // decrement the numbers - // to convert 1-based indexes to 0-based - val line = (lines.getLineNumber(position) - 1).toInt() - val column = (lines.getColumnNumber(position) - 1).toInt() - return com.itsaky.androidide.models.Position(line, column) - } - - private fun severityFor(kind: Diagnostic.Kind): DiagnosticSeverity { - return when (kind) { - Diagnostic.Kind.ERROR -> DiagnosticSeverity.ERROR - Diagnostic.Kind.WARNING, - Diagnostic.Kind.MANDATORY_WARNING -> WARNING - Diagnostic.Kind.NOTE -> DiagnosticSeverity.INFO - Diagnostic.Kind.OTHER -> DiagnosticSeverity.HINT - else -> DiagnosticSeverity.HINT - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.java.providers + +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.models.DiagnosticCode +import org.appdevforall.codeonthego.lsp.java.models.DiagnosticCode.EMPTY_BLOCK +import org.appdevforall.codeonthego.lsp.java.models.DiagnosticCode.UNUSED_THROWS +import org.appdevforall.codeonthego.lsp.java.visitors.DiagnosticVisitor +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem +import org.appdevforall.codeonthego.lsp.models.DiagnosticSeverity +import org.appdevforall.codeonthego.lsp.models.DiagnosticSeverity.WARNING +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.progress.ProgressManager.Companion.abortIfCancelled +import org.appdevforall.codeonthego.projects.FileManager +import org.appdevforall.codeonthego.utils.DocumentUtils.isSameFile +import jdkx.lang.model.element.Element +import jdkx.tools.Diagnostic +import jdkx.tools.JavaFileObject +import openjdk.source.tree.BlockTree +import openjdk.source.tree.ClassTree +import openjdk.source.tree.CompilationUnitTree +import openjdk.source.tree.LineMap +import openjdk.source.tree.MethodTree +import openjdk.source.tree.VariableTree +import openjdk.source.util.TreePath +import openjdk.source.util.Trees +import java.nio.file.Path +import java.nio.file.Paths +import java.util.Locale +import java.util.regex.Pattern + +/** + * Finds errors and warnings from a compilation task. + * + * @author Akash Yadav + */ +object DiagnosticsProvider { + /** + * Finds diagnostics from the given task (only the diagnostics for the given file). The task + * should be a valid task. + * + * As the file might be too long, the diagnostics list must be sorted so we can quickly binary + * search the list when needed. + * + * @param task The compilation task to get diagnostics from. + * @param file The file of which the diagnostics must be extracted. + * @return The list of diagnostics retrieved from the task. Never null. + */ + @JvmStatic + fun findDiagnostics(task: CompileTask, file: Path?): List { + val result = mutableListOf() + var root: CompilationUnitTree? = null + for (tree in task.roots) { + abortIfCancelled() + val path = Paths.get(tree.sourceFile.toUri()) + if (isSameFile(path, file!!)) { + root = tree + break + } + } + + abortIfCancelled() + + if (root == null) { + // CompilationUnitTree for the file was not found + // Can't do anything... + return result + } + + addCompilerErrors(task, root, result) + abortIfCancelled() + addDiagnosticsByVisiting(task, root, result) + abortIfCancelled() + return result + } + + private fun addDiagnosticsByVisiting( + task: CompileTask, + root: CompilationUnitTree, + result: MutableList + ) { + val notThrown = mutableMapOf() + val scanner = DiagnosticVisitor(task.task) + scanner.scan(root, notThrown) + for (unusedEl in scanner.notUsed()) { + warnUnused(task, unusedEl)?.also { result.add(it) } + } + + for (location in notThrown.keys) { + result.add(warnNotThrown(task, notThrown[location], location!!)) + } + + for (path in scanner.emptyBlocks.keys) { + result.add(warnEmptyBlock(task, path, scanner.emptyBlocks[path]!!)) + } + } + + private fun warnEmptyBlock(task: CompileTask, path: TreePath, name: String): DiagnosticItem { + val trees = Trees.instance(task.task) + val thisTree = path.leaf + val code = EMPTY_BLOCK + + val root = task.root() + val lines = task.root().lineMap + val positions = trees.sourcePositions + val start = positions.getStartPosition(root, thisTree) + val end = positions.getEndPosition(root, thisTree) + return DiagnosticItem( + source = "", + code = code.id, + message = "'$name' statement has empty body", + severity = WARNING, + range = + Range(getPosition(start, lines), getPosition(end, lines)).apply { + this.start.index = start.toInt() + this.end.index = end.toInt() + } + ) + } + + private fun addCompilerErrors( + task: CompileTask, + root: CompilationUnitTree, + result: MutableList + ) { + for (diagnostic in task.diagnostics) { + if (diagnostic.source == null || diagnostic.source!!.toUri() != root.sourceFile.toUri()) { + continue + } + if (diagnostic.startPosition == -1L || diagnostic.endPosition == -1L) { + continue + } + result.add(asDiagnosticItem(diagnostic, root.lineMap)) + } + } + + private fun warnNotThrown(task: CompileTask, name: String?, path: TreePath): DiagnosticItem { + val trees = Trees.instance(task.task) + val pos = trees.sourcePositions + val root = path.compilationUnit + val lines = root.lineMap + val start = pos.getStartPosition(root, path.leaf) + val end = pos.getEndPosition(root, path.leaf) + return DiagnosticItem( + message = String.format("'%s' is not thrown in the body of the method", name), + range = + Range(getPosition(start, lines), getPosition(end, lines)).apply { + this.start.index = start.toInt() + this.end.index = end.toInt() + }, + code = UNUSED_THROWS.id, + severity = DiagnosticSeverity.INFO, + source = "" + ) + } + + private fun warnUnused(task: CompileTask, unusedEl: Element): DiagnosticItem? { + val trees = Trees.instance(task.task) + val path = trees.getPath(unusedEl) ?: throw RuntimeException("$unusedEl has no path") + val root = path.compilationUnit + val leaf = path.leaf + val pos = trees.sourcePositions + var start = pos.getStartPosition(root, leaf).toInt() + var end = pos.getEndPosition(root, leaf).toInt() + + if (leaf is VariableTree) { + val offset = pos.getEndPosition(root, leaf.type).toInt() + if (offset != -1) { + start = offset + } + } + + val file = Paths.get(root.sourceFile.toUri()) + val contents = FileManager.getDocumentContents(file) + var name = unusedEl.simpleName + if (name.contentEquals("")) { + name = unusedEl.enclosingElement.simpleName + } + + val region = try { + contents.subSequence(start, end) + } catch (err: IndexOutOfBoundsException) { + // might happen if the file contents were changed after the file was compiled for analysis + return null + } + + val matcher = Pattern.compile("\\b$name\\b").matcher(region) + if (matcher.find()) { + start += matcher.start() + end = start + name.length + } + + val message = String.format("'%s' is not used", name) + val code: DiagnosticCode + val severity: DiagnosticSeverity + when (leaf) { + is VariableTree -> { + when (path.parentPath.leaf) { + is MethodTree -> { + code = DiagnosticCode.UNUSED_PARAM + severity = DiagnosticSeverity.HINT + } + is BlockTree -> { + code = DiagnosticCode.UNUSED_LOCAL + severity = DiagnosticSeverity.INFO + } + is ClassTree -> { + code = DiagnosticCode.UNUSED_FIELD + severity = DiagnosticSeverity.INFO + } + else -> { + code = DiagnosticCode.UNUSED_OTHER + severity = DiagnosticSeverity.HINT + } + } + } + is MethodTree -> { + code = DiagnosticCode.UNUSED_METHOD + severity = DiagnosticSeverity.INFO + } + is ClassTree -> { + code = DiagnosticCode.UNUSED_CLASS + severity = DiagnosticSeverity.INFO + } + else -> { + code = DiagnosticCode.UNUSED_OTHER + severity = DiagnosticSeverity.INFO + } + } + + return asDiagnosticItem(severity, code.id, message, start.toLong(), end.toLong(), root) + } + + private fun asDiagnosticItem( + severity: DiagnosticSeverity, + code: String, + message: String, + start: Long, + end: Long, + root: CompilationUnitTree + ): DiagnosticItem { + return DiagnosticItem( + message = message, + code = code, + severity = severity, + range = + Range(getPosition(start, root.lineMap), getPosition(end, root.lineMap)).apply { + this.start.index = start.toInt() + this.end.index = end.toInt() + }, + source = "" + ) + } + + private fun asDiagnosticItem( + diagnostic: Diagnostic, + lines: LineMap + ): DiagnosticItem { + abortIfCancelled() + val result = + DiagnosticItem( + range = getDiagnosticRange(diagnostic, lines), + severity = severityFor(diagnostic.kind), + code = diagnostic.code, + message = diagnostic.getMessage(Locale.getDefault()), + source = "" + ) + result.range.start.index = diagnostic.startPosition.toInt() + result.range.end.index = diagnostic.endPosition.toInt() + result.extra = diagnostic + return result + } + + private fun getDiagnosticRange( + diagnostic: Diagnostic, + lines: LineMap + ): Range { + abortIfCancelled() + val start = getPosition(diagnostic.startPosition, lines) + val end = getPosition(diagnostic.endPosition, lines) + return Range(start, end) + } + + private fun getPosition(position: Long, lines: LineMap): org.appdevforall.codeonthego.models.Position { + abortIfCancelled() + // decrement the numbers + // to convert 1-based indexes to 0-based + val line = (lines.getLineNumber(position) - 1).toInt() + val column = (lines.getColumnNumber(position) - 1).toInt() + return org.appdevforall.codeonthego.models.Position(line, column) + } + + private fun severityFor(kind: Diagnostic.Kind): DiagnosticSeverity { + return when (kind) { + Diagnostic.Kind.ERROR -> DiagnosticSeverity.ERROR + Diagnostic.Kind.WARNING, + Diagnostic.Kind.MANDATORY_WARNING -> WARNING + Diagnostic.Kind.NOTE -> DiagnosticSeverity.INFO + Diagnostic.Kind.OTHER -> DiagnosticSeverity.HINT + else -> DiagnosticSeverity.HINT + } + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/JavaDiagnosticProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/JavaDiagnosticProvider.kt similarity index 85% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/JavaDiagnosticProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/JavaDiagnosticProvider.kt index 78671f4d67..c7c5e5007b 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/JavaDiagnosticProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/JavaDiagnosticProvider.kt @@ -14,17 +14,17 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.providers - -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.java.providers.DiagnosticsProvider.findDiagnostics -import com.itsaky.androidide.lsp.java.utils.CancelChecker -import com.itsaky.androidide.lsp.models.DiagnosticResult -import com.itsaky.androidide.progress.ProgressManager -import com.itsaky.androidide.progress.ProgressManager.Companion.abortIfCancelled -import com.itsaky.androidide.projects.FileManager -import com.itsaky.androidide.projects.IProjectManager +package org.appdevforall.codeonthego.lsp.java.providers + +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.java.providers.DiagnosticsProvider.findDiagnostics +import org.appdevforall.codeonthego.lsp.java.utils.CancelChecker +import org.appdevforall.codeonthego.lsp.models.DiagnosticResult +import org.appdevforall.codeonthego.progress.ProgressManager +import org.appdevforall.codeonthego.progress.ProgressManager.Companion.abortIfCancelled +import org.appdevforall.codeonthego.projects.FileManager +import org.appdevforall.codeonthego.projects.IProjectManager import org.slf4j.LoggerFactory import java.nio.file.Path import java.time.Instant diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/JavaSelectionProvider.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/JavaSelectionProvider.java similarity index 85% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/JavaSelectionProvider.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/JavaSelectionProvider.java index aa80b2a453..4d038bd68a 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/JavaSelectionProvider.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/JavaSelectionProvider.java @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.providers; +package org.appdevforall.codeonthego.lsp.java.providers; import androidx.annotation.NonNull; -import com.itsaky.androidide.lsp.java.compiler.CompilerProvider; -import com.itsaky.androidide.lsp.java.visitors.FindBiggerRange; -import com.itsaky.androidide.lsp.models.ExpandSelectionParams; -import com.itsaky.androidide.models.Range; +import org.appdevforall.codeonthego.lsp.java.compiler.CompilerProvider; +import org.appdevforall.codeonthego.lsp.java.visitors.FindBiggerRange; +import org.appdevforall.codeonthego.lsp.models.ExpandSelectionParams; +import org.appdevforall.codeonthego.models.Range; import openjdk.source.tree.CompilationUnitTree; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/ReferenceProvider.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/ReferenceProvider.java similarity index 86% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/ReferenceProvider.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/ReferenceProvider.java index b799787b16..e1be0fd81f 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/ReferenceProvider.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/ReferenceProvider.java @@ -15,20 +15,20 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.providers; +package org.appdevforall.codeonthego.lsp.java.providers; import androidx.annotation.NonNull; -import com.itsaky.androidide.lsp.java.compiler.CompileTask; -import com.itsaky.androidide.lsp.java.compiler.CompilerProvider; -import com.itsaky.androidide.lsp.java.compiler.SynchronizedTask; -import com.itsaky.androidide.lsp.java.utils.CancelChecker; -import com.itsaky.androidide.lsp.java.utils.FindHelper; -import com.itsaky.androidide.lsp.java.utils.NavigationHelper; -import com.itsaky.androidide.lsp.java.visitors.FindReferences; -import com.itsaky.androidide.lsp.models.ReferenceParams; -import com.itsaky.androidide.lsp.models.ReferenceResult; -import com.itsaky.androidide.models.Location; -import com.itsaky.androidide.progress.ICancelChecker; +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask; +import org.appdevforall.codeonthego.lsp.java.compiler.CompilerProvider; +import org.appdevforall.codeonthego.lsp.java.compiler.SynchronizedTask; +import org.appdevforall.codeonthego.lsp.java.utils.CancelChecker; +import org.appdevforall.codeonthego.lsp.java.utils.FindHelper; +import org.appdevforall.codeonthego.lsp.java.utils.NavigationHelper; +import org.appdevforall.codeonthego.lsp.java.visitors.FindReferences; +import org.appdevforall.codeonthego.lsp.models.ReferenceParams; +import org.appdevforall.codeonthego.lsp.models.ReferenceResult; +import org.appdevforall.codeonthego.models.Location; +import org.appdevforall.codeonthego.progress.ICancelChecker; import java.nio.file.Path; import java.util.ArrayList; import java.util.Collections; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/SignatureProvider.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/SignatureProvider.java similarity index 93% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/SignatureProvider.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/SignatureProvider.java index de4b9a3afc..10b93c4367 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/SignatureProvider.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/SignatureProvider.java @@ -15,22 +15,22 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.providers; +package org.appdevforall.codeonthego.lsp.java.providers; import androidx.annotation.NonNull; -import com.itsaky.androidide.lsp.java.compiler.CompileTask; -import com.itsaky.androidide.lsp.java.compiler.CompilerProvider; -import com.itsaky.androidide.lsp.java.compiler.SynchronizedTask; -import com.itsaky.androidide.lsp.java.utils.FindHelper; -import com.itsaky.androidide.lsp.java.utils.MarkdownHelper; -import com.itsaky.androidide.lsp.java.utils.ScopeHelper; -import com.itsaky.androidide.lsp.java.utils.ShortTypePrinter; -import com.itsaky.androidide.lsp.java.visitors.FindInvocationAt; -import com.itsaky.androidide.lsp.models.ParameterInformation; -import com.itsaky.androidide.lsp.models.SignatureHelp; -import com.itsaky.androidide.lsp.models.SignatureHelpParams; -import com.itsaky.androidide.lsp.models.SignatureInformation; -import com.itsaky.androidide.progress.ICancelChecker; +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask; +import org.appdevforall.codeonthego.lsp.java.compiler.CompilerProvider; +import org.appdevforall.codeonthego.lsp.java.compiler.SynchronizedTask; +import org.appdevforall.codeonthego.lsp.java.utils.FindHelper; +import org.appdevforall.codeonthego.lsp.java.utils.MarkdownHelper; +import org.appdevforall.codeonthego.lsp.java.utils.ScopeHelper; +import org.appdevforall.codeonthego.lsp.java.utils.ShortTypePrinter; +import org.appdevforall.codeonthego.lsp.java.visitors.FindInvocationAt; +import org.appdevforall.codeonthego.lsp.models.ParameterInformation; +import org.appdevforall.codeonthego.lsp.models.SignatureHelp; +import org.appdevforall.codeonthego.lsp.models.SignatureHelpParams; +import org.appdevforall.codeonthego.lsp.models.SignatureInformation; +import org.appdevforall.codeonthego.progress.ICancelChecker; import java.nio.file.Path; import java.util.ArrayList; import java.util.Collections; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/ClassNamesCompletionProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/ClassNamesCompletionProvider.kt similarity index 82% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/ClassNamesCompletionProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/ClassNamesCompletionProvider.kt index 0b2f57916e..bc3b27c517 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/ClassNamesCompletionProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/ClassNamesCompletionProvider.kt @@ -1,111 +1,111 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.providers.completion - -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.java.providers.CompletionProvider -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.MatchLevel.NO_MATCH -import openjdk.source.tree.ClassTree -import openjdk.source.tree.CompilationUnitTree -import openjdk.source.util.TreePath -import java.nio.file.Path -import java.nio.file.Paths -import java.util.Objects - -/** - * Completes class names. - * - * @author Akash Yadav - */ -class ClassNamesCompletionProvider( - completingFile: Path, - cursor: Long, - compiler: JavaCompilerService, - settings: IServerSettings, - val root: CompilationUnitTree, -) : IJavaCompletionProvider(cursor, completingFile, compiler, settings) { - - override fun doComplete( - task: CompileTask, - path: TreePath, - partial: String, - endsWithParen: Boolean, - ): CompletionResult { - val list = mutableListOf() - val packageName = Objects.toString(root.packageName, "") - val uniques: MutableSet = HashSet() - - val file: Path = Paths.get(root.sourceFile.toUri()) - val imports: Set = - root.imports.map { it.qualifiedIdentifier }.mapNotNull { it.toString() }.toSet() - - abortCompletionIfCancelled() - for (className in compiler.packagePrivateTopLevelTypes(packageName)) { - val matchLevel = matchLevel(className, partial) - if (matchLevel == NO_MATCH) { - continue - } - - list.add(classItem(imports, file, className, matchLevel)) - uniques.add(className) - } - - abortCompletionIfCancelled() - - val topLevelTypes = compiler.publicTopLevelTypes() - for (className in topLevelTypes) { - val matchLevel = matchLevel(simpleName(className), partial) - if (matchLevel == NO_MATCH) { - continue - } - - if (uniques.contains(className)) { - continue - } - - list.add(classItem(imports, file, className, matchLevel)) - uniques.add(className) - } - abortCompletionIfCancelled() - for (t in root.typeDecls) { - if (t !is ClassTree) { - continue - } - val candidate = if (t.simpleName == null) "" else t.simpleName - - val matchLevel = matchLevel(candidate, partial) - if (matchLevel == NO_MATCH) { - continue - } - - val name = packageName + "." + t.simpleName - list.add(classItem(name, matchLevel)) - - if (list.size > CompletionProvider.MAX_COMPLETION_ITEMS) { - break - } - } - - log.info("...found {} class names", list.size) - - return CompletionResult(list) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.providers.completion + +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.java.providers.CompletionProvider +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.MatchLevel.NO_MATCH +import openjdk.source.tree.ClassTree +import openjdk.source.tree.CompilationUnitTree +import openjdk.source.util.TreePath +import java.nio.file.Path +import java.nio.file.Paths +import java.util.Objects + +/** + * Completes class names. + * + * @author Akash Yadav + */ +class ClassNamesCompletionProvider( + completingFile: Path, + cursor: Long, + compiler: JavaCompilerService, + settings: IServerSettings, + val root: CompilationUnitTree, +) : IJavaCompletionProvider(cursor, completingFile, compiler, settings) { + + override fun doComplete( + task: CompileTask, + path: TreePath, + partial: String, + endsWithParen: Boolean, + ): CompletionResult { + val list = mutableListOf() + val packageName = Objects.toString(root.packageName, "") + val uniques: MutableSet = HashSet() + + val file: Path = Paths.get(root.sourceFile.toUri()) + val imports: Set = + root.imports.map { it.qualifiedIdentifier }.mapNotNull { it.toString() }.toSet() + + abortCompletionIfCancelled() + for (className in compiler.packagePrivateTopLevelTypes(packageName)) { + val matchLevel = matchLevel(className, partial) + if (matchLevel == NO_MATCH) { + continue + } + + list.add(classItem(imports, file, className, matchLevel)) + uniques.add(className) + } + + abortCompletionIfCancelled() + + val topLevelTypes = compiler.publicTopLevelTypes() + for (className in topLevelTypes) { + val matchLevel = matchLevel(simpleName(className), partial) + if (matchLevel == NO_MATCH) { + continue + } + + if (uniques.contains(className)) { + continue + } + + list.add(classItem(imports, file, className, matchLevel)) + uniques.add(className) + } + abortCompletionIfCancelled() + for (t in root.typeDecls) { + if (t !is ClassTree) { + continue + } + val candidate = if (t.simpleName == null) "" else t.simpleName + + val matchLevel = matchLevel(candidate, partial) + if (matchLevel == NO_MATCH) { + continue + } + + val name = packageName + "." + t.simpleName + list.add(classItem(name, matchLevel)) + + if (list.size > CompletionProvider.MAX_COMPLETION_ITEMS) { + break + } + } + + log.info("...found {} class names", list.size) + + return CompletionResult(list) + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/IJavaCompletionProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/IJavaCompletionProvider.kt similarity index 85% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/IJavaCompletionProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/IJavaCompletionProvider.kt index bf43a77cec..66f6da7970 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/IJavaCompletionProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/IJavaCompletionProvider.kt @@ -1,403 +1,403 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.providers.completion - -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.api.describeSnippet -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.java.edits.ClassImportEditHandler -import com.itsaky.androidide.lsp.java.models.JavaCompletionItem -import com.itsaky.androidide.lsp.java.providers.BaseJavaServiceProvider -import com.itsaky.androidide.lsp.java.utils.EditHelper -import com.itsaky.androidide.lsp.models.ClassCompletionData -import com.itsaky.androidide.lsp.models.Command -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionItemKind -import com.itsaky.androidide.lsp.models.CompletionItemKind.ENUM_MEMBER -import com.itsaky.androidide.lsp.models.CompletionItemKind.FUNCTION -import com.itsaky.androidide.lsp.models.CompletionItemKind.KEYWORD -import com.itsaky.androidide.lsp.models.CompletionItemKind.MODULE -import com.itsaky.androidide.lsp.models.CompletionItemKind.NONE -import com.itsaky.androidide.lsp.models.CompletionItemKind.PROPERTY -import com.itsaky.androidide.lsp.models.CompletionItemKind.VARIABLE -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.FieldCompletionData -import com.itsaky.androidide.lsp.models.ICompletionData -import com.itsaky.androidide.lsp.models.InsertTextFormat.SNIPPET -import com.itsaky.androidide.lsp.models.MatchLevel -import com.itsaky.androidide.lsp.models.MethodCompletionData -import com.itsaky.androidide.lsp.snippets.ISnippet -import com.itsaky.androidide.preferences.utils.indentationString -import jdkx.lang.model.element.Element -import jdkx.lang.model.element.ElementKind.ANNOTATION_TYPE -import jdkx.lang.model.element.ElementKind.CLASS -import jdkx.lang.model.element.ElementKind.CONSTRUCTOR -import jdkx.lang.model.element.ElementKind.ENUM -import jdkx.lang.model.element.ElementKind.ENUM_CONSTANT -import jdkx.lang.model.element.ElementKind.EXCEPTION_PARAMETER -import jdkx.lang.model.element.ElementKind.FIELD -import jdkx.lang.model.element.ElementKind.INSTANCE_INIT -import jdkx.lang.model.element.ElementKind.INTERFACE -import jdkx.lang.model.element.ElementKind.LOCAL_VARIABLE -import jdkx.lang.model.element.ElementKind.METHOD -import jdkx.lang.model.element.ElementKind.OTHER -import jdkx.lang.model.element.ElementKind.PACKAGE -import jdkx.lang.model.element.ElementKind.PARAMETER -import jdkx.lang.model.element.ElementKind.RESOURCE_VARIABLE -import jdkx.lang.model.element.ElementKind.STATIC_INIT -import jdkx.lang.model.element.ElementKind.TYPE_PARAMETER -import jdkx.lang.model.element.ExecutableElement -import jdkx.lang.model.element.TypeElement -import jdkx.lang.model.element.VariableElement -import openjdk.source.tree.Tree -import openjdk.source.util.TreePath -import org.slf4j.Logger -import org.slf4j.LoggerFactory -import java.nio.file.Path - -/** - * Completion provider for Java source code. - * - * @author Akash Yadav - */ -abstract class IJavaCompletionProvider( - protected val cursor: Long, - completingFile: Path, - compiler: JavaCompilerService, - settings: IServerSettings, -) : BaseJavaServiceProvider(completingFile, compiler, settings) { - protected lateinit var filePackage: String - protected lateinit var fileImports: Set - - companion object { - @JvmStatic - protected val log: Logger = LoggerFactory.getLogger(IJavaCompletionProvider::class.java) - } - - open fun complete( - task: CompileTask, - path: TreePath, - partial: String, - endsWithParen: Boolean, - ): CompletionResult { - val root = task.root(file) - filePackage = root.`package`?.packageName?.toString() ?: "" - fileImports = root.imports.map { it.qualifiedIdentifier.toString() }.toSet() - abortCompletionIfCancelled() - return doComplete(task, path, partial, endsWithParen) - } - - /** - * Provide completions with the given data. - * - * @param task The compilation task. Subclasses are expected to use this compile task instead of - * starting another compilation process. - * @param path The [TreePath] defining the [Tree] at the current position. - * @param partial The partial identifier. - * @param endsWithParen `true` if the statement at cursor ends with a parenthesis. `false` - * otherwise. - */ - protected abstract fun doComplete( - task: CompileTask, - path: TreePath, - partial: String, - endsWithParen: Boolean, - ): CompletionResult - - protected open fun matchLevel(candidate: CharSequence, partial: CharSequence): MatchLevel { - abortCompletionIfCancelled() - return CompletionItem.matchLevel(candidate.toString(), partial.toString()) - } - - protected open fun putMethod( - method: ExecutableElement, - methods: MutableMap>, - ) { - abortCompletionIfCancelled() - val name = method.simpleName.toString() - if (!methods.containsKey(name)) { - methods[name] = ArrayList() - } - methods[name]!!.add(method) - } - - protected open fun keyword( - keyword: String, - partial: CharSequence, - matchRatio: Int, - ): CompletionItem = - keyword(keyword, partial, CompletionItem.matchLevel(keyword, partial.toString())) - - protected open fun keyword( - keyword: String, - partialName: CharSequence, - matchLevel: MatchLevel, - ): CompletionItem { - abortCompletionIfCancelled() - val item = JavaCompletionItem() - item.ideLabel = keyword - item.completionKind = KEYWORD - item.detail = "keyword" - item.ideSortText = keyword - item.matchLevel = matchLevel - return item - } - - protected open fun method( - task: CompileTask, - overloads: List, - addParens: Boolean, - matchLevel: MatchLevel, - partial: String - ): CompletionItem { - abortCompletionIfCancelled() - val first = overloads[0] - val item = JavaCompletionItem() - item.ideLabel = first.simpleName.toString() - item.completionKind = CompletionItemKind.METHOD - item.detail = printMethodDetail(first) - item.ideSortText = item.ideLabel - item.matchLevel = matchLevel - item.overrideTypeText = EditHelper.printType(first.returnType) - val data = data(task, first, overloads.size) - item.data = data - - abortCompletionIfCancelled() - if (addParens) { - if (overloads.size == 1 && first.parameters.isEmpty()) { - item.insertText = first.simpleName.toString() + "()$0" - } else { - item.insertText = first.simpleName.toString() + "($0)" - item.command = Command("Trigger Parameter Hints", Command.TRIGGER_PARAMETER_HINTS) - } - item.insertTextFormat = SNIPPET // DefaultSnippet - item.snippetDescription = describeSnippet(prefix = partial, allowCommandExecution = true) - } - return item - } - - protected open fun printMethodDetail(first: ExecutableElement): String { - val sb = StringBuilder() - sb.append(first.simpleName) - sb.append("(") - if (first.parameters.isNotEmpty()) { - for (index in first.parameters.indices) { - val parameter = first.parameters[index] - sb.append(EditHelper.printType(parameter.asType())) - if (index != first.parameters.lastIndex) { - sb.append(", ") - } - } - } - sb.append(")") - return sb.toString() - } - - protected open fun item( - task: CompileTask, - element: Element, - matchLevel: MatchLevel, - ): CompletionItem { - if (element.kind == METHOD) throw RuntimeException("method") - - abortCompletionIfCancelled() - val item = JavaCompletionItem() - item.ideLabel = element.simpleName.toString() - item.completionKind = kind(element) - item.detail = element.toString() - item.data = data(task, element, 1) - item.ideSortText = item.ideLabel - item.matchLevel = matchLevel - - if (element is VariableElement) { - if (element.constantValue != null) { - item.detail = "Constant: ${element.constantValue}" - } - item.overrideTypeText = EditHelper.printType(element.asType()) - } - - return item - } - - protected open fun classItem(className: String, matchLevel: MatchLevel): CompletionItem { - return classItem(emptySet(), null, className, matchLevel) - } - - protected open fun classItem( - imports: Set, - file: Path?, - className: String, - matchLevel: MatchLevel, - ): CompletionItem { - abortCompletionIfCancelled() - val item = JavaCompletionItem() - item.ideLabel = simpleName(className).toString() - item.completionKind = CompletionItemKind.CLASS - item.detail = packageName(className).toString() - item.ideSortText = item.ideLabel - item.matchLevel = matchLevel - item.data = ClassCompletionData(className) - - // If file is not provided, we are probably completing an import path - item.additionalEditHandler = if (file == null) null else ClassImportEditHandler(imports, file) - return item - } - - protected open fun simpleName(name: String): CharSequence { - return if (name.contains(".")) { - name.subSequence(name.lastIndexOf('.') + 1, name.length) - } else name - } - - private fun packageName(name: CharSequence): CharSequence { - return if (name.contains(".")) { - name.subSequence(0, name.lastIndexOf('.')) - } else name - } - - protected open fun packageItem(name: String, matchLevel: MatchLevel): CompletionItem { - abortCompletionIfCancelled() - val simpleName = simpleName(name).toString() - var packageName = packageName(name).toString() - if (packageName == name) { - packageName = " " - } - return JavaCompletionItem().apply { - this.ideLabel = simpleName - this.detail = packageName - this.insertText = simpleName - this.completionKind = MODULE - this.ideSortText = name - this.matchLevel = matchLevel - } - } - - protected open fun snippetItem( - snippet: ISnippet, - matchLevel: MatchLevel, - partial: String, - indent: Int - ): CompletionItem { - return JavaCompletionItem().apply { - this.ideLabel = snippet.prefix - this.detail = snippet.description - this.completionKind = CompletionItemKind.SNIPPET - this.matchLevel = matchLevel - this.ideSortText = "00000${snippet.prefix}" - this.snippetDescription = describeSnippet(partial) - - val indentation = indentationString(indent) - this.insertTextFormat = SNIPPET - this.insertText = - snippet.body.joinToString(separator = "\n").also { - it.replace("\t", indentationString).replace("\n", "\n${indentation}") - } - } - } - - protected open fun kind(e: Element): CompletionItemKind { - abortCompletionIfCancelled() - return when (e.kind) { - ANNOTATION_TYPE -> CompletionItemKind.ANNOTATION_TYPE - CLASS -> CompletionItemKind.CLASS - CONSTRUCTOR -> CompletionItemKind.CONSTRUCTOR - ENUM -> CompletionItemKind.ENUM - ENUM_CONSTANT -> ENUM_MEMBER - EXCEPTION_PARAMETER, - PARAMETER, -> PROPERTY - FIELD -> CompletionItemKind.FIELD - STATIC_INIT, - INSTANCE_INIT, -> FUNCTION - INTERFACE -> CompletionItemKind.INTERFACE - LOCAL_VARIABLE, - RESOURCE_VARIABLE, -> VARIABLE - METHOD -> CompletionItemKind.METHOD - PACKAGE -> MODULE - TYPE_PARAMETER -> CompletionItemKind.TYPE_PARAMETER - OTHER -> NONE - else -> NONE - } - } - - protected open fun data(task: CompileTask, element: Element, overloads: Int): ICompletionData? { - abortCompletionIfCancelled() - return when { - element is TypeElement -> getClassCompletionData(element) - element.kind == FIELD -> getFieldCompletionData(element) - element is ExecutableElement -> getMethodCompletionData(task, element, overloads) - else -> return null - } - } - - protected open fun getMethodCompletionData( - task: CompileTask, - element: ExecutableElement, - overloads: Int - ): MethodCompletionData { - val types = task.task.types - val type = element.enclosingElement as TypeElement - val parameterTypes = Array(element.parameters.size) { "" } - val erasedParameterTypes = Array(parameterTypes.size) { "" } - val plusOverloads = overloads - 1 - - for (i in element.parameters.indices) { - val p = element.parameters[i].asType() - parameterTypes[i] = p.toString() - erasedParameterTypes[i] = types.erasure(p).toString() - } - - return MethodCompletionData( - element.simpleName.toString(), - getClassCompletionData(type), - parameterTypes.toList(), - erasedParameterTypes.toList(), - plusOverloads - ) - } - - protected open fun getFieldCompletionData(element: Element): FieldCompletionData { - val field = element as VariableElement - val type = field.enclosingElement as TypeElement - return FieldCompletionData(field.simpleName.toString(), getClassCompletionData(type)) - } - - protected open fun getClassCompletionData(element: TypeElement) = - ClassCompletionData( - element.qualifiedName.toString(), - element.enclosingElement.kind != PACKAGE, - element.findTopLevelElement().qualifiedName.toString() - ) - - protected open fun TypeElement.findTopLevelElement(): TypeElement { - if (enclosingElement.kind == PACKAGE) { - return this - } - - var element: TypeElement? = this - while (true) { - if (element == null || element.enclosingElement?.kind == PACKAGE) { - break - } - - element = element.enclosingElement as? TypeElement - } - - return element!! - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.providers.completion + +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.api.describeSnippet +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.java.edits.ClassImportEditHandler +import org.appdevforall.codeonthego.lsp.java.models.JavaCompletionItem +import org.appdevforall.codeonthego.lsp.java.providers.BaseJavaServiceProvider +import org.appdevforall.codeonthego.lsp.java.utils.EditHelper +import org.appdevforall.codeonthego.lsp.models.ClassCompletionData +import org.appdevforall.codeonthego.lsp.models.Command +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind.ENUM_MEMBER +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind.FUNCTION +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind.KEYWORD +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind.MODULE +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind.NONE +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind.PROPERTY +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind.VARIABLE +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.FieldCompletionData +import org.appdevforall.codeonthego.lsp.models.ICompletionData +import org.appdevforall.codeonthego.lsp.models.InsertTextFormat.SNIPPET +import org.appdevforall.codeonthego.lsp.models.MatchLevel +import org.appdevforall.codeonthego.lsp.models.MethodCompletionData +import org.appdevforall.codeonthego.lsp.snippets.ISnippet +import org.appdevforall.codeonthego.preferences.utils.indentationString +import jdkx.lang.model.element.Element +import jdkx.lang.model.element.ElementKind.ANNOTATION_TYPE +import jdkx.lang.model.element.ElementKind.CLASS +import jdkx.lang.model.element.ElementKind.CONSTRUCTOR +import jdkx.lang.model.element.ElementKind.ENUM +import jdkx.lang.model.element.ElementKind.ENUM_CONSTANT +import jdkx.lang.model.element.ElementKind.EXCEPTION_PARAMETER +import jdkx.lang.model.element.ElementKind.FIELD +import jdkx.lang.model.element.ElementKind.INSTANCE_INIT +import jdkx.lang.model.element.ElementKind.INTERFACE +import jdkx.lang.model.element.ElementKind.LOCAL_VARIABLE +import jdkx.lang.model.element.ElementKind.METHOD +import jdkx.lang.model.element.ElementKind.OTHER +import jdkx.lang.model.element.ElementKind.PACKAGE +import jdkx.lang.model.element.ElementKind.PARAMETER +import jdkx.lang.model.element.ElementKind.RESOURCE_VARIABLE +import jdkx.lang.model.element.ElementKind.STATIC_INIT +import jdkx.lang.model.element.ElementKind.TYPE_PARAMETER +import jdkx.lang.model.element.ExecutableElement +import jdkx.lang.model.element.TypeElement +import jdkx.lang.model.element.VariableElement +import openjdk.source.tree.Tree +import openjdk.source.util.TreePath +import org.slf4j.Logger +import org.slf4j.LoggerFactory +import java.nio.file.Path + +/** + * Completion provider for Java source code. + * + * @author Akash Yadav + */ +abstract class IJavaCompletionProvider( + protected val cursor: Long, + completingFile: Path, + compiler: JavaCompilerService, + settings: IServerSettings, +) : BaseJavaServiceProvider(completingFile, compiler, settings) { + protected lateinit var filePackage: String + protected lateinit var fileImports: Set + + companion object { + @JvmStatic + protected val log: Logger = LoggerFactory.getLogger(IJavaCompletionProvider::class.java) + } + + open fun complete( + task: CompileTask, + path: TreePath, + partial: String, + endsWithParen: Boolean, + ): CompletionResult { + val root = task.root(file) + filePackage = root.`package`?.packageName?.toString() ?: "" + fileImports = root.imports.map { it.qualifiedIdentifier.toString() }.toSet() + abortCompletionIfCancelled() + return doComplete(task, path, partial, endsWithParen) + } + + /** + * Provide completions with the given data. + * + * @param task The compilation task. Subclasses are expected to use this compile task instead of + * starting another compilation process. + * @param path The [TreePath] defining the [Tree] at the current position. + * @param partial The partial identifier. + * @param endsWithParen `true` if the statement at cursor ends with a parenthesis. `false` + * otherwise. + */ + protected abstract fun doComplete( + task: CompileTask, + path: TreePath, + partial: String, + endsWithParen: Boolean, + ): CompletionResult + + protected open fun matchLevel(candidate: CharSequence, partial: CharSequence): MatchLevel { + abortCompletionIfCancelled() + return CompletionItem.matchLevel(candidate.toString(), partial.toString()) + } + + protected open fun putMethod( + method: ExecutableElement, + methods: MutableMap>, + ) { + abortCompletionIfCancelled() + val name = method.simpleName.toString() + if (!methods.containsKey(name)) { + methods[name] = ArrayList() + } + methods[name]!!.add(method) + } + + protected open fun keyword( + keyword: String, + partial: CharSequence, + matchRatio: Int, + ): CompletionItem = + keyword(keyword, partial, CompletionItem.matchLevel(keyword, partial.toString())) + + protected open fun keyword( + keyword: String, + partialName: CharSequence, + matchLevel: MatchLevel, + ): CompletionItem { + abortCompletionIfCancelled() + val item = JavaCompletionItem() + item.ideLabel = keyword + item.completionKind = KEYWORD + item.detail = "keyword" + item.ideSortText = keyword + item.matchLevel = matchLevel + return item + } + + protected open fun method( + task: CompileTask, + overloads: List, + addParens: Boolean, + matchLevel: MatchLevel, + partial: String + ): CompletionItem { + abortCompletionIfCancelled() + val first = overloads[0] + val item = JavaCompletionItem() + item.ideLabel = first.simpleName.toString() + item.completionKind = CompletionItemKind.METHOD + item.detail = printMethodDetail(first) + item.ideSortText = item.ideLabel + item.matchLevel = matchLevel + item.overrideTypeText = EditHelper.printType(first.returnType) + val data = data(task, first, overloads.size) + item.data = data + + abortCompletionIfCancelled() + if (addParens) { + if (overloads.size == 1 && first.parameters.isEmpty()) { + item.insertText = first.simpleName.toString() + "()$0" + } else { + item.insertText = first.simpleName.toString() + "($0)" + item.command = Command("Trigger Parameter Hints", Command.TRIGGER_PARAMETER_HINTS) + } + item.insertTextFormat = SNIPPET // DefaultSnippet + item.snippetDescription = describeSnippet(prefix = partial, allowCommandExecution = true) + } + return item + } + + protected open fun printMethodDetail(first: ExecutableElement): String { + val sb = StringBuilder() + sb.append(first.simpleName) + sb.append("(") + if (first.parameters.isNotEmpty()) { + for (index in first.parameters.indices) { + val parameter = first.parameters[index] + sb.append(EditHelper.printType(parameter.asType())) + if (index != first.parameters.lastIndex) { + sb.append(", ") + } + } + } + sb.append(")") + return sb.toString() + } + + protected open fun item( + task: CompileTask, + element: Element, + matchLevel: MatchLevel, + ): CompletionItem { + if (element.kind == METHOD) throw RuntimeException("method") + + abortCompletionIfCancelled() + val item = JavaCompletionItem() + item.ideLabel = element.simpleName.toString() + item.completionKind = kind(element) + item.detail = element.toString() + item.data = data(task, element, 1) + item.ideSortText = item.ideLabel + item.matchLevel = matchLevel + + if (element is VariableElement) { + if (element.constantValue != null) { + item.detail = "Constant: ${element.constantValue}" + } + item.overrideTypeText = EditHelper.printType(element.asType()) + } + + return item + } + + protected open fun classItem(className: String, matchLevel: MatchLevel): CompletionItem { + return classItem(emptySet(), null, className, matchLevel) + } + + protected open fun classItem( + imports: Set, + file: Path?, + className: String, + matchLevel: MatchLevel, + ): CompletionItem { + abortCompletionIfCancelled() + val item = JavaCompletionItem() + item.ideLabel = simpleName(className).toString() + item.completionKind = CompletionItemKind.CLASS + item.detail = packageName(className).toString() + item.ideSortText = item.ideLabel + item.matchLevel = matchLevel + item.data = ClassCompletionData(className) + + // If file is not provided, we are probably completing an import path + item.additionalEditHandler = if (file == null) null else ClassImportEditHandler(imports, file) + return item + } + + protected open fun simpleName(name: String): CharSequence { + return if (name.contains(".")) { + name.subSequence(name.lastIndexOf('.') + 1, name.length) + } else name + } + + private fun packageName(name: CharSequence): CharSequence { + return if (name.contains(".")) { + name.subSequence(0, name.lastIndexOf('.')) + } else name + } + + protected open fun packageItem(name: String, matchLevel: MatchLevel): CompletionItem { + abortCompletionIfCancelled() + val simpleName = simpleName(name).toString() + var packageName = packageName(name).toString() + if (packageName == name) { + packageName = " " + } + return JavaCompletionItem().apply { + this.ideLabel = simpleName + this.detail = packageName + this.insertText = simpleName + this.completionKind = MODULE + this.ideSortText = name + this.matchLevel = matchLevel + } + } + + protected open fun snippetItem( + snippet: ISnippet, + matchLevel: MatchLevel, + partial: String, + indent: Int + ): CompletionItem { + return JavaCompletionItem().apply { + this.ideLabel = snippet.prefix + this.detail = snippet.description + this.completionKind = CompletionItemKind.SNIPPET + this.matchLevel = matchLevel + this.ideSortText = "00000${snippet.prefix}" + this.snippetDescription = describeSnippet(partial) + + val indentation = indentationString(indent) + this.insertTextFormat = SNIPPET + this.insertText = + snippet.body.joinToString(separator = "\n").also { + it.replace("\t", indentationString).replace("\n", "\n${indentation}") + } + } + } + + protected open fun kind(e: Element): CompletionItemKind { + abortCompletionIfCancelled() + return when (e.kind) { + ANNOTATION_TYPE -> CompletionItemKind.ANNOTATION_TYPE + CLASS -> CompletionItemKind.CLASS + CONSTRUCTOR -> CompletionItemKind.CONSTRUCTOR + ENUM -> CompletionItemKind.ENUM + ENUM_CONSTANT -> ENUM_MEMBER + EXCEPTION_PARAMETER, + PARAMETER, -> PROPERTY + FIELD -> CompletionItemKind.FIELD + STATIC_INIT, + INSTANCE_INIT, -> FUNCTION + INTERFACE -> CompletionItemKind.INTERFACE + LOCAL_VARIABLE, + RESOURCE_VARIABLE, -> VARIABLE + METHOD -> CompletionItemKind.METHOD + PACKAGE -> MODULE + TYPE_PARAMETER -> CompletionItemKind.TYPE_PARAMETER + OTHER -> NONE + else -> NONE + } + } + + protected open fun data(task: CompileTask, element: Element, overloads: Int): ICompletionData? { + abortCompletionIfCancelled() + return when { + element is TypeElement -> getClassCompletionData(element) + element.kind == FIELD -> getFieldCompletionData(element) + element is ExecutableElement -> getMethodCompletionData(task, element, overloads) + else -> return null + } + } + + protected open fun getMethodCompletionData( + task: CompileTask, + element: ExecutableElement, + overloads: Int + ): MethodCompletionData { + val types = task.task.types + val type = element.enclosingElement as TypeElement + val parameterTypes = Array(element.parameters.size) { "" } + val erasedParameterTypes = Array(parameterTypes.size) { "" } + val plusOverloads = overloads - 1 + + for (i in element.parameters.indices) { + val p = element.parameters[i].asType() + parameterTypes[i] = p.toString() + erasedParameterTypes[i] = types.erasure(p).toString() + } + + return MethodCompletionData( + element.simpleName.toString(), + getClassCompletionData(type), + parameterTypes.toList(), + erasedParameterTypes.toList(), + plusOverloads + ) + } + + protected open fun getFieldCompletionData(element: Element): FieldCompletionData { + val field = element as VariableElement + val type = field.enclosingElement as TypeElement + return FieldCompletionData(field.simpleName.toString(), getClassCompletionData(type)) + } + + protected open fun getClassCompletionData(element: TypeElement) = + ClassCompletionData( + element.qualifiedName.toString(), + element.enclosingElement.kind != PACKAGE, + element.findTopLevelElement().qualifiedName.toString() + ) + + protected open fun TypeElement.findTopLevelElement(): TypeElement { + if (enclosingElement.kind == PACKAGE) { + return this + } + + var element: TypeElement? = this + while (true) { + if (element == null || element.enclosingElement?.kind == PACKAGE) { + break + } + + element = element.enclosingElement as? TypeElement + } + + return element!! + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/IdentifierCompletionProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/IdentifierCompletionProvider.kt similarity index 85% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/IdentifierCompletionProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/IdentifierCompletionProvider.kt index 3986cea4f4..d5d9989791 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/IdentifierCompletionProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/IdentifierCompletionProvider.kt @@ -1,81 +1,81 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.providers.completion - -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionResult -import openjdk.source.util.TreePath -import java.nio.file.Path - -/** @author Akash Yadav */ -class IdentifierCompletionProvider( - completingFile: Path, - cursor: Long, - compiler: JavaCompilerService, - settings: IServerSettings -) : IJavaCompletionProvider(cursor, completingFile, compiler, settings) { - - override fun doComplete( - task: CompileTask, - path: TreePath, - partial: String, - endsWithParen: Boolean, - ): CompletionResult { - val list = mutableListOf() - - abortCompletionIfCancelled() - - val snippets = - SnippetCompletionProvider(cursor, file, compiler, settings) - .complete(task, path, partial, endsWithParen) - list.addAll(snippets.items) - - val scopeMembers = - ScopeCompletionProvider(file, cursor, compiler, settings) - .complete(task, path, partial, endsWithParen) - list.addAll(scopeMembers.items) - - abortCompletionIfCancelled() - val staticImports = - StaticImportCompletionProvider(file, cursor, compiler, settings, path.compilationUnit) - .complete(task, path, partial, endsWithParen) - list.addAll(staticImports.items) - - if (CompletionResult.TRIM_TO_MAX && list.size < CompletionResult.MAX_ITEMS) { - val allLower: Boolean = settings.shouldMatchAllLowerCase() - if (allLower || partial.isNotEmpty() && Character.isUpperCase(partial[0])) { - abortCompletionIfCancelled() - val classNames = - ClassNamesCompletionProvider(file, cursor, compiler, settings, path.compilationUnit) - .complete(task, path, partial, endsWithParen) - list.addAll(classNames.items) - } - } - - abortCompletionIfCancelled() - val keywords = - KeywordCompletionProvider(file, cursor, compiler, settings) - .complete(task, path, partial, endsWithParen) - list.addAll(keywords.items) - - return CompletionResult(list) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.providers.completion + +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import openjdk.source.util.TreePath +import java.nio.file.Path + +/** @author Akash Yadav */ +class IdentifierCompletionProvider( + completingFile: Path, + cursor: Long, + compiler: JavaCompilerService, + settings: IServerSettings +) : IJavaCompletionProvider(cursor, completingFile, compiler, settings) { + + override fun doComplete( + task: CompileTask, + path: TreePath, + partial: String, + endsWithParen: Boolean, + ): CompletionResult { + val list = mutableListOf() + + abortCompletionIfCancelled() + + val snippets = + SnippetCompletionProvider(cursor, file, compiler, settings) + .complete(task, path, partial, endsWithParen) + list.addAll(snippets.items) + + val scopeMembers = + ScopeCompletionProvider(file, cursor, compiler, settings) + .complete(task, path, partial, endsWithParen) + list.addAll(scopeMembers.items) + + abortCompletionIfCancelled() + val staticImports = + StaticImportCompletionProvider(file, cursor, compiler, settings, path.compilationUnit) + .complete(task, path, partial, endsWithParen) + list.addAll(staticImports.items) + + if (CompletionResult.TRIM_TO_MAX && list.size < CompletionResult.MAX_ITEMS) { + val allLower: Boolean = settings.shouldMatchAllLowerCase() + if (allLower || partial.isNotEmpty() && Character.isUpperCase(partial[0])) { + abortCompletionIfCancelled() + val classNames = + ClassNamesCompletionProvider(file, cursor, compiler, settings, path.compilationUnit) + .complete(task, path, partial, endsWithParen) + list.addAll(classNames.items) + } + } + + abortCompletionIfCancelled() + val keywords = + KeywordCompletionProvider(file, cursor, compiler, settings) + .complete(task, path, partial, endsWithParen) + list.addAll(keywords.items) + + return CompletionResult(list) + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/ImportCompletionProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/ImportCompletionProvider.kt similarity index 90% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/ImportCompletionProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/ImportCompletionProvider.kt index b8434e9b6c..f554c04783 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/ImportCompletionProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/ImportCompletionProvider.kt @@ -1,446 +1,446 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.providers.completion - -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.java.providers.CompletionProvider.MAX_COMPLETION_ITEMS -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.MatchLevel.CASE_SENSITIVE_EQUAL -import com.itsaky.androidide.lsp.models.MatchLevel.NO_MATCH -import com.itsaky.androidide.projects.api.ModuleProject -import com.itsaky.androidide.projects.util.BootClasspathProvider -import com.itsaky.androidide.utils.ClassTrie -import com.itsaky.androidide.utils.ClassTrie.Node -import jdkx.lang.model.element.Element -import jdkx.lang.model.element.ElementKind -import jdkx.lang.model.element.ElementKind.ANNOTATION_TYPE -import jdkx.lang.model.element.ElementKind.CLASS -import jdkx.lang.model.element.ElementKind.CONSTRUCTOR -import jdkx.lang.model.element.ElementKind.ENUM -import jdkx.lang.model.element.ElementKind.ENUM_CONSTANT -import jdkx.lang.model.element.ElementKind.FIELD -import jdkx.lang.model.element.ElementKind.INSTANCE_INIT -import jdkx.lang.model.element.ElementKind.INTERFACE -import jdkx.lang.model.element.ElementKind.METHOD -import jdkx.lang.model.element.ElementKind.STATIC_INIT -import jdkx.lang.model.element.Modifier.STATIC -import jdkx.lang.model.element.TypeElement -import openjdk.source.util.TreePath -import openjdk.tools.javac.api.JavacTrees -import openjdk.tools.javac.code.Symbol.MethodSymbol -import openjdk.tools.javac.model.JavacTypes -import openjdk.tools.javac.tree.JCTree.JCImport -import java.nio.file.Path - -/** - * Provides completions for imports. - * - * @author Akash Yadav - */ -class ImportCompletionProvider( - completingFile: Path, - cursor: Long, - compiler: JavaCompilerService, - settings: IServerSettings, -) : IJavaCompletionProvider(cursor, completingFile, compiler, settings) { - - lateinit var importPath: String - - // TODO add tests for this - override fun doComplete( - task: CompileTask, - path: TreePath, - partial: String, - endsWithParen: Boolean, - ): CompletionResult { - - val importTree = path.leaf - if (importTree !is JCImport) { - return CompletionResult.EMPTY - } - - log.info("...complete import for path: {}", importPath) - - val names: MutableSet = HashSet() - val list = mutableListOf() - - var pkgName = importPath - val incomplete: String - if (!pkgName.contains(".")) { - pkgName = "" - incomplete = importPath - } else if (pkgName.endsWith(".")) { - pkgName = pkgName.substring(0, pkgName.lastIndex) - incomplete = "" - } else { - incomplete = pkgName.substringAfterLast(delimiter = '.') - pkgName = pkgName.substringBeforeLast(delimiter = '.') - } - - abortCompletionIfCancelled() - run { - val match = matchLevel("static", incomplete) - if (match != NO_MATCH && !importTree.isStatic && pkgName.isEmpty()) { - list.add(keyword("static", incomplete, match)) - } - } - - abortCompletionIfCancelled() - val module = compiler.module - if (module == null) { - legacyImportPathCompletion(partial, names, list) - return CompletionResult(list) - } - - if (pkgName.isEmpty() || pkgName.isBlank()) { - // User is typing first segment of package name - // Javac APIs will not work here - tryCompleteImport(pkgName, incomplete, list, names, module) - return CompletionResult(list) - } - - try { - val packages = collectPackageNodes(module, pkgName) - abortCompletionIfCancelled() - if (packages.isNotEmpty()) { - for (node in packages) { - addDirectChildNodes(node, incomplete, list, names, false) - } - } - } catch (err: RequireMemberCompletionException) { - // If pkgName is not an existing package name, check if it is a qualified classname - // A user might be trying to acess members of a member class. So, we keep replacing last '.' - // until we find a valid qualified name of a class - if (completeTypeMembers(task, path, pkgName, incomplete, list)) { - return CompletionResult(list) - } - } - - try { - // This maybe reached only in some rare cases - tryCompleteImport(pkgName, incomplete, list, names, module) - } catch (e: RequireMemberCompletionException) { - // User is trying to access members of a class - if (completeTypeMembers(task, path, pkgName, incomplete, list)) { - return CompletionResult(list) - } - } - - return CompletionResult(list) - } - - private fun completeTypeMembers( - task: CompileTask, - path: TreePath, - pkgName: String, - incomplete: String, - list: MutableList - ): Boolean { - abortCompletionIfCancelled() - val elements = task.task.elements - var typesForPkg: Set = setOf() - val maybeInnerName = StringBuilder(pkgName) - while (true) { - val types = elements.getAllTypeElements(maybeInnerName) - if (types.isNotEmpty()) { - typesForPkg = types - break - } - - if (!maybeInnerName.contains(".")) { - break - } - maybeInnerName.setCharAt(maybeInnerName.lastIndexOf('.'), '$') - } - - abortCompletionIfCancelled() - if (typesForPkg.isNotEmpty()) { - // We found a valid class name - // Add the accessible class items - for (type in typesForPkg) { - val result = completeTypeMembers(task, type, path, incomplete) - if (result.isNotEmpty()) { - list.addAll(result) - } - } - return true - } - return false - } - - /** - * Collects package nodes for [pkgName] in source paths, classpaths and bootclasspaths. If any - * segment of [pkgName] is a class, [RequireMemberCompletionException] is thrown to indicate that - * class members must be completed. - * - * @param module The project module - * @param pkgName The package name to collect nodes for. - */ - private fun collectPackageNodes(module: ModuleProject, pkgName: String): List { - abortCompletionIfCancelled() - val result = mutableListOf() - val fromSource = collectPackageNode(module.compileJavaSourceClasses, pkgName) - if (fromSource != null) { - result.add(fromSource) - } - - abortCompletionIfCancelled() - val fromClasspath = collectPackageNode(module.compileClasspathClasses, pkgName) - if (fromClasspath != null) { - result.add(fromClasspath) - } - - BootClasspathProvider.getAllEntries().forEach { - abortCompletionIfCancelled() - val fromBootclasspath = collectPackageNode(it, pkgName) - if (fromBootclasspath != null) { - result.add(fromBootclasspath) - } - } - return result - } - - /** - * Collect package nodes from the [trie] for the given [pkgName]. If any segment of [pkgName] is a - * class, [RequireMemberCompletionException] is thrown to indicate that class members must be - * completed. - * - * @param trie The [ClassTrie] to find package names from. - * @param pkgName The package name of the package to find node for. - * @return The found package name. Or `null` if no package can be found. - */ - private fun collectPackageNode(trie: com.itsaky.androidide.utils.ClassTrie, pkgName: String): Node? { - val segments = trie.segments(pkgName) - var node: Node? = trie.root - for (segment in segments) { - abortCompletionIfCancelled() - if (node == null) { - break - } - - if (node.isClass) { - // If any of the segment in pkgName is a class - // We need to complete memebers of a class - throw RequireMemberCompletionException() - } - - node = node.children[segment] - } - - return node - } - - private fun completeTypeMembers( - task: CompileTask, - type: TypeElement, - path: TreePath, - partial: String - ): MutableList { - - abortCompletionIfCancelled() - - val list = mutableListOf() - val elements = task.task.elements - val trees = JavacTrees.instance(task.task.context) - val jcTypes = JavacTypes.instance(task.task.context) - val scope = trees.getScope(path) - val isStatic = (path.leaf as JCImport).isStatic - if (!trees.isAccessible(scope, type)) { - // Type not accessible - return list - } - - val members = elements.getAllMembers(type) - for (member in members) { - abortCompletionIfCancelled() - if ( - member.kind == CONSTRUCTOR || member.kind == STATIC_INIT || member.kind == INSTANCE_INIT - ) { - continue - } - - val match = matchLevel(member.simpleName, partial) - if (match == NO_MATCH) { - continue - } - - if (isType(member)) { - list.add(classItem(member.simpleName.toString(), match)) - continue - } - - if (!isStatic) { - continue - } - - val mods = member.modifiers - if (!mods.contains(STATIC)) { - continue - } - - if (!trees.isAccessible(scope, member, jcTypes.getDeclaredType(type))) { - continue - } - - if (member.kind == METHOD) { - list.add(method(task, listOf(member as MethodSymbol), false, match, partial)) - continue - } - - if (member.kind == FIELD || member.kind == ENUM_CONSTANT) { - list.add(item(task, member, match)) - } - } - - return list - } - - @Throws(RequireMemberCompletionException::class) - private fun tryCompleteImport( - pkgName: String, - incomplete: String, - list: MutableList, - names: MutableSet, - module: ModuleProject, - packageOnly: Boolean = false - ) { - abortCompletionIfCancelled() - val sourceNode = - if (pkgName.isEmpty()) module.compileJavaSourceClasses.root - else module.compileJavaSourceClasses.findNode(pkgName) - if (sourceNode != null) { - if (sourceNode.isClass) { - throw RequireMemberCompletionException() - } - - addDirectChildNodes(sourceNode, incomplete, list, names, packageOnly) - } - - abortCompletionIfCancelled() - val classpathNode = - if (pkgName.isEmpty()) module.compileClasspathClasses.root - else module.compileClasspathClasses.findNode(pkgName) - if (classpathNode != null) { - if (classpathNode.isClass) { - throw RequireMemberCompletionException() - } - - addDirectChildNodes(classpathNode, incomplete, list, names, packageOnly) - } - - BootClasspathProvider.getAllEntries().forEach { - abortCompletionIfCancelled() - val node = - if (pkgName.isEmpty()) { - it.root - } else it.findNode(pkgName) - if (node != null) { - if (node.isClass) { - throw RequireMemberCompletionException() - } - addDirectChildNodes(node, incomplete, list, names, packageOnly) - } - } - } - - private fun addDirectChildNodes( - sourceNode: Node, - incomplete: String, - list: MutableList, - names: MutableSet, - packageOnly: Boolean - ) { - for (child in sourceNode.children.values) { - abortCompletionIfCancelled() - val match = - if (incomplete.isEmpty()) { - CASE_SENSITIVE_EQUAL - } else { - matchLevel(child.name, incomplete) - } - - if (match == NO_MATCH || names.contains(child.name)) { - continue - } - - if (packageOnly && child.isClass) { - continue - } - - if (child.isClass) { - list.add(classItem(child.qualifiedName, match)) - } else { - list.add(packageItem(child.qualifiedName, match)) - } - - names.add(child.name) - } - } - - private fun legacyImportPathCompletion( - partial: String, - names: MutableSet, - list: MutableList - ) { - abortCompletionIfCancelled() - for (className in compiler.publicTopLevelTypes()) { - val matchLevel = matchLevel(className, partial) - if (matchLevel == NO_MATCH) { - continue - } - - val start = importPath.lastIndexOf('.') - var end = className.indexOf('.', importPath.length) - if (end == -1) { - end = className.length - } - val segment = className.substring(start + 1, end) - if (names.contains(segment)) { - continue - } - names.add(segment) - val isClass = end == importPath.length - if (isClass) { - list.add(classItem(className, matchLevel)) - } else { - list.add(packageItem(segment, matchLevel)) - } - - if (list.size > MAX_COMPLETION_ITEMS) { - break - } - } - } - - internal fun isType(element: Element): Boolean { - return isType(element.kind) - } - - internal fun isType(kind: ElementKind): Boolean { - return kind == ANNOTATION_TYPE || kind == CLASS || kind == INTERFACE || kind == ENUM - } - - /** - * Internal exception to indicate that members of a class must be completed. This is thrown and - * caught internally when completing imports. - */ - internal class RequireMemberCompletionException : IllegalStateException() -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.providers.completion + +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.java.providers.CompletionProvider.MAX_COMPLETION_ITEMS +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.MatchLevel.CASE_SENSITIVE_EQUAL +import org.appdevforall.codeonthego.lsp.models.MatchLevel.NO_MATCH +import org.appdevforall.codeonthego.projects.api.ModuleProject +import org.appdevforall.codeonthego.projects.util.BootClasspathProvider +import org.appdevforall.codeonthego.utils.ClassTrie +import org.appdevforall.codeonthego.utils.ClassTrie.Node +import jdkx.lang.model.element.Element +import jdkx.lang.model.element.ElementKind +import jdkx.lang.model.element.ElementKind.ANNOTATION_TYPE +import jdkx.lang.model.element.ElementKind.CLASS +import jdkx.lang.model.element.ElementKind.CONSTRUCTOR +import jdkx.lang.model.element.ElementKind.ENUM +import jdkx.lang.model.element.ElementKind.ENUM_CONSTANT +import jdkx.lang.model.element.ElementKind.FIELD +import jdkx.lang.model.element.ElementKind.INSTANCE_INIT +import jdkx.lang.model.element.ElementKind.INTERFACE +import jdkx.lang.model.element.ElementKind.METHOD +import jdkx.lang.model.element.ElementKind.STATIC_INIT +import jdkx.lang.model.element.Modifier.STATIC +import jdkx.lang.model.element.TypeElement +import openjdk.source.util.TreePath +import openjdk.tools.javac.api.JavacTrees +import openjdk.tools.javac.code.Symbol.MethodSymbol +import openjdk.tools.javac.model.JavacTypes +import openjdk.tools.javac.tree.JCTree.JCImport +import java.nio.file.Path + +/** + * Provides completions for imports. + * + * @author Akash Yadav + */ +class ImportCompletionProvider( + completingFile: Path, + cursor: Long, + compiler: JavaCompilerService, + settings: IServerSettings, +) : IJavaCompletionProvider(cursor, completingFile, compiler, settings) { + + lateinit var importPath: String + + // TODO add tests for this + override fun doComplete( + task: CompileTask, + path: TreePath, + partial: String, + endsWithParen: Boolean, + ): CompletionResult { + + val importTree = path.leaf + if (importTree !is JCImport) { + return CompletionResult.EMPTY + } + + log.info("...complete import for path: {}", importPath) + + val names: MutableSet = HashSet() + val list = mutableListOf() + + var pkgName = importPath + val incomplete: String + if (!pkgName.contains(".")) { + pkgName = "" + incomplete = importPath + } else if (pkgName.endsWith(".")) { + pkgName = pkgName.substring(0, pkgName.lastIndex) + incomplete = "" + } else { + incomplete = pkgName.substringAfterLast(delimiter = '.') + pkgName = pkgName.substringBeforeLast(delimiter = '.') + } + + abortCompletionIfCancelled() + run { + val match = matchLevel("static", incomplete) + if (match != NO_MATCH && !importTree.isStatic && pkgName.isEmpty()) { + list.add(keyword("static", incomplete, match)) + } + } + + abortCompletionIfCancelled() + val module = compiler.module + if (module == null) { + legacyImportPathCompletion(partial, names, list) + return CompletionResult(list) + } + + if (pkgName.isEmpty() || pkgName.isBlank()) { + // User is typing first segment of package name + // Javac APIs will not work here + tryCompleteImport(pkgName, incomplete, list, names, module) + return CompletionResult(list) + } + + try { + val packages = collectPackageNodes(module, pkgName) + abortCompletionIfCancelled() + if (packages.isNotEmpty()) { + for (node in packages) { + addDirectChildNodes(node, incomplete, list, names, false) + } + } + } catch (err: RequireMemberCompletionException) { + // If pkgName is not an existing package name, check if it is a qualified classname + // A user might be trying to acess members of a member class. So, we keep replacing last '.' + // until we find a valid qualified name of a class + if (completeTypeMembers(task, path, pkgName, incomplete, list)) { + return CompletionResult(list) + } + } + + try { + // This maybe reached only in some rare cases + tryCompleteImport(pkgName, incomplete, list, names, module) + } catch (e: RequireMemberCompletionException) { + // User is trying to access members of a class + if (completeTypeMembers(task, path, pkgName, incomplete, list)) { + return CompletionResult(list) + } + } + + return CompletionResult(list) + } + + private fun completeTypeMembers( + task: CompileTask, + path: TreePath, + pkgName: String, + incomplete: String, + list: MutableList + ): Boolean { + abortCompletionIfCancelled() + val elements = task.task.elements + var typesForPkg: Set = setOf() + val maybeInnerName = StringBuilder(pkgName) + while (true) { + val types = elements.getAllTypeElements(maybeInnerName) + if (types.isNotEmpty()) { + typesForPkg = types + break + } + + if (!maybeInnerName.contains(".")) { + break + } + maybeInnerName.setCharAt(maybeInnerName.lastIndexOf('.'), '$') + } + + abortCompletionIfCancelled() + if (typesForPkg.isNotEmpty()) { + // We found a valid class name + // Add the accessible class items + for (type in typesForPkg) { + val result = completeTypeMembers(task, type, path, incomplete) + if (result.isNotEmpty()) { + list.addAll(result) + } + } + return true + } + return false + } + + /** + * Collects package nodes for [pkgName] in source paths, classpaths and bootclasspaths. If any + * segment of [pkgName] is a class, [RequireMemberCompletionException] is thrown to indicate that + * class members must be completed. + * + * @param module The project module + * @param pkgName The package name to collect nodes for. + */ + private fun collectPackageNodes(module: ModuleProject, pkgName: String): List { + abortCompletionIfCancelled() + val result = mutableListOf() + val fromSource = collectPackageNode(module.compileJavaSourceClasses, pkgName) + if (fromSource != null) { + result.add(fromSource) + } + + abortCompletionIfCancelled() + val fromClasspath = collectPackageNode(module.compileClasspathClasses, pkgName) + if (fromClasspath != null) { + result.add(fromClasspath) + } + + BootClasspathProvider.getAllEntries().forEach { + abortCompletionIfCancelled() + val fromBootclasspath = collectPackageNode(it, pkgName) + if (fromBootclasspath != null) { + result.add(fromBootclasspath) + } + } + return result + } + + /** + * Collect package nodes from the [trie] for the given [pkgName]. If any segment of [pkgName] is a + * class, [RequireMemberCompletionException] is thrown to indicate that class members must be + * completed. + * + * @param trie The [ClassTrie] to find package names from. + * @param pkgName The package name of the package to find node for. + * @return The found package name. Or `null` if no package can be found. + */ + private fun collectPackageNode(trie: org.appdevforall.codeonthego.utils.ClassTrie, pkgName: String): Node? { + val segments = trie.segments(pkgName) + var node: Node? = trie.root + for (segment in segments) { + abortCompletionIfCancelled() + if (node == null) { + break + } + + if (node.isClass) { + // If any of the segment in pkgName is a class + // We need to complete memebers of a class + throw RequireMemberCompletionException() + } + + node = node.children[segment] + } + + return node + } + + private fun completeTypeMembers( + task: CompileTask, + type: TypeElement, + path: TreePath, + partial: String + ): MutableList { + + abortCompletionIfCancelled() + + val list = mutableListOf() + val elements = task.task.elements + val trees = JavacTrees.instance(task.task.context) + val jcTypes = JavacTypes.instance(task.task.context) + val scope = trees.getScope(path) + val isStatic = (path.leaf as JCImport).isStatic + if (!trees.isAccessible(scope, type)) { + // Type not accessible + return list + } + + val members = elements.getAllMembers(type) + for (member in members) { + abortCompletionIfCancelled() + if ( + member.kind == CONSTRUCTOR || member.kind == STATIC_INIT || member.kind == INSTANCE_INIT + ) { + continue + } + + val match = matchLevel(member.simpleName, partial) + if (match == NO_MATCH) { + continue + } + + if (isType(member)) { + list.add(classItem(member.simpleName.toString(), match)) + continue + } + + if (!isStatic) { + continue + } + + val mods = member.modifiers + if (!mods.contains(STATIC)) { + continue + } + + if (!trees.isAccessible(scope, member, jcTypes.getDeclaredType(type))) { + continue + } + + if (member.kind == METHOD) { + list.add(method(task, listOf(member as MethodSymbol), false, match, partial)) + continue + } + + if (member.kind == FIELD || member.kind == ENUM_CONSTANT) { + list.add(item(task, member, match)) + } + } + + return list + } + + @Throws(RequireMemberCompletionException::class) + private fun tryCompleteImport( + pkgName: String, + incomplete: String, + list: MutableList, + names: MutableSet, + module: ModuleProject, + packageOnly: Boolean = false + ) { + abortCompletionIfCancelled() + val sourceNode = + if (pkgName.isEmpty()) module.compileJavaSourceClasses.root + else module.compileJavaSourceClasses.findNode(pkgName) + if (sourceNode != null) { + if (sourceNode.isClass) { + throw RequireMemberCompletionException() + } + + addDirectChildNodes(sourceNode, incomplete, list, names, packageOnly) + } + + abortCompletionIfCancelled() + val classpathNode = + if (pkgName.isEmpty()) module.compileClasspathClasses.root + else module.compileClasspathClasses.findNode(pkgName) + if (classpathNode != null) { + if (classpathNode.isClass) { + throw RequireMemberCompletionException() + } + + addDirectChildNodes(classpathNode, incomplete, list, names, packageOnly) + } + + BootClasspathProvider.getAllEntries().forEach { + abortCompletionIfCancelled() + val node = + if (pkgName.isEmpty()) { + it.root + } else it.findNode(pkgName) + if (node != null) { + if (node.isClass) { + throw RequireMemberCompletionException() + } + addDirectChildNodes(node, incomplete, list, names, packageOnly) + } + } + } + + private fun addDirectChildNodes( + sourceNode: Node, + incomplete: String, + list: MutableList, + names: MutableSet, + packageOnly: Boolean + ) { + for (child in sourceNode.children.values) { + abortCompletionIfCancelled() + val match = + if (incomplete.isEmpty()) { + CASE_SENSITIVE_EQUAL + } else { + matchLevel(child.name, incomplete) + } + + if (match == NO_MATCH || names.contains(child.name)) { + continue + } + + if (packageOnly && child.isClass) { + continue + } + + if (child.isClass) { + list.add(classItem(child.qualifiedName, match)) + } else { + list.add(packageItem(child.qualifiedName, match)) + } + + names.add(child.name) + } + } + + private fun legacyImportPathCompletion( + partial: String, + names: MutableSet, + list: MutableList + ) { + abortCompletionIfCancelled() + for (className in compiler.publicTopLevelTypes()) { + val matchLevel = matchLevel(className, partial) + if (matchLevel == NO_MATCH) { + continue + } + + val start = importPath.lastIndexOf('.') + var end = className.indexOf('.', importPath.length) + if (end == -1) { + end = className.length + } + val segment = className.substring(start + 1, end) + if (names.contains(segment)) { + continue + } + names.add(segment) + val isClass = end == importPath.length + if (isClass) { + list.add(classItem(className, matchLevel)) + } else { + list.add(packageItem(segment, matchLevel)) + } + + if (list.size > MAX_COMPLETION_ITEMS) { + break + } + } + } + + internal fun isType(element: Element): Boolean { + return isType(element.kind) + } + + internal fun isType(kind: ElementKind): Boolean { + return kind == ANNOTATION_TYPE || kind == CLASS || kind == INTERFACE || kind == ENUM + } + + /** + * Internal exception to indicate that members of a class must be completed. This is thrown and + * caught internally when completing imports. + */ + internal class RequireMemberCompletionException : IllegalStateException() +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/KeywordCompletionProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/KeywordCompletionProvider.kt similarity index 86% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/KeywordCompletionProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/KeywordCompletionProvider.kt index 779bba385d..09d9daf193 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/KeywordCompletionProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/KeywordCompletionProvider.kt @@ -1,162 +1,162 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.providers.completion - -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.MatchLevel.NO_MATCH -import openjdk.source.tree.ClassTree -import openjdk.source.tree.CompilationUnitTree -import openjdk.source.tree.MethodTree -import openjdk.source.tree.Tree -import openjdk.source.util.TreePath -import java.nio.file.Path - -/** - * Provides keyword completions. - * - * @author Akash Yadav - */ -class KeywordCompletionProvider( - completingFile: Path, - cursor: Long, - compiler: JavaCompilerService, - settings: IServerSettings -) : IJavaCompletionProvider(cursor, completingFile, compiler, settings) { - - override fun doComplete( - task: CompileTask, - path: TreePath, - partial: String, - endsWithParen: Boolean, - ): CompletionResult { - - if (partial.isBlank()) { - return CompletionResult.EMPTY - } - - val level: Tree = findKeywordLevel(path) - var keywords = arrayOf() - when (level) { - is CompilationUnitTree -> keywords = TOP_LEVEL_KEYWORDS - is ClassTree -> keywords = CLASS_BODY_KEYWORDS - is MethodTree -> keywords = METHOD_BODY_KEYWORDS - } - - abortCompletionIfCancelled() - val list = mutableListOf() - for (k in keywords) { - val matchLevel = matchLevel(k, partial) - if (matchLevel == NO_MATCH) { - continue - } - - list.add(keyword(k, partial, 100)) - } - - return CompletionResult(list) - } - - private fun findKeywordLevel(treePath: TreePath): Tree { - var path: TreePath? = treePath - while (path != null) { - if (path.leaf is CompilationUnitTree || path.leaf is ClassTree || path.leaf is MethodTree) { - return path.leaf - } - path = path.parentPath - } - throw RuntimeException("empty path") - } - - companion object { - private val TOP_LEVEL_KEYWORDS = - arrayOf( - "package", - "import", - "public", - "private", - "protected", - "abstract", - "class", - "interface", - "@interface", - "extends", - "implements" - ) - private val CLASS_BODY_KEYWORDS = - arrayOf( - "public", - "private", - "protected", - "static", - "final", - "native", - "synchronized", - "abstract", - "default", - "class", - "interface", - "void", - "boolean", - "int", - "long", - "float", - "double", - "true", - "false", - "null" - ) - private val METHOD_BODY_KEYWORDS = - arrayOf( - "new", - "assert", - "try", - "catch", - "finally", - "throw", - "return", - "break", - "case", - "continue", - "default", - "do", - "while", - "for", - "switch", - "if", - "else", - "instanceof", - "var", - "final", - "class", - "void", - "boolean", - "int", - "long", - "float", - "double", - "synchronized", - "true", - "false", - "null" - ) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.providers.completion + +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.MatchLevel.NO_MATCH +import openjdk.source.tree.ClassTree +import openjdk.source.tree.CompilationUnitTree +import openjdk.source.tree.MethodTree +import openjdk.source.tree.Tree +import openjdk.source.util.TreePath +import java.nio.file.Path + +/** + * Provides keyword completions. + * + * @author Akash Yadav + */ +class KeywordCompletionProvider( + completingFile: Path, + cursor: Long, + compiler: JavaCompilerService, + settings: IServerSettings +) : IJavaCompletionProvider(cursor, completingFile, compiler, settings) { + + override fun doComplete( + task: CompileTask, + path: TreePath, + partial: String, + endsWithParen: Boolean, + ): CompletionResult { + + if (partial.isBlank()) { + return CompletionResult.EMPTY + } + + val level: Tree = findKeywordLevel(path) + var keywords = arrayOf() + when (level) { + is CompilationUnitTree -> keywords = TOP_LEVEL_KEYWORDS + is ClassTree -> keywords = CLASS_BODY_KEYWORDS + is MethodTree -> keywords = METHOD_BODY_KEYWORDS + } + + abortCompletionIfCancelled() + val list = mutableListOf() + for (k in keywords) { + val matchLevel = matchLevel(k, partial) + if (matchLevel == NO_MATCH) { + continue + } + + list.add(keyword(k, partial, 100)) + } + + return CompletionResult(list) + } + + private fun findKeywordLevel(treePath: TreePath): Tree { + var path: TreePath? = treePath + while (path != null) { + if (path.leaf is CompilationUnitTree || path.leaf is ClassTree || path.leaf is MethodTree) { + return path.leaf + } + path = path.parentPath + } + throw RuntimeException("empty path") + } + + companion object { + private val TOP_LEVEL_KEYWORDS = + arrayOf( + "package", + "import", + "public", + "private", + "protected", + "abstract", + "class", + "interface", + "@interface", + "extends", + "implements" + ) + private val CLASS_BODY_KEYWORDS = + arrayOf( + "public", + "private", + "protected", + "static", + "final", + "native", + "synchronized", + "abstract", + "default", + "class", + "interface", + "void", + "boolean", + "int", + "long", + "float", + "double", + "true", + "false", + "null" + ) + private val METHOD_BODY_KEYWORDS = + arrayOf( + "new", + "assert", + "try", + "catch", + "finally", + "throw", + "return", + "break", + "case", + "continue", + "default", + "do", + "while", + "for", + "switch", + "if", + "else", + "instanceof", + "var", + "final", + "class", + "void", + "boolean", + "int", + "long", + "float", + "double", + "synchronized", + "true", + "false", + "null" + ) + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/MemberReferenceCompletionProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/MemberReferenceCompletionProvider.kt similarity index 88% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/MemberReferenceCompletionProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/MemberReferenceCompletionProvider.kt index 82ece497ba..14f6de4211 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/MemberReferenceCompletionProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/MemberReferenceCompletionProvider.kt @@ -1,174 +1,174 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.providers.completion - -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.MatchLevel -import com.itsaky.androidide.lsp.models.MatchLevel.NO_MATCH -import jdkx.lang.model.element.ElementKind.METHOD -import jdkx.lang.model.element.ExecutableElement -import jdkx.lang.model.element.Modifier.STATIC -import jdkx.lang.model.element.TypeElement -import jdkx.lang.model.type.ArrayType -import jdkx.lang.model.type.DeclaredType -import jdkx.lang.model.type.TypeVariable -import openjdk.source.tree.MemberReferenceTree -import openjdk.source.tree.Scope -import openjdk.source.util.TreePath -import openjdk.source.util.Trees -import java.nio.file.Path - -/** - * Completions for member reference. - * - * @author Akash Yadav - */ -class MemberReferenceCompletionProvider( - completingFile: Path, - cursor: Long, - compiler: JavaCompilerService, - settings: IServerSettings, -) : IJavaCompletionProvider(cursor, completingFile, compiler, settings) { - - override fun doComplete( - task: CompileTask, - path: TreePath, - partial: String, - endsWithParen: Boolean, - ): CompletionResult { - val trees = Trees.instance(task.task) - val select = path.leaf as MemberReferenceTree - log.info("...complete methods of {}", select.qualifierExpression) - - val exprPath = TreePath(path, select.qualifierExpression) - val element = trees.getElement(exprPath) - val isStatic = element is TypeElement - val scope = trees.getScope(exprPath) - - abortCompletionIfCancelled() - return when (val type = trees.getTypeMirror(exprPath)) { - is ArrayType -> completeArrayMemberReference(isStatic, partial) - is TypeVariable -> completeTypeVariableMemberReference(task, scope, type, isStatic, partial) - is DeclaredType -> completeDeclaredTypeMemberReference(task, scope, type, isStatic, partial) - else -> CompletionResult.EMPTY - } - } - - private fun completeArrayMemberReference( - isStatic: Boolean, - partialName: CharSequence, - ): CompletionResult { - abortCompletionIfCancelled() - return if (isStatic) { - val list = mutableListOf() - list.add(keyword("new", partialName, 100)) - CompletionResult(list) - } else { - CompletionResult.EMPTY - } - } - - private fun completeTypeVariableMemberReference( - task: CompileTask, - scope: Scope, - type: TypeVariable, - isStatic: Boolean, - partial: String, - ): CompletionResult { - abortCompletionIfCancelled() - return when (type.upperBound) { - is DeclaredType -> - completeDeclaredTypeMemberReference( - task, - scope, - type.upperBound as DeclaredType, - isStatic, - partial - ) - is TypeVariable -> - completeTypeVariableMemberReference( - task, - scope, - type.upperBound as TypeVariable, - isStatic, - partial - ) - else -> CompletionResult.EMPTY - } - } - - private fun completeDeclaredTypeMemberReference( - task: CompileTask, - scope: Scope, - type: DeclaredType, - isStatic: Boolean, - partial: String, - ): CompletionResult { - abortCompletionIfCancelled() - val trees = Trees.instance(task.task) - val typeElement = type.asElement() as TypeElement - val list: MutableList = ArrayList() - val methods: MutableMap> = mutableMapOf() - val matchLevels: MutableMap = HashMap() - for (member in task.task.elements.getAllMembers(typeElement)) { - val matchLevel = matchLevel(member.simpleName, partial) - if (matchLevel == NO_MATCH) { - continue - } - - if (member.kind != METHOD) { - continue - } - - if (!trees.isAccessible(scope, member, type)) { - continue - } - - if (!isStatic && member.modifiers.contains(STATIC)) { - continue - } - - if (member.kind == METHOD) { - putMethod((member as ExecutableElement), methods) - matchLevels.putIfAbsent(member.getSimpleName().toString(), matchLevel) - } else { - list.add(item(task, member, matchLevel)) - } - } - - abortCompletionIfCancelled() - for ((key, value) in methods) { - val matchLevel = matchLevels.getOrDefault(key, NO_MATCH) - if (matchLevel == NO_MATCH) { - continue - } - - list.add(method(task, value, false, matchLevel, partial)) - } - - if (isStatic) { - list.add(keyword("new", partial, 100)) - } - - return CompletionResult(list) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.providers.completion + +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.MatchLevel +import org.appdevforall.codeonthego.lsp.models.MatchLevel.NO_MATCH +import jdkx.lang.model.element.ElementKind.METHOD +import jdkx.lang.model.element.ExecutableElement +import jdkx.lang.model.element.Modifier.STATIC +import jdkx.lang.model.element.TypeElement +import jdkx.lang.model.type.ArrayType +import jdkx.lang.model.type.DeclaredType +import jdkx.lang.model.type.TypeVariable +import openjdk.source.tree.MemberReferenceTree +import openjdk.source.tree.Scope +import openjdk.source.util.TreePath +import openjdk.source.util.Trees +import java.nio.file.Path + +/** + * Completions for member reference. + * + * @author Akash Yadav + */ +class MemberReferenceCompletionProvider( + completingFile: Path, + cursor: Long, + compiler: JavaCompilerService, + settings: IServerSettings, +) : IJavaCompletionProvider(cursor, completingFile, compiler, settings) { + + override fun doComplete( + task: CompileTask, + path: TreePath, + partial: String, + endsWithParen: Boolean, + ): CompletionResult { + val trees = Trees.instance(task.task) + val select = path.leaf as MemberReferenceTree + log.info("...complete methods of {}", select.qualifierExpression) + + val exprPath = TreePath(path, select.qualifierExpression) + val element = trees.getElement(exprPath) + val isStatic = element is TypeElement + val scope = trees.getScope(exprPath) + + abortCompletionIfCancelled() + return when (val type = trees.getTypeMirror(exprPath)) { + is ArrayType -> completeArrayMemberReference(isStatic, partial) + is TypeVariable -> completeTypeVariableMemberReference(task, scope, type, isStatic, partial) + is DeclaredType -> completeDeclaredTypeMemberReference(task, scope, type, isStatic, partial) + else -> CompletionResult.EMPTY + } + } + + private fun completeArrayMemberReference( + isStatic: Boolean, + partialName: CharSequence, + ): CompletionResult { + abortCompletionIfCancelled() + return if (isStatic) { + val list = mutableListOf() + list.add(keyword("new", partialName, 100)) + CompletionResult(list) + } else { + CompletionResult.EMPTY + } + } + + private fun completeTypeVariableMemberReference( + task: CompileTask, + scope: Scope, + type: TypeVariable, + isStatic: Boolean, + partial: String, + ): CompletionResult { + abortCompletionIfCancelled() + return when (type.upperBound) { + is DeclaredType -> + completeDeclaredTypeMemberReference( + task, + scope, + type.upperBound as DeclaredType, + isStatic, + partial + ) + is TypeVariable -> + completeTypeVariableMemberReference( + task, + scope, + type.upperBound as TypeVariable, + isStatic, + partial + ) + else -> CompletionResult.EMPTY + } + } + + private fun completeDeclaredTypeMemberReference( + task: CompileTask, + scope: Scope, + type: DeclaredType, + isStatic: Boolean, + partial: String, + ): CompletionResult { + abortCompletionIfCancelled() + val trees = Trees.instance(task.task) + val typeElement = type.asElement() as TypeElement + val list: MutableList = ArrayList() + val methods: MutableMap> = mutableMapOf() + val matchLevels: MutableMap = HashMap() + for (member in task.task.elements.getAllMembers(typeElement)) { + val matchLevel = matchLevel(member.simpleName, partial) + if (matchLevel == NO_MATCH) { + continue + } + + if (member.kind != METHOD) { + continue + } + + if (!trees.isAccessible(scope, member, type)) { + continue + } + + if (!isStatic && member.modifiers.contains(STATIC)) { + continue + } + + if (member.kind == METHOD) { + putMethod((member as ExecutableElement), methods) + matchLevels.putIfAbsent(member.getSimpleName().toString(), matchLevel) + } else { + list.add(item(task, member, matchLevel)) + } + } + + abortCompletionIfCancelled() + for ((key, value) in methods) { + val matchLevel = matchLevels.getOrDefault(key, NO_MATCH) + if (matchLevel == NO_MATCH) { + continue + } + + list.add(method(task, value, false, matchLevel, partial)) + } + + if (isStatic) { + list.add(keyword("new", partial, 100)) + } + + return CompletionResult(list) + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/MemberSelectCompletionProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/MemberSelectCompletionProvider.kt similarity index 89% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/MemberSelectCompletionProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/MemberSelectCompletionProvider.kt index b6d1ed99cf..7c2cad339c 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/MemberSelectCompletionProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/MemberSelectCompletionProvider.kt @@ -1,227 +1,227 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.providers.completion - -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.java.utils.ScopeHelper -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.MatchLevel -import com.itsaky.androidide.lsp.models.MatchLevel.NO_MATCH -import jdkx.lang.model.element.ElementKind.CONSTRUCTOR -import jdkx.lang.model.element.ElementKind.METHOD -import jdkx.lang.model.element.ExecutableElement -import jdkx.lang.model.element.Modifier.STATIC -import jdkx.lang.model.element.TypeElement -import jdkx.lang.model.type.ArrayType -import jdkx.lang.model.type.DeclaredType -import jdkx.lang.model.type.TypeVariable -import openjdk.source.tree.MemberSelectTree -import openjdk.source.tree.Scope -import openjdk.source.util.TreePath -import openjdk.source.util.Trees -import openjdk.tools.javac.code.Symbol -import java.nio.file.Path - -/** - * Completions for member select. - * - * @author Akash Yadav - */ -class MemberSelectCompletionProvider( - completingFile: Path, - cursor: Long, - compiler: JavaCompilerService, - settings: IServerSettings, -) : IJavaCompletionProvider(cursor, completingFile, compiler, settings) { - - override fun doComplete( - task: CompileTask, - path: TreePath, - partial: String, - endsWithParen: Boolean, - ): CompletionResult { - val trees = Trees.instance(task.task) - val select = - path.leaf as? MemberSelectTree - ?: run { - log.error("A member select tree was expected but was {}", path.leaf.javaClass) - return CompletionResult.EMPTY - } - - log.info("...complete members of {}", select.expression) - - val exprPath = TreePath(path, select.expression) - val isStatic = trees.getElement(exprPath) is TypeElement - val scope = trees.getScope(exprPath) - - abortCompletionIfCancelled() - return when (val type = trees.getTypeMirror(exprPath)) { - is ArrayType -> completeArrayMemberSelect(isStatic, partial) - is TypeVariable -> - completeTypeVariableMemberSelect(task, scope, type, isStatic, partial, endsWithParen) - - is DeclaredType -> - completeDeclaredTypeMemberSelect(task, scope, type, isStatic, partial, endsWithParen) - - else -> CompletionResult.EMPTY - } - } - - private fun completeArrayMemberSelect( - isStatic: Boolean, - partialName: CharSequence - ): CompletionResult { - return if (isStatic) { - abortCompletionIfCancelled() - CompletionResult.EMPTY - } else { - val list = mutableListOf() - list.add(keyword("length", partialName, 100)) - CompletionResult(list) - } - } - - private fun completeTypeVariableMemberSelect( - task: CompileTask, - scope: Scope, - type: TypeVariable, - isStatic: Boolean, - partial: String, - endsWithParen: Boolean, - ): CompletionResult { - abortCompletionIfCancelled() - return when (type.upperBound) { - is DeclaredType -> - completeDeclaredTypeMemberSelect( - task, - scope, - type.upperBound as DeclaredType, - isStatic, - partial, - endsWithParen - ) - - is TypeVariable -> - completeTypeVariableMemberSelect( - task, - scope, - type.upperBound as TypeVariable, - isStatic, - partial, - endsWithParen - ) - - else -> CompletionResult.EMPTY - } - } - - private fun completeDeclaredTypeMemberSelect( - task: CompileTask, - scope: Scope, - type: DeclaredType, - isStatic: Boolean, - partial: String, - endsWithParen: Boolean, - ): CompletionResult { - val trees = Trees.instance(task.task) - val typeElement = type.asElement() as TypeElement - val list = mutableListOf() - val methods = mutableMapOf>() - val matchLevels = mutableMapOf() - - log.debug("DeclaredType {} with members {} in scope: {}", - typeElement, - (typeElement as Symbol).members(), - scope - ) - - abortCompletionIfCancelled() - for (member in task.task.elements.getAllMembers(typeElement)) { - if (member.kind == CONSTRUCTOR) { - continue - } - val matchLevel = matchLevel(member.simpleName, partial) - if (matchLevel == NO_MATCH) { - continue - } - - if (!trees.isAccessible(scope, member, type)) { - continue - } - - if (isStatic != member.modifiers.contains(STATIC)) { - continue - } - - if (member.kind == METHOD) { - putMethod((member as ExecutableElement), methods) - matchLevels.putIfAbsent(member.getSimpleName().toString(), matchLevel) - } else { - list.add(item(task, member, matchLevel)) - } - } - - log.debug("Found {} members along with {} methods", list.size, methods.size) - - abortCompletionIfCancelled() - for ((key, value) in methods) { - val matchLevel = matchLevels.getOrDefault(key, NO_MATCH) - if (matchLevel == NO_MATCH) { - continue - } - - list.add(method(task, value, !endsWithParen, matchLevel, partial)) - } - - if (isStatic) { - list.add(keyword("class", partial, 100)) - } - - if (!isStatic && isEnclosingClass(type, scope)) { - list.add(keyword("this", partial, 100)) - list.add(keyword("super", partial, 100)) - } - - return CompletionResult(list) - } - - private fun isEnclosingClass(type: DeclaredType, start: Scope): Boolean { - for (s in ScopeHelper.fastScopes(start)) { - // If we reach a static method, stop looking - val method = s.enclosingMethod - if (method != null && method.modifiers.contains(STATIC)) { - return false - } - - // If we find the enclosing class - val thisElement = s.enclosingClass - if (thisElement != null && thisElement.asType() == type) { - return true - } - - // If the enclosing class is static, stop looking - if (thisElement != null && thisElement.modifiers.contains(STATIC)) { - return false - } - } - return false - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.providers.completion + +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.java.utils.ScopeHelper +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.MatchLevel +import org.appdevforall.codeonthego.lsp.models.MatchLevel.NO_MATCH +import jdkx.lang.model.element.ElementKind.CONSTRUCTOR +import jdkx.lang.model.element.ElementKind.METHOD +import jdkx.lang.model.element.ExecutableElement +import jdkx.lang.model.element.Modifier.STATIC +import jdkx.lang.model.element.TypeElement +import jdkx.lang.model.type.ArrayType +import jdkx.lang.model.type.DeclaredType +import jdkx.lang.model.type.TypeVariable +import openjdk.source.tree.MemberSelectTree +import openjdk.source.tree.Scope +import openjdk.source.util.TreePath +import openjdk.source.util.Trees +import openjdk.tools.javac.code.Symbol +import java.nio.file.Path + +/** + * Completions for member select. + * + * @author Akash Yadav + */ +class MemberSelectCompletionProvider( + completingFile: Path, + cursor: Long, + compiler: JavaCompilerService, + settings: IServerSettings, +) : IJavaCompletionProvider(cursor, completingFile, compiler, settings) { + + override fun doComplete( + task: CompileTask, + path: TreePath, + partial: String, + endsWithParen: Boolean, + ): CompletionResult { + val trees = Trees.instance(task.task) + val select = + path.leaf as? MemberSelectTree + ?: run { + log.error("A member select tree was expected but was {}", path.leaf.javaClass) + return CompletionResult.EMPTY + } + + log.info("...complete members of {}", select.expression) + + val exprPath = TreePath(path, select.expression) + val isStatic = trees.getElement(exprPath) is TypeElement + val scope = trees.getScope(exprPath) + + abortCompletionIfCancelled() + return when (val type = trees.getTypeMirror(exprPath)) { + is ArrayType -> completeArrayMemberSelect(isStatic, partial) + is TypeVariable -> + completeTypeVariableMemberSelect(task, scope, type, isStatic, partial, endsWithParen) + + is DeclaredType -> + completeDeclaredTypeMemberSelect(task, scope, type, isStatic, partial, endsWithParen) + + else -> CompletionResult.EMPTY + } + } + + private fun completeArrayMemberSelect( + isStatic: Boolean, + partialName: CharSequence + ): CompletionResult { + return if (isStatic) { + abortCompletionIfCancelled() + CompletionResult.EMPTY + } else { + val list = mutableListOf() + list.add(keyword("length", partialName, 100)) + CompletionResult(list) + } + } + + private fun completeTypeVariableMemberSelect( + task: CompileTask, + scope: Scope, + type: TypeVariable, + isStatic: Boolean, + partial: String, + endsWithParen: Boolean, + ): CompletionResult { + abortCompletionIfCancelled() + return when (type.upperBound) { + is DeclaredType -> + completeDeclaredTypeMemberSelect( + task, + scope, + type.upperBound as DeclaredType, + isStatic, + partial, + endsWithParen + ) + + is TypeVariable -> + completeTypeVariableMemberSelect( + task, + scope, + type.upperBound as TypeVariable, + isStatic, + partial, + endsWithParen + ) + + else -> CompletionResult.EMPTY + } + } + + private fun completeDeclaredTypeMemberSelect( + task: CompileTask, + scope: Scope, + type: DeclaredType, + isStatic: Boolean, + partial: String, + endsWithParen: Boolean, + ): CompletionResult { + val trees = Trees.instance(task.task) + val typeElement = type.asElement() as TypeElement + val list = mutableListOf() + val methods = mutableMapOf>() + val matchLevels = mutableMapOf() + + log.debug("DeclaredType {} with members {} in scope: {}", + typeElement, + (typeElement as Symbol).members(), + scope + ) + + abortCompletionIfCancelled() + for (member in task.task.elements.getAllMembers(typeElement)) { + if (member.kind == CONSTRUCTOR) { + continue + } + val matchLevel = matchLevel(member.simpleName, partial) + if (matchLevel == NO_MATCH) { + continue + } + + if (!trees.isAccessible(scope, member, type)) { + continue + } + + if (isStatic != member.modifiers.contains(STATIC)) { + continue + } + + if (member.kind == METHOD) { + putMethod((member as ExecutableElement), methods) + matchLevels.putIfAbsent(member.getSimpleName().toString(), matchLevel) + } else { + list.add(item(task, member, matchLevel)) + } + } + + log.debug("Found {} members along with {} methods", list.size, methods.size) + + abortCompletionIfCancelled() + for ((key, value) in methods) { + val matchLevel = matchLevels.getOrDefault(key, NO_MATCH) + if (matchLevel == NO_MATCH) { + continue + } + + list.add(method(task, value, !endsWithParen, matchLevel, partial)) + } + + if (isStatic) { + list.add(keyword("class", partial, 100)) + } + + if (!isStatic && isEnclosingClass(type, scope)) { + list.add(keyword("this", partial, 100)) + list.add(keyword("super", partial, 100)) + } + + return CompletionResult(list) + } + + private fun isEnclosingClass(type: DeclaredType, start: Scope): Boolean { + for (s in ScopeHelper.fastScopes(start)) { + // If we reach a static method, stop looking + val method = s.enclosingMethod + if (method != null && method.modifiers.contains(STATIC)) { + return false + } + + // If we find the enclosing class + val thisElement = s.enclosingClass + if (thisElement != null && thisElement.asType() == type) { + return true + } + + // If the enclosing class is static, stop looking + if (thisElement != null && thisElement.modifiers.contains(STATIC)) { + return false + } + } + return false + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/ScopeCompletionProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/ScopeCompletionProvider.kt similarity index 83% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/ScopeCompletionProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/ScopeCompletionProvider.kt index e6c48e71ac..1a5c16d444 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/ScopeCompletionProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/ScopeCompletionProvider.kt @@ -1,188 +1,188 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.providers.completion - -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.api.describeSnippet -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.java.edits.MultipleClassImportEditHandler -import com.itsaky.androidide.lsp.java.models.JavaCompletionItem -import com.itsaky.androidide.lsp.java.utils.JavaPoetUtils.Companion.buildMethod -import com.itsaky.androidide.lsp.java.utils.JavaPoetUtils.Companion.print -import com.itsaky.androidide.lsp.java.utils.ScopeHelper -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.InsertTextFormat.SNIPPET -import com.itsaky.androidide.lsp.models.MatchLevel -import com.itsaky.androidide.lsp.models.MatchLevel.NO_MATCH -import com.squareup.javapoet.MethodSpec.Builder -import jdkx.lang.model.element.ElementKind.METHOD -import jdkx.lang.model.element.ExecutableElement -import jdkx.lang.model.element.Modifier.FINAL -import jdkx.lang.model.element.Modifier.PRIVATE -import jdkx.lang.model.element.Modifier.STATIC -import jdkx.lang.model.type.DeclaredType -import openjdk.source.tree.ClassTree -import openjdk.source.tree.Tree.Kind.CLASS -import openjdk.source.util.TreePath -import openjdk.source.util.Trees -import java.nio.file.Path -import java.util.function.Predicate - -/** - * Provides completions using [openjdk.source.tree.Scope]. - * - * @author Akash Yadav - */ -class ScopeCompletionProvider( - completingFile: Path, - cursor: Long, - compiler: JavaCompilerService, - settings: IServerSettings, -) : IJavaCompletionProvider(cursor, completingFile, compiler, settings) { - - override fun doComplete( - task: CompileTask, - path: TreePath, - partial: String, - endsWithParen: Boolean, - ): CompletionResult { - val trees = Trees.instance(task.task) - val list: MutableList = ArrayList() - val scope = trees.getScope(path) - val matchLevels = HashMap() - val filter = - Predicate { - if (it == null || it.isEmpty()) { - return@Predicate false - } - - var name = it - if (it.contains('(')) { - name = it.substring(0, it.lastIndexOf('(')) - } - - val level = matchLevel(name, partial) - matchLevels[name.toString()] = level - return@Predicate level != NO_MATCH - } - - abortCompletionIfCancelled() - for (member in ScopeHelper.scopeMembers(task, scope, filter)) { - var name = member.simpleName.toString() - if (name.contains('(')) { - name = name.substring(0, name.lastIndexOf('(')) - } - - val matchLevel = matchLevels.getOrDefault(name, NO_MATCH) - - if (member.kind == METHOD) { - val method = member as ExecutableElement - val parentPath = path.parentPath /*method*/.parentPath /*class*/ - list.add(overrideIfPossible(task, parentPath, method, endsWithParen, matchLevel, partial)) - } else { - list.add(item(task, member, matchLevel)) - } - } - - log.info("...found {} scope members", list.size) - - return CompletionResult(list) - } - - /** - * Override the given method if it is overridable. - * - * @param task The compilation task. - * @param parentPath The tree path of the parent class. - * @param method The method to override if possible. - * @param endsWithParen Does the statement at cursor ends with a parenthesis? - * @return The completion item. - */ - private fun overrideIfPossible( - task: CompileTask, - parentPath: TreePath, - method: ExecutableElement, - endsWithParen: Boolean, - matchLevel: MatchLevel, - partial: String - ): CompletionItem { - if (parentPath.leaf.kind != CLASS) { - // Can only override if the cursor is directly in a class declaration - return method(task, listOf(method), !endsWithParen, matchLevel, partial) - } - - abortCompletionIfCancelled() - val types = task.task.types - val parentElement = - Trees.instance(task.task).getElement(parentPath) - ?: // Can't get further information for overriding this method - return method(task, listOf(method), !endsWithParen, matchLevel, partial) - val type = parentElement.asType() as DeclaredType - val enclosing = method.enclosingElement - val isFinalClass = enclosing.modifiers.contains(FINAL) - val isNotOverridable = - (method.modifiers.contains(STATIC) || - method.modifiers.contains(FINAL) || - method.modifiers.contains(PRIVATE)) - if ( - isFinalClass || - isNotOverridable || - !types.isAssignable(type, enclosing.asType()) || - parentPath.leaf !is ClassTree - ) { - // Override is not possible - return method(task, listOf(method), !endsWithParen, matchLevel, partial) - } - - // Print the method details and the annotations - // Print the method details and the annotations - val builder: Builder - try { - builder = buildMethod(method, types, type) - } catch (error: Throwable) { - log.error("Cannot override method:{} err={}", method.simpleName, error.message) - return method(task, listOf(method), !endsWithParen, matchLevel, partial) - } - - val imports = mutableSetOf() - val methodSpec = builder.build() - val insertText = print(methodSpec, imports, false) - - abortCompletionIfCancelled() - - val item = JavaCompletionItem() - item.ideLabel = methodSpec.name - item.completionKind = com.itsaky.androidide.lsp.models.CompletionItemKind.METHOD - item.detail = method.returnType.toString() + " " + method - item.ideSortText = item.ideLabel - item.insertText = insertText - item.insertTextFormat = SNIPPET - item.snippetDescription = describeSnippet(partial) - item.matchLevel = matchLevel - item.data = data(task, method, 1) - if (item.additionalTextEdits == null) { - item.additionalTextEdits = mutableListOf() - } - - imports.removeIf { "java.lang." == it || fileImports.contains(it) || filePackage == it } - item.additionalEditHandler = MultipleClassImportEditHandler(imports, fileImports, file) - return item - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.providers.completion + +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.api.describeSnippet +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.java.edits.MultipleClassImportEditHandler +import org.appdevforall.codeonthego.lsp.java.models.JavaCompletionItem +import org.appdevforall.codeonthego.lsp.java.utils.JavaPoetUtils.Companion.buildMethod +import org.appdevforall.codeonthego.lsp.java.utils.JavaPoetUtils.Companion.print +import org.appdevforall.codeonthego.lsp.java.utils.ScopeHelper +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.InsertTextFormat.SNIPPET +import org.appdevforall.codeonthego.lsp.models.MatchLevel +import org.appdevforall.codeonthego.lsp.models.MatchLevel.NO_MATCH +import com.squareup.javapoet.MethodSpec.Builder +import jdkx.lang.model.element.ElementKind.METHOD +import jdkx.lang.model.element.ExecutableElement +import jdkx.lang.model.element.Modifier.FINAL +import jdkx.lang.model.element.Modifier.PRIVATE +import jdkx.lang.model.element.Modifier.STATIC +import jdkx.lang.model.type.DeclaredType +import openjdk.source.tree.ClassTree +import openjdk.source.tree.Tree.Kind.CLASS +import openjdk.source.util.TreePath +import openjdk.source.util.Trees +import java.nio.file.Path +import java.util.function.Predicate + +/** + * Provides completions using [openjdk.source.tree.Scope]. + * + * @author Akash Yadav + */ +class ScopeCompletionProvider( + completingFile: Path, + cursor: Long, + compiler: JavaCompilerService, + settings: IServerSettings, +) : IJavaCompletionProvider(cursor, completingFile, compiler, settings) { + + override fun doComplete( + task: CompileTask, + path: TreePath, + partial: String, + endsWithParen: Boolean, + ): CompletionResult { + val trees = Trees.instance(task.task) + val list: MutableList = ArrayList() + val scope = trees.getScope(path) + val matchLevels = HashMap() + val filter = + Predicate { + if (it == null || it.isEmpty()) { + return@Predicate false + } + + var name = it + if (it.contains('(')) { + name = it.substring(0, it.lastIndexOf('(')) + } + + val level = matchLevel(name, partial) + matchLevels[name.toString()] = level + return@Predicate level != NO_MATCH + } + + abortCompletionIfCancelled() + for (member in ScopeHelper.scopeMembers(task, scope, filter)) { + var name = member.simpleName.toString() + if (name.contains('(')) { + name = name.substring(0, name.lastIndexOf('(')) + } + + val matchLevel = matchLevels.getOrDefault(name, NO_MATCH) + + if (member.kind == METHOD) { + val method = member as ExecutableElement + val parentPath = path.parentPath /*method*/.parentPath /*class*/ + list.add(overrideIfPossible(task, parentPath, method, endsWithParen, matchLevel, partial)) + } else { + list.add(item(task, member, matchLevel)) + } + } + + log.info("...found {} scope members", list.size) + + return CompletionResult(list) + } + + /** + * Override the given method if it is overridable. + * + * @param task The compilation task. + * @param parentPath The tree path of the parent class. + * @param method The method to override if possible. + * @param endsWithParen Does the statement at cursor ends with a parenthesis? + * @return The completion item. + */ + private fun overrideIfPossible( + task: CompileTask, + parentPath: TreePath, + method: ExecutableElement, + endsWithParen: Boolean, + matchLevel: MatchLevel, + partial: String + ): CompletionItem { + if (parentPath.leaf.kind != CLASS) { + // Can only override if the cursor is directly in a class declaration + return method(task, listOf(method), !endsWithParen, matchLevel, partial) + } + + abortCompletionIfCancelled() + val types = task.task.types + val parentElement = + Trees.instance(task.task).getElement(parentPath) + ?: // Can't get further information for overriding this method + return method(task, listOf(method), !endsWithParen, matchLevel, partial) + val type = parentElement.asType() as DeclaredType + val enclosing = method.enclosingElement + val isFinalClass = enclosing.modifiers.contains(FINAL) + val isNotOverridable = + (method.modifiers.contains(STATIC) || + method.modifiers.contains(FINAL) || + method.modifiers.contains(PRIVATE)) + if ( + isFinalClass || + isNotOverridable || + !types.isAssignable(type, enclosing.asType()) || + parentPath.leaf !is ClassTree + ) { + // Override is not possible + return method(task, listOf(method), !endsWithParen, matchLevel, partial) + } + + // Print the method details and the annotations + // Print the method details and the annotations + val builder: Builder + try { + builder = buildMethod(method, types, type) + } catch (error: Throwable) { + log.error("Cannot override method:{} err={}", method.simpleName, error.message) + return method(task, listOf(method), !endsWithParen, matchLevel, partial) + } + + val imports = mutableSetOf() + val methodSpec = builder.build() + val insertText = print(methodSpec, imports, false) + + abortCompletionIfCancelled() + + val item = JavaCompletionItem() + item.ideLabel = methodSpec.name + item.completionKind = org.appdevforall.codeonthego.lsp.models.CompletionItemKind.METHOD + item.detail = method.returnType.toString() + " " + method + item.ideSortText = item.ideLabel + item.insertText = insertText + item.insertTextFormat = SNIPPET + item.snippetDescription = describeSnippet(partial) + item.matchLevel = matchLevel + item.data = data(task, method, 1) + if (item.additionalTextEdits == null) { + item.additionalTextEdits = mutableListOf() + } + + imports.removeIf { "java.lang." == it || fileImports.contains(it) || filePackage == it } + item.additionalEditHandler = MultipleClassImportEditHandler(imports, fileImports, file) + return item + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/SnippetCompletionProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/SnippetCompletionProvider.kt similarity index 80% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/SnippetCompletionProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/SnippetCompletionProvider.kt index fae50b8c27..5263f6af46 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/SnippetCompletionProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/SnippetCompletionProvider.kt @@ -15,18 +15,18 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.providers.completion +package org.appdevforall.codeonthego.lsp.java.providers.completion -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.java.providers.snippet.JavaSnippetRepository -import com.itsaky.androidide.lsp.java.providers.snippet.JavaSnippetScope -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.MatchLevel -import com.itsaky.androidide.lsp.snippets.ISnippet -import com.itsaky.androidide.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.java.providers.snippet.JavaSnippetRepository +import org.appdevforall.codeonthego.lsp.java.providers.snippet.JavaSnippetScope +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.MatchLevel +import org.appdevforall.codeonthego.lsp.snippets.ISnippet +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences import io.github.rosemoe.sora.text.TextUtils import openjdk.source.tree.ClassTree import openjdk.source.tree.CompilationUnitTree diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/StaticImportCompletionProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/StaticImportCompletionProvider.kt similarity index 84% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/StaticImportCompletionProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/StaticImportCompletionProvider.kt index ba3a66dd96..9f65c7315c 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/StaticImportCompletionProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/StaticImportCompletionProvider.kt @@ -1,126 +1,126 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.providers.completion - -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.java.providers.CompletionProvider -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.MatchLevel -import com.itsaky.androidide.lsp.models.MatchLevel.NO_MATCH -import jdkx.lang.model.element.Element -import jdkx.lang.model.element.ElementKind.METHOD -import jdkx.lang.model.element.ExecutableElement -import jdkx.lang.model.element.Modifier.STATIC -import jdkx.lang.model.element.Name -import jdkx.lang.model.element.TypeElement -import openjdk.source.tree.CompilationUnitTree -import openjdk.source.tree.MemberSelectTree -import openjdk.source.util.TreePath -import openjdk.source.util.Trees -import java.nio.file.Path - -/** - * Completes static imports. - * - * @author Akash Yadav - */ -class StaticImportCompletionProvider( - completingFile: Path, - cursor: Long, - compiler: JavaCompilerService, - settings: IServerSettings, - val root: CompilationUnitTree, -) : IJavaCompletionProvider(cursor, completingFile, compiler, settings) { - - override fun doComplete( - task: CompileTask, - path: TreePath, - partial: String, - endsWithParen: Boolean, - ): CompletionResult { - val list = mutableListOf() - val trees = Trees.instance(task.task) - val methods = mutableMapOf>() - val matchRatios: MutableMap = mutableMapOf() - - abortCompletionIfCancelled() - - outer@ for (i in root.imports) { - if (!i.isStatic) { - continue - } - - val id = i.qualifiedIdentifier as MemberSelectTree - if (!importMatchesPartial(id.identifier, partial)) { - continue - } - - val exprPath = trees.getPath(root, id.expression) - val type = trees.getElement(exprPath) as TypeElement - - for (member in type.enclosedElements) { - if (!member.modifiers.contains(STATIC)) { - continue - } - - if (!memberMatchesImport(id.identifier, member)) { - continue - } - - val matchLevel = matchLevel(member.simpleName, partial) - if (matchLevel == NO_MATCH) { - continue - } - - if (member.kind == METHOD) { - putMethod(member as ExecutableElement, methods) - matchRatios.putIfAbsent(member.simpleName.toString(), matchLevel) - } else { - list.add(item(task, member, matchLevel)) - } - if (list.size + methods.size > CompletionProvider.MAX_COMPLETION_ITEMS) { - break@outer - } - } - } - - for ((key, value) in methods) { - val matchLevel = matchRatios.getOrDefault(key, NO_MATCH) - if (matchLevel == NO_MATCH) { - continue - } - - list.add(method(task, value, !endsWithParen, matchLevel, partial)) - } - - log.info("...found {} static imports", list.size) - - return CompletionResult(list) - } - - private fun importMatchesPartial(staticImport: Name, partial: String): Boolean { - return (staticImport.contentEquals("*") || matchLevel(staticImport, partial) != NO_MATCH) - } - - private fun memberMatchesImport(staticImport: Name, member: Element): Boolean { - return staticImport.contentEquals("*") || staticImport.contentEquals(member.simpleName) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.providers.completion + +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.java.providers.CompletionProvider +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.MatchLevel +import org.appdevforall.codeonthego.lsp.models.MatchLevel.NO_MATCH +import jdkx.lang.model.element.Element +import jdkx.lang.model.element.ElementKind.METHOD +import jdkx.lang.model.element.ExecutableElement +import jdkx.lang.model.element.Modifier.STATIC +import jdkx.lang.model.element.Name +import jdkx.lang.model.element.TypeElement +import openjdk.source.tree.CompilationUnitTree +import openjdk.source.tree.MemberSelectTree +import openjdk.source.util.TreePath +import openjdk.source.util.Trees +import java.nio.file.Path + +/** + * Completes static imports. + * + * @author Akash Yadav + */ +class StaticImportCompletionProvider( + completingFile: Path, + cursor: Long, + compiler: JavaCompilerService, + settings: IServerSettings, + val root: CompilationUnitTree, +) : IJavaCompletionProvider(cursor, completingFile, compiler, settings) { + + override fun doComplete( + task: CompileTask, + path: TreePath, + partial: String, + endsWithParen: Boolean, + ): CompletionResult { + val list = mutableListOf() + val trees = Trees.instance(task.task) + val methods = mutableMapOf>() + val matchRatios: MutableMap = mutableMapOf() + + abortCompletionIfCancelled() + + outer@ for (i in root.imports) { + if (!i.isStatic) { + continue + } + + val id = i.qualifiedIdentifier as MemberSelectTree + if (!importMatchesPartial(id.identifier, partial)) { + continue + } + + val exprPath = trees.getPath(root, id.expression) + val type = trees.getElement(exprPath) as TypeElement + + for (member in type.enclosedElements) { + if (!member.modifiers.contains(STATIC)) { + continue + } + + if (!memberMatchesImport(id.identifier, member)) { + continue + } + + val matchLevel = matchLevel(member.simpleName, partial) + if (matchLevel == NO_MATCH) { + continue + } + + if (member.kind == METHOD) { + putMethod(member as ExecutableElement, methods) + matchRatios.putIfAbsent(member.simpleName.toString(), matchLevel) + } else { + list.add(item(task, member, matchLevel)) + } + if (list.size + methods.size > CompletionProvider.MAX_COMPLETION_ITEMS) { + break@outer + } + } + } + + for ((key, value) in methods) { + val matchLevel = matchRatios.getOrDefault(key, NO_MATCH) + if (matchLevel == NO_MATCH) { + continue + } + + list.add(method(task, value, !endsWithParen, matchLevel, partial)) + } + + log.info("...found {} static imports", list.size) + + return CompletionResult(list) + } + + private fun importMatchesPartial(staticImport: Name, partial: String): Boolean { + return (staticImport.contentEquals("*") || matchLevel(staticImport, partial) != NO_MATCH) + } + + private fun memberMatchesImport(staticImport: Name, member: Element): Boolean { + return staticImport.contentEquals("*") || staticImport.contentEquals(member.simpleName) + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/SwitchConstantCompletionProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/SwitchConstantCompletionProvider.kt similarity index 84% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/SwitchConstantCompletionProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/SwitchConstantCompletionProvider.kt index b66912219c..66af7d0c6e 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/completion/SwitchConstantCompletionProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/completion/SwitchConstantCompletionProvider.kt @@ -1,105 +1,105 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.providers.completion - -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.MatchLevel.NO_MATCH -import jdkx.lang.model.element.ElementKind.ENUM -import jdkx.lang.model.element.ElementKind.ENUM_CONSTANT -import jdkx.lang.model.element.TypeElement -import jdkx.lang.model.type.DeclaredType -import openjdk.source.tree.SwitchTree -import openjdk.source.util.TreePath -import openjdk.source.util.Trees -import java.nio.file.Path - -/** - * Provides completions for switch constants. - * - * @author Akash Yadav - */ -class SwitchConstantCompletionProvider( - completingFile: Path, - cursor: Long, - compiler: JavaCompilerService, - settings: IServerSettings, -) : IJavaCompletionProvider(cursor, completingFile, compiler, settings) { - - override fun doComplete( - task: CompileTask, - path: TreePath, - partial: String, - endsWithParen: Boolean, - ): CompletionResult { - val switchTree = path.leaf as SwitchTree - val exprPath = TreePath(path, switchTree.expression) - val type = Trees.instance(task.task).getTypeMirror(exprPath) - - if (type.kind.isPrimitive || type !is DeclaredType) { - // primitive types do not have any members - return completeIdentifier(task, exprPath, partial, endsWithParen) - } - - val element = type.asElement() as TypeElement - - if (element.kind != ENUM) { - // If the switch's expression is not an enum type - // we will not get any constants to complete - // In this case, we fall back to completing identifiers - // At this point, we are sure that the case expression will definitely be an identifier - // tree - // see visitCase (CaseTree, Long) in FindCompletionsAt.java - return completeIdentifier(task, exprPath, partial, endsWithParen) - } - - log.info("...complete constants of type {}", type) - - val list: MutableList = ArrayList() - - abortCompletionIfCancelled() - - for (member in task.task.elements.getAllMembers(element)) { - if (member.kind != ENUM_CONSTANT) { - continue - } - - val matchLevel = matchLevel(member.simpleName, partial) - if (matchLevel == NO_MATCH) { - continue - } - - list.add(item(task, member, matchLevel)) - } - - return CompletionResult(list) - } - - private fun completeIdentifier( - task: CompileTask, - path: TreePath, - partial: String, - endsWithParen: Boolean - ): CompletionResult { - abortCompletionIfCancelled() - return IdentifierCompletionProvider(file, cursor, compiler, settings) - .complete(task, path, partial, endsWithParen) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.providers.completion + +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.MatchLevel.NO_MATCH +import jdkx.lang.model.element.ElementKind.ENUM +import jdkx.lang.model.element.ElementKind.ENUM_CONSTANT +import jdkx.lang.model.element.TypeElement +import jdkx.lang.model.type.DeclaredType +import openjdk.source.tree.SwitchTree +import openjdk.source.util.TreePath +import openjdk.source.util.Trees +import java.nio.file.Path + +/** + * Provides completions for switch constants. + * + * @author Akash Yadav + */ +class SwitchConstantCompletionProvider( + completingFile: Path, + cursor: Long, + compiler: JavaCompilerService, + settings: IServerSettings, +) : IJavaCompletionProvider(cursor, completingFile, compiler, settings) { + + override fun doComplete( + task: CompileTask, + path: TreePath, + partial: String, + endsWithParen: Boolean, + ): CompletionResult { + val switchTree = path.leaf as SwitchTree + val exprPath = TreePath(path, switchTree.expression) + val type = Trees.instance(task.task).getTypeMirror(exprPath) + + if (type.kind.isPrimitive || type !is DeclaredType) { + // primitive types do not have any members + return completeIdentifier(task, exprPath, partial, endsWithParen) + } + + val element = type.asElement() as TypeElement + + if (element.kind != ENUM) { + // If the switch's expression is not an enum type + // we will not get any constants to complete + // In this case, we fall back to completing identifiers + // At this point, we are sure that the case expression will definitely be an identifier + // tree + // see visitCase (CaseTree, Long) in FindCompletionsAt.java + return completeIdentifier(task, exprPath, partial, endsWithParen) + } + + log.info("...complete constants of type {}", type) + + val list: MutableList = ArrayList() + + abortCompletionIfCancelled() + + for (member in task.task.elements.getAllMembers(element)) { + if (member.kind != ENUM_CONSTANT) { + continue + } + + val matchLevel = matchLevel(member.simpleName, partial) + if (matchLevel == NO_MATCH) { + continue + } + + list.add(item(task, member, matchLevel)) + } + + return CompletionResult(list) + } + + private fun completeIdentifier( + task: CompileTask, + path: TreePath, + partial: String, + endsWithParen: Boolean + ): CompletionResult { + abortCompletionIfCancelled() + return IdentifierCompletionProvider(file, cursor, compiler, settings) + .complete(task, path, partial, endsWithParen) + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/definition/ErroneousDefinitionProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/definition/ErroneousDefinitionProvider.kt similarity index 81% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/definition/ErroneousDefinitionProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/definition/ErroneousDefinitionProvider.kt index 6f01deb224..3af4f41d18 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/definition/ErroneousDefinitionProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/definition/ErroneousDefinitionProvider.kt @@ -15,17 +15,17 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.providers.definition +package org.appdevforall.codeonthego.lsp.java.providers.definition -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.java.compiler.SourceFileObject -import com.itsaky.androidide.lsp.java.providers.DefinitionProvider -import com.itsaky.androidide.lsp.java.utils.FindHelper -import com.itsaky.androidide.models.Location -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.progress.ICancelChecker -import com.itsaky.androidide.utils.DocumentUtils.isSameFile +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.java.compiler.SourceFileObject +import org.appdevforall.codeonthego.lsp.java.providers.DefinitionProvider +import org.appdevforall.codeonthego.lsp.java.utils.FindHelper +import org.appdevforall.codeonthego.models.Location +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.progress.ICancelChecker +import org.appdevforall.codeonthego.utils.DocumentUtils.isSameFile import jdkx.lang.model.element.Element import jdkx.lang.model.element.TypeElement import jdkx.tools.JavaFileObject diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/definition/IJavaDefinitionProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/definition/IJavaDefinitionProvider.kt similarity index 77% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/definition/IJavaDefinitionProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/definition/IJavaDefinitionProvider.kt index e677208489..4530f4d5cb 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/definition/IJavaDefinitionProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/definition/IJavaDefinitionProvider.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.providers.definition +package org.appdevforall.codeonthego.lsp.java.providers.definition -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.java.providers.BaseJavaServiceProvider -import com.itsaky.androidide.lsp.java.providers.DefinitionProvider -import com.itsaky.androidide.models.Location -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.progress.ICancelChecker +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.java.providers.BaseJavaServiceProvider +import org.appdevforall.codeonthego.lsp.java.providers.DefinitionProvider +import org.appdevforall.codeonthego.models.Location +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.progress.ICancelChecker import jdkx.lang.model.element.Element import org.slf4j.Logger import org.slf4j.LoggerFactory diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/definition/LocalDefinitionProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/definition/LocalDefinitionProvider.kt similarity index 80% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/definition/LocalDefinitionProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/definition/LocalDefinitionProvider.kt index 5102b2eec9..3ba7238ae9 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/definition/LocalDefinitionProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/definition/LocalDefinitionProvider.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.providers.definition +package org.appdevforall.codeonthego.lsp.java.providers.definition -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.lsp.java.utils.FindHelper -import com.itsaky.androidide.models.Location -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.progress.ICancelChecker +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.lsp.java.utils.FindHelper +import org.appdevforall.codeonthego.models.Location +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.progress.ICancelChecker import jdkx.lang.model.element.Element import openjdk.source.util.Trees import java.nio.file.Path diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/definition/RemoteDefinitionProvider.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/definition/RemoteDefinitionProvider.kt similarity index 82% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/definition/RemoteDefinitionProvider.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/definition/RemoteDefinitionProvider.kt index da9a574de7..e43a8aaaa0 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/definition/RemoteDefinitionProvider.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/definition/RemoteDefinitionProvider.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.providers.definition +package org.appdevforall.codeonthego.lsp.java.providers.definition -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.models.Location -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.progress.ICancelChecker +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.models.Location +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.progress.ICancelChecker import jdkx.lang.model.element.Element import jdkx.tools.JavaFileObject import java.nio.file.Path diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/snippet/JavaSnippetRepository.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/snippet/JavaSnippetRepository.kt similarity index 81% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/snippet/JavaSnippetRepository.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/snippet/JavaSnippetRepository.kt index 150b1f1483..047cad7a1d 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/snippet/JavaSnippetRepository.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/snippet/JavaSnippetRepository.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.providers.snippet +package org.appdevforall.codeonthego.lsp.java.providers.snippet -import com.itsaky.androidide.lsp.snippets.ISnippet -import com.itsaky.androidide.lsp.snippets.SnippetLanguage -import com.itsaky.androidide.lsp.snippets.SnippetRegistry +import org.appdevforall.codeonthego.lsp.snippets.ISnippet +import org.appdevforall.codeonthego.lsp.snippets.SnippetLanguage +import org.appdevforall.codeonthego.lsp.snippets.SnippetRegistry /** * Repository to store various snippets for Java. diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/snippet/JavaSnippetScope.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/snippet/JavaSnippetScope.kt similarity index 91% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/snippet/JavaSnippetScope.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/snippet/JavaSnippetScope.kt index 0ea5745127..9eb1046019 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/providers/snippet/JavaSnippetScope.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/providers/snippet/JavaSnippetScope.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.providers.snippet +package org.appdevforall.codeonthego.lsp.java.providers.snippet -import com.itsaky.androidide.lsp.snippets.ISnippetScope +import org.appdevforall.codeonthego.lsp.snippets.ISnippetScope /** * Scope for [JavaSnippet]. diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/AnchorMember.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/AnchorMember.kt similarity index 95% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/AnchorMember.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/AnchorMember.kt index bba97d7475..548f0e091d 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/AnchorMember.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/AnchorMember.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor -import com.itsaky.androidide.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.TextSpan import jdkx.lang.model.element.Modifier import openjdk.source.tree.BlockTree import openjdk.source.tree.ClassTree diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/CandidateExpressions.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/CandidateExpressions.kt similarity index 98% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/CandidateExpressions.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/CandidateExpressions.kt index 030cbdc590..bc8003062d 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/CandidateExpressions.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/CandidateExpressions.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor -import com.itsaky.androidide.lsp.refactor.MAX_CANDIDATES -import com.itsaky.androidide.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.MAX_CANDIDATES +import org.appdevforall.codeonthego.lsp.refactor.TextSpan import jdkx.lang.model.element.ElementKind import jdkx.lang.model.element.Modifier import openjdk.source.tree.AnnotatedTypeTree diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodEdit.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodEdit.kt similarity index 91% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodEdit.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodEdit.kt index 48db9f7b92..0194b2a98b 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodEdit.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodEdit.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor -import com.itsaky.androidide.lsp.refactor.RewriteSpan -import com.itsaky.androidide.lsp.refactor.TextSpan -import com.itsaky.androidide.lsp.refactor.detectIndentUnit -import com.itsaky.androidide.lsp.refactor.detectNewline -import com.itsaky.androidide.lsp.refactor.leadingIndentAt +import org.appdevforall.codeonthego.lsp.refactor.RewriteSpan +import org.appdevforall.codeonthego.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.detectIndentUnit +import org.appdevforall.codeonthego.lsp.refactor.detectNewline +import org.appdevforall.codeonthego.lsp.refactor.leadingIndentAt /** * The two replacements an extraction performs: the new method, and the call that replaces the region. diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodPlan.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodPlan.kt similarity index 98% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodPlan.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodPlan.kt index ad82663a29..05f2ce54fe 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodPlan.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodPlan.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor -import com.itsaky.androidide.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.TextSpan /** One derived parameter of the new method. Names are the originals, unchanged (R5). */ data class MethodParameter( diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodPlanner.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodPlanner.kt similarity index 96% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodPlanner.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodPlanner.kt index 0a63270c50..d38b8782e7 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodPlanner.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodPlanner.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor -import com.itsaky.androidide.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask import openjdk.source.tree.CompilationUnitTree import openjdk.source.util.JavacTask import openjdk.source.util.Trees diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractVariableEdit.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractVariableEdit.kt similarity index 84% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractVariableEdit.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractVariableEdit.kt index 0ccda4b6a7..17d54a2534 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractVariableEdit.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractVariableEdit.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor -import com.itsaky.androidide.lsp.refactor.RewriteSpan -import com.itsaky.androidide.lsp.refactor.TextSpan -import com.itsaky.androidide.lsp.refactor.detectNewline -import com.itsaky.androidide.lsp.refactor.existingBlockRewrite -import com.itsaky.androidide.lsp.refactor.replaceOccurrences -import com.itsaky.androidide.lsp.refactor.wrapInBracesRewrite +import org.appdevforall.codeonthego.lsp.refactor.RewriteSpan +import org.appdevforall.codeonthego.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.detectNewline +import org.appdevforall.codeonthego.lsp.refactor.existingBlockRewrite +import org.appdevforall.codeonthego.lsp.refactor.replaceOccurrences +import org.appdevforall.codeonthego.lsp.refactor.wrapInBracesRewrite /** * Builds the extraction rewrite, or null when the inputs cannot produce one. [name] is already diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractVariablePlanner.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractVariablePlanner.kt similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractVariablePlanner.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractVariablePlanner.kt index f67718b230..ab6e44757c 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractVariablePlanner.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractVariablePlanner.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.refactor.BlockAnchor -import com.itsaky.androidide.lsp.refactor.BlockPlacement -import com.itsaky.androidide.lsp.refactor.TextSpan -import com.itsaky.androidide.lsp.refactor.anchorOf -import com.itsaky.androidide.lsp.refactor.blockPlacementFor -import com.itsaky.androidide.lsp.refactor.detectIndentUnit -import com.itsaky.androidide.lsp.refactor.excludeUnsoundOccurrences -import com.itsaky.androidide.lsp.refactor.hoistSkipsWrite -import com.itsaky.androidide.lsp.refactor.hoistsOverLoopWrite +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.refactor.BlockAnchor +import org.appdevforall.codeonthego.lsp.refactor.BlockPlacement +import org.appdevforall.codeonthego.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.anchorOf +import org.appdevforall.codeonthego.lsp.refactor.blockPlacementFor +import org.appdevforall.codeonthego.lsp.refactor.detectIndentUnit +import org.appdevforall.codeonthego.lsp.refactor.excludeUnsoundOccurrences +import org.appdevforall.codeonthego.lsp.refactor.hoistSkipsWrite +import org.appdevforall.codeonthego.lsp.refactor.hoistsOverLoopWrite import jdkx.lang.model.element.Element import jdkx.lang.model.element.ElementKind import jdkx.lang.model.element.ExecutableElement diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractionPlan.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractionPlan.kt similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractionPlan.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractionPlan.kt index 86dcc19607..5ad15ff07a 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractionPlan.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractionPlan.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor import androidx.annotation.StringRes -import com.itsaky.androidide.lsp.refactor.BlockAnchor -import com.itsaky.androidide.lsp.refactor.BracelessBody -import com.itsaky.androidide.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.BlockAnchor +import org.appdevforall.codeonthego.lsp.refactor.BracelessBody +import org.appdevforall.codeonthego.lsp.refactor.TextSpan /** Not every Java scope is a block: a lambda and a `->` switch rule can have an expression body. */ sealed interface AnchorForm { diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractionRegion.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractionRegion.kt similarity index 98% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractionRegion.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractionRegion.kt index d92bace2ba..55a84a231d 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ExtractionRegion.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractionRegion.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor -import com.itsaky.androidide.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.TextSpan import openjdk.source.tree.BlockTree import openjdk.source.tree.CompilationUnitTree import openjdk.source.tree.ExpressionStatementTree diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/JavaExtractMethodUi.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/JavaExtractMethodUi.kt similarity index 85% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/JavaExtractMethodUi.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/JavaExtractMethodUi.kt index 0cd5ba23fe..96aaa746d0 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/JavaExtractMethodUi.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/JavaExtractMethodUi.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor -import com.itsaky.androidide.lsp.ui.ExtractMethodSelection -import com.itsaky.androidide.lsp.ui.MethodCandidateView +import org.appdevforall.codeonthego.lsp.ui.ExtractMethodSelection +import org.appdevforall.codeonthego.lsp.ui.MethodCandidateView /** * The plan as the shared sheet sees it: labels, names and the two halves of the signature, no trees and diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/JavaExtractVariableUi.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/JavaExtractVariableUi.kt similarity index 85% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/JavaExtractVariableUi.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/JavaExtractVariableUi.kt index 4537424715..33239d64f8 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/JavaExtractVariableUi.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/JavaExtractVariableUi.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor import android.content.Context -import com.itsaky.androidide.lsp.refactor.TextSpan -import com.itsaky.androidide.lsp.ui.CandidateView -import com.itsaky.androidide.lsp.ui.ExtractVariableSelection -import com.itsaky.androidide.lsp.ui.NameMessages -import com.itsaky.androidide.lsp.ui.ScopeView +import org.appdevforall.codeonthego.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.ui.CandidateView +import org.appdevforall.codeonthego.lsp.ui.ExtractVariableSelection +import org.appdevforall.codeonthego.lsp.ui.NameMessages +import org.appdevforall.codeonthego.lsp.ui.ScopeView import com.itsaky.androidide.resources.R /** diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/MethodSignature.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/MethodSignature.kt similarity index 98% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/MethodSignature.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/MethodSignature.kt index 494fb7dffe..1a908db9e3 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/MethodSignature.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/MethodSignature.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor -import com.itsaky.androidide.lsp.refactor.TextSpan -import com.itsaky.androidide.lsp.refactor.leadingIndentAt -import com.itsaky.androidide.lsp.refactor.uniqueName +import org.appdevforall.codeonthego.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.leadingIndentAt +import org.appdevforall.codeonthego.lsp.refactor.uniqueName import jdkx.lang.model.element.Element import jdkx.lang.model.element.ElementKind import jdkx.lang.model.element.ExecutableElement diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/NameSuggestion.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/NameSuggestion.kt similarity index 86% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/NameSuggestion.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/NameSuggestion.kt index e131c8123b..6612934668 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/NameSuggestion.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/NameSuggestion.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor -import com.itsaky.androidide.lsp.refactor.FALLBACK_NAME -import com.itsaky.androidide.lsp.refactor.decapitaliseFirst -import com.itsaky.androidide.lsp.refactor.nameFromType -import com.itsaky.androidide.lsp.refactor.stripAccessorPrefix -import com.itsaky.androidide.lsp.refactor.uniqueName -import com.itsaky.androidide.lsp.ui.isIdentifier +import org.appdevforall.codeonthego.lsp.refactor.FALLBACK_NAME +import org.appdevforall.codeonthego.lsp.refactor.decapitaliseFirst +import org.appdevforall.codeonthego.lsp.refactor.nameFromType +import org.appdevforall.codeonthego.lsp.refactor.stripAccessorPrefix +import org.appdevforall.codeonthego.lsp.refactor.uniqueName +import org.appdevforall.codeonthego.lsp.ui.isIdentifier import openjdk.source.tree.ArrayAccessTree import openjdk.source.tree.IdentifierTree import openjdk.source.tree.MemberSelectTree diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/Occurrences.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/Occurrences.kt similarity index 99% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/Occurrences.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/Occurrences.kt index 4d768d28bf..0f339ae1c5 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/Occurrences.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/Occurrences.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor -import com.itsaky.androidide.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.TextSpan import jdkx.lang.model.element.Element import jdkx.lang.model.element.ElementKind import jdkx.lang.model.element.Modifier diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/RegionReferences.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/RegionReferences.kt similarity index 97% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/RegionReferences.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/RegionReferences.kt index d32efc5cc4..26250a50c4 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/RegionReferences.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/RegionReferences.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor -import com.itsaky.androidide.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.TextSpan import jdkx.lang.model.element.Element import jdkx.lang.model.element.VariableElement import openjdk.source.tree.AssignmentTree diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/RegionTypes.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/RegionTypes.kt similarity index 98% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/RegionTypes.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/RegionTypes.kt index 78ca98585e..8cd729f100 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/RegionTypes.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/RegionTypes.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor -import com.itsaky.androidide.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.TextSpan import jdkx.lang.model.element.Element import jdkx.lang.model.element.NestingKind import jdkx.lang.model.element.TypeElement diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ScopeChain.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ScopeChain.kt similarity index 97% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ScopeChain.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ScopeChain.kt index 60b0e7292a..a994598a5e 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ScopeChain.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ScopeChain.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor -import com.itsaky.androidide.lsp.refactor.BlockAnchor -import com.itsaky.androidide.lsp.refactor.BracelessBody -import com.itsaky.androidide.lsp.refactor.TextSpan -import com.itsaky.androidide.lsp.refactor.leadingIndentAt +import org.appdevforall.codeonthego.lsp.refactor.BlockAnchor +import org.appdevforall.codeonthego.lsp.refactor.BracelessBody +import org.appdevforall.codeonthego.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.leadingIndentAt import androidx.annotation.StringRes import com.itsaky.androidide.resources.R diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/SourceNormalizer.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/SourceNormalizer.kt similarity index 98% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/SourceNormalizer.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/SourceNormalizer.kt index 13d388f27e..4463d95cc0 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/SourceNormalizer.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/SourceNormalizer.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor /** * Strips comments and collapses whitespace outside string and character literals. diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ThrownTypes.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ThrownTypes.kt similarity index 99% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ThrownTypes.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ThrownTypes.kt index 40fad2b95e..1c0dddcaba 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/ThrownTypes.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/ThrownTypes.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor -import com.itsaky.androidide.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.TextSpan import jdkx.lang.model.element.Element import jdkx.lang.model.element.ExecutableElement import jdkx.lang.model.element.TypeElement diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/TypeText.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/TypeText.kt similarity index 99% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/TypeText.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/TypeText.kt index 212f7ddf70..67e44b6b74 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/refactor/TypeText.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/refactor/TypeText.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor import jdkx.lang.model.type.DeclaredType import jdkx.lang.model.type.TypeKind diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/AddException.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/AddException.java similarity index 88% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/AddException.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/AddException.java index b2c7f5d6d7..fd9ebeffb1 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/AddException.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/AddException.java @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.rewrite; +package org.appdevforall.codeonthego.lsp.java.rewrite; import androidx.annotation.NonNull; -import com.itsaky.androidide.lsp.java.compiler.CompilerProvider; -import com.itsaky.androidide.lsp.java.compiler.SynchronizedTask; -import com.itsaky.androidide.lsp.java.utils.FindHelper; -import com.itsaky.androidide.lsp.models.TextEdit; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; +import org.appdevforall.codeonthego.lsp.java.compiler.CompilerProvider; +import org.appdevforall.codeonthego.lsp.java.compiler.SynchronizedTask; +import org.appdevforall.codeonthego.lsp.java.utils.FindHelper; +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; import java.nio.file.Path; import java.util.Collections; import java.util.Map; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/AddImport.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/AddImport.java similarity index 78% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/AddImport.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/AddImport.java index ae03d08be0..48a3539e5c 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/AddImport.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/AddImport.java @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.rewrite; +package org.appdevforall.codeonthego.lsp.java.rewrite; import androidx.annotation.NonNull; import androidx.annotation.RestrictTo; -import com.itsaky.androidide.lsp.java.compiler.CompilerProvider; -import com.itsaky.androidide.lsp.java.parser.ParseTask; -import com.itsaky.androidide.lsp.java.utils.InsertUtilsKt; -import com.itsaky.androidide.lsp.models.TextEdit; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; +import org.appdevforall.codeonthego.lsp.java.compiler.CompilerProvider; +import org.appdevforall.codeonthego.lsp.java.parser.ParseTask; +import org.appdevforall.codeonthego.lsp.java.utils.InsertUtilsKt; +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; import java.nio.file.Path; import java.util.Collections; import java.util.Map; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/AddSuppressWarningAnnotation.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/AddSuppressWarningAnnotation.java similarity index 85% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/AddSuppressWarningAnnotation.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/AddSuppressWarningAnnotation.java index 4fab2520ec..65147d4adc 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/AddSuppressWarningAnnotation.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/AddSuppressWarningAnnotation.java @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.rewrite; +package org.appdevforall.codeonthego.lsp.java.rewrite; import androidx.annotation.NonNull; -import com.itsaky.androidide.lsp.java.compiler.CompilerProvider; -import com.itsaky.androidide.lsp.java.compiler.SynchronizedTask; -import com.itsaky.androidide.lsp.java.utils.FindHelper; -import com.itsaky.androidide.lsp.models.TextEdit; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; -import com.itsaky.androidide.preferences.utils.EditorUtilKt; +import org.appdevforall.codeonthego.lsp.java.compiler.CompilerProvider; +import org.appdevforall.codeonthego.lsp.java.compiler.SynchronizedTask; +import org.appdevforall.codeonthego.lsp.java.utils.FindHelper; +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; +import org.appdevforall.codeonthego.preferences.utils.EditorUtilKt; import java.nio.file.Path; import java.util.Collections; import java.util.Map; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/ConvertFieldToBlock.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/ConvertFieldToBlock.java similarity index 83% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/ConvertFieldToBlock.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/ConvertFieldToBlock.java index 5369291828..e6bf372fe8 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/ConvertFieldToBlock.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/ConvertFieldToBlock.java @@ -15,17 +15,17 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.rewrite; +package org.appdevforall.codeonthego.lsp.java.rewrite; -import static com.itsaky.androidide.lsp.java.rewrite.ConvertVariableToStatement.findVariable; -import static com.itsaky.androidide.lsp.java.rewrite.ConvertVariableToStatement.isExpressionStatement; +import static org.appdevforall.codeonthego.lsp.java.rewrite.ConvertVariableToStatement.findVariable; +import static org.appdevforall.codeonthego.lsp.java.rewrite.ConvertVariableToStatement.isExpressionStatement; import androidx.annotation.NonNull; -import com.itsaky.androidide.lsp.java.compiler.CompilerProvider; -import com.itsaky.androidide.lsp.java.parser.ParseTask; -import com.itsaky.androidide.lsp.models.TextEdit; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; +import org.appdevforall.codeonthego.lsp.java.compiler.CompilerProvider; +import org.appdevforall.codeonthego.lsp.java.parser.ParseTask; +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; import java.nio.file.Path; import java.util.Collections; import java.util.Map; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/ConvertVariableToStatement.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/ConvertVariableToStatement.java similarity index 88% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/ConvertVariableToStatement.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/ConvertVariableToStatement.java index 6f23dc1fce..456b38c70a 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/ConvertVariableToStatement.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/ConvertVariableToStatement.java @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.rewrite; +package org.appdevforall.codeonthego.lsp.java.rewrite; import androidx.annotation.NonNull; -import com.itsaky.androidide.lsp.java.compiler.CompilerProvider; -import com.itsaky.androidide.lsp.java.parser.ParseTask; -import com.itsaky.androidide.lsp.java.visitors.FindVariableAtCursor; -import com.itsaky.androidide.lsp.models.TextEdit; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; +import org.appdevforall.codeonthego.lsp.java.compiler.CompilerProvider; +import org.appdevforall.codeonthego.lsp.java.parser.ParseTask; +import org.appdevforall.codeonthego.lsp.java.visitors.FindVariableAtCursor; +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; import java.nio.file.Path; import java.util.Collections; import java.util.Map; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/CreateMissingMethod.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/CreateMissingMethod.java similarity index 90% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/CreateMissingMethod.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/CreateMissingMethod.java index bd3bffa87b..39a0fe5f9d 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/CreateMissingMethod.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/CreateMissingMethod.java @@ -15,23 +15,23 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.rewrite; +package org.appdevforall.codeonthego.lsp.java.rewrite; -import static com.itsaky.androidide.lsp.java.utils.EditHelper.indent; -import static com.itsaky.androidide.lsp.java.utils.EditHelper.insertAfter; -import static com.itsaky.androidide.lsp.java.utils.EditHelper.insertAtEndOfClass; +import static org.appdevforall.codeonthego.lsp.java.utils.EditHelper.indent; +import static org.appdevforall.codeonthego.lsp.java.utils.EditHelper.insertAfter; +import static org.appdevforall.codeonthego.lsp.java.utils.EditHelper.insertAtEndOfClass; import androidx.annotation.NonNull; -import com.itsaky.androidide.lsp.java.compiler.CompileTask; -import com.itsaky.androidide.lsp.java.compiler.CompilerProvider; -import com.itsaky.androidide.lsp.java.compiler.SynchronizedTask; -import com.itsaky.androidide.lsp.java.utils.EditHelper; -import com.itsaky.androidide.lsp.java.visitors.FindMethodCallAt; -import com.itsaky.androidide.lsp.models.TextEdit; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; -import com.itsaky.androidide.preferences.internal.EditorPreferences; -import com.itsaky.androidide.preferences.utils.EditorUtilKt; +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask; +import org.appdevforall.codeonthego.lsp.java.compiler.CompilerProvider; +import org.appdevforall.codeonthego.lsp.java.compiler.SynchronizedTask; +import org.appdevforall.codeonthego.lsp.java.utils.EditHelper; +import org.appdevforall.codeonthego.lsp.java.visitors.FindMethodCallAt; +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences; +import org.appdevforall.codeonthego.preferences.utils.EditorUtilKt; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Collections; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/GenerateRecordConstructor.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/GenerateRecordConstructor.java similarity index 90% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/GenerateRecordConstructor.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/GenerateRecordConstructor.java index 2d4ba69ec3..1bd1d3f5f2 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/GenerateRecordConstructor.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/GenerateRecordConstructor.java @@ -15,18 +15,18 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.rewrite; +package org.appdevforall.codeonthego.lsp.java.rewrite; import androidx.annotation.NonNull; -import com.itsaky.androidide.lsp.java.compiler.CompileTask; -import com.itsaky.androidide.lsp.java.compiler.CompilerProvider; -import com.itsaky.androidide.lsp.java.compiler.SynchronizedTask; -import com.itsaky.androidide.lsp.java.utils.EditHelper; -import com.itsaky.androidide.lsp.models.TextEdit; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; -import com.itsaky.androidide.preferences.internal.EditorPreferences; -import com.itsaky.androidide.preferences.utils.EditorUtilKt; +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask; +import org.appdevforall.codeonthego.lsp.java.compiler.CompilerProvider; +import org.appdevforall.codeonthego.lsp.java.compiler.SynchronizedTask; +import org.appdevforall.codeonthego.lsp.java.utils.EditHelper; +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences; +import org.appdevforall.codeonthego.preferences.utils.EditorUtilKt; import java.io.IOException; import java.nio.file.Path; import java.util.ArrayList; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/ImplementAbstractMethods.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/ImplementAbstractMethods.java similarity index 85% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/ImplementAbstractMethods.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/ImplementAbstractMethods.java index 5524ee3ef9..5540532d9a 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/ImplementAbstractMethods.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/ImplementAbstractMethods.java @@ -1,180 +1,180 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.java.rewrite; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import com.itsaky.androidide.lsp.java.compiler.CompileTask; -import com.itsaky.androidide.lsp.java.compiler.CompilerProvider; -import com.itsaky.androidide.lsp.java.compiler.SynchronizedTask; -import com.itsaky.androidide.lsp.java.utils.EditHelper; -import com.itsaky.androidide.lsp.java.utils.JavaPoetUtils; -import com.itsaky.androidide.lsp.java.visitors.FindAnonymousTypeDeclaration; -import com.itsaky.androidide.lsp.java.visitors.FindTypeDeclarationAt; -import com.itsaky.androidide.lsp.models.CodeActionItem; -import com.itsaky.androidide.lsp.models.Command; -import com.itsaky.androidide.lsp.models.TextEdit; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; -import com.itsaky.androidide.preferences.internal.EditorPreferences; -import com.itsaky.androidide.preferences.utils.EditorUtilKt; -import com.squareup.javapoet.MethodSpec; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.StringJoiner; -import java.util.TreeSet; -import java.util.stream.Collectors; -import jdkx.lang.model.element.Element; -import jdkx.lang.model.element.ElementKind; -import jdkx.lang.model.element.ExecutableElement; -import jdkx.lang.model.element.Modifier; -import jdkx.lang.model.element.TypeElement; -import jdkx.lang.model.util.Elements; -import openjdk.source.tree.ClassTree; -import openjdk.source.tree.CompilationUnitTree; -import openjdk.source.tree.ImportTree; -import openjdk.source.tree.Tree; -import openjdk.source.util.Trees; -import openjdk.tools.javac.util.JCDiagnostic; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ImplementAbstractMethods extends Rewrite { - - private static final Logger LOG = LoggerFactory.getLogger(ImplementAbstractMethods.class); - private final String className; - private final String classFile; - private final long position; - - public ImplementAbstractMethods(@NonNull JCDiagnostic diagnostic) { - Object[] args = diagnostic.getArgs(); - String className = args[0].toString(); - - if (!className.contains(" rewrite(@NonNull CompilerProvider compiler) { - final Path file = compiler.findTypeDeclaration(this.classFile); - if (file == CompilerProvider.NOT_FOUND) { - LOG.warn("Unable to find source file for class: {} classFile={}", this.className, - this.classFile); - return CANCELLED; - } - - final SynchronizedTask synchronizedTask = compiler.compile(file); - return synchronizedTask.get( - task -> { - StringJoiner insertText = new StringJoiner("\n"); - Elements elements = task.task.getElements(); - Trees trees = Trees.instance(task.task); - TypeElement thisClass = elements.getTypeElement(this.className); - - ClassTree thisTree = getClassTree(task, file); - if (thisTree == null) { - thisTree = trees.getTree(thisClass); - } - - final Set imports = new TreeSet<>(); - int indent = EditHelper.indent(task.task, task.root(), thisTree) - + EditorPreferences.INSTANCE.getTabSize(); - for (Element member : elements.getAllMembers(thisClass)) { - if (member.getKind() == ElementKind.METHOD - && member.getModifiers().contains(Modifier.ABSTRACT)) { - ExecutableElement method = (ExecutableElement) member; - final MethodSpec methodSpec = MethodSpec.overriding(method).build(); - String text = "\n" + JavaPoetUtils.print(methodSpec, imports, false); - text = text.replaceAll("\n", "\n" + EditorUtilKt.indentationString(indent)); - insertText.add(text); - } - } - - Position insert = EditHelper.insertAtEndOfClass(task.task, task.root(), thisTree); - final List edits = new ArrayList<>(); - edits.add(new TextEdit(new Range(insert, insert), insertText + "\n")); - addImports(compiler, task, file, imports, edits); - - return Collections.singletonMap(file, edits.toArray(new TextEdit[0])); - }); - } - - private void addImports( - CompilerProvider compiler, - CompileTask task, - Path file, - Set imports, - List edits) { - imports = - imports.stream().filter(name -> !name.startsWith("java.lang.")).collect(Collectors.toSet()); - for (String name : imports) { - final List importEdits = - EditHelper.addImportIfNeeded(compiler, file, getFileImports(task, file), name); - if (importEdits != null && !importEdits.isEmpty()) { - edits.addAll(importEdits); - } - } - } - - private Set getFileImports(@NonNull CompileTask task, Path file) { - return task.root(file).getImports().stream() - .map(ImportTree::getQualifiedIdentifier) - .map(Tree::toString) - .collect(Collectors.toSet()); - } - - @Nullable - private ClassTree getClassTree(@NonNull CompileTask task, Path file) { - ClassTree thisTree = null; - CompilationUnitTree root = task.root(file); - if (root == null) { - return null; - } - - if (position != 0) { - final FindTypeDeclarationAt scanner = new FindTypeDeclarationAt(task.task); - thisTree = scanner.scan(root, position); - } - - if (thisTree == null) { - final FindAnonymousTypeDeclaration scanner = - new FindAnonymousTypeDeclaration(task.task, root); - thisTree = scanner.scan(root, position); - } - - return thisTree; - } - - @Override - protected void finalizeCodeAction(@NonNull CodeActionItem action) { - action.setCommand(new Command("Format code", Command.FORMAT_CODE)); - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.java.rewrite; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask; +import org.appdevforall.codeonthego.lsp.java.compiler.CompilerProvider; +import org.appdevforall.codeonthego.lsp.java.compiler.SynchronizedTask; +import org.appdevforall.codeonthego.lsp.java.utils.EditHelper; +import org.appdevforall.codeonthego.lsp.java.utils.JavaPoetUtils; +import org.appdevforall.codeonthego.lsp.java.visitors.FindAnonymousTypeDeclaration; +import org.appdevforall.codeonthego.lsp.java.visitors.FindTypeDeclarationAt; +import org.appdevforall.codeonthego.lsp.models.CodeActionItem; +import org.appdevforall.codeonthego.lsp.models.Command; +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences; +import org.appdevforall.codeonthego.preferences.utils.EditorUtilKt; +import com.squareup.javapoet.MethodSpec; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.StringJoiner; +import java.util.TreeSet; +import java.util.stream.Collectors; +import jdkx.lang.model.element.Element; +import jdkx.lang.model.element.ElementKind; +import jdkx.lang.model.element.ExecutableElement; +import jdkx.lang.model.element.Modifier; +import jdkx.lang.model.element.TypeElement; +import jdkx.lang.model.util.Elements; +import openjdk.source.tree.ClassTree; +import openjdk.source.tree.CompilationUnitTree; +import openjdk.source.tree.ImportTree; +import openjdk.source.tree.Tree; +import openjdk.source.util.Trees; +import openjdk.tools.javac.util.JCDiagnostic; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ImplementAbstractMethods extends Rewrite { + + private static final Logger LOG = LoggerFactory.getLogger(ImplementAbstractMethods.class); + private final String className; + private final String classFile; + private final long position; + + public ImplementAbstractMethods(@NonNull JCDiagnostic diagnostic) { + Object[] args = diagnostic.getArgs(); + String className = args[0].toString(); + + if (!className.contains(" rewrite(@NonNull CompilerProvider compiler) { + final Path file = compiler.findTypeDeclaration(this.classFile); + if (file == CompilerProvider.NOT_FOUND) { + LOG.warn("Unable to find source file for class: {} classFile={}", this.className, + this.classFile); + return CANCELLED; + } + + final SynchronizedTask synchronizedTask = compiler.compile(file); + return synchronizedTask.get( + task -> { + StringJoiner insertText = new StringJoiner("\n"); + Elements elements = task.task.getElements(); + Trees trees = Trees.instance(task.task); + TypeElement thisClass = elements.getTypeElement(this.className); + + ClassTree thisTree = getClassTree(task, file); + if (thisTree == null) { + thisTree = trees.getTree(thisClass); + } + + final Set imports = new TreeSet<>(); + int indent = EditHelper.indent(task.task, task.root(), thisTree) + + EditorPreferences.INSTANCE.getTabSize(); + for (Element member : elements.getAllMembers(thisClass)) { + if (member.getKind() == ElementKind.METHOD + && member.getModifiers().contains(Modifier.ABSTRACT)) { + ExecutableElement method = (ExecutableElement) member; + final MethodSpec methodSpec = MethodSpec.overriding(method).build(); + String text = "\n" + JavaPoetUtils.print(methodSpec, imports, false); + text = text.replaceAll("\n", "\n" + EditorUtilKt.indentationString(indent)); + insertText.add(text); + } + } + + Position insert = EditHelper.insertAtEndOfClass(task.task, task.root(), thisTree); + final List edits = new ArrayList<>(); + edits.add(new TextEdit(new Range(insert, insert), insertText + "\n")); + addImports(compiler, task, file, imports, edits); + + return Collections.singletonMap(file, edits.toArray(new TextEdit[0])); + }); + } + + private void addImports( + CompilerProvider compiler, + CompileTask task, + Path file, + Set imports, + List edits) { + imports = + imports.stream().filter(name -> !name.startsWith("java.lang.")).collect(Collectors.toSet()); + for (String name : imports) { + final List importEdits = + EditHelper.addImportIfNeeded(compiler, file, getFileImports(task, file), name); + if (importEdits != null && !importEdits.isEmpty()) { + edits.addAll(importEdits); + } + } + } + + private Set getFileImports(@NonNull CompileTask task, Path file) { + return task.root(file).getImports().stream() + .map(ImportTree::getQualifiedIdentifier) + .map(Tree::toString) + .collect(Collectors.toSet()); + } + + @Nullable + private ClassTree getClassTree(@NonNull CompileTask task, Path file) { + ClassTree thisTree = null; + CompilationUnitTree root = task.root(file); + if (root == null) { + return null; + } + + if (position != 0) { + final FindTypeDeclarationAt scanner = new FindTypeDeclarationAt(task.task); + thisTree = scanner.scan(root, position); + } + + if (thisTree == null) { + final FindAnonymousTypeDeclaration scanner = + new FindAnonymousTypeDeclaration(task.task, root); + thisTree = scanner.scan(root, position); + } + + return thisTree; + } + + @Override + protected void finalizeCodeAction(@NonNull CodeActionItem action) { + action.setCommand(new Command("Format code", Command.FORMAT_CODE)); + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/RemoveClass.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/RemoveClass.java similarity index 78% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/RemoveClass.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/RemoveClass.java index 0adbf192dd..6209b9fb9c 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/RemoveClass.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/RemoveClass.java @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.rewrite; +package org.appdevforall.codeonthego.lsp.java.rewrite; import androidx.annotation.NonNull; -import com.itsaky.androidide.lsp.java.compiler.CompilerProvider; -import com.itsaky.androidide.lsp.java.parser.ParseTask; -import com.itsaky.androidide.lsp.java.utils.EditHelper; -import com.itsaky.androidide.lsp.java.visitors.FindTypeDeclarationAt; -import com.itsaky.androidide.lsp.models.TextEdit; +import org.appdevforall.codeonthego.lsp.java.compiler.CompilerProvider; +import org.appdevforall.codeonthego.lsp.java.parser.ParseTask; +import org.appdevforall.codeonthego.lsp.java.utils.EditHelper; +import org.appdevforall.codeonthego.lsp.java.visitors.FindTypeDeclarationAt; +import org.appdevforall.codeonthego.lsp.models.TextEdit; import java.nio.file.Path; import java.util.Collections; import java.util.Map; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/RemoveException.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/RemoveException.java similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/RemoveException.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/RemoveException.java index e98aeafcb3..09b7104ad3 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/RemoveException.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/RemoveException.java @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.rewrite; +package org.appdevforall.codeonthego.lsp.java.rewrite; import androidx.annotation.NonNull; -import com.itsaky.androidide.lsp.java.compiler.CompilerProvider; -import com.itsaky.androidide.lsp.java.compiler.SynchronizedTask; -import com.itsaky.androidide.lsp.java.utils.FindHelper; -import com.itsaky.androidide.lsp.models.TextEdit; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; +import org.appdevforall.codeonthego.lsp.java.compiler.CompilerProvider; +import org.appdevforall.codeonthego.lsp.java.compiler.SynchronizedTask; +import org.appdevforall.codeonthego.lsp.java.utils.FindHelper; +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; import java.io.IOException; import java.nio.file.Path; import java.util.Collections; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/RemoveMethod.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/RemoveMethod.java similarity index 86% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/RemoveMethod.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/RemoveMethod.java index 8488bd29e2..f69596522e 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/RemoveMethod.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/RemoveMethod.java @@ -14,13 +14,13 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.rewrite; +package org.appdevforall.codeonthego.lsp.java.rewrite; import androidx.annotation.NonNull; -import com.itsaky.androidide.lsp.java.compiler.CompilerProvider; -import com.itsaky.androidide.lsp.java.utils.EditHelper; -import com.itsaky.androidide.lsp.java.utils.FindHelper; -import com.itsaky.androidide.lsp.models.TextEdit; +import org.appdevforall.codeonthego.lsp.java.compiler.CompilerProvider; +import org.appdevforall.codeonthego.lsp.java.utils.EditHelper; +import org.appdevforall.codeonthego.lsp.java.utils.FindHelper; +import org.appdevforall.codeonthego.lsp.models.TextEdit; import java.nio.file.Path; import java.util.Collections; import java.util.Map; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/Rewrite.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/Rewrite.kt similarity index 85% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/Rewrite.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/Rewrite.kt index c9ecc85d13..67ee04617c 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/rewrite/Rewrite.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/rewrite/Rewrite.kt @@ -1,84 +1,84 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.java.rewrite - -import com.itsaky.androidide.lsp.java.compiler.CompilerProvider -import com.itsaky.androidide.lsp.models.CodeActionItem -import com.itsaky.androidide.lsp.models.CodeActionKind -import com.itsaky.androidide.lsp.models.DocumentChange -import com.itsaky.androidide.lsp.models.TextEdit -import java.nio.file.Path - -/** - * A source code rewrite. - * - * @author Akash Yadav - */ -abstract class Rewrite { - - /** - * Converts the edits to code action item. - * - * @param compiler The compiler service. - * @param title The title for the code action. - * @return The code action item. - */ - fun asCodeActions(compiler: CompilerProvider, title: String): CodeActionItem? { - val edits = rewrite(compiler) - if (edits.isEmpty()) { - return null - } - - val changes: MutableList = ArrayList(0) - for (file in edits.keys) { - val textEdits = edits[file] ?: continue - val change = DocumentChange() - change.file = file - change.edits = textEdits.asList() - changes.add(change) - } - val action = CodeActionItem() - action.title = title - action.kind = CodeActionKind.QuickFix - action.changes = changes - finalizeCodeAction(action) - return action - } - - /** - * Perform a rewrite across the entire codebase. The given compiler can be used for anything - * except compiling other files. If you try to compile any file, the current thread will be - * blocked. - * - * @param compiler The compiler. - */ - abstract fun rewrite(compiler: CompilerProvider): Map> - - /** - * Called after the code action is created. Subclasses can implement this to do some finalization - * tasks on the given code action. - * - * @param action The code action. - */ - protected open fun finalizeCodeAction(action: CodeActionItem) {} - - companion object { - - /** CANCELLED signals that the rewrite couldn't be completed. */ - @JvmField var CANCELLED = emptyMap>() - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.java.rewrite + +import org.appdevforall.codeonthego.lsp.java.compiler.CompilerProvider +import org.appdevforall.codeonthego.lsp.models.CodeActionItem +import org.appdevforall.codeonthego.lsp.models.CodeActionKind +import org.appdevforall.codeonthego.lsp.models.DocumentChange +import org.appdevforall.codeonthego.lsp.models.TextEdit +import java.nio.file.Path + +/** + * A source code rewrite. + * + * @author Akash Yadav + */ +abstract class Rewrite { + + /** + * Converts the edits to code action item. + * + * @param compiler The compiler service. + * @param title The title for the code action. + * @return The code action item. + */ + fun asCodeActions(compiler: CompilerProvider, title: String): CodeActionItem? { + val edits = rewrite(compiler) + if (edits.isEmpty()) { + return null + } + + val changes: MutableList = ArrayList(0) + for (file in edits.keys) { + val textEdits = edits[file] ?: continue + val change = DocumentChange() + change.file = file + change.edits = textEdits.asList() + changes.add(change) + } + val action = CodeActionItem() + action.title = title + action.kind = CodeActionKind.QuickFix + action.changes = changes + finalizeCodeAction(action) + return action + } + + /** + * Perform a rewrite across the entire codebase. The given compiler can be used for anything + * except compiling other files. If you try to compile any file, the current thread will be + * blocked. + * + * @param compiler The compiler. + */ + abstract fun rewrite(compiler: CompilerProvider): Map> + + /** + * Called after the code action is created. Subclasses can implement this to do some finalization + * tasks on the given code action. + * + * @param action The code action. + */ + protected open fun finalizeCodeAction(action: CodeActionItem) {} + + companion object { + + /** CANCELLED signals that the rewrite couldn't be completed. */ + @JvmField var CANCELLED = emptyMap>() + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/ASTFixer.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/ASTFixer.java similarity index 98% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/ASTFixer.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/ASTFixer.java index 3fbf10daaf..d6cc60d85c 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/ASTFixer.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/ASTFixer.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.utils; +package org.appdevforall.codeonthego.lsp.java.utils; import androidx.annotation.NonNull; import com.google.common.collect.ImmutableList; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/AnalyzeTimer.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/AnalyzeTimer.java similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/AnalyzeTimer.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/AnalyzeTimer.java index f3a7cced45..3c8665f8ce 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/AnalyzeTimer.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/AnalyzeTimer.java @@ -1,93 +1,93 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.utils; - -import android.os.Handler; -import androidx.annotation.NonNull; -import java.util.Objects; - -/** - * A timer which helps the language server to run a lint check after a specified interval. - * - * @author Akash Yadav - */ -public class AnalyzeTimer { - - public static final long DEFAULT_INTERVAL = 400; - @NonNull private final Handler timerHandler; - @NonNull private final Runnable timerCallback; - private long interval; - private boolean started; - - /** - * Creates a new AnalyzeTimer instance. - * - * @param timerCallback The callback that will be invoked after the timer has ended. - */ - public AnalyzeTimer(@NonNull Runnable timerCallback) { - this.timerHandler = new Handler(); - this.interval = DEFAULT_INTERVAL; - this.timerCallback = timerCallback; - - Objects.requireNonNull(this.timerCallback, "Callback cannot be null"); - } - - /** - * Get the interval set to this timer. - * - * @return The interval. - */ - public long getInterval() { - return interval; - } - - /** - * Set the interval for the lint timer. - * - * @param interval The interval after which timerCallback will be called. - */ - public void setInterval(long interval) { - this.interval = interval; - - if (this.interval <= 0) { - throw new IllegalArgumentException("Invalid interval specified for timer."); - } - } - - /** Starts the timer. */ - public void start() { - restart(); - } - - /** Restarts the timer. */ - public void restart() { - timerHandler.removeCallbacks(timerCallback); - timerHandler.postDelayed(timerCallback, interval); - started = true; - } - - /** Shutdown the timer. Cancels any running timers. */ - public void cancel() { - timerHandler.removeCallbacks(timerCallback); - started = false; - } - - public boolean isStarted() { - return started; - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.utils; + +import android.os.Handler; +import androidx.annotation.NonNull; +import java.util.Objects; + +/** + * A timer which helps the language server to run a lint check after a specified interval. + * + * @author Akash Yadav + */ +public class AnalyzeTimer { + + public static final long DEFAULT_INTERVAL = 400; + @NonNull private final Handler timerHandler; + @NonNull private final Runnable timerCallback; + private long interval; + private boolean started; + + /** + * Creates a new AnalyzeTimer instance. + * + * @param timerCallback The callback that will be invoked after the timer has ended. + */ + public AnalyzeTimer(@NonNull Runnable timerCallback) { + this.timerHandler = new Handler(); + this.interval = DEFAULT_INTERVAL; + this.timerCallback = timerCallback; + + Objects.requireNonNull(this.timerCallback, "Callback cannot be null"); + } + + /** + * Get the interval set to this timer. + * + * @return The interval. + */ + public long getInterval() { + return interval; + } + + /** + * Set the interval for the lint timer. + * + * @param interval The interval after which timerCallback will be called. + */ + public void setInterval(long interval) { + this.interval = interval; + + if (this.interval <= 0) { + throw new IllegalArgumentException("Invalid interval specified for timer."); + } + } + + /** Starts the timer. */ + public void start() { + restart(); + } + + /** Restarts the timer. */ + public void restart() { + timerHandler.removeCallbacks(timerCallback); + timerHandler.postDelayed(timerCallback, interval); + started = true; + } + + /** Shutdown the timer. Cancels any running timers. */ + public void cancel() { + timerHandler.removeCallbacks(timerCallback); + started = false; + } + + public boolean isStarted() { + return started; + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/CancelChecker.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/CancelChecker.kt similarity index 90% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/CancelChecker.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/CancelChecker.kt index 1646c2c1a2..b3d8a25850 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/CancelChecker.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/CancelChecker.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.utils +package org.appdevforall.codeonthego.lsp.java.utils -import com.itsaky.androidide.javac.services.CancelAbort +import org.appdevforall.codeonthego.javac.services.CancelAbort import java.util.concurrent.CancellationException /** @author Akash Yadav */ diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/CodeActionUtils.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/CodeActionUtils.java similarity index 89% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/CodeActionUtils.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/CodeActionUtils.java index e7267416c9..290d4ec954 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/CodeActionUtils.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/CodeActionUtils.java @@ -1,208 +1,208 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.utils; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import com.itsaky.androidide.javac.services.util.JavaDiagnosticUtils; -import com.itsaky.androidide.lsp.java.compiler.CompileTask; -import com.itsaky.androidide.lsp.java.compiler.CompilerProvider; -import com.itsaky.androidide.lsp.java.rewrite.Rewrite; -import com.itsaky.androidide.lsp.java.visitors.FindMethodDeclarationAt; -import com.itsaky.androidide.lsp.java.visitors.FindTypeDeclarationAt; -import com.itsaky.androidide.lsp.models.CodeActionItem; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; -import java.io.IOException; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import jdkx.lang.model.element.ExecutableElement; -import jdkx.lang.model.element.TypeElement; -import jdkx.tools.Diagnostic; -import jdkx.tools.JavaFileObject; -import openjdk.source.tree.ClassTree; -import openjdk.source.tree.CompilationUnitTree; -import openjdk.source.tree.LineMap; -import openjdk.source.tree.MethodTree; -import openjdk.source.tree.Tree; -import openjdk.source.util.TreePath; -import openjdk.source.util.Trees; -import openjdk.tools.javac.util.JCDiagnostic; -import org.jetbrains.annotations.Contract; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Akash Yadav - */ -public class CodeActionUtils { - - private static final Pattern NOT_THROWN_EXCEPTION = - Pattern.compile("^'((\\w+\\.)*\\w+)' is not thrown"); - private static final Pattern UNREPORTED_EXCEPTION = - Pattern.compile("unreported exception ((\\w+\\.)*\\w+)"); - private static final Logger LOG = LoggerFactory.getLogger(CodeActionUtils.class); - - public static CodeActionItem createQuickFix( - final CompilerProvider compiler, String title, Rewrite rewrite) { - - if (rewrite == null) { - return null; - } - - return ((Rewrite) rewrite).asCodeActions(compiler, title); - } - - public static boolean isInMethod(@NonNull CompileTask task, long cursor) { - MethodTree method = new FindMethodDeclarationAt(task.task).scan(task.root(), cursor); - return method != null; - } - - public static boolean isBlankLine(@NonNull CompilationUnitTree root, long cursor) { - LineMap lines = root.getLineMap(); - long line = lines.getLineNumber(cursor); - long start = lines.getStartPosition(line); - CharSequence contents; - try { - contents = root.getSourceFile().getCharContent(true); - } catch (IOException e) { - throw new RuntimeException(e); - } - for (long i = start; i < cursor; i++) { - if (!Character.isWhitespace(contents.charAt((int) i))) { - return false; - } - } - return true; - } - - public static int findPosition(@NonNull CompileTask task, @NonNull Position position) { - final LineMap lines = task.root().getLineMap(); - return (int) lines.getPosition(position.getLine() + 1, position.getColumn() + 1); - } - - @Nullable - public static String findClassNeedingConstructor(CompileTask task, Range range) { - final ClassTree type = findClassTree(task, range); - if (type == null || hasConstructor(task, type)) { - return null; - } - return qualifiedName(task, type); - } - - public static ClassTree findClassTree(@NonNull CompileTask task, @NonNull Range range) { - final long position = - task.root() - .getLineMap() - .getPosition(range.getStart().getLine() + 1, range.getStart().getColumn() + 1); - return newClassFinder(task).scan(task.root(), position); - } - - @NonNull - @Contract("_ -> new") - public static FindTypeDeclarationAt newClassFinder(@NonNull CompileTask task) { - return new FindTypeDeclarationAt(task.task); - } - - @NonNull - public static String qualifiedName(@NonNull CompileTask task, ClassTree tree) { - final Trees trees = Trees.instance(task.task); - final TreePath path = trees.getPath(task.root(), tree); - final TypeElement type = (TypeElement) trees.getElement(path); - return type.getQualifiedName().toString(); - } - - public static boolean hasConstructor(CompileTask task, @NonNull ClassTree type) { - for (Tree member : type.getMembers()) { - if (member instanceof MethodTree) { - MethodTree method = (MethodTree) member; - if (isConstructor(task, method)) { - return true; - } - } - } - return false; - } - - public static boolean isConstructor(CompileTask task, @NonNull MethodTree method) { - return method.getName().contentEquals("") && !synthetic(task, method); - } - - public static boolean synthetic(@NonNull CompileTask task, MethodTree method) { - return Trees.instance(task.task).getSourcePositions().getStartPosition(task.root(), method) - != -1; - } - - @NonNull - public static MethodPtr findMethod(@NonNull CompileTask task, @NonNull Range range) { - final Trees trees = Trees.instance(task.task); - final long position = - task.root() - .getLineMap() - .getPosition(range.getStart().getLine() + 1, range.getStart().getColumn() + 1); - final MethodTree tree = new FindMethodDeclarationAt(task.task).scan(task.root(), position); - final TreePath path = trees.getPath(task.root(), tree); - final ExecutableElement method = (ExecutableElement) trees.getElement(path); - return new MethodPtr(task.task, method); - } - - public static String extractNotThrownExceptionName(String message) { - final Matcher matcher = NOT_THROWN_EXCEPTION.matcher(message); - if (!matcher.find()) { - LOG.warn("`{}` doesn't match `{}`", message, NOT_THROWN_EXCEPTION); - return ""; - } - return matcher.group(1); - } - - public static String extractExceptionName(String message) { - final Matcher matcher = UNREPORTED_EXCEPTION.matcher(message); - if (!matcher.find()) { - LOG.warn("`{}` doesn't match `{}`", message, UNREPORTED_EXCEPTION); - return ""; - } - return matcher.group(1); - } - - @NonNull - public static CharSequence extractRange(@NonNull CompileTask task, Range range) { - CharSequence contents; - try { - contents = task.root().getSourceFile().getCharContent(true); - } catch (IOException e) { - throw new RuntimeException(e); - } - int start = - (int) - task.root() - .getLineMap() - .getPosition(range.getStart().getLine() + 1, range.getStart().getColumn() + 1); - int end = - (int) - task.root() - .getLineMap() - .getPosition(range.getEnd().getLine() + 1, range.getEnd().getColumn() + 1); - return contents.subSequence(start, end); - } - - @Nullable - @Contract(pure = true) - public static JCDiagnostic unwrapJCDiagnostic(Diagnostic diagnostic) { - return JavaDiagnosticUtils.asJCDiagnostic(diagnostic); - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.utils; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import org.appdevforall.codeonthego.javac.services.util.JavaDiagnosticUtils; +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask; +import org.appdevforall.codeonthego.lsp.java.compiler.CompilerProvider; +import org.appdevforall.codeonthego.lsp.java.rewrite.Rewrite; +import org.appdevforall.codeonthego.lsp.java.visitors.FindMethodDeclarationAt; +import org.appdevforall.codeonthego.lsp.java.visitors.FindTypeDeclarationAt; +import org.appdevforall.codeonthego.lsp.models.CodeActionItem; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; +import java.io.IOException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import jdkx.lang.model.element.ExecutableElement; +import jdkx.lang.model.element.TypeElement; +import jdkx.tools.Diagnostic; +import jdkx.tools.JavaFileObject; +import openjdk.source.tree.ClassTree; +import openjdk.source.tree.CompilationUnitTree; +import openjdk.source.tree.LineMap; +import openjdk.source.tree.MethodTree; +import openjdk.source.tree.Tree; +import openjdk.source.util.TreePath; +import openjdk.source.util.Trees; +import openjdk.tools.javac.util.JCDiagnostic; +import org.jetbrains.annotations.Contract; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Akash Yadav + */ +public class CodeActionUtils { + + private static final Pattern NOT_THROWN_EXCEPTION = + Pattern.compile("^'((\\w+\\.)*\\w+)' is not thrown"); + private static final Pattern UNREPORTED_EXCEPTION = + Pattern.compile("unreported exception ((\\w+\\.)*\\w+)"); + private static final Logger LOG = LoggerFactory.getLogger(CodeActionUtils.class); + + public static CodeActionItem createQuickFix( + final CompilerProvider compiler, String title, Rewrite rewrite) { + + if (rewrite == null) { + return null; + } + + return ((Rewrite) rewrite).asCodeActions(compiler, title); + } + + public static boolean isInMethod(@NonNull CompileTask task, long cursor) { + MethodTree method = new FindMethodDeclarationAt(task.task).scan(task.root(), cursor); + return method != null; + } + + public static boolean isBlankLine(@NonNull CompilationUnitTree root, long cursor) { + LineMap lines = root.getLineMap(); + long line = lines.getLineNumber(cursor); + long start = lines.getStartPosition(line); + CharSequence contents; + try { + contents = root.getSourceFile().getCharContent(true); + } catch (IOException e) { + throw new RuntimeException(e); + } + for (long i = start; i < cursor; i++) { + if (!Character.isWhitespace(contents.charAt((int) i))) { + return false; + } + } + return true; + } + + public static int findPosition(@NonNull CompileTask task, @NonNull Position position) { + final LineMap lines = task.root().getLineMap(); + return (int) lines.getPosition(position.getLine() + 1, position.getColumn() + 1); + } + + @Nullable + public static String findClassNeedingConstructor(CompileTask task, Range range) { + final ClassTree type = findClassTree(task, range); + if (type == null || hasConstructor(task, type)) { + return null; + } + return qualifiedName(task, type); + } + + public static ClassTree findClassTree(@NonNull CompileTask task, @NonNull Range range) { + final long position = + task.root() + .getLineMap() + .getPosition(range.getStart().getLine() + 1, range.getStart().getColumn() + 1); + return newClassFinder(task).scan(task.root(), position); + } + + @NonNull + @Contract("_ -> new") + public static FindTypeDeclarationAt newClassFinder(@NonNull CompileTask task) { + return new FindTypeDeclarationAt(task.task); + } + + @NonNull + public static String qualifiedName(@NonNull CompileTask task, ClassTree tree) { + final Trees trees = Trees.instance(task.task); + final TreePath path = trees.getPath(task.root(), tree); + final TypeElement type = (TypeElement) trees.getElement(path); + return type.getQualifiedName().toString(); + } + + public static boolean hasConstructor(CompileTask task, @NonNull ClassTree type) { + for (Tree member : type.getMembers()) { + if (member instanceof MethodTree) { + MethodTree method = (MethodTree) member; + if (isConstructor(task, method)) { + return true; + } + } + } + return false; + } + + public static boolean isConstructor(CompileTask task, @NonNull MethodTree method) { + return method.getName().contentEquals("") && !synthetic(task, method); + } + + public static boolean synthetic(@NonNull CompileTask task, MethodTree method) { + return Trees.instance(task.task).getSourcePositions().getStartPosition(task.root(), method) + != -1; + } + + @NonNull + public static MethodPtr findMethod(@NonNull CompileTask task, @NonNull Range range) { + final Trees trees = Trees.instance(task.task); + final long position = + task.root() + .getLineMap() + .getPosition(range.getStart().getLine() + 1, range.getStart().getColumn() + 1); + final MethodTree tree = new FindMethodDeclarationAt(task.task).scan(task.root(), position); + final TreePath path = trees.getPath(task.root(), tree); + final ExecutableElement method = (ExecutableElement) trees.getElement(path); + return new MethodPtr(task.task, method); + } + + public static String extractNotThrownExceptionName(String message) { + final Matcher matcher = NOT_THROWN_EXCEPTION.matcher(message); + if (!matcher.find()) { + LOG.warn("`{}` doesn't match `{}`", message, NOT_THROWN_EXCEPTION); + return ""; + } + return matcher.group(1); + } + + public static String extractExceptionName(String message) { + final Matcher matcher = UNREPORTED_EXCEPTION.matcher(message); + if (!matcher.find()) { + LOG.warn("`{}` doesn't match `{}`", message, UNREPORTED_EXCEPTION); + return ""; + } + return matcher.group(1); + } + + @NonNull + public static CharSequence extractRange(@NonNull CompileTask task, Range range) { + CharSequence contents; + try { + contents = task.root().getSourceFile().getCharContent(true); + } catch (IOException e) { + throw new RuntimeException(e); + } + int start = + (int) + task.root() + .getLineMap() + .getPosition(range.getStart().getLine() + 1, range.getStart().getColumn() + 1); + int end = + (int) + task.root() + .getLineMap() + .getPosition(range.getEnd().getLine() + 1, range.getEnd().getColumn() + 1); + return contents.subSequence(start, end); + } + + @Nullable + @Contract(pure = true) + public static JCDiagnostic unwrapJCDiagnostic(Diagnostic diagnostic) { + return JavaDiagnosticUtils.asJCDiagnostic(diagnostic); + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/CompletableDeferredExts.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/CompletableDeferredExts.kt similarity index 91% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/CompletableDeferredExts.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/CompletableDeferredExts.kt index 31c69a5065..84c962e51c 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/CompletableDeferredExts.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/CompletableDeferredExts.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.utils +package org.appdevforall.codeonthego.lsp.java.utils import kotlinx.coroutines.Deferred import kotlinx.coroutines.ExperimentalCoroutinesApi diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/EditHelper.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/EditHelper.java similarity index 93% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/EditHelper.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/EditHelper.java index a49b46d6f9..89737ce084 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/EditHelper.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/EditHelper.java @@ -1,208 +1,208 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.utils; - -import androidx.annotation.NonNull; -import com.itsaky.androidide.lsp.java.compiler.CompilerProvider; -import com.itsaky.androidide.lsp.java.rewrite.AddImport; -import com.itsaky.androidide.lsp.models.TextEdit; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; -import com.itsaky.androidide.projects.util.StringSearch; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.Set; -import java.util.StringJoiner; -import jdkx.lang.model.element.ExecutableElement; -import jdkx.lang.model.element.Modifier; -import jdkx.lang.model.element.Name; -import jdkx.lang.model.element.TypeElement; -import jdkx.lang.model.type.ArrayType; -import jdkx.lang.model.type.DeclaredType; -import jdkx.lang.model.type.ExecutableType; -import jdkx.lang.model.type.TypeMirror; -import openjdk.source.tree.ClassTree; -import openjdk.source.tree.CompilationUnitTree; -import openjdk.source.tree.LineMap; -import openjdk.source.tree.MethodTree; -import openjdk.source.tree.Tree; -import openjdk.source.util.JavacTask; -import openjdk.source.util.SourcePositions; -import openjdk.source.util.Trees; - -public class EditHelper { - - public static List addImportIfNeeded(CompilerProvider compiler, Path file, - Set imports, String className - ) { - if (file == null || containsImport(file, imports, className)) { - return Collections.emptyList(); - } - - AddImport addImport = new AddImport(file, className); - return Arrays.asList(Objects.requireNonNull(addImport.rewrite(compiler).get(file))); - } - - public static boolean containsImport(@NonNull Path file, Set imports, String className) { - if (imports == null) { - imports = Collections.emptySet(); - } - - final String pkgName = Extractors.packageName(className); - final String star = pkgName + ".*"; - if ("java.lang".equals(pkgName) || imports.contains(className) || imports.contains(star)) { - return true; - } - - final var filePackage = StringSearch.packageName(file); - return filePackage != null && filePackage.equals(pkgName); - } - - public static TextEdit removeTree(final JavacTask task, final CompilationUnitTree root, - final Tree remove - ) { - SourcePositions pos = Trees.instance(task).getSourcePositions(); - LineMap lines = root.getLineMap(); - long start = pos.getStartPosition(root, remove); - long end = pos.getEndPosition(root, remove); - int startLine = (int) lines.getLineNumber(start); - int startColumn = (int) lines.getColumnNumber(start); - Position startPos = new Position(startLine - 1, startColumn - 1); - int endLine = (int) lines.getLineNumber(end); - int endColumn = (int) lines.getColumnNumber(end); - Position endPos = new Position(endLine - 1, endColumn - 1); - Range range = new Range(startPos, endPos); - return new TextEdit(range, ""); - } - - public static String printMethod(final ExecutableElement method, - final ExecutableType parameterizedType, MethodTree source - ) { - final StringBuilder buf = new StringBuilder(); - // TODO leading \n is extra, but needed for indent replaceAll trick - buf.append("\n@Override\n"); - if (method.getModifiers().contains(Modifier.PUBLIC)) { - buf.append("public "); - } - if (method.getModifiers().contains(Modifier.PROTECTED)) { - buf.append("protected "); - } - buf.append(EditHelper.printType(parameterizedType.getReturnType())).append(" "); - buf.append(method.getSimpleName()).append("("); - buf.append(printParameters(parameterizedType, source)); - buf.append(") {\n // TODO\n}"); - return buf.toString(); - } - - public static String printType(final TypeMirror type) { - if (type instanceof DeclaredType) { - DeclaredType declared = (DeclaredType) type; - String string = printTypeName((TypeElement) declared.asElement()); - if (!declared.getTypeArguments().isEmpty()) { - string = string + "<" + printTypeParameters(declared.getTypeArguments()) + ">"; - } - return string; - } else if (type instanceof ArrayType) { - ArrayType array = (ArrayType) type; - return printType(array.getComponentType()) + "[]"; - } else { - return type.toString(); - } - } - - public static String printTypeName(final TypeElement type) { - if (type.getEnclosingElement() instanceof TypeElement) { - return printTypeName((TypeElement) type.getEnclosingElement()) + "." + type.getSimpleName(); - } - return type.getSimpleName().toString(); - } - - public static int indent(final JavacTask task, final CompilationUnitTree root, final Tree leaf) { - SourcePositions pos = Trees.instance(task).getSourcePositions(); - return indent(root, leaf, pos); - } - - private static int indent(@NonNull CompilationUnitTree root, Tree leaf, - @NonNull SourcePositions pos - ) { - LineMap lines = root.getLineMap(); - long startClass = pos.getStartPosition(root, leaf); - long startLine = lines.getStartPosition(lines.getLineNumber(startClass)); - return (int) (startClass - startLine); - } - - public static Position insertBefore(final JavacTask task, final CompilationUnitTree root, - final Tree member - ) { - SourcePositions pos = Trees.instance(task).getSourcePositions(); - LineMap lines = root.getLineMap(); - long start = pos.getStartPosition(root, member); - int line = (int) lines.getLineNumber(start); - return new Position(line - 1, 0); - } - - public static Position insertAfter(final JavacTask task, final CompilationUnitTree root, - final Tree member - ) { - SourcePositions pos = Trees.instance(task).getSourcePositions(); - LineMap lines = root.getLineMap(); - long end = pos.getEndPosition(root, member); - int line = (int) lines.getLineNumber(end); - return new Position(line, 0); - } - - public static Position insertAtEndOfClass(JavacTask task, CompilationUnitTree root, ClassTree leaf - ) { - SourcePositions pos = Trees.instance(task).getSourcePositions(); - LineMap lines = root.getLineMap(); - - long end = pos.getEndPosition(root, leaf); - - if (end < 0) throw new IllegalStateException("Cannot determine class end position"); - - int line = (int) lines.getLineNumber(end); - int column = (int) lines.getColumnNumber(end); - - if (line <= 0 || column <= 0) { - throw new IllegalStateException("Invalid class end position: line=" + line + ", column=" + column); - } - - return new Position(line - 1, Math.max(0, column - 2)); - } - - private static String printParameters(final ExecutableType method, final MethodTree source) { - StringJoiner join = new StringJoiner(", "); - for (int i = 0; i < method.getParameterTypes().size(); i++) { - String type = EditHelper.printType(method.getParameterTypes().get(i)); - Name name = source.getParameters().get(i).getName(); - join.add(type + " " + name); - } - return join.toString(); - } - - private static String printTypeParameters(final List arguments) { - StringJoiner join = new StringJoiner(", "); - for (TypeMirror a : arguments) { - join.add(printType(a)); - } - return join.toString(); - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.utils; + +import androidx.annotation.NonNull; +import org.appdevforall.codeonthego.lsp.java.compiler.CompilerProvider; +import org.appdevforall.codeonthego.lsp.java.rewrite.AddImport; +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; +import org.appdevforall.codeonthego.projects.util.StringSearch; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Set; +import java.util.StringJoiner; +import jdkx.lang.model.element.ExecutableElement; +import jdkx.lang.model.element.Modifier; +import jdkx.lang.model.element.Name; +import jdkx.lang.model.element.TypeElement; +import jdkx.lang.model.type.ArrayType; +import jdkx.lang.model.type.DeclaredType; +import jdkx.lang.model.type.ExecutableType; +import jdkx.lang.model.type.TypeMirror; +import openjdk.source.tree.ClassTree; +import openjdk.source.tree.CompilationUnitTree; +import openjdk.source.tree.LineMap; +import openjdk.source.tree.MethodTree; +import openjdk.source.tree.Tree; +import openjdk.source.util.JavacTask; +import openjdk.source.util.SourcePositions; +import openjdk.source.util.Trees; + +public class EditHelper { + + public static List addImportIfNeeded(CompilerProvider compiler, Path file, + Set imports, String className + ) { + if (file == null || containsImport(file, imports, className)) { + return Collections.emptyList(); + } + + AddImport addImport = new AddImport(file, className); + return Arrays.asList(Objects.requireNonNull(addImport.rewrite(compiler).get(file))); + } + + public static boolean containsImport(@NonNull Path file, Set imports, String className) { + if (imports == null) { + imports = Collections.emptySet(); + } + + final String pkgName = Extractors.packageName(className); + final String star = pkgName + ".*"; + if ("java.lang".equals(pkgName) || imports.contains(className) || imports.contains(star)) { + return true; + } + + final var filePackage = StringSearch.packageName(file); + return filePackage != null && filePackage.equals(pkgName); + } + + public static TextEdit removeTree(final JavacTask task, final CompilationUnitTree root, + final Tree remove + ) { + SourcePositions pos = Trees.instance(task).getSourcePositions(); + LineMap lines = root.getLineMap(); + long start = pos.getStartPosition(root, remove); + long end = pos.getEndPosition(root, remove); + int startLine = (int) lines.getLineNumber(start); + int startColumn = (int) lines.getColumnNumber(start); + Position startPos = new Position(startLine - 1, startColumn - 1); + int endLine = (int) lines.getLineNumber(end); + int endColumn = (int) lines.getColumnNumber(end); + Position endPos = new Position(endLine - 1, endColumn - 1); + Range range = new Range(startPos, endPos); + return new TextEdit(range, ""); + } + + public static String printMethod(final ExecutableElement method, + final ExecutableType parameterizedType, MethodTree source + ) { + final StringBuilder buf = new StringBuilder(); + // TODO leading \n is extra, but needed for indent replaceAll trick + buf.append("\n@Override\n"); + if (method.getModifiers().contains(Modifier.PUBLIC)) { + buf.append("public "); + } + if (method.getModifiers().contains(Modifier.PROTECTED)) { + buf.append("protected "); + } + buf.append(EditHelper.printType(parameterizedType.getReturnType())).append(" "); + buf.append(method.getSimpleName()).append("("); + buf.append(printParameters(parameterizedType, source)); + buf.append(") {\n // TODO\n}"); + return buf.toString(); + } + + public static String printType(final TypeMirror type) { + if (type instanceof DeclaredType) { + DeclaredType declared = (DeclaredType) type; + String string = printTypeName((TypeElement) declared.asElement()); + if (!declared.getTypeArguments().isEmpty()) { + string = string + "<" + printTypeParameters(declared.getTypeArguments()) + ">"; + } + return string; + } else if (type instanceof ArrayType) { + ArrayType array = (ArrayType) type; + return printType(array.getComponentType()) + "[]"; + } else { + return type.toString(); + } + } + + public static String printTypeName(final TypeElement type) { + if (type.getEnclosingElement() instanceof TypeElement) { + return printTypeName((TypeElement) type.getEnclosingElement()) + "." + type.getSimpleName(); + } + return type.getSimpleName().toString(); + } + + public static int indent(final JavacTask task, final CompilationUnitTree root, final Tree leaf) { + SourcePositions pos = Trees.instance(task).getSourcePositions(); + return indent(root, leaf, pos); + } + + private static int indent(@NonNull CompilationUnitTree root, Tree leaf, + @NonNull SourcePositions pos + ) { + LineMap lines = root.getLineMap(); + long startClass = pos.getStartPosition(root, leaf); + long startLine = lines.getStartPosition(lines.getLineNumber(startClass)); + return (int) (startClass - startLine); + } + + public static Position insertBefore(final JavacTask task, final CompilationUnitTree root, + final Tree member + ) { + SourcePositions pos = Trees.instance(task).getSourcePositions(); + LineMap lines = root.getLineMap(); + long start = pos.getStartPosition(root, member); + int line = (int) lines.getLineNumber(start); + return new Position(line - 1, 0); + } + + public static Position insertAfter(final JavacTask task, final CompilationUnitTree root, + final Tree member + ) { + SourcePositions pos = Trees.instance(task).getSourcePositions(); + LineMap lines = root.getLineMap(); + long end = pos.getEndPosition(root, member); + int line = (int) lines.getLineNumber(end); + return new Position(line, 0); + } + + public static Position insertAtEndOfClass(JavacTask task, CompilationUnitTree root, ClassTree leaf + ) { + SourcePositions pos = Trees.instance(task).getSourcePositions(); + LineMap lines = root.getLineMap(); + + long end = pos.getEndPosition(root, leaf); + + if (end < 0) throw new IllegalStateException("Cannot determine class end position"); + + int line = (int) lines.getLineNumber(end); + int column = (int) lines.getColumnNumber(end); + + if (line <= 0 || column <= 0) { + throw new IllegalStateException("Invalid class end position: line=" + line + ", column=" + column); + } + + return new Position(line - 1, Math.max(0, column - 2)); + } + + private static String printParameters(final ExecutableType method, final MethodTree source) { + StringJoiner join = new StringJoiner(", "); + for (int i = 0; i < method.getParameterTypes().size(); i++) { + String type = EditHelper.printType(method.getParameterTypes().get(i)); + Name name = source.getParameters().get(i).getName(); + join.add(type + " " + name); + } + return join.toString(); + } + + private static String printTypeParameters(final List arguments) { + StringJoiner join = new StringJoiner(", "); + for (TypeMirror a : arguments) { + join.add(printType(a)); + } + return join.toString(); + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/Extractors.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/Extractors.java similarity index 96% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/Extractors.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/Extractors.java index 2d277a0fd7..500e4f2e76 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/Extractors.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/Extractors.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.utils; +package org.appdevforall.codeonthego.lsp.java.utils; import androidx.annotation.NonNull; import java.util.regex.Matcher; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/FindHelper.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/FindHelper.java similarity index 95% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/FindHelper.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/FindHelper.java index 3e7a2a066f..9790ca134f 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/FindHelper.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/FindHelper.java @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.utils; +package org.appdevforall.codeonthego.lsp.java.utils; import androidx.annotation.Nullable; -import com.itsaky.androidide.lsp.java.compiler.CompileTask; -import com.itsaky.androidide.lsp.java.parser.ParseTask; -import com.itsaky.androidide.lsp.java.visitors.FindTypeDeclarationNamed; -import com.itsaky.androidide.models.Location; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask; +import org.appdevforall.codeonthego.lsp.java.parser.ParseTask; +import org.appdevforall.codeonthego.lsp.java.visitors.FindTypeDeclarationNamed; +import org.appdevforall.codeonthego.models.Location; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; import java.io.IOException; import java.net.URI; import java.nio.file.Paths; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/JavaParserUtils.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/JavaParserUtils.kt similarity index 96% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/JavaParserUtils.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/JavaParserUtils.kt index 7f0c5c83fb..27921ea95a 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/JavaParserUtils.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/JavaParserUtils.kt @@ -1,789 +1,789 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -@file:Suppress("unused", "MemberVisibilityCanBePrivate") - -package com.itsaky.androidide.lsp.java.utils - -import androidx.annotation.NonNull -import androidx.annotation.Nullable -import com.github.javaparser.StaticJavaParser -import com.github.javaparser.ast.CompilationUnit -import com.github.javaparser.ast.ImportDeclaration -import com.github.javaparser.ast.Node -import com.github.javaparser.ast.NodeList -import com.github.javaparser.ast.PackageDeclaration -import com.github.javaparser.ast.body.BodyDeclaration -import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration -import com.github.javaparser.ast.body.FieldDeclaration -import com.github.javaparser.ast.body.MethodDeclaration -import com.github.javaparser.ast.body.Parameter -import com.github.javaparser.ast.body.ReceiverParameter -import com.github.javaparser.ast.body.VariableDeclarator -import com.github.javaparser.ast.expr.AnnotationExpr -import com.github.javaparser.ast.expr.AssignExpr -import com.github.javaparser.ast.expr.BooleanLiteralExpr -import com.github.javaparser.ast.expr.CharLiteralExpr -import com.github.javaparser.ast.expr.DoubleLiteralExpr -import com.github.javaparser.ast.expr.Expression -import com.github.javaparser.ast.expr.FieldAccessExpr -import com.github.javaparser.ast.expr.IntegerLiteralExpr -import com.github.javaparser.ast.expr.LiteralExpr -import com.github.javaparser.ast.expr.LongLiteralExpr -import com.github.javaparser.ast.expr.MarkerAnnotationExpr -import com.github.javaparser.ast.expr.MemberValuePair -import com.github.javaparser.ast.expr.MethodCallExpr -import com.github.javaparser.ast.expr.Name -import com.github.javaparser.ast.expr.NameExpr -import com.github.javaparser.ast.expr.NormalAnnotationExpr -import com.github.javaparser.ast.expr.NullLiteralExpr -import com.github.javaparser.ast.expr.SimpleName -import com.github.javaparser.ast.expr.SingleMemberAnnotationExpr -import com.github.javaparser.ast.expr.StringLiteralExpr -import com.github.javaparser.ast.expr.SuperExpr -import com.github.javaparser.ast.expr.VariableDeclarationExpr -import com.github.javaparser.ast.nodeTypes.NodeWithSimpleName -import com.github.javaparser.ast.stmt.BlockStmt -import com.github.javaparser.ast.stmt.ExpressionStmt -import com.github.javaparser.ast.stmt.ReturnStmt -import com.github.javaparser.ast.stmt.Statement -import com.github.javaparser.ast.type.ArrayType -import com.github.javaparser.ast.type.PrimitiveType -import com.github.javaparser.ast.type.PrimitiveType.Primitive.BOOLEAN -import com.github.javaparser.ast.type.PrimitiveType.Primitive.BYTE -import com.github.javaparser.ast.type.PrimitiveType.Primitive.CHAR -import com.github.javaparser.ast.type.PrimitiveType.Primitive.DOUBLE -import com.github.javaparser.ast.type.PrimitiveType.Primitive.FLOAT -import com.github.javaparser.ast.type.PrimitiveType.Primitive.INT -import com.github.javaparser.ast.type.PrimitiveType.Primitive.LONG -import com.github.javaparser.ast.type.PrimitiveType.Primitive.SHORT -import com.github.javaparser.ast.type.ReferenceType -import com.github.javaparser.ast.type.Type -import com.github.javaparser.ast.type.TypeParameter -import com.github.javaparser.printer.DefaultPrettyPrinter -import com.github.javaparser.printer.configuration.DefaultPrinterConfiguration -import com.github.javaparser.printer.configuration.PrinterConfiguration -import com.itsaky.androidide.lsp.java.utils.TypeUtils.toType -import com.itsaky.androidide.lsp.java.visitors.PrettyPrintingVisitor -import jdkx.lang.model.element.ExecutableElement -import jdkx.lang.model.element.Modifier -import jdkx.lang.model.element.TypeParameterElement -import jdkx.lang.model.element.VariableElement -import jdkx.lang.model.type.ExecutableType -import jdkx.lang.model.type.TypeKind -import jdkx.lang.model.type.TypeMirror -import jdkx.lang.model.type.TypeVariable -import openjdk.source.tree.AnnotationTree -import openjdk.source.tree.AssignmentTree -import openjdk.source.tree.BlockTree -import openjdk.source.tree.ClassTree -import openjdk.source.tree.CompilationUnitTree -import openjdk.source.tree.ErroneousTree -import openjdk.source.tree.ExpressionStatementTree -import openjdk.source.tree.ExpressionTree -import openjdk.source.tree.IdentifierTree -import openjdk.source.tree.ImportTree -import openjdk.source.tree.LiteralTree -import openjdk.source.tree.MemberSelectTree -import openjdk.source.tree.MethodInvocationTree -import openjdk.source.tree.MethodTree -import openjdk.source.tree.PackageTree -import openjdk.source.tree.StatementTree -import openjdk.source.tree.Tree -import openjdk.source.tree.TypeParameterTree -import openjdk.source.tree.VariableTree -import org.jetbrains.annotations.Contract -import java.util.function.Predicate -import java.util.stream.IntStream -import java.util.stream.Stream -import kotlin.jvm.optionals.getOrNull - -object JavaParserUtils { - - /** - * Collects all the type names from the given node. - * - * @param type The method to get types from. - * @return A set of fully qualified names of the types in the given node. - */ - fun collectImports(type: ExecutableType): MutableSet { - val types = mutableSetOf() - val returnType = type.returnType - if (returnType != null) { - if ( - returnType.kind != TypeKind.VOID && - returnType.kind != TypeKind.TYPEVAR && - !returnType.kind.isPrimitive - ) { - val fqn = getTypeToImport(returnType) - if (fqn != null) { - types.add(fqn) - } - } - } - if (type.thrownTypes != null) { - for (thrown in type.thrownTypes) { - val fqn = getTypeToImport(thrown) - if (fqn != null) { - types.add(fqn) - } - } - } - for (t in type.parameterTypes) { - if (t.kind.isPrimitive) { - continue - } - val fqn = getTypeToImport(t) - if (fqn != null) { - types.add(fqn) - } - } - return types - } - - @Nullable - private fun getTypeToImport(type: TypeMirror): String? { - if (type.kind.isPrimitive) { - return null - } - if (type.kind == TypeKind.TYPEVAR) { - return null - } - var fqn = toType(type).toString() - if (type.kind == TypeKind.ARRAY) { - fqn = removeArray(fqn) - } - - return removeDiamond(fqn) - } - - fun printMethod( - method: ExecutableElement, - parameterizedType: ExecutableType?, - source: MethodTree, - ): MethodDeclaration { - val methodDeclaration: MethodDeclaration = toMethodDeclaration(source, parameterizedType) - printMethodInternal(methodDeclaration, method) - return methodDeclaration - } - - fun printMethod( - method: ExecutableElement?, - parameterizedType: ExecutableType?, - source: ExecutableElement, - ): MethodDeclaration { - val methodDeclaration: MethodDeclaration = toMethodDeclaration(method, parameterizedType) - printMethodInternal(methodDeclaration, source) - return methodDeclaration - } - - private fun printMethodInternal( - methodDeclaration: MethodDeclaration, - method: ExecutableElement, - ) { - methodDeclaration.addMarkerAnnotation(Override::class.java) - val recentlyNonNull = methodDeclaration.getAnnotationByName("RecentlyNonNull") - if (recentlyNonNull.isPresent) { - methodDeclaration.remove(recentlyNonNull.get()) - methodDeclaration.addMarkerAnnotation(NonNull::class.java) - } - - val blockStmt = BlockStmt() - if (method.modifiers.contains(Modifier.ABSTRACT)) { - methodDeclaration.removeModifier(com.github.javaparser.ast.Modifier.Keyword.ABSTRACT) - if (methodDeclaration.type.isClassOrInterfaceType) { - blockStmt.addStatement(ReturnStmt(NullLiteralExpr())) - } - if (methodDeclaration.type.isPrimitiveType) { - val type = methodDeclaration.type.asPrimitiveType() - blockStmt.addStatement(ReturnStmt(getReturnExpr(type))) - } - } else { - val methodCallExpr = MethodCallExpr() - methodCallExpr.name = methodDeclaration.name - methodCallExpr.arguments = - methodDeclaration.parameters - .stream() - .map { obj: Parameter -> obj.nameAsExpression } - .collect(NodeList.toNodeList()) - methodCallExpr.setScope(SuperExpr()) - if (methodDeclaration.type.isVoidType) { - blockStmt.addStatement(methodCallExpr) - } else { - blockStmt.addStatement(ReturnStmt(methodCallExpr)) - } - } - methodDeclaration.setBody(blockStmt) - } - - private fun getReturnExpr(type: PrimitiveType): Expression { - return when (type.type) { - BOOLEAN -> BooleanLiteralExpr() - BYTE, - DOUBLE, - CHAR, - SHORT, - LONG, - FLOAT, - INT -> IntegerLiteralExpr("0") - - else -> NullLiteralExpr() - } - } - - @Suppress("Since15") - fun toCompilationUnit(tree: CompilationUnitTree): CompilationUnit { - val compilationUnit = CompilationUnit() - compilationUnit.setPackageDeclaration(toPackageDeclaration(tree.getPackage())) - tree.imports.forEach { importTree: ImportTree? -> - compilationUnit.addImport(toImportDeclaration(importTree!!)) - } - compilationUnit.types = - tree.typeDecls - .stream() - .map { toClassOrInterfaceDeclaration(it) } - .collect(NodeList.toNodeList()) - return compilationUnit - } - - @Suppress("Since15") - fun toPackageDeclaration(tree: PackageTree): PackageDeclaration { - val declaration = PackageDeclaration() - declaration.setName(tree.packageName.toString()) - return declaration - } - - fun toImportDeclaration(tree: ImportTree): ImportDeclaration { - val name = tree.qualifiedIdentifier.toString() - val isAsterisk = name.endsWith("*") - return ImportDeclaration(name, tree.isStatic, isAsterisk) - } - - fun toClassOrInterfaceDeclaration(tree: Tree?): ClassOrInterfaceDeclaration? { - return if (tree is ClassTree) { - toClassOrInterfaceDeclaration(tree as ClassTree?) - } else null - } - - fun toBlockStatement(tree: BlockTree): BlockStmt { - val blockStmt = BlockStmt() - blockStmt.statements = - tree.statements.stream().map { toStatement(it) }.collect(NodeList.toNodeList()) - return blockStmt - } - - fun toStatement(tree: StatementTree?): Statement? { - if (tree is ExpressionStatementTree) { - return toExpressionStatement((tree as ExpressionStatementTree?)!!) - } - return if (tree is VariableTree) { - toVariableDeclarationExpression((tree as VariableTree?)!!) - } else StaticJavaParser.parseStatement(tree.toString()) - } - - fun toExpressionStatement(tree: ExpressionStatementTree): ExpressionStmt { - val expressionStmt = ExpressionStmt() - expressionStmt.expression = toExpression(tree.expression) - return expressionStmt - } - - fun toExpression(tree: ExpressionTree?): Expression? { - if (tree is MethodInvocationTree) { - return toMethodCallExpression((tree as MethodInvocationTree?)!!) - } - if (tree is MemberSelectTree) { - return toFieldAccessExpression((tree as MemberSelectTree?)!!) - } - if (tree is IdentifierTree) { - return toNameExpr((tree as IdentifierTree?)!!) - } - if (tree is LiteralTree) { - return toLiteralExpression((tree as LiteralTree?)!!) - } - if (tree is AssignmentTree) { - return toAssignExpression((tree as AssignmentTree?)!!) - } - if (tree is ErroneousTree) { - val erroneousTree = tree as ErroneousTree? - if (erroneousTree!!.errorTrees.isNotEmpty()) { - val errorTree = erroneousTree.errorTrees[0] - return toExpression(errorTree as ExpressionTree) - } - } - return null - } - - private fun toAssignExpression(tree: AssignmentTree): AssignExpr { - val assignExpr = AssignExpr() - assignExpr.target = toExpression(tree.variable) - assignExpr.value = toExpression(tree.expression) - return assignExpr - } - - fun toVariableDeclarationExpression(tree: VariableTree): ExpressionStmt { - val expr = VariableDeclarationExpr() - expr.modifiers = - tree.modifiers.flags.stream().map { toModifier(it) }.collect(NodeList.toNodeList()) - val declarator = VariableDeclarator() - declarator.setName(tree.name.toString()) - declarator.setInitializer(toExpression(tree.initializer)) - declarator.type = toType(tree.type) - expr.addVariable(declarator) - val stmt = ExpressionStmt() - stmt.expression = expr - return stmt - } - - fun toNameExpr(tree: IdentifierTree): NameExpr { - val nameExpr = NameExpr() - nameExpr.setName(tree.name.toString()) - return nameExpr - } - - fun toLiteralExpression(tree: LiteralTree): LiteralExpr? { - val value = tree.value - if (value is String) { - return StringLiteralExpr(value) - } - if (value is Boolean) { - return BooleanLiteralExpr(value) - } - if (value is Int) { - return IntegerLiteralExpr(value.toString()) - } - if (value is Char) { - return CharLiteralExpr(value) - } - if (value is Long) { - return LongLiteralExpr(value.toString()) - } - return if (value is Double) { - DoubleLiteralExpr(value) - } else null - } - - fun toMethodCallExpression(tree: MethodInvocationTree): MethodCallExpr { - val expr = MethodCallExpr() - if (tree.methodSelect is MemberSelectTree) { - val methodSelect = tree.methodSelect as MemberSelectTree - expr.setScope(toExpression(methodSelect.expression)) - expr.setName(methodSelect.identifier.toString()) - } - expr.arguments = tree.arguments.stream().map { toExpression(it) }.collect(NodeList.toNodeList()) - expr.setTypeArguments( - tree.typeArguments.stream().map { toType(it) }.collect(NodeList.toNodeList()) - ) - if (tree.methodSelect is IdentifierTree) { - expr.name = toNameExpr((tree.methodSelect as IdentifierTree)).name - } - return expr - } - - fun toFieldAccessExpression(tree: MemberSelectTree): FieldAccessExpr { - val fieldAccessExpr = FieldAccessExpr() - fieldAccessExpr.setName(tree.identifier.toString()) - fieldAccessExpr.scope = toExpression(tree.expression) - return fieldAccessExpr - } - - fun toClassOrInterfaceDeclaration(tree: ClassTree): ClassOrInterfaceDeclaration { - val declaration = ClassOrInterfaceDeclaration() - declaration.setName(tree.simpleName.toString()) - declaration.extendedTypes = - NodeList.nodeList(TypeUtils.toClassOrInterfaceType(tree.extendsClause)) - declaration.typeParameters = - tree.typeParameters.stream().map { toTypeParameter(it) }.collect(NodeList.toNodeList()) - declaration.typeParameters = - tree.typeParameters.stream().map { toTypeParameter(it) }.collect(NodeList.toNodeList()) - declaration.implementedTypes = - tree.implementsClause - .stream() - .map { TypeUtils.toClassOrInterfaceType(it) } - .collect(NodeList.toNodeList()) - declaration.modifiers = - tree.modifiers.flags.stream().map { toModifier(it) }.collect(NodeList.toNodeList()) - declaration.members = - tree.members.stream().map { toBodyDeclaration(it) }.collect(NodeList.toNodeList()) - return declaration - } - - fun toBodyDeclaration(tree: Tree?): BodyDeclaration<*>? { - if (tree is MethodTree) { - return toMethodDeclaration((tree as MethodTree?)!!, null) - } - return if (tree is VariableTree) { - toFieldDeclaration((tree as VariableTree?)!!) - } else null - } - - fun toFieldDeclaration(tree: VariableTree): FieldDeclaration { - val declaration = FieldDeclaration() - declaration.modifiers = - tree.modifiers.flags.stream().map { toModifier(it) }.collect(NodeList.toNodeList()) - val declarator = VariableDeclarator() - declarator.setName(tree.name.toString()) - val initializer = toExpression(tree.initializer) - if (initializer != null) { - declarator.setInitializer(initializer) - } - val type = toType(tree.type) - if (type != null) { - declarator.type = type - } - declaration.addVariable(declarator) - return declaration - } - - fun toMethodDeclaration(method: MethodTree, type: ExecutableType?): MethodDeclaration { - val methodDeclaration = MethodDeclaration() - methodDeclaration.annotations = - method.modifiers.annotations.stream().map { toAnnotation(it) }.collect(NodeList.toNodeList()) - methodDeclaration.setName(method.name.toString()) - val returnType = - if (type != null) { - toType(type.returnType) - } else { - toType(method.returnType) - } - if (returnType != null) { - methodDeclaration.type = getTypeWithoutBounds(returnType) - } - methodDeclaration.modifiers = - method.modifiers.flags.stream().map { toModifier(it) }.collect(NodeList.toNodeList()) - methodDeclaration.parameters = - method.parameters - .map { variable -> - return@map toParameter(variable).also { param -> - val firstType = getTypeWithoutBounds(param.type) - param.type = firstType - } - } - .toNodeList() - methodDeclaration.typeParameters = - method.typeParameters - .mapNotNull { - return@mapNotNull toType(it as Tree?)?.toTypeParameter()?.getOrNull() - } - .toNodeList() - if (method.body != null) { - methodDeclaration.setBody(toBlockStatement(method.body)) - } - if (method.receiverParameter != null) { - methodDeclaration.setReceiverParameter(toReceiverParameter(method.receiverParameter)) - } - return methodDeclaration - } - - fun toAnnotation(tree: AnnotationTree): AnnotationExpr { - if (tree.arguments.isEmpty()) { - val expr = MarkerAnnotationExpr() - expr.setName(toType(tree.annotationType).toString()) - return expr - } - if (tree.arguments.size == 1) { - val expr = SingleMemberAnnotationExpr() - expr.setName(toType(tree.annotationType).toString()) - expr.memberValue = toExpression(tree.arguments[0]) - return expr - } - val expr = NormalAnnotationExpr() - expr.setName(toType(tree.annotationType).toString()) - expr.pairs = - tree.arguments - .map { - return@map if (it is AssignmentTree) { - val assignExpr = toAssignExpression((it as AssignmentTree?)!!) - val pair = MemberValuePair() - pair.setName(assignExpr.target.toString()) - pair.value = assignExpr.value - pair - } else null - } - .toNodeList() - return expr - } - - fun toParameter(tree: VariableTree): Parameter { - val parameter = Parameter() - parameter.type = toType(tree.type) - tree.modifiers.flags.map { toModifier(it) }.toNodeList().also { parameter.modifiers = it } - parameter.setName(tree.name.toString()) - return parameter - } - - /** - * Convert a parameter into [Parameter] object. This method is called from source files, giving - * their accurate names. - */ - fun toParameter(type: TypeMirror?, name: VariableTree): Parameter { - val parameter = Parameter() - parameter.setType(EditHelper.printType(type)) - parameter.setName(name.name.toString()) - parameter.modifiers = name.modifiers.flags.map { toModifier(it) }.toNodeList() - parameter.setName(name.name.toString()) - return parameter - } - - fun toTypeParameter(type: TypeParameterTree): TypeParameter? { - return StaticJavaParser.parseTypeParameter(type.toString()) - } - - fun toReceiverParameter(parameter: VariableTree): ReceiverParameter { - val receiverParameter = ReceiverParameter() - receiverParameter.setName(parameter.name.toString()) - receiverParameter.type = toType(parameter.type) - return receiverParameter - } - - fun toMethodDeclaration(method: ExecutableElement?, type: ExecutableType?): MethodDeclaration { - val methodDeclaration = MethodDeclaration() - val returnType = - if (type != null) { - toType(type.returnType) - } else { - toType(method!!.returnType) - } - if (returnType != null) { - methodDeclaration.type = getTypeWithoutBounds(returnType) - } - methodDeclaration.isDefault = method!!.isDefault - methodDeclaration.setName(method.simpleName.toString()) - methodDeclaration.setModifiers( - *method.modifiers - .stream() - .map { com.github.javaparser.ast.Modifier.Keyword.valueOf(it!!.name) } - .asArray() - ) - methodDeclaration.parameters = - IntStream.range(0, method.parameters.size) - .mapToObj { - return@mapToObj toParameter(type!!.parameterTypes[it], - method.parameters[it]).also { parameter -> - val firstType = getTypeWithoutBounds(parameter.type) - parameter.type = firstType - } - } - .collect(NodeList.toNodeList()) - methodDeclaration.typeParameters = - type!! - .typeVariables - .mapNotNull { toType(it as TypeMirror?)?.toTypeParameter()?.getOrNull() } - .toNodeList() - return methodDeclaration - } - - fun getFirstArrayType(type: Type): Type { - if (type.isTypeParameter) { - val typeParameter = type.asTypeParameter() - if (typeParameter!!.typeBound.isNonEmpty) { - val first = typeParameter.typeBound.first - if (first!!.isPresent) { - return ArrayType(first.get()) - } - } - } - return type - } - - fun getFirstType(type: Type): Type { - if (type.isTypeParameter) { - val typeParameter = type.asTypeParameter() - if (typeParameter!!.typeBound.isNonEmpty) { - val first = typeParameter.typeBound.first - if (first!!.isPresent) { - return first.get() - } - } - } - if (!type.isClassOrInterfaceType) { - return type - } - - val typeArguments = type.asClassOrInterfaceType().typeArguments - if (!typeArguments!!.isPresent || !typeArguments.get().isNonEmpty) { - return type - } - - val first = typeArguments.get().first - if (!first!!.isPresent || !first.get().isTypeParameter) { - return type - } - - val typeBound = first.get().asTypeParameter().typeBound - if (!typeBound!!.isNonEmpty) { - return type - } - - val first1 = typeBound.first - if (!first1!!.isPresent) { - return type - } - - type.asClassOrInterfaceType().setTypeArguments(first1.get()) - return type - } - - fun getTypeWithoutBounds(type: Type): Type { - if (type.isArrayType && !type.asArrayType().componentType.isTypeParameter) { - return type - } - if (!type.isArrayType && !type.isTypeParameter) { - return type - } - if (type is NodeWithSimpleName<*>) { - return StaticJavaParser.parseClassOrInterfaceType( - (type as NodeWithSimpleName<*>).nameAsString - ) - } - return if (type.isArrayType) { - ArrayType(getTypeWithoutBounds(type.asArrayType().componentType)) - } else type - } - - @Contract("_ -> new") - fun toModifier(modifier: Modifier): com.github.javaparser.ast.Modifier { - return com.github.javaparser.ast.Modifier( - com.github.javaparser.ast.Modifier.Keyword.valueOf(modifier.name) - ) - } - - /** - * Convert a parameter into [Parameter] object. This method is called from compiled class files, - * giving inaccurate parameter names - */ - fun toParameter(type: TypeMirror?, name: VariableElement?): Parameter { - val parameter = Parameter() - parameter.setType(EditHelper.printType(type)) - if (parameter.type.isArrayType) { - if ((type as openjdk.tools.javac.code.Type.ArrayType?)!!.isVarargs) { - parameter.type = parameter.type.asArrayType().componentType - parameter.isVarArgs = true - } - } - parameter.setName(name!!.simpleName.toString()) - parameter.modifiers = name.modifiers.map { toModifier(it) }.toNodeList() - parameter.setName(name.simpleName.toString()) - return parameter - } - - fun toTypeParameter(type: TypeParameterElement): TypeParameter? { - return StaticJavaParser.parseTypeParameter(type.toString()) - } - - fun toTypeParameter(typeVariable: TypeVariable): TypeParameter? { - return StaticJavaParser.parseTypeParameter(typeVariable.toString()) - } - - fun getClassNames(type: Type): MutableList { - val classNames: MutableList = ArrayList() - if (type.isClassOrInterfaceType) { - classNames.add(type.asClassOrInterfaceType().name.asString()) - } - if (type.isWildcardType) { - val wildcardType = type.asWildcardType() - wildcardType!!.extendedType.ifPresent { t: ReferenceType? -> - classNames.addAll(getClassNames(t!!)) - } - wildcardType.superType.ifPresent { t: ReferenceType? -> - classNames.addAll(getClassNames(t!!)) - } - } - if (type.isArrayType) { - classNames.addAll(getClassNames(type.asArrayType().componentType)) - } - if (type.isIntersectionType) { - type - .asIntersectionType() - .elements - .stream() - .map { getClassNames(it) } - .forEach { c: MutableList? -> classNames.addAll(c!!) } - } - return classNames - } - - /** - * Print a node declaration into its string representation - * - * @param node node to print - * @param delegate callback to whether a class name should be printed as fully qualified names - * @return String representation of the method declaration properly formatted - */ - fun prettyPrint(node: Node?, delegate: Predicate?): String? { - val configuration: PrinterConfiguration = DefaultPrinterConfiguration() - val visitor: PrettyPrintingVisitor = - object : PrettyPrintingVisitor(configuration) { - override fun visit(n: SimpleName?, arg: Void?) { - printOrphanCommentsBeforeThisChildNode(n) - printComment(n!!.comment, arg) - val identifier = n.identifier - if (delegate!!.test(identifier)) { - printer.print(identifier) - } else { - printer.print(getSimpleName(identifier)) - } - } - - override fun visit(n: Name?, arg: Void?) { - super.visit(n, arg) - } - } - val prettyPrinter = DefaultPrettyPrinter({ visitor }, configuration) - return prettyPrinter.print(node) - } - - @JvmStatic - fun getSimpleName(className: String?): String { - var name = className - name = removeDiamond(name!!) - val dot = name.lastIndexOf('.') - if (dot == -1) { - return name - } - return if (name.startsWith("? extends")) { - "? extends " + name.substring(dot + 1) - } else name.substring(dot + 1) - } - - fun removeDiamond(className: String): String { - var name = className - if (name.contains("<")) { - name = name.substring(0, name.indexOf('<')) - } - return name - } - - fun removeArray(className: String): String { - var name = className - if (name.contains("[")) { - name = name.substring(0, name.indexOf('[')) - } - return name - } -} - -private fun Collection.toNodeList(): NodeList { - return NodeList(this) -} - -private inline fun Stream.asArray(): Array { - val arr = mutableListOf() - for (element in this) { - arr.add(element) - } - - return arr.toTypedArray() -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +@file:Suppress("unused", "MemberVisibilityCanBePrivate") + +package org.appdevforall.codeonthego.lsp.java.utils + +import androidx.annotation.NonNull +import androidx.annotation.Nullable +import com.github.javaparser.StaticJavaParser +import com.github.javaparser.ast.CompilationUnit +import com.github.javaparser.ast.ImportDeclaration +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.NodeList +import com.github.javaparser.ast.PackageDeclaration +import com.github.javaparser.ast.body.BodyDeclaration +import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration +import com.github.javaparser.ast.body.FieldDeclaration +import com.github.javaparser.ast.body.MethodDeclaration +import com.github.javaparser.ast.body.Parameter +import com.github.javaparser.ast.body.ReceiverParameter +import com.github.javaparser.ast.body.VariableDeclarator +import com.github.javaparser.ast.expr.AnnotationExpr +import com.github.javaparser.ast.expr.AssignExpr +import com.github.javaparser.ast.expr.BooleanLiteralExpr +import com.github.javaparser.ast.expr.CharLiteralExpr +import com.github.javaparser.ast.expr.DoubleLiteralExpr +import com.github.javaparser.ast.expr.Expression +import com.github.javaparser.ast.expr.FieldAccessExpr +import com.github.javaparser.ast.expr.IntegerLiteralExpr +import com.github.javaparser.ast.expr.LiteralExpr +import com.github.javaparser.ast.expr.LongLiteralExpr +import com.github.javaparser.ast.expr.MarkerAnnotationExpr +import com.github.javaparser.ast.expr.MemberValuePair +import com.github.javaparser.ast.expr.MethodCallExpr +import com.github.javaparser.ast.expr.Name +import com.github.javaparser.ast.expr.NameExpr +import com.github.javaparser.ast.expr.NormalAnnotationExpr +import com.github.javaparser.ast.expr.NullLiteralExpr +import com.github.javaparser.ast.expr.SimpleName +import com.github.javaparser.ast.expr.SingleMemberAnnotationExpr +import com.github.javaparser.ast.expr.StringLiteralExpr +import com.github.javaparser.ast.expr.SuperExpr +import com.github.javaparser.ast.expr.VariableDeclarationExpr +import com.github.javaparser.ast.nodeTypes.NodeWithSimpleName +import com.github.javaparser.ast.stmt.BlockStmt +import com.github.javaparser.ast.stmt.ExpressionStmt +import com.github.javaparser.ast.stmt.ReturnStmt +import com.github.javaparser.ast.stmt.Statement +import com.github.javaparser.ast.type.ArrayType +import com.github.javaparser.ast.type.PrimitiveType +import com.github.javaparser.ast.type.PrimitiveType.Primitive.BOOLEAN +import com.github.javaparser.ast.type.PrimitiveType.Primitive.BYTE +import com.github.javaparser.ast.type.PrimitiveType.Primitive.CHAR +import com.github.javaparser.ast.type.PrimitiveType.Primitive.DOUBLE +import com.github.javaparser.ast.type.PrimitiveType.Primitive.FLOAT +import com.github.javaparser.ast.type.PrimitiveType.Primitive.INT +import com.github.javaparser.ast.type.PrimitiveType.Primitive.LONG +import com.github.javaparser.ast.type.PrimitiveType.Primitive.SHORT +import com.github.javaparser.ast.type.ReferenceType +import com.github.javaparser.ast.type.Type +import com.github.javaparser.ast.type.TypeParameter +import com.github.javaparser.printer.DefaultPrettyPrinter +import com.github.javaparser.printer.configuration.DefaultPrinterConfiguration +import com.github.javaparser.printer.configuration.PrinterConfiguration +import org.appdevforall.codeonthego.lsp.java.utils.TypeUtils.toType +import org.appdevforall.codeonthego.lsp.java.visitors.PrettyPrintingVisitor +import jdkx.lang.model.element.ExecutableElement +import jdkx.lang.model.element.Modifier +import jdkx.lang.model.element.TypeParameterElement +import jdkx.lang.model.element.VariableElement +import jdkx.lang.model.type.ExecutableType +import jdkx.lang.model.type.TypeKind +import jdkx.lang.model.type.TypeMirror +import jdkx.lang.model.type.TypeVariable +import openjdk.source.tree.AnnotationTree +import openjdk.source.tree.AssignmentTree +import openjdk.source.tree.BlockTree +import openjdk.source.tree.ClassTree +import openjdk.source.tree.CompilationUnitTree +import openjdk.source.tree.ErroneousTree +import openjdk.source.tree.ExpressionStatementTree +import openjdk.source.tree.ExpressionTree +import openjdk.source.tree.IdentifierTree +import openjdk.source.tree.ImportTree +import openjdk.source.tree.LiteralTree +import openjdk.source.tree.MemberSelectTree +import openjdk.source.tree.MethodInvocationTree +import openjdk.source.tree.MethodTree +import openjdk.source.tree.PackageTree +import openjdk.source.tree.StatementTree +import openjdk.source.tree.Tree +import openjdk.source.tree.TypeParameterTree +import openjdk.source.tree.VariableTree +import org.jetbrains.annotations.Contract +import java.util.function.Predicate +import java.util.stream.IntStream +import java.util.stream.Stream +import kotlin.jvm.optionals.getOrNull + +object JavaParserUtils { + + /** + * Collects all the type names from the given node. + * + * @param type The method to get types from. + * @return A set of fully qualified names of the types in the given node. + */ + fun collectImports(type: ExecutableType): MutableSet { + val types = mutableSetOf() + val returnType = type.returnType + if (returnType != null) { + if ( + returnType.kind != TypeKind.VOID && + returnType.kind != TypeKind.TYPEVAR && + !returnType.kind.isPrimitive + ) { + val fqn = getTypeToImport(returnType) + if (fqn != null) { + types.add(fqn) + } + } + } + if (type.thrownTypes != null) { + for (thrown in type.thrownTypes) { + val fqn = getTypeToImport(thrown) + if (fqn != null) { + types.add(fqn) + } + } + } + for (t in type.parameterTypes) { + if (t.kind.isPrimitive) { + continue + } + val fqn = getTypeToImport(t) + if (fqn != null) { + types.add(fqn) + } + } + return types + } + + @Nullable + private fun getTypeToImport(type: TypeMirror): String? { + if (type.kind.isPrimitive) { + return null + } + if (type.kind == TypeKind.TYPEVAR) { + return null + } + var fqn = toType(type).toString() + if (type.kind == TypeKind.ARRAY) { + fqn = removeArray(fqn) + } + + return removeDiamond(fqn) + } + + fun printMethod( + method: ExecutableElement, + parameterizedType: ExecutableType?, + source: MethodTree, + ): MethodDeclaration { + val methodDeclaration: MethodDeclaration = toMethodDeclaration(source, parameterizedType) + printMethodInternal(methodDeclaration, method) + return methodDeclaration + } + + fun printMethod( + method: ExecutableElement?, + parameterizedType: ExecutableType?, + source: ExecutableElement, + ): MethodDeclaration { + val methodDeclaration: MethodDeclaration = toMethodDeclaration(method, parameterizedType) + printMethodInternal(methodDeclaration, source) + return methodDeclaration + } + + private fun printMethodInternal( + methodDeclaration: MethodDeclaration, + method: ExecutableElement, + ) { + methodDeclaration.addMarkerAnnotation(Override::class.java) + val recentlyNonNull = methodDeclaration.getAnnotationByName("RecentlyNonNull") + if (recentlyNonNull.isPresent) { + methodDeclaration.remove(recentlyNonNull.get()) + methodDeclaration.addMarkerAnnotation(NonNull::class.java) + } + + val blockStmt = BlockStmt() + if (method.modifiers.contains(Modifier.ABSTRACT)) { + methodDeclaration.removeModifier(com.github.javaparser.ast.Modifier.Keyword.ABSTRACT) + if (methodDeclaration.type.isClassOrInterfaceType) { + blockStmt.addStatement(ReturnStmt(NullLiteralExpr())) + } + if (methodDeclaration.type.isPrimitiveType) { + val type = methodDeclaration.type.asPrimitiveType() + blockStmt.addStatement(ReturnStmt(getReturnExpr(type))) + } + } else { + val methodCallExpr = MethodCallExpr() + methodCallExpr.name = methodDeclaration.name + methodCallExpr.arguments = + methodDeclaration.parameters + .stream() + .map { obj: Parameter -> obj.nameAsExpression } + .collect(NodeList.toNodeList()) + methodCallExpr.setScope(SuperExpr()) + if (methodDeclaration.type.isVoidType) { + blockStmt.addStatement(methodCallExpr) + } else { + blockStmt.addStatement(ReturnStmt(methodCallExpr)) + } + } + methodDeclaration.setBody(blockStmt) + } + + private fun getReturnExpr(type: PrimitiveType): Expression { + return when (type.type) { + BOOLEAN -> BooleanLiteralExpr() + BYTE, + DOUBLE, + CHAR, + SHORT, + LONG, + FLOAT, + INT -> IntegerLiteralExpr("0") + + else -> NullLiteralExpr() + } + } + + @Suppress("Since15") + fun toCompilationUnit(tree: CompilationUnitTree): CompilationUnit { + val compilationUnit = CompilationUnit() + compilationUnit.setPackageDeclaration(toPackageDeclaration(tree.getPackage())) + tree.imports.forEach { importTree: ImportTree? -> + compilationUnit.addImport(toImportDeclaration(importTree!!)) + } + compilationUnit.types = + tree.typeDecls + .stream() + .map { toClassOrInterfaceDeclaration(it) } + .collect(NodeList.toNodeList()) + return compilationUnit + } + + @Suppress("Since15") + fun toPackageDeclaration(tree: PackageTree): PackageDeclaration { + val declaration = PackageDeclaration() + declaration.setName(tree.packageName.toString()) + return declaration + } + + fun toImportDeclaration(tree: ImportTree): ImportDeclaration { + val name = tree.qualifiedIdentifier.toString() + val isAsterisk = name.endsWith("*") + return ImportDeclaration(name, tree.isStatic, isAsterisk) + } + + fun toClassOrInterfaceDeclaration(tree: Tree?): ClassOrInterfaceDeclaration? { + return if (tree is ClassTree) { + toClassOrInterfaceDeclaration(tree as ClassTree?) + } else null + } + + fun toBlockStatement(tree: BlockTree): BlockStmt { + val blockStmt = BlockStmt() + blockStmt.statements = + tree.statements.stream().map { toStatement(it) }.collect(NodeList.toNodeList()) + return blockStmt + } + + fun toStatement(tree: StatementTree?): Statement? { + if (tree is ExpressionStatementTree) { + return toExpressionStatement((tree as ExpressionStatementTree?)!!) + } + return if (tree is VariableTree) { + toVariableDeclarationExpression((tree as VariableTree?)!!) + } else StaticJavaParser.parseStatement(tree.toString()) + } + + fun toExpressionStatement(tree: ExpressionStatementTree): ExpressionStmt { + val expressionStmt = ExpressionStmt() + expressionStmt.expression = toExpression(tree.expression) + return expressionStmt + } + + fun toExpression(tree: ExpressionTree?): Expression? { + if (tree is MethodInvocationTree) { + return toMethodCallExpression((tree as MethodInvocationTree?)!!) + } + if (tree is MemberSelectTree) { + return toFieldAccessExpression((tree as MemberSelectTree?)!!) + } + if (tree is IdentifierTree) { + return toNameExpr((tree as IdentifierTree?)!!) + } + if (tree is LiteralTree) { + return toLiteralExpression((tree as LiteralTree?)!!) + } + if (tree is AssignmentTree) { + return toAssignExpression((tree as AssignmentTree?)!!) + } + if (tree is ErroneousTree) { + val erroneousTree = tree as ErroneousTree? + if (erroneousTree!!.errorTrees.isNotEmpty()) { + val errorTree = erroneousTree.errorTrees[0] + return toExpression(errorTree as ExpressionTree) + } + } + return null + } + + private fun toAssignExpression(tree: AssignmentTree): AssignExpr { + val assignExpr = AssignExpr() + assignExpr.target = toExpression(tree.variable) + assignExpr.value = toExpression(tree.expression) + return assignExpr + } + + fun toVariableDeclarationExpression(tree: VariableTree): ExpressionStmt { + val expr = VariableDeclarationExpr() + expr.modifiers = + tree.modifiers.flags.stream().map { toModifier(it) }.collect(NodeList.toNodeList()) + val declarator = VariableDeclarator() + declarator.setName(tree.name.toString()) + declarator.setInitializer(toExpression(tree.initializer)) + declarator.type = toType(tree.type) + expr.addVariable(declarator) + val stmt = ExpressionStmt() + stmt.expression = expr + return stmt + } + + fun toNameExpr(tree: IdentifierTree): NameExpr { + val nameExpr = NameExpr() + nameExpr.setName(tree.name.toString()) + return nameExpr + } + + fun toLiteralExpression(tree: LiteralTree): LiteralExpr? { + val value = tree.value + if (value is String) { + return StringLiteralExpr(value) + } + if (value is Boolean) { + return BooleanLiteralExpr(value) + } + if (value is Int) { + return IntegerLiteralExpr(value.toString()) + } + if (value is Char) { + return CharLiteralExpr(value) + } + if (value is Long) { + return LongLiteralExpr(value.toString()) + } + return if (value is Double) { + DoubleLiteralExpr(value) + } else null + } + + fun toMethodCallExpression(tree: MethodInvocationTree): MethodCallExpr { + val expr = MethodCallExpr() + if (tree.methodSelect is MemberSelectTree) { + val methodSelect = tree.methodSelect as MemberSelectTree + expr.setScope(toExpression(methodSelect.expression)) + expr.setName(methodSelect.identifier.toString()) + } + expr.arguments = tree.arguments.stream().map { toExpression(it) }.collect(NodeList.toNodeList()) + expr.setTypeArguments( + tree.typeArguments.stream().map { toType(it) }.collect(NodeList.toNodeList()) + ) + if (tree.methodSelect is IdentifierTree) { + expr.name = toNameExpr((tree.methodSelect as IdentifierTree)).name + } + return expr + } + + fun toFieldAccessExpression(tree: MemberSelectTree): FieldAccessExpr { + val fieldAccessExpr = FieldAccessExpr() + fieldAccessExpr.setName(tree.identifier.toString()) + fieldAccessExpr.scope = toExpression(tree.expression) + return fieldAccessExpr + } + + fun toClassOrInterfaceDeclaration(tree: ClassTree): ClassOrInterfaceDeclaration { + val declaration = ClassOrInterfaceDeclaration() + declaration.setName(tree.simpleName.toString()) + declaration.extendedTypes = + NodeList.nodeList(TypeUtils.toClassOrInterfaceType(tree.extendsClause)) + declaration.typeParameters = + tree.typeParameters.stream().map { toTypeParameter(it) }.collect(NodeList.toNodeList()) + declaration.typeParameters = + tree.typeParameters.stream().map { toTypeParameter(it) }.collect(NodeList.toNodeList()) + declaration.implementedTypes = + tree.implementsClause + .stream() + .map { TypeUtils.toClassOrInterfaceType(it) } + .collect(NodeList.toNodeList()) + declaration.modifiers = + tree.modifiers.flags.stream().map { toModifier(it) }.collect(NodeList.toNodeList()) + declaration.members = + tree.members.stream().map { toBodyDeclaration(it) }.collect(NodeList.toNodeList()) + return declaration + } + + fun toBodyDeclaration(tree: Tree?): BodyDeclaration<*>? { + if (tree is MethodTree) { + return toMethodDeclaration((tree as MethodTree?)!!, null) + } + return if (tree is VariableTree) { + toFieldDeclaration((tree as VariableTree?)!!) + } else null + } + + fun toFieldDeclaration(tree: VariableTree): FieldDeclaration { + val declaration = FieldDeclaration() + declaration.modifiers = + tree.modifiers.flags.stream().map { toModifier(it) }.collect(NodeList.toNodeList()) + val declarator = VariableDeclarator() + declarator.setName(tree.name.toString()) + val initializer = toExpression(tree.initializer) + if (initializer != null) { + declarator.setInitializer(initializer) + } + val type = toType(tree.type) + if (type != null) { + declarator.type = type + } + declaration.addVariable(declarator) + return declaration + } + + fun toMethodDeclaration(method: MethodTree, type: ExecutableType?): MethodDeclaration { + val methodDeclaration = MethodDeclaration() + methodDeclaration.annotations = + method.modifiers.annotations.stream().map { toAnnotation(it) }.collect(NodeList.toNodeList()) + methodDeclaration.setName(method.name.toString()) + val returnType = + if (type != null) { + toType(type.returnType) + } else { + toType(method.returnType) + } + if (returnType != null) { + methodDeclaration.type = getTypeWithoutBounds(returnType) + } + methodDeclaration.modifiers = + method.modifiers.flags.stream().map { toModifier(it) }.collect(NodeList.toNodeList()) + methodDeclaration.parameters = + method.parameters + .map { variable -> + return@map toParameter(variable).also { param -> + val firstType = getTypeWithoutBounds(param.type) + param.type = firstType + } + } + .toNodeList() + methodDeclaration.typeParameters = + method.typeParameters + .mapNotNull { + return@mapNotNull toType(it as Tree?)?.toTypeParameter()?.getOrNull() + } + .toNodeList() + if (method.body != null) { + methodDeclaration.setBody(toBlockStatement(method.body)) + } + if (method.receiverParameter != null) { + methodDeclaration.setReceiverParameter(toReceiverParameter(method.receiverParameter)) + } + return methodDeclaration + } + + fun toAnnotation(tree: AnnotationTree): AnnotationExpr { + if (tree.arguments.isEmpty()) { + val expr = MarkerAnnotationExpr() + expr.setName(toType(tree.annotationType).toString()) + return expr + } + if (tree.arguments.size == 1) { + val expr = SingleMemberAnnotationExpr() + expr.setName(toType(tree.annotationType).toString()) + expr.memberValue = toExpression(tree.arguments[0]) + return expr + } + val expr = NormalAnnotationExpr() + expr.setName(toType(tree.annotationType).toString()) + expr.pairs = + tree.arguments + .map { + return@map if (it is AssignmentTree) { + val assignExpr = toAssignExpression((it as AssignmentTree?)!!) + val pair = MemberValuePair() + pair.setName(assignExpr.target.toString()) + pair.value = assignExpr.value + pair + } else null + } + .toNodeList() + return expr + } + + fun toParameter(tree: VariableTree): Parameter { + val parameter = Parameter() + parameter.type = toType(tree.type) + tree.modifiers.flags.map { toModifier(it) }.toNodeList().also { parameter.modifiers = it } + parameter.setName(tree.name.toString()) + return parameter + } + + /** + * Convert a parameter into [Parameter] object. This method is called from source files, giving + * their accurate names. + */ + fun toParameter(type: TypeMirror?, name: VariableTree): Parameter { + val parameter = Parameter() + parameter.setType(EditHelper.printType(type)) + parameter.setName(name.name.toString()) + parameter.modifiers = name.modifiers.flags.map { toModifier(it) }.toNodeList() + parameter.setName(name.name.toString()) + return parameter + } + + fun toTypeParameter(type: TypeParameterTree): TypeParameter? { + return StaticJavaParser.parseTypeParameter(type.toString()) + } + + fun toReceiverParameter(parameter: VariableTree): ReceiverParameter { + val receiverParameter = ReceiverParameter() + receiverParameter.setName(parameter.name.toString()) + receiverParameter.type = toType(parameter.type) + return receiverParameter + } + + fun toMethodDeclaration(method: ExecutableElement?, type: ExecutableType?): MethodDeclaration { + val methodDeclaration = MethodDeclaration() + val returnType = + if (type != null) { + toType(type.returnType) + } else { + toType(method!!.returnType) + } + if (returnType != null) { + methodDeclaration.type = getTypeWithoutBounds(returnType) + } + methodDeclaration.isDefault = method!!.isDefault + methodDeclaration.setName(method.simpleName.toString()) + methodDeclaration.setModifiers( + *method.modifiers + .stream() + .map { com.github.javaparser.ast.Modifier.Keyword.valueOf(it!!.name) } + .asArray() + ) + methodDeclaration.parameters = + IntStream.range(0, method.parameters.size) + .mapToObj { + return@mapToObj toParameter(type!!.parameterTypes[it], + method.parameters[it]).also { parameter -> + val firstType = getTypeWithoutBounds(parameter.type) + parameter.type = firstType + } + } + .collect(NodeList.toNodeList()) + methodDeclaration.typeParameters = + type!! + .typeVariables + .mapNotNull { toType(it as TypeMirror?)?.toTypeParameter()?.getOrNull() } + .toNodeList() + return methodDeclaration + } + + fun getFirstArrayType(type: Type): Type { + if (type.isTypeParameter) { + val typeParameter = type.asTypeParameter() + if (typeParameter!!.typeBound.isNonEmpty) { + val first = typeParameter.typeBound.first + if (first!!.isPresent) { + return ArrayType(first.get()) + } + } + } + return type + } + + fun getFirstType(type: Type): Type { + if (type.isTypeParameter) { + val typeParameter = type.asTypeParameter() + if (typeParameter!!.typeBound.isNonEmpty) { + val first = typeParameter.typeBound.first + if (first!!.isPresent) { + return first.get() + } + } + } + if (!type.isClassOrInterfaceType) { + return type + } + + val typeArguments = type.asClassOrInterfaceType().typeArguments + if (!typeArguments!!.isPresent || !typeArguments.get().isNonEmpty) { + return type + } + + val first = typeArguments.get().first + if (!first!!.isPresent || !first.get().isTypeParameter) { + return type + } + + val typeBound = first.get().asTypeParameter().typeBound + if (!typeBound!!.isNonEmpty) { + return type + } + + val first1 = typeBound.first + if (!first1!!.isPresent) { + return type + } + + type.asClassOrInterfaceType().setTypeArguments(first1.get()) + return type + } + + fun getTypeWithoutBounds(type: Type): Type { + if (type.isArrayType && !type.asArrayType().componentType.isTypeParameter) { + return type + } + if (!type.isArrayType && !type.isTypeParameter) { + return type + } + if (type is NodeWithSimpleName<*>) { + return StaticJavaParser.parseClassOrInterfaceType( + (type as NodeWithSimpleName<*>).nameAsString + ) + } + return if (type.isArrayType) { + ArrayType(getTypeWithoutBounds(type.asArrayType().componentType)) + } else type + } + + @Contract("_ -> new") + fun toModifier(modifier: Modifier): com.github.javaparser.ast.Modifier { + return com.github.javaparser.ast.Modifier( + com.github.javaparser.ast.Modifier.Keyword.valueOf(modifier.name) + ) + } + + /** + * Convert a parameter into [Parameter] object. This method is called from compiled class files, + * giving inaccurate parameter names + */ + fun toParameter(type: TypeMirror?, name: VariableElement?): Parameter { + val parameter = Parameter() + parameter.setType(EditHelper.printType(type)) + if (parameter.type.isArrayType) { + if ((type as openjdk.tools.javac.code.Type.ArrayType?)!!.isVarargs) { + parameter.type = parameter.type.asArrayType().componentType + parameter.isVarArgs = true + } + } + parameter.setName(name!!.simpleName.toString()) + parameter.modifiers = name.modifiers.map { toModifier(it) }.toNodeList() + parameter.setName(name.simpleName.toString()) + return parameter + } + + fun toTypeParameter(type: TypeParameterElement): TypeParameter? { + return StaticJavaParser.parseTypeParameter(type.toString()) + } + + fun toTypeParameter(typeVariable: TypeVariable): TypeParameter? { + return StaticJavaParser.parseTypeParameter(typeVariable.toString()) + } + + fun getClassNames(type: Type): MutableList { + val classNames: MutableList = ArrayList() + if (type.isClassOrInterfaceType) { + classNames.add(type.asClassOrInterfaceType().name.asString()) + } + if (type.isWildcardType) { + val wildcardType = type.asWildcardType() + wildcardType!!.extendedType.ifPresent { t: ReferenceType? -> + classNames.addAll(getClassNames(t!!)) + } + wildcardType.superType.ifPresent { t: ReferenceType? -> + classNames.addAll(getClassNames(t!!)) + } + } + if (type.isArrayType) { + classNames.addAll(getClassNames(type.asArrayType().componentType)) + } + if (type.isIntersectionType) { + type + .asIntersectionType() + .elements + .stream() + .map { getClassNames(it) } + .forEach { c: MutableList? -> classNames.addAll(c!!) } + } + return classNames + } + + /** + * Print a node declaration into its string representation + * + * @param node node to print + * @param delegate callback to whether a class name should be printed as fully qualified names + * @return String representation of the method declaration properly formatted + */ + fun prettyPrint(node: Node?, delegate: Predicate?): String? { + val configuration: PrinterConfiguration = DefaultPrinterConfiguration() + val visitor: PrettyPrintingVisitor = + object : PrettyPrintingVisitor(configuration) { + override fun visit(n: SimpleName?, arg: Void?) { + printOrphanCommentsBeforeThisChildNode(n) + printComment(n!!.comment, arg) + val identifier = n.identifier + if (delegate!!.test(identifier)) { + printer.print(identifier) + } else { + printer.print(getSimpleName(identifier)) + } + } + + override fun visit(n: Name?, arg: Void?) { + super.visit(n, arg) + } + } + val prettyPrinter = DefaultPrettyPrinter({ visitor }, configuration) + return prettyPrinter.print(node) + } + + @JvmStatic + fun getSimpleName(className: String?): String { + var name = className + name = removeDiamond(name!!) + val dot = name.lastIndexOf('.') + if (dot == -1) { + return name + } + return if (name.startsWith("? extends")) { + "? extends " + name.substring(dot + 1) + } else name.substring(dot + 1) + } + + fun removeDiamond(className: String): String { + var name = className + if (name.contains("<")) { + name = name.substring(0, name.indexOf('<')) + } + return name + } + + fun removeArray(className: String): String { + var name = className + if (name.contains("[")) { + name = name.substring(0, name.indexOf('[')) + } + return name + } +} + +private fun Collection.toNodeList(): NodeList { + return NodeList(this) +} + +private inline fun Stream.asArray(): Array { + val arr = mutableListOf() + for (element in this) { + arr.add(element) + } + + return arr.toTypedArray() +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/JavaPoetUtils.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/JavaPoetUtils.kt similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/JavaPoetUtils.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/JavaPoetUtils.kt index 4a2ec418e9..bfd324778b 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/JavaPoetUtils.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/JavaPoetUtils.kt @@ -1,109 +1,109 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.utils - -import com.itsaky.androidide.preferences.utils.indentationString -import com.squareup.javapoet.AnnotationSpec -import com.squareup.javapoet.ImportCollectingCodeWriter -import com.squareup.javapoet.MethodSpec -import jdkx.lang.model.element.ExecutableElement -import jdkx.lang.model.element.Modifier -import jdkx.lang.model.type.DeclaredType -import jdkx.lang.model.type.NoType -import jdkx.lang.model.type.NullType -import jdkx.lang.model.type.TypeKind -import jdkx.lang.model.util.Types - -/** @author Akash Yadav */ -class JavaPoetUtils { - companion object { - @JvmStatic - fun print( - method: MethodSpec, - importsOut: MutableSet, - qualifiedNames: Boolean = true, - ): String { - val sb = StringBuilder() - val writer = ImportCollectingCodeWriter(sb, indentationString, emptySet(), emptySet()) - - writer.isPrintQualifiedNames = qualifiedNames - writer.emit(method) - importsOut.addAll(writer.importClasses) - - return sb.toString() - } - - @JvmStatic - fun print(build: MethodSpec, imports: MutableSet): String { - return print(build, imports, true) - } - - @JvmStatic - fun buildMethod( - method: ExecutableElement, - types: Types, - type: DeclaredType - ): MethodSpec.Builder { - val builder = MethodSpec.overriding(method, type, types) - val mirrors = method.annotationMirrors - if (mirrors != null && mirrors.isNotEmpty()) { - for (mirror in mirrors) { - if (mirror !is NullType && mirror.annotationType.kind != TypeKind.NULL) { - builder.addAnnotation(AnnotationSpec.get(mirror)) - } - } - } - var addComment = true - // Add super call if the method is not abstract - if (!method.modifiers.contains(Modifier.ABSTRACT)) { - if (method.returnType is NoType) { - builder.addStatement(createSuperCall(builder)) - } else { - addComment = false - builder.addComment("TODO: Implement this method") - builder.addStatement("return " + createSuperCall(builder)) - } - } - if (addComment) { - builder.addComment("TODO: Implement this method") - } - return builder - } - - /** - * Create a superclass method invocation statement. - * - * @param builder The method builder. - * @return The super invocation statement string without ending ';'. - */ - private fun createSuperCall(builder: MethodSpec.Builder): String { - val sb = java.lang.StringBuilder() - sb.append("super.") - sb.append(builder.name) - sb.append("(") - for (i in builder.parameters.indices) { - sb.append(builder.parameters[i].name) - if (i != builder.parameters.size - 1) { - sb.append(", ") - } - } - sb.append(")") - return sb.toString() - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.utils + +import org.appdevforall.codeonthego.preferences.utils.indentationString +import com.squareup.javapoet.AnnotationSpec +import com.squareup.javapoet.ImportCollectingCodeWriter +import com.squareup.javapoet.MethodSpec +import jdkx.lang.model.element.ExecutableElement +import jdkx.lang.model.element.Modifier +import jdkx.lang.model.type.DeclaredType +import jdkx.lang.model.type.NoType +import jdkx.lang.model.type.NullType +import jdkx.lang.model.type.TypeKind +import jdkx.lang.model.util.Types + +/** @author Akash Yadav */ +class JavaPoetUtils { + companion object { + @JvmStatic + fun print( + method: MethodSpec, + importsOut: MutableSet, + qualifiedNames: Boolean = true, + ): String { + val sb = StringBuilder() + val writer = ImportCollectingCodeWriter(sb, indentationString, emptySet(), emptySet()) + + writer.isPrintQualifiedNames = qualifiedNames + writer.emit(method) + importsOut.addAll(writer.importClasses) + + return sb.toString() + } + + @JvmStatic + fun print(build: MethodSpec, imports: MutableSet): String { + return print(build, imports, true) + } + + @JvmStatic + fun buildMethod( + method: ExecutableElement, + types: Types, + type: DeclaredType + ): MethodSpec.Builder { + val builder = MethodSpec.overriding(method, type, types) + val mirrors = method.annotationMirrors + if (mirrors != null && mirrors.isNotEmpty()) { + for (mirror in mirrors) { + if (mirror !is NullType && mirror.annotationType.kind != TypeKind.NULL) { + builder.addAnnotation(AnnotationSpec.get(mirror)) + } + } + } + var addComment = true + // Add super call if the method is not abstract + if (!method.modifiers.contains(Modifier.ABSTRACT)) { + if (method.returnType is NoType) { + builder.addStatement(createSuperCall(builder)) + } else { + addComment = false + builder.addComment("TODO: Implement this method") + builder.addStatement("return " + createSuperCall(builder)) + } + } + if (addComment) { + builder.addComment("TODO: Implement this method") + } + return builder + } + + /** + * Create a superclass method invocation statement. + * + * @param builder The method builder. + * @return The super invocation statement string without ending ';'. + */ + private fun createSuperCall(builder: MethodSpec.Builder): String { + val sb = java.lang.StringBuilder() + sb.append("super.") + sb.append(builder.name) + sb.append("(") + for (i in builder.parameters.indices) { + sb.append(builder.parameters[i].name) + if (i != builder.parameters.size - 1) { + sb.append(", ") + } + } + sb.append(")") + return sb.toString() + } + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/MarkdownHelper.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/MarkdownHelper.java similarity index 97% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/MarkdownHelper.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/MarkdownHelper.java index fa687be4cc..55d68ac45b 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/MarkdownHelper.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/MarkdownHelper.java @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.utils; +package org.appdevforall.codeonthego.lsp.java.utils; -import com.itsaky.androidide.lsp.models.MarkupContent; -import com.itsaky.androidide.lsp.models.MarkupKind; +import org.appdevforall.codeonthego.lsp.models.MarkupContent; +import org.appdevforall.codeonthego.lsp.models.MarkupKind; import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/MethodPtr.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/MethodPtr.java similarity index 95% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/MethodPtr.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/MethodPtr.java index 803a3c1fb1..28ac0e434f 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/MethodPtr.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/MethodPtr.java @@ -1,105 +1,105 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.utils; - -import androidx.annotation.NonNull; -import com.squareup.javapoet.ImportCollectingCodeWriter; -import com.squareup.javapoet.TypeName; -import java.io.IOException; -import java.util.Arrays; -import java.util.Objects; -import jdkx.lang.model.element.ExecutableElement; -import jdkx.lang.model.element.TypeElement; -import jdkx.lang.model.element.VariableElement; -import jdkx.lang.model.type.TypeKind; -import jdkx.lang.model.type.TypeMirror; -import jdkx.lang.model.util.Types; -import openjdk.source.util.JavacTask; - -/** - * @author Akash Yadav - */ -public class MethodPtr { - - public String className, methodName; - public String[] erasedParameterTypes; - public String[] simplifiedErasedParameterTypes; - - public MethodPtr(@NonNull JavacTask task, @NonNull ExecutableElement method) { - final Types types = task.getTypes(); - final TypeElement parent = (TypeElement) method.getEnclosingElement(); - className = parent.getQualifiedName().toString(); - methodName = method.getSimpleName().toString(); - erasedParameterTypes = new String[method.getParameters().size()]; - simplifiedErasedParameterTypes = new String[erasedParameterTypes.length]; - - for (int i = 0; i < erasedParameterTypes.length; i++) { - final VariableElement param = method.getParameters().get(i); - final TypeMirror type = param.asType(); - final TypeMirror erased = types.erasure(type); - erasedParameterTypes[i] = erased.toString(); - simplifiedErasedParameterTypes[i] = simplify(erased); - } - } - - private String simplify(@NonNull TypeMirror type) { - - if (type.getKind() == TypeKind.NULL) { - return type.toString(); - } - - final TypeName name = TypeName.get(type); - try { - return getSimpleName(name); - } catch (IOException e) { - return type.toString(); - } - } - - @NonNull - private String getSimpleName(TypeName name) throws IOException { - final StringBuilder sb = new StringBuilder(); - final ImportCollectingCodeWriter writer = new ImportCollectingCodeWriter(sb); - writer.setPrintQualifiedNames(false); - writer.emit(name); - return sb.toString(); - } - - @Override - public int hashCode() { - int result = Objects.hash(className, methodName); - result = 31 * result + Arrays.hashCode(erasedParameterTypes); - result = 31 * result + Arrays.hashCode(simplifiedErasedParameterTypes); - return result; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof MethodPtr)) { - return false; - } - MethodPtr methodPtr = (MethodPtr) o; - return Objects.equals(className, methodPtr.className) - && Objects.equals(methodName, methodPtr.methodName) - && Arrays.equals(erasedParameterTypes, methodPtr.erasedParameterTypes) - && Arrays.equals(simplifiedErasedParameterTypes, methodPtr.simplifiedErasedParameterTypes); - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.utils; + +import androidx.annotation.NonNull; +import com.squareup.javapoet.ImportCollectingCodeWriter; +import com.squareup.javapoet.TypeName; +import java.io.IOException; +import java.util.Arrays; +import java.util.Objects; +import jdkx.lang.model.element.ExecutableElement; +import jdkx.lang.model.element.TypeElement; +import jdkx.lang.model.element.VariableElement; +import jdkx.lang.model.type.TypeKind; +import jdkx.lang.model.type.TypeMirror; +import jdkx.lang.model.util.Types; +import openjdk.source.util.JavacTask; + +/** + * @author Akash Yadav + */ +public class MethodPtr { + + public String className, methodName; + public String[] erasedParameterTypes; + public String[] simplifiedErasedParameterTypes; + + public MethodPtr(@NonNull JavacTask task, @NonNull ExecutableElement method) { + final Types types = task.getTypes(); + final TypeElement parent = (TypeElement) method.getEnclosingElement(); + className = parent.getQualifiedName().toString(); + methodName = method.getSimpleName().toString(); + erasedParameterTypes = new String[method.getParameters().size()]; + simplifiedErasedParameterTypes = new String[erasedParameterTypes.length]; + + for (int i = 0; i < erasedParameterTypes.length; i++) { + final VariableElement param = method.getParameters().get(i); + final TypeMirror type = param.asType(); + final TypeMirror erased = types.erasure(type); + erasedParameterTypes[i] = erased.toString(); + simplifiedErasedParameterTypes[i] = simplify(erased); + } + } + + private String simplify(@NonNull TypeMirror type) { + + if (type.getKind() == TypeKind.NULL) { + return type.toString(); + } + + final TypeName name = TypeName.get(type); + try { + return getSimpleName(name); + } catch (IOException e) { + return type.toString(); + } + } + + @NonNull + private String getSimpleName(TypeName name) throws IOException { + final StringBuilder sb = new StringBuilder(); + final ImportCollectingCodeWriter writer = new ImportCollectingCodeWriter(sb); + writer.setPrintQualifiedNames(false); + writer.emit(name); + return sb.toString(); + } + + @Override + public int hashCode() { + int result = Objects.hash(className, methodName); + result = 31 * result + Arrays.hashCode(erasedParameterTypes); + result = 31 * result + Arrays.hashCode(simplifiedErasedParameterTypes); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof MethodPtr)) { + return false; + } + MethodPtr methodPtr = (MethodPtr) o; + return Objects.equals(className, methodPtr.className) + && Objects.equals(methodName, methodPtr.methodName) + && Arrays.equals(erasedParameterTypes, methodPtr.erasedParameterTypes) + && Arrays.equals(simplifiedErasedParameterTypes, methodPtr.simplifiedErasedParameterTypes); + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/NavigationHelper.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/NavigationHelper.java similarity index 93% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/NavigationHelper.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/NavigationHelper.java index 309d5fe1fb..0fe9b9e5de 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/NavigationHelper.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/NavigationHelper.java @@ -32,12 +32,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.utils; +package org.appdevforall.codeonthego.lsp.java.utils; import androidx.annotation.Nullable; -import com.itsaky.androidide.lsp.java.compiler.CompileTask; -import com.itsaky.androidide.lsp.java.visitors.FindNameAt; -import com.itsaky.androidide.progress.ICancelChecker; +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask; +import org.appdevforall.codeonthego.lsp.java.visitors.FindNameAt; +import org.appdevforall.codeonthego.progress.ICancelChecker; import java.nio.file.Path; import jdkx.lang.model.element.Element; import jdkx.lang.model.element.Modifier; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/ScopeHelper.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/ScopeHelper.java similarity index 96% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/ScopeHelper.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/ScopeHelper.java index b7990091e5..e5636920a2 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/ScopeHelper.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/ScopeHelper.java @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.utils; +package org.appdevforall.codeonthego.lsp.java.utils; -import com.itsaky.androidide.lsp.java.compiler.CompileTask; +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask; import java.util.ArrayList; import java.util.List; import java.util.function.Predicate; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/ShortTypePrinter.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/ShortTypePrinter.java similarity index 98% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/ShortTypePrinter.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/ShortTypePrinter.java index 14a63d33b0..fc2133a84f 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/ShortTypePrinter.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/ShortTypePrinter.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.utils; +package org.appdevforall.codeonthego.lsp.java.utils; import java.util.stream.Collectors; import jdkx.lang.model.type.ArrayType; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/TestUtils.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/TestUtils.kt similarity index 92% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/TestUtils.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/TestUtils.kt index c3362e37b9..0af79cbe33 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/TestUtils.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/TestUtils.kt @@ -1,37 +1,37 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.utils - -/** - * Utility related to tests. - * - * @author Akash Yadav - */ -class TestUtils { - companion object { - @JvmStatic - fun isTestEnvironment(): Boolean { - return try { - Class.forName("org.robolectric.RobolectricTestRunner") - true - } catch (error: ClassNotFoundException) { - false - } - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.utils + +/** + * Utility related to tests. + * + * @author Akash Yadav + */ +class TestUtils { + companion object { + @JvmStatic + fun isTestEnvironment(): Boolean { + return try { + Class.forName("org.robolectric.RobolectricTestRunner") + true + } catch (error: ClassNotFoundException) { + false + } + } + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/TreeUtils.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/TreeUtils.kt similarity index 97% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/TreeUtils.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/TreeUtils.kt index a9e67596a0..b7fa32be5e 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/TreeUtils.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/TreeUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.utils +package org.appdevforall.codeonthego.lsp.java.utils import openjdk.source.tree.MethodTree import openjdk.source.tree.Tree diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/TypeUtils.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/TypeUtils.java similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/TypeUtils.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/TypeUtils.java index 3c5385c9d8..159a1e2837 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/TypeUtils.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/TypeUtils.java @@ -1,288 +1,288 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.java.utils; - -import static com.itsaky.androidide.projects.util.StringSearch.containsClass; -import static com.itsaky.androidide.projects.util.StringSearch.containsInterface; - -import com.github.javaparser.StaticJavaParser; -import com.github.javaparser.ast.NodeList; -import com.github.javaparser.ast.expr.SimpleName; -import com.github.javaparser.ast.type.ArrayType; -import com.github.javaparser.ast.type.ClassOrInterfaceType; -import com.github.javaparser.ast.type.IntersectionType; -import com.github.javaparser.ast.type.PrimitiveType; -import com.github.javaparser.ast.type.ReferenceType; -import com.github.javaparser.ast.type.Type; -import com.github.javaparser.ast.type.TypeParameter; -import com.github.javaparser.ast.type.UnknownType; -import com.github.javaparser.ast.type.VoidType; -import com.github.javaparser.ast.type.WildcardType; -import com.github.javaparser.printer.DefaultPrettyPrinter; -import com.github.javaparser.printer.configuration.DefaultPrinterConfiguration; -import com.github.javaparser.printer.configuration.PrinterConfiguration; -import com.itsaky.androidide.lsp.java.visitors.PrettyPrintingVisitor; -import java.nio.file.Path; -import java.util.Objects; -import java.util.function.Predicate; -import jdkx.lang.model.element.TypeElement; -import jdkx.lang.model.type.DeclaredType; -import jdkx.lang.model.type.NoType; -import jdkx.lang.model.type.TypeKind; -import jdkx.lang.model.type.TypeMirror; -import jdkx.lang.model.type.TypeVariable; -import openjdk.source.tree.IdentifierTree; -import openjdk.source.tree.ParameterizedTypeTree; -import openjdk.source.tree.PrimitiveTypeTree; -import openjdk.source.tree.Tree; -import openjdk.source.tree.TypeParameterTree; -import openjdk.source.tree.WildcardTree; -import openjdk.tools.javac.code.BoundKind; -import openjdk.tools.javac.tree.JCTree; - -public class TypeUtils { - - // trees - public static ClassOrInterfaceType toClassOrInterfaceType(Tree tree) { - ClassOrInterfaceType type = new ClassOrInterfaceType(); - if (tree instanceof IdentifierTree) { - type.setName(((IdentifierTree) tree).getName().toString()); - } - if (tree instanceof ParameterizedTypeTree) { - ParameterizedTypeTree parameterizedTypeTree = (ParameterizedTypeTree) tree; - Type t = toType(parameterizedTypeTree.getType()); - - NodeList typeArguments = new NodeList<>(); - for (Tree typeArgument : parameterizedTypeTree.getTypeArguments()) { - Type typ = toType(typeArgument); - typeArguments.add(typ); - } - if (t.isClassOrInterfaceType()) { - type.setName(t.asClassOrInterfaceType().getName()); - } - type.setTypeArguments(typeArguments); - } - return type; - } - - public static Type toType(Tree tree) { - Type type; - if (tree instanceof PrimitiveTypeTree) { - type = getPrimitiveType((PrimitiveTypeTree) tree); - } else if (tree instanceof IdentifierTree) { - type = toClassOrInterfaceType(tree); - } else if (tree instanceof WildcardTree) { - JCTree.JCWildcard wildcardTree = (JCTree.JCWildcard) tree; - WildcardType wildcardType = new WildcardType(); - Tree bound = wildcardTree.getBound(); - Type boundType = toType(bound); - if (wildcardTree.kind.kind == BoundKind.EXTENDS) { - wildcardType.setExtendedType((ReferenceType) boundType); - } else { - wildcardType.setSuperType((ReferenceType) boundType); - } - type = wildcardType; - } else if (tree instanceof ParameterizedTypeTree) { - type = toClassOrInterfaceType(tree); - } else if (tree instanceof TypeParameterTree) { - TypeParameter typeParameter = new TypeParameter(); - typeParameter.setName(((TypeParameterTree) tree).getName().toString()); - typeParameter.setTypeBound( - ((TypeParameterTree) tree) - .getBounds().stream() - .map(TypeUtils::toClassOrInterfaceType) - .collect(NodeList.toNodeList())); - type = typeParameter; - } else { - if (tree != null) { - type = StaticJavaParser.parseType(tree.toString()); - } else { - type = null; - } - } - return type; - } - - public static Type getPrimitiveType(PrimitiveTypeTree tree) { - Type type; - switch (tree.getPrimitiveTypeKind()) { - case INT: - type = PrimitiveType.intType(); - break; - case BOOLEAN: - type = PrimitiveType.booleanType(); - break; - case LONG: - type = PrimitiveType.longType(); - break; - case SHORT: - type = PrimitiveType.shortType(); - break; - case CHAR: - type = PrimitiveType.charType(); - break; - case FLOAT: - type = PrimitiveType.floatType(); - break; - case VOID: - type = new VoidType(); - break; - default: - type = new UnknownType(); - } - return type; - } - - public static Type toType(TypeMirror typeMirror) { - if (typeMirror.getKind() == TypeKind.ARRAY) { - return toArrayType((jdkx.lang.model.type.ArrayType) typeMirror); - } - if (typeMirror.getKind().isPrimitive()) { - return toPrimitiveType((jdkx.lang.model.type.PrimitiveType) typeMirror); - } - if (typeMirror instanceof jdkx.lang.model.type.IntersectionType) { - return toIntersectionType((jdkx.lang.model.type.IntersectionType) typeMirror); - } - if (typeMirror instanceof jdkx.lang.model.type.WildcardType) { - return toWildcardType((jdkx.lang.model.type.WildcardType) typeMirror); - } - if (typeMirror instanceof jdkx.lang.model.type.DeclaredType) { - return toClassOrInterfaceType((DeclaredType) typeMirror); - } - if (typeMirror instanceof jdkx.lang.model.type.TypeVariable) { - return toType(((TypeVariable) typeMirror)); - } - if (typeMirror instanceof NoType) { - return new VoidType(); - } - return null; - } - - // type mirrors - - public static IntersectionType toIntersectionType(jdkx.lang.model.type.IntersectionType type) { - NodeList collect = - type.getBounds().stream() - .map(TypeUtils::toType) - .map(it -> ((ReferenceType) it)) - .collect(NodeList.toNodeList()); - return new IntersectionType(collect); - } - - public static Type toType(TypeVariable typeVariable) { - TypeParameter typeParameter = new TypeParameter(); - TypeMirror upperBound = typeVariable.getUpperBound(); - - if (!typeVariable.equals(upperBound)) { - Type type = toType(upperBound); - if (type != null) { - if (type.isIntersectionType()) { - typeParameter.setTypeBound( - type.asIntersectionType().getElements().stream() - .filter(Type::isClassOrInterfaceType) - .map(Type::asClassOrInterfaceType) - .collect(NodeList.toNodeList())); - } else if (type.isClassOrInterfaceType()) { - typeParameter.setTypeBound(NodeList.nodeList(type.asClassOrInterfaceType())); - } - } - } - typeParameter.setName(typeVariable.toString()); - return typeParameter; - } - - public static WildcardType toWildcardType(jdkx.lang.model.type.WildcardType type) { - WildcardType wildcardType = new WildcardType(); - if (type.getSuperBound() != null) { - Type result = toType(type.getSuperBound()); - if (result instanceof ReferenceType) { - wildcardType.setSuperType((ReferenceType) result); - } else if (result instanceof WildcardType) { - wildcardType = result.asWildcardType(); - } - } - - if (type.getExtendsBound() != null) { - wildcardType.setExtendedType((ReferenceType) toType(type.getExtendsBound())); - } - return wildcardType; - } - - public static PrimitiveType toPrimitiveType(jdkx.lang.model.type.PrimitiveType type) { - PrimitiveType.Primitive primitive = PrimitiveType.Primitive.valueOf(type.getKind().name()); - return new PrimitiveType(primitive); - } - - public static ArrayType toArrayType(jdkx.lang.model.type.ArrayType type) { - Type componentType = toType(type.getComponentType()); - return new ArrayType(componentType); - } - - public static ClassOrInterfaceType toClassOrInterfaceType(DeclaredType type) { - ClassOrInterfaceType classOrInterfaceType = new ClassOrInterfaceType(); - if (!type.getTypeArguments().isEmpty()) { - classOrInterfaceType.setTypeArguments( - type.getTypeArguments().stream() - .map(TypeUtils::toType) - .filter(Objects::nonNull) - .collect(NodeList.toNodeList())); - } - if (!type.asElement().toString().isEmpty()) { - classOrInterfaceType.setName(type.asElement().toString()); - } - return classOrInterfaceType; - } - - public static String getName(Type type, Predicate needFqnDelegate) { - PrinterConfiguration configuration = new DefaultPrinterConfiguration(); - PrettyPrintingVisitor visitor = - new PrettyPrintingVisitor(configuration) { - @Override - public void visit(SimpleName n, Void arg) { - printOrphanCommentsBeforeThisChildNode(n); - printComment(n.getComment(), arg); - - String identifier = n.getIdentifier(); - if (needFqnDelegate.test(identifier)) { - printer.print(identifier); - } else { - printer.print(JavaParserUtils.getSimpleName(identifier)); - } - } - }; - DefaultPrettyPrinter prettyPrinter = new DefaultPrettyPrinter(t -> visitor, configuration); - return prettyPrinter.print(type); - } - - public static String getSimpleName(Type type) { - PrinterConfiguration configuration = new DefaultPrinterConfiguration(); - PrettyPrintingVisitor visitor = new PrettyPrintingVisitor(configuration); - DefaultPrettyPrinter prettyPrinter = new DefaultPrettyPrinter(t -> visitor, configuration); - return prettyPrinter.print(type); - } - - public static boolean containsType(Path file, TypeElement el) { - switch (el.getKind()) { - case INTERFACE: - return containsInterface(file, el.getSimpleName().toString()); - case CLASS: - return containsClass(file, el.getSimpleName().toString()); - default: - throw new RuntimeException("Don't know what to do with " + el.getKind()); - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.java.utils; + +import static org.appdevforall.codeonthego.projects.util.StringSearch.containsClass; +import static org.appdevforall.codeonthego.projects.util.StringSearch.containsInterface; + +import com.github.javaparser.StaticJavaParser; +import com.github.javaparser.ast.NodeList; +import com.github.javaparser.ast.expr.SimpleName; +import com.github.javaparser.ast.type.ArrayType; +import com.github.javaparser.ast.type.ClassOrInterfaceType; +import com.github.javaparser.ast.type.IntersectionType; +import com.github.javaparser.ast.type.PrimitiveType; +import com.github.javaparser.ast.type.ReferenceType; +import com.github.javaparser.ast.type.Type; +import com.github.javaparser.ast.type.TypeParameter; +import com.github.javaparser.ast.type.UnknownType; +import com.github.javaparser.ast.type.VoidType; +import com.github.javaparser.ast.type.WildcardType; +import com.github.javaparser.printer.DefaultPrettyPrinter; +import com.github.javaparser.printer.configuration.DefaultPrinterConfiguration; +import com.github.javaparser.printer.configuration.PrinterConfiguration; +import org.appdevforall.codeonthego.lsp.java.visitors.PrettyPrintingVisitor; +import java.nio.file.Path; +import java.util.Objects; +import java.util.function.Predicate; +import jdkx.lang.model.element.TypeElement; +import jdkx.lang.model.type.DeclaredType; +import jdkx.lang.model.type.NoType; +import jdkx.lang.model.type.TypeKind; +import jdkx.lang.model.type.TypeMirror; +import jdkx.lang.model.type.TypeVariable; +import openjdk.source.tree.IdentifierTree; +import openjdk.source.tree.ParameterizedTypeTree; +import openjdk.source.tree.PrimitiveTypeTree; +import openjdk.source.tree.Tree; +import openjdk.source.tree.TypeParameterTree; +import openjdk.source.tree.WildcardTree; +import openjdk.tools.javac.code.BoundKind; +import openjdk.tools.javac.tree.JCTree; + +public class TypeUtils { + + // trees + public static ClassOrInterfaceType toClassOrInterfaceType(Tree tree) { + ClassOrInterfaceType type = new ClassOrInterfaceType(); + if (tree instanceof IdentifierTree) { + type.setName(((IdentifierTree) tree).getName().toString()); + } + if (tree instanceof ParameterizedTypeTree) { + ParameterizedTypeTree parameterizedTypeTree = (ParameterizedTypeTree) tree; + Type t = toType(parameterizedTypeTree.getType()); + + NodeList typeArguments = new NodeList<>(); + for (Tree typeArgument : parameterizedTypeTree.getTypeArguments()) { + Type typ = toType(typeArgument); + typeArguments.add(typ); + } + if (t.isClassOrInterfaceType()) { + type.setName(t.asClassOrInterfaceType().getName()); + } + type.setTypeArguments(typeArguments); + } + return type; + } + + public static Type toType(Tree tree) { + Type type; + if (tree instanceof PrimitiveTypeTree) { + type = getPrimitiveType((PrimitiveTypeTree) tree); + } else if (tree instanceof IdentifierTree) { + type = toClassOrInterfaceType(tree); + } else if (tree instanceof WildcardTree) { + JCTree.JCWildcard wildcardTree = (JCTree.JCWildcard) tree; + WildcardType wildcardType = new WildcardType(); + Tree bound = wildcardTree.getBound(); + Type boundType = toType(bound); + if (wildcardTree.kind.kind == BoundKind.EXTENDS) { + wildcardType.setExtendedType((ReferenceType) boundType); + } else { + wildcardType.setSuperType((ReferenceType) boundType); + } + type = wildcardType; + } else if (tree instanceof ParameterizedTypeTree) { + type = toClassOrInterfaceType(tree); + } else if (tree instanceof TypeParameterTree) { + TypeParameter typeParameter = new TypeParameter(); + typeParameter.setName(((TypeParameterTree) tree).getName().toString()); + typeParameter.setTypeBound( + ((TypeParameterTree) tree) + .getBounds().stream() + .map(TypeUtils::toClassOrInterfaceType) + .collect(NodeList.toNodeList())); + type = typeParameter; + } else { + if (tree != null) { + type = StaticJavaParser.parseType(tree.toString()); + } else { + type = null; + } + } + return type; + } + + public static Type getPrimitiveType(PrimitiveTypeTree tree) { + Type type; + switch (tree.getPrimitiveTypeKind()) { + case INT: + type = PrimitiveType.intType(); + break; + case BOOLEAN: + type = PrimitiveType.booleanType(); + break; + case LONG: + type = PrimitiveType.longType(); + break; + case SHORT: + type = PrimitiveType.shortType(); + break; + case CHAR: + type = PrimitiveType.charType(); + break; + case FLOAT: + type = PrimitiveType.floatType(); + break; + case VOID: + type = new VoidType(); + break; + default: + type = new UnknownType(); + } + return type; + } + + public static Type toType(TypeMirror typeMirror) { + if (typeMirror.getKind() == TypeKind.ARRAY) { + return toArrayType((jdkx.lang.model.type.ArrayType) typeMirror); + } + if (typeMirror.getKind().isPrimitive()) { + return toPrimitiveType((jdkx.lang.model.type.PrimitiveType) typeMirror); + } + if (typeMirror instanceof jdkx.lang.model.type.IntersectionType) { + return toIntersectionType((jdkx.lang.model.type.IntersectionType) typeMirror); + } + if (typeMirror instanceof jdkx.lang.model.type.WildcardType) { + return toWildcardType((jdkx.lang.model.type.WildcardType) typeMirror); + } + if (typeMirror instanceof jdkx.lang.model.type.DeclaredType) { + return toClassOrInterfaceType((DeclaredType) typeMirror); + } + if (typeMirror instanceof jdkx.lang.model.type.TypeVariable) { + return toType(((TypeVariable) typeMirror)); + } + if (typeMirror instanceof NoType) { + return new VoidType(); + } + return null; + } + + // type mirrors + + public static IntersectionType toIntersectionType(jdkx.lang.model.type.IntersectionType type) { + NodeList collect = + type.getBounds().stream() + .map(TypeUtils::toType) + .map(it -> ((ReferenceType) it)) + .collect(NodeList.toNodeList()); + return new IntersectionType(collect); + } + + public static Type toType(TypeVariable typeVariable) { + TypeParameter typeParameter = new TypeParameter(); + TypeMirror upperBound = typeVariable.getUpperBound(); + + if (!typeVariable.equals(upperBound)) { + Type type = toType(upperBound); + if (type != null) { + if (type.isIntersectionType()) { + typeParameter.setTypeBound( + type.asIntersectionType().getElements().stream() + .filter(Type::isClassOrInterfaceType) + .map(Type::asClassOrInterfaceType) + .collect(NodeList.toNodeList())); + } else if (type.isClassOrInterfaceType()) { + typeParameter.setTypeBound(NodeList.nodeList(type.asClassOrInterfaceType())); + } + } + } + typeParameter.setName(typeVariable.toString()); + return typeParameter; + } + + public static WildcardType toWildcardType(jdkx.lang.model.type.WildcardType type) { + WildcardType wildcardType = new WildcardType(); + if (type.getSuperBound() != null) { + Type result = toType(type.getSuperBound()); + if (result instanceof ReferenceType) { + wildcardType.setSuperType((ReferenceType) result); + } else if (result instanceof WildcardType) { + wildcardType = result.asWildcardType(); + } + } + + if (type.getExtendsBound() != null) { + wildcardType.setExtendedType((ReferenceType) toType(type.getExtendsBound())); + } + return wildcardType; + } + + public static PrimitiveType toPrimitiveType(jdkx.lang.model.type.PrimitiveType type) { + PrimitiveType.Primitive primitive = PrimitiveType.Primitive.valueOf(type.getKind().name()); + return new PrimitiveType(primitive); + } + + public static ArrayType toArrayType(jdkx.lang.model.type.ArrayType type) { + Type componentType = toType(type.getComponentType()); + return new ArrayType(componentType); + } + + public static ClassOrInterfaceType toClassOrInterfaceType(DeclaredType type) { + ClassOrInterfaceType classOrInterfaceType = new ClassOrInterfaceType(); + if (!type.getTypeArguments().isEmpty()) { + classOrInterfaceType.setTypeArguments( + type.getTypeArguments().stream() + .map(TypeUtils::toType) + .filter(Objects::nonNull) + .collect(NodeList.toNodeList())); + } + if (!type.asElement().toString().isEmpty()) { + classOrInterfaceType.setName(type.asElement().toString()); + } + return classOrInterfaceType; + } + + public static String getName(Type type, Predicate needFqnDelegate) { + PrinterConfiguration configuration = new DefaultPrinterConfiguration(); + PrettyPrintingVisitor visitor = + new PrettyPrintingVisitor(configuration) { + @Override + public void visit(SimpleName n, Void arg) { + printOrphanCommentsBeforeThisChildNode(n); + printComment(n.getComment(), arg); + + String identifier = n.getIdentifier(); + if (needFqnDelegate.test(identifier)) { + printer.print(identifier); + } else { + printer.print(JavaParserUtils.getSimpleName(identifier)); + } + } + }; + DefaultPrettyPrinter prettyPrinter = new DefaultPrettyPrinter(t -> visitor, configuration); + return prettyPrinter.print(type); + } + + public static String getSimpleName(Type type) { + PrinterConfiguration configuration = new DefaultPrinterConfiguration(); + PrettyPrintingVisitor visitor = new PrettyPrintingVisitor(configuration); + DefaultPrettyPrinter prettyPrinter = new DefaultPrettyPrinter(t -> visitor, configuration); + return prettyPrinter.print(type); + } + + public static boolean containsType(Path file, TypeElement el) { + switch (el.getKind()) { + case INTERFACE: + return containsInterface(file, el.getSimpleName().toString()); + case CLASS: + return containsClass(file, el.getSimpleName().toString()); + default: + throw new RuntimeException("Don't know what to do with " + el.getKind()); + } + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/insertUtils.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/insertUtils.kt similarity index 90% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/insertUtils.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/insertUtils.kt index 5375b05d0b..3280823693 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/utils/insertUtils.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/utils/insertUtils.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.utils +package org.appdevforall.codeonthego.lsp.java.utils -import com.itsaky.androidide.lsp.java.compiler.CompileTask -import com.itsaky.androidide.lsp.java.parser.ParseTask -import com.itsaky.androidide.models.Position +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask +import org.appdevforall.codeonthego.lsp.java.parser.ParseTask +import org.appdevforall.codeonthego.models.Position import openjdk.source.tree.CompilationUnitTree import openjdk.source.tree.Tree import openjdk.source.util.JavacTask diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/DiagnosticVisitor.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/DiagnosticVisitor.kt similarity index 95% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/DiagnosticVisitor.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/DiagnosticVisitor.kt index bf9d3383ce..8a74b803e0 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/DiagnosticVisitor.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/DiagnosticVisitor.kt @@ -1,400 +1,400 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.java.visitors - -import com.itsaky.androidide.progress.ProgressManager.Companion.abortIfCancelled -import jdkx.lang.model.element.Element -import jdkx.lang.model.element.ExecutableElement -import jdkx.lang.model.element.Modifier -import jdkx.lang.model.element.TypeElement -import jdkx.lang.model.type.DeclaredType -import jdkx.lang.model.type.TypeKind -import jdkx.lang.model.type.TypeMirror -import openjdk.source.tree.BlockTree -import openjdk.source.tree.ClassTree -import openjdk.source.tree.CompilationUnitTree -import openjdk.source.tree.DoWhileLoopTree -import openjdk.source.tree.ForLoopTree -import openjdk.source.tree.IdentifierTree -import openjdk.source.tree.IfTree -import openjdk.source.tree.MemberReferenceTree -import openjdk.source.tree.MemberSelectTree -import openjdk.source.tree.MethodInvocationTree -import openjdk.source.tree.MethodTree -import openjdk.source.tree.NewClassTree -import openjdk.source.tree.ThrowTree -import openjdk.source.tree.Tree -import openjdk.source.tree.TryTree -import openjdk.source.tree.VariableTree -import openjdk.source.tree.WhileLoopTree -import openjdk.source.util.TreePath -import openjdk.source.util.TreeScanner -import openjdk.source.util.Trees -import openjdk.tools.javac.api.JavacTaskImpl -import java.util.Objects - -class DiagnosticVisitor(task: JavacTaskImpl?) : - TreeScanner>() { - - private val trees = Trees.instance(task) - private val privateDeclarations = mutableMapOf() - private val localVariables = mutableMapOf() - private val used = mutableSetOf() - private var declaredExceptions = mutableMapOf() - private var observedExceptions = mutableSetOf() - val emptyBlocks = mutableMapOf() - - // Copied from TreePathScanner - // We need to be able to call scan(path, _) recursively - private var path: TreePath? = null - - private fun scanPath(path: TreePath) { - abortIfCancelled() - val prev = this.path - this.path = path - try { - path.leaf.accept(this, null) - } finally { - this.path = prev // So we can call scan(path, _) recursively - } - } - - override fun scan(tree: Tree?, p: MutableMap?): Void? { - abortIfCancelled() - if (tree == null) { - return null - } - - val prev = path - path = TreePath(path, tree) - return try { - tree.accept(this, p) - } finally { - path = prev - } - } - - fun notUsed(): Set { - val unused = mutableSetOf() - unused.addAll(privateDeclarations.keys) - unused.addAll(localVariables.keys) - unused.removeAll(used) - // Remove if there are any null elements somehow ended up being added - // during async work which calls `lint` - unused.removeIf { Objects.isNull(it) } - // Remove if field was injected while forming the AST - unused.removeIf { it.toString() == "" } - return unused - } - - private fun foundPrivateDeclaration() { - abortIfCancelled() - val element = trees.getElement(path) ?: return - privateDeclarations[element] = path!! - } - - private fun foundLocalVariable() { - abortIfCancelled() - val element = trees.getElement(path) ?: return - localVariables[element] = path!! - } - - private fun foundReference() { - abortIfCancelled() - val toEl = trees.getElement(path) ?: return - if (toEl.asType().kind == TypeKind.ERROR) { - foundPseudoReference(toEl) - return - } - - sweep(toEl) - } - - private fun foundPseudoReference(toEl: Element) { - abortIfCancelled() - val parent = toEl.enclosingElement as? TypeElement ?: return - val memberName = toEl.simpleName - for (member in parent.enclosedElements) { - if (member.simpleName.contentEquals(memberName)) { - sweep(member) - } - } - } - - private fun sweep(toEl: Element) { - abortIfCancelled() - val firstUse = used.add(toEl) - val notScanned = firstUse && privateDeclarations.containsKey(toEl) - if (notScanned) { - scanPath(privateDeclarations[toEl]!!) - } - } - - private fun isReachable(path: TreePath): Boolean { - abortIfCancelled() - // Check if t is reachable because it's public - val leaf = path.leaf - if (leaf is VariableTree) { - val isPrivate = leaf.modifiers.flags.contains(Modifier.PRIVATE) - if (!isPrivate || isLocalVariable(path)) { - return true - } - } - - if (leaf is MethodTree) { - val isPrivate = leaf.modifiers.flags.contains(Modifier.PRIVATE) - val isEmptyConstructor = leaf.parameters.isEmpty() && leaf.returnType == null - if (!isPrivate || isEmptyConstructor) { - return true - } - } - - if (leaf is ClassTree) { - val isPrivate = leaf.modifiers.flags.contains(Modifier.PRIVATE) - if (!isPrivate) { - return true - } - } - - abortIfCancelled() - - // Check if t has been referenced by a reachable element - val el = trees.getElement(path) - return used.contains(el) - } - - private fun isLocalVariable(path: TreePath): Boolean { - abortIfCancelled() - val kind = path.leaf.kind - if (kind != Tree.Kind.VARIABLE) { - return false - } - - val parent = path.parentPath.leaf.kind - if (parent == Tree.Kind.CLASS || parent == Tree.Kind.INTERFACE) { - return false - } - - if (parent == Tree.Kind.METHOD) { - val method = path.parentPath.leaf as MethodTree - return method.body != null - } - - return true - } - - private fun declared(t: MethodTree): MutableMap { - abortIfCancelled() - val names = mutableMapOf() - for (e in t.throws) { - val path = TreePath(path, e) - val to = trees.getElement(path) as? TypeElement ?: continue - val name = to.qualifiedName.toString() - names[name] = path - } - return names - } - - override fun visitCompilationUnit( - t: CompilationUnitTree, - notThrown: MutableMap - ): Void? { - abortIfCancelled() - return super.visitCompilationUnit(t, notThrown) - } - - override fun visitVariable(t: VariableTree?, notThrown: MutableMap?): Void? { - when { - isLocalVariable(path!!) -> { - foundLocalVariable() - super.visitVariable(t, notThrown) - } - - isReachable(path!!) -> super.visitVariable(t, notThrown) - else -> foundPrivateDeclaration() - } - return null - } - - override fun visitMethod(t: MethodTree?, notThrown: MutableMap?): Void? { - abortIfCancelled() - if (t == null || notThrown == null) { - return null - } - - // Create a new method scope - val pushDeclared = declaredExceptions - val pushObserved = observedExceptions - declaredExceptions = declared(t) - observedExceptions = HashSet() - - abortIfCancelled() - // Recursively scan for 'throw' and method calls - super.visitMethod(t, notThrown) - abortIfCancelled() - - // Check for exceptions that were never thrown - for (exception in declaredExceptions.keys) { - if (!observedExceptions.contains(exception)) { - notThrown[declaredExceptions[exception]] = exception - } - } - declaredExceptions = pushDeclared - observedExceptions = pushObserved - if (!isReachable(path!!)) { - foundPrivateDeclaration() - } - return null - } - - override fun visitClass(t: ClassTree?, notThrown: MutableMap?): Void? { - if (isReachable(path!!)) { - super.visitClass(t, notThrown) - } else { - foundPrivateDeclaration() - } - return null - } - - override fun visitIdentifier( - t: IdentifierTree?, - notThrown: MutableMap? - ): Void? { - foundReference() - return super.visitIdentifier(t, notThrown) - } - - override fun visitMemberSelect( - t: MemberSelectTree?, - notThrown: MutableMap? - ): Void? { - foundReference() - return super.visitMemberSelect(t, notThrown) - } - - override fun visitMemberReference( - t: MemberReferenceTree?, - notThrown: MutableMap? - ): Void? { - foundReference() - return super.visitMemberReference(t, notThrown) - } - - override fun visitNewClass(t: NewClassTree?, notThrown: MutableMap?): Void? { - foundReference() - return super.visitNewClass(t, notThrown) - } - - override fun visitThrow(t: ThrowTree?, notThrown: MutableMap?): Void? { - abortIfCancelled() - if (t == null) { - return null - } - - val path = TreePath(path, t.expression) - val type = trees.getTypeMirror(path) - addThrown(type) - return super.visitThrow(t, notThrown) - } - - override fun visitMethodInvocation( - t: MethodInvocationTree?, - notThrown: MutableMap? - ): Void? { - abortIfCancelled() - val target = trees.getElement(path) - if (target is ExecutableElement) { - for (type in target.thrownTypes) { - addThrown(type) - } - } - - return super.visitMethodInvocation(t, notThrown) - } - - override fun visitBlock(node: BlockTree?, p: MutableMap?): Void? { - abortIfCancelled() - if (node != null && node.statements.isEmpty()) { - val name: String? = - when (val parent = path!!.parentPath.leaf) { - is IfTree -> fromIfTree(node, parent) - is TryTree -> fromTryTree(node, parent) - is ForLoopTree -> fromForTree(parent, node) - is WhileLoopTree -> fromWhileTree(parent, node) - is DoWhileLoopTree -> fromDoWhileTree(parent, node) - else -> null - } - - if (name != null) { - emptyBlocks[path!!] = name - } - } - return super.visitBlock(node, p) - } - - private fun fromDoWhileTree(parent: DoWhileLoopTree, node: BlockTree?) = - if (parent.statement == node) { - "do" - } else { - null - } - - private fun fromWhileTree(parent: WhileLoopTree, node: BlockTree?) = - if (parent.statement == node) { - "while" - } else { - null - } - - private fun fromForTree(parent: ForLoopTree, node: BlockTree?) = - if (parent.statement == node) { - "for" - } else { - null - } - - private fun fromTryTree(node: BlockTree, parent: TryTree) = - when (node) { - parent.block -> "try" - parent.finallyBlock -> "finally" - else -> { - val catch = - if (parent.catches.find { it.block == node } != null) { - "catch" - } else { - null - } - catch - } - } - - private fun fromIfTree(node: BlockTree, parent: IfTree) = - when (node) { - parent.thenStatement -> "if" - parent.elseStatement -> "else" - else -> null - } - - private fun addThrown(type: TypeMirror) { - abortIfCancelled() - if (type is DeclaredType) { - val el = type.asElement() as TypeElement - val name = el.qualifiedName.toString() - observedExceptions.add(name) - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.java.visitors + +import org.appdevforall.codeonthego.progress.ProgressManager.Companion.abortIfCancelled +import jdkx.lang.model.element.Element +import jdkx.lang.model.element.ExecutableElement +import jdkx.lang.model.element.Modifier +import jdkx.lang.model.element.TypeElement +import jdkx.lang.model.type.DeclaredType +import jdkx.lang.model.type.TypeKind +import jdkx.lang.model.type.TypeMirror +import openjdk.source.tree.BlockTree +import openjdk.source.tree.ClassTree +import openjdk.source.tree.CompilationUnitTree +import openjdk.source.tree.DoWhileLoopTree +import openjdk.source.tree.ForLoopTree +import openjdk.source.tree.IdentifierTree +import openjdk.source.tree.IfTree +import openjdk.source.tree.MemberReferenceTree +import openjdk.source.tree.MemberSelectTree +import openjdk.source.tree.MethodInvocationTree +import openjdk.source.tree.MethodTree +import openjdk.source.tree.NewClassTree +import openjdk.source.tree.ThrowTree +import openjdk.source.tree.Tree +import openjdk.source.tree.TryTree +import openjdk.source.tree.VariableTree +import openjdk.source.tree.WhileLoopTree +import openjdk.source.util.TreePath +import openjdk.source.util.TreeScanner +import openjdk.source.util.Trees +import openjdk.tools.javac.api.JavacTaskImpl +import java.util.Objects + +class DiagnosticVisitor(task: JavacTaskImpl?) : + TreeScanner>() { + + private val trees = Trees.instance(task) + private val privateDeclarations = mutableMapOf() + private val localVariables = mutableMapOf() + private val used = mutableSetOf() + private var declaredExceptions = mutableMapOf() + private var observedExceptions = mutableSetOf() + val emptyBlocks = mutableMapOf() + + // Copied from TreePathScanner + // We need to be able to call scan(path, _) recursively + private var path: TreePath? = null + + private fun scanPath(path: TreePath) { + abortIfCancelled() + val prev = this.path + this.path = path + try { + path.leaf.accept(this, null) + } finally { + this.path = prev // So we can call scan(path, _) recursively + } + } + + override fun scan(tree: Tree?, p: MutableMap?): Void? { + abortIfCancelled() + if (tree == null) { + return null + } + + val prev = path + path = TreePath(path, tree) + return try { + tree.accept(this, p) + } finally { + path = prev + } + } + + fun notUsed(): Set { + val unused = mutableSetOf() + unused.addAll(privateDeclarations.keys) + unused.addAll(localVariables.keys) + unused.removeAll(used) + // Remove if there are any null elements somehow ended up being added + // during async work which calls `lint` + unused.removeIf { Objects.isNull(it) } + // Remove if field was injected while forming the AST + unused.removeIf { it.toString() == "" } + return unused + } + + private fun foundPrivateDeclaration() { + abortIfCancelled() + val element = trees.getElement(path) ?: return + privateDeclarations[element] = path!! + } + + private fun foundLocalVariable() { + abortIfCancelled() + val element = trees.getElement(path) ?: return + localVariables[element] = path!! + } + + private fun foundReference() { + abortIfCancelled() + val toEl = trees.getElement(path) ?: return + if (toEl.asType().kind == TypeKind.ERROR) { + foundPseudoReference(toEl) + return + } + + sweep(toEl) + } + + private fun foundPseudoReference(toEl: Element) { + abortIfCancelled() + val parent = toEl.enclosingElement as? TypeElement ?: return + val memberName = toEl.simpleName + for (member in parent.enclosedElements) { + if (member.simpleName.contentEquals(memberName)) { + sweep(member) + } + } + } + + private fun sweep(toEl: Element) { + abortIfCancelled() + val firstUse = used.add(toEl) + val notScanned = firstUse && privateDeclarations.containsKey(toEl) + if (notScanned) { + scanPath(privateDeclarations[toEl]!!) + } + } + + private fun isReachable(path: TreePath): Boolean { + abortIfCancelled() + // Check if t is reachable because it's public + val leaf = path.leaf + if (leaf is VariableTree) { + val isPrivate = leaf.modifiers.flags.contains(Modifier.PRIVATE) + if (!isPrivate || isLocalVariable(path)) { + return true + } + } + + if (leaf is MethodTree) { + val isPrivate = leaf.modifiers.flags.contains(Modifier.PRIVATE) + val isEmptyConstructor = leaf.parameters.isEmpty() && leaf.returnType == null + if (!isPrivate || isEmptyConstructor) { + return true + } + } + + if (leaf is ClassTree) { + val isPrivate = leaf.modifiers.flags.contains(Modifier.PRIVATE) + if (!isPrivate) { + return true + } + } + + abortIfCancelled() + + // Check if t has been referenced by a reachable element + val el = trees.getElement(path) + return used.contains(el) + } + + private fun isLocalVariable(path: TreePath): Boolean { + abortIfCancelled() + val kind = path.leaf.kind + if (kind != Tree.Kind.VARIABLE) { + return false + } + + val parent = path.parentPath.leaf.kind + if (parent == Tree.Kind.CLASS || parent == Tree.Kind.INTERFACE) { + return false + } + + if (parent == Tree.Kind.METHOD) { + val method = path.parentPath.leaf as MethodTree + return method.body != null + } + + return true + } + + private fun declared(t: MethodTree): MutableMap { + abortIfCancelled() + val names = mutableMapOf() + for (e in t.throws) { + val path = TreePath(path, e) + val to = trees.getElement(path) as? TypeElement ?: continue + val name = to.qualifiedName.toString() + names[name] = path + } + return names + } + + override fun visitCompilationUnit( + t: CompilationUnitTree, + notThrown: MutableMap + ): Void? { + abortIfCancelled() + return super.visitCompilationUnit(t, notThrown) + } + + override fun visitVariable(t: VariableTree?, notThrown: MutableMap?): Void? { + when { + isLocalVariable(path!!) -> { + foundLocalVariable() + super.visitVariable(t, notThrown) + } + + isReachable(path!!) -> super.visitVariable(t, notThrown) + else -> foundPrivateDeclaration() + } + return null + } + + override fun visitMethod(t: MethodTree?, notThrown: MutableMap?): Void? { + abortIfCancelled() + if (t == null || notThrown == null) { + return null + } + + // Create a new method scope + val pushDeclared = declaredExceptions + val pushObserved = observedExceptions + declaredExceptions = declared(t) + observedExceptions = HashSet() + + abortIfCancelled() + // Recursively scan for 'throw' and method calls + super.visitMethod(t, notThrown) + abortIfCancelled() + + // Check for exceptions that were never thrown + for (exception in declaredExceptions.keys) { + if (!observedExceptions.contains(exception)) { + notThrown[declaredExceptions[exception]] = exception + } + } + declaredExceptions = pushDeclared + observedExceptions = pushObserved + if (!isReachable(path!!)) { + foundPrivateDeclaration() + } + return null + } + + override fun visitClass(t: ClassTree?, notThrown: MutableMap?): Void? { + if (isReachable(path!!)) { + super.visitClass(t, notThrown) + } else { + foundPrivateDeclaration() + } + return null + } + + override fun visitIdentifier( + t: IdentifierTree?, + notThrown: MutableMap? + ): Void? { + foundReference() + return super.visitIdentifier(t, notThrown) + } + + override fun visitMemberSelect( + t: MemberSelectTree?, + notThrown: MutableMap? + ): Void? { + foundReference() + return super.visitMemberSelect(t, notThrown) + } + + override fun visitMemberReference( + t: MemberReferenceTree?, + notThrown: MutableMap? + ): Void? { + foundReference() + return super.visitMemberReference(t, notThrown) + } + + override fun visitNewClass(t: NewClassTree?, notThrown: MutableMap?): Void? { + foundReference() + return super.visitNewClass(t, notThrown) + } + + override fun visitThrow(t: ThrowTree?, notThrown: MutableMap?): Void? { + abortIfCancelled() + if (t == null) { + return null + } + + val path = TreePath(path, t.expression) + val type = trees.getTypeMirror(path) + addThrown(type) + return super.visitThrow(t, notThrown) + } + + override fun visitMethodInvocation( + t: MethodInvocationTree?, + notThrown: MutableMap? + ): Void? { + abortIfCancelled() + val target = trees.getElement(path) + if (target is ExecutableElement) { + for (type in target.thrownTypes) { + addThrown(type) + } + } + + return super.visitMethodInvocation(t, notThrown) + } + + override fun visitBlock(node: BlockTree?, p: MutableMap?): Void? { + abortIfCancelled() + if (node != null && node.statements.isEmpty()) { + val name: String? = + when (val parent = path!!.parentPath.leaf) { + is IfTree -> fromIfTree(node, parent) + is TryTree -> fromTryTree(node, parent) + is ForLoopTree -> fromForTree(parent, node) + is WhileLoopTree -> fromWhileTree(parent, node) + is DoWhileLoopTree -> fromDoWhileTree(parent, node) + else -> null + } + + if (name != null) { + emptyBlocks[path!!] = name + } + } + return super.visitBlock(node, p) + } + + private fun fromDoWhileTree(parent: DoWhileLoopTree, node: BlockTree?) = + if (parent.statement == node) { + "do" + } else { + null + } + + private fun fromWhileTree(parent: WhileLoopTree, node: BlockTree?) = + if (parent.statement == node) { + "while" + } else { + null + } + + private fun fromForTree(parent: ForLoopTree, node: BlockTree?) = + if (parent.statement == node) { + "for" + } else { + null + } + + private fun fromTryTree(node: BlockTree, parent: TryTree) = + when (node) { + parent.block -> "try" + parent.finallyBlock -> "finally" + else -> { + val catch = + if (parent.catches.find { it.block == node } != null) { + "catch" + } else { + null + } + catch + } + } + + private fun fromIfTree(node: BlockTree, parent: IfTree) = + when (node) { + parent.thenStatement -> "if" + parent.elseStatement -> "else" + else -> null + } + + private fun addThrown(type: TypeMirror) { + abortIfCancelled() + if (type is DeclaredType) { + val el = type.asElement() as TypeElement + val name = el.qualifiedName.toString() + observedExceptions.add(name) + } + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindAnonymousTypeDeclaration.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindAnonymousTypeDeclaration.java similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindAnonymousTypeDeclaration.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindAnonymousTypeDeclaration.java index 434f5bbec1..78381df8ba 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindAnonymousTypeDeclaration.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindAnonymousTypeDeclaration.java @@ -1,73 +1,73 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.visitors; - -import openjdk.source.tree.ClassTree; -import openjdk.source.tree.CompilationUnitTree; -import openjdk.source.tree.NewClassTree; -import openjdk.source.util.JavacTask; -import openjdk.source.util.SourcePositions; -import openjdk.source.util.TreePath; -import openjdk.source.util.TreePathScanner; -import openjdk.source.util.Trees; - -/** - * @author Akash Yadav - */ -public class FindAnonymousTypeDeclaration extends TreePathScanner { - - private final SourcePositions pos; - private final CompilationUnitTree root; - private TreePath stored; - - public FindAnonymousTypeDeclaration(JavacTask task, CompilationUnitTree root) { - this.pos = Trees.instance(task).getSourcePositions(); - this.root = root; - } - - @Override - public ClassTree reduce(ClassTree a, ClassTree b) { - if (a != null) return a; - return b; - } - - @Override - public ClassTree visitNewClass(NewClassTree t, Long find) { - - if (pos == null) { - return null; - } - - ClassTree smaller = super.visitNewClass(t, find); - if (smaller != null) { - return smaller; - } - - if (pos.getStartPosition(root, t.getClassBody()) <= find - && find < pos.getEndPosition(root, t.getClassBody())) { - stored = getCurrentPath(); - return t.getClassBody(); - } - - return null; - } - - public TreePath getStoredPath() { - return stored; - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.visitors; + +import openjdk.source.tree.ClassTree; +import openjdk.source.tree.CompilationUnitTree; +import openjdk.source.tree.NewClassTree; +import openjdk.source.util.JavacTask; +import openjdk.source.util.SourcePositions; +import openjdk.source.util.TreePath; +import openjdk.source.util.TreePathScanner; +import openjdk.source.util.Trees; + +/** + * @author Akash Yadav + */ +public class FindAnonymousTypeDeclaration extends TreePathScanner { + + private final SourcePositions pos; + private final CompilationUnitTree root; + private TreePath stored; + + public FindAnonymousTypeDeclaration(JavacTask task, CompilationUnitTree root) { + this.pos = Trees.instance(task).getSourcePositions(); + this.root = root; + } + + @Override + public ClassTree reduce(ClassTree a, ClassTree b) { + if (a != null) return a; + return b; + } + + @Override + public ClassTree visitNewClass(NewClassTree t, Long find) { + + if (pos == null) { + return null; + } + + ClassTree smaller = super.visitNewClass(t, find); + if (smaller != null) { + return smaller; + } + + if (pos.getStartPosition(root, t.getClassBody()) <= find + && find < pos.getEndPosition(root, t.getClassBody())) { + stored = getCurrentPath(); + return t.getClassBody(); + } + + return null; + } + + public TreePath getStoredPath() { + return stored; + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindBiggerRange.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindBiggerRange.java similarity index 96% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindBiggerRange.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindBiggerRange.java index fc973ac116..0b554a5e84 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindBiggerRange.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindBiggerRange.java @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.visitors; +package org.appdevforall.codeonthego.lsp.java.visitors; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; import openjdk.source.tree.ClassTree; import openjdk.source.tree.CompilationUnitTree; import openjdk.source.tree.LineMap; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindCompletionsAt.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindCompletionsAt.java similarity index 98% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindCompletionsAt.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindCompletionsAt.java index 41deeb3b72..0710dfc0cf 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindCompletionsAt.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindCompletionsAt.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.visitors; +package org.appdevforall.codeonthego.lsp.java.visitors; import openjdk.source.tree.CaseTree; import openjdk.source.tree.CompilationUnitTree; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindInvocationAt.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindInvocationAt.java similarity index 95% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindInvocationAt.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindInvocationAt.java index e90303922e..834e80d074 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindInvocationAt.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindInvocationAt.java @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.visitors; +package org.appdevforall.codeonthego.lsp.java.visitors; -import com.itsaky.androidide.progress.ICancelChecker; +import org.appdevforall.codeonthego.progress.ICancelChecker; import openjdk.source.tree.CompilationUnitTree; import openjdk.source.tree.MethodInvocationTree; import openjdk.source.tree.NewClassTree; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindMethodAt.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindMethodAt.kt similarity index 97% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindMethodAt.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindMethodAt.kt index 7314cddc2f..41fc232210 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindMethodAt.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindMethodAt.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.visitors +package org.appdevforall.codeonthego.lsp.java.visitors import openjdk.source.tree.CompilationUnitTree import openjdk.source.tree.MethodTree diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindMethodCallAt.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindMethodCallAt.java similarity index 99% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindMethodCallAt.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindMethodCallAt.java index 734b119482..52a263bc25 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindMethodCallAt.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindMethodCallAt.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.visitors; +package org.appdevforall.codeonthego.lsp.java.visitors; import jdkx.lang.model.element.Element; import jdkx.lang.model.element.NestingKind; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindMethodDeclarationAt.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindMethodDeclarationAt.java similarity index 96% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindMethodDeclarationAt.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindMethodDeclarationAt.java index 28243dc7f1..4e43e1139f 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindMethodDeclarationAt.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindMethodDeclarationAt.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.visitors; +package org.appdevforall.codeonthego.lsp.java.visitors; import openjdk.source.tree.CompilationUnitTree; import openjdk.source.tree.MethodTree; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindNameAt.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindNameAt.java similarity index 95% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindNameAt.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindNameAt.java index c5a76f3bfe..278dd7e584 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindNameAt.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindNameAt.java @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.visitors; +package org.appdevforall.codeonthego.lsp.java.visitors; -import com.itsaky.androidide.lsp.java.compiler.CompileTask; -import com.itsaky.androidide.lsp.java.utils.FindHelper; +import org.appdevforall.codeonthego.lsp.java.compiler.CompileTask; +import org.appdevforall.codeonthego.lsp.java.utils.FindHelper; import jdkx.lang.model.element.Name; import openjdk.source.tree.ClassTree; import openjdk.source.tree.CompilationUnitTree; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindReferences.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindReferences.java similarity index 97% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindReferences.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindReferences.java index 1c843344c6..10e2d8b6df 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindReferences.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindReferences.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.visitors; +package org.appdevforall.codeonthego.lsp.java.visitors; import java.util.List; import jdkx.lang.model.element.Element; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindTypeDeclarationAt.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindTypeDeclarationAt.java similarity index 97% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindTypeDeclarationAt.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindTypeDeclarationAt.java index 7f45f1b124..0a7d514239 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindTypeDeclarationAt.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindTypeDeclarationAt.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.visitors; +package org.appdevforall.codeonthego.lsp.java.visitors; import openjdk.source.tree.ClassTree; import openjdk.source.tree.CompilationUnitTree; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindTypeDeclarationNamed.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindTypeDeclarationNamed.java similarity index 96% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindTypeDeclarationNamed.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindTypeDeclarationNamed.java index 00df0274fc..4ab7a76010 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindTypeDeclarationNamed.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindTypeDeclarationNamed.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.visitors; +package org.appdevforall.codeonthego.lsp.java.visitors; import java.util.ArrayList; import java.util.List; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindTypeDeclarations.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindTypeDeclarations.java similarity index 96% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindTypeDeclarations.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindTypeDeclarations.java index 0838d33ee4..ffa550f641 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindTypeDeclarations.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindTypeDeclarations.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.visitors; +package org.appdevforall.codeonthego.lsp.java.visitors; import java.util.ArrayList; import java.util.List; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindVariableAtCursor.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindVariableAtCursor.java similarity index 97% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindVariableAtCursor.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindVariableAtCursor.java index 057c6be63f..2f3022c2f4 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindVariableAtCursor.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindVariableAtCursor.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.visitors; +package org.appdevforall.codeonthego.lsp.java.visitors; import openjdk.source.tree.CompilationUnitTree; import openjdk.source.tree.VariableTree; diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindVariablesBetween.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindVariablesBetween.java similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindVariablesBetween.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindVariablesBetween.java index 5098e40359..a35b0f2473 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/FindVariablesBetween.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/FindVariablesBetween.java @@ -1,76 +1,76 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.visitors; - -import androidx.annotation.NonNull; -import java.util.ArrayList; -import java.util.List; -import openjdk.source.tree.CompilationUnitTree; -import openjdk.source.tree.VariableTree; -import openjdk.source.util.JavacTask; -import openjdk.source.util.SourcePositions; -import openjdk.source.util.TreePath; -import openjdk.source.util.TreePathScanner; -import openjdk.source.util.Trees; - -/** - * Finds variables between the given start and end indexes. - * - * @author Akash Yadav - */ -public class FindVariablesBetween extends TreePathScanner { - - private final long start; - private final long end; - private final SourcePositions positions; - private final List paths = new ArrayList<>(); - private CompilationUnitTree root; - - public FindVariablesBetween(@NonNull JavacTask task, long start, long end) { - Trees trees = Trees.instance(task); - this.positions = trees.getSourcePositions(); - this.start = start; - this.end = end; - } - - @Override - public Void visitCompilationUnit(CompilationUnitTree node, Void unused) { - this.root = node; - return super.visitCompilationUnit(node, unused); - } - - @Override - public Void visitVariable(VariableTree node, Void unused) { - if (isInRange(node)) { - this.paths.add(getCurrentPath()); - } - - return super.visitVariable(node, unused); - } - - private boolean isInRange(VariableTree node) { - final long start = this.positions.getStartPosition(root, node); - final long end = this.positions.getEndPosition(root, node); - return (this.start <= start && end <= this.end) || (start <= this.start && end >= this.end); - } - - @NonNull - public List getPaths() { - return paths; - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.visitors; + +import androidx.annotation.NonNull; +import java.util.ArrayList; +import java.util.List; +import openjdk.source.tree.CompilationUnitTree; +import openjdk.source.tree.VariableTree; +import openjdk.source.util.JavacTask; +import openjdk.source.util.SourcePositions; +import openjdk.source.util.TreePath; +import openjdk.source.util.TreePathScanner; +import openjdk.source.util.Trees; + +/** + * Finds variables between the given start and end indexes. + * + * @author Akash Yadav + */ +public class FindVariablesBetween extends TreePathScanner { + + private final long start; + private final long end; + private final SourcePositions positions; + private final List paths = new ArrayList<>(); + private CompilationUnitTree root; + + public FindVariablesBetween(@NonNull JavacTask task, long start, long end) { + Trees trees = Trees.instance(task); + this.positions = trees.getSourcePositions(); + this.start = start; + this.end = end; + } + + @Override + public Void visitCompilationUnit(CompilationUnitTree node, Void unused) { + this.root = node; + return super.visitCompilationUnit(node, unused); + } + + @Override + public Void visitVariable(VariableTree node, Void unused) { + if (isInRange(node)) { + this.paths.add(getCurrentPath()); + } + + return super.visitVariable(node, unused); + } + + private boolean isInRange(VariableTree node) { + final long start = this.positions.getStartPosition(root, node); + final long end = this.positions.getEndPosition(root, node); + return (this.start <= start && end <= this.end) || (start <= this.start && end >= this.end); + } + + @NonNull + public List getPaths() { + return paths; + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/MethodRangeScanner.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/MethodRangeScanner.kt similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/MethodRangeScanner.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/MethodRangeScanner.kt index 9313f2ccb4..63086c7736 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/MethodRangeScanner.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/MethodRangeScanner.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.visitors +package org.appdevforall.codeonthego.lsp.java.visitors import androidx.core.util.Pair -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range import openjdk.source.tree.CompilationUnitTree import openjdk.source.tree.LineMap import openjdk.source.tree.MethodTree diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/PrettyPrintingVisitor.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/PrettyPrintingVisitor.java similarity index 94% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/PrettyPrintingVisitor.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/PrettyPrintingVisitor.java index ecb1ef5932..3e57ca569d 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/PrettyPrintingVisitor.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/PrettyPrintingVisitor.java @@ -1,145 +1,145 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.visitors; - -import static com.github.javaparser.utils.PositionUtils.sortByBeginPosition; -import static com.itsaky.androidide.lsp.java.utils.JavaParserUtils.getSimpleName; - -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.comments.Comment; -import com.github.javaparser.ast.expr.Name; -import com.github.javaparser.ast.expr.SimpleName; -import com.github.javaparser.ast.type.ClassOrInterfaceType; -import com.github.javaparser.printer.DefaultPrettyPrinterVisitor; -import com.github.javaparser.printer.SourcePrinter; -import com.github.javaparser.printer.configuration.ConfigurationOption; -import com.github.javaparser.printer.configuration.DefaultConfigurationOption; -import com.github.javaparser.printer.configuration.DefaultPrinterConfiguration; -import com.github.javaparser.printer.configuration.PrinterConfiguration; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -public class PrettyPrintingVisitor extends DefaultPrettyPrinterVisitor { - - public PrettyPrintingVisitor(PrinterConfiguration configuration) { - super(configuration); - } - - public PrettyPrintingVisitor(PrinterConfiguration configuration, SourcePrinter printer) { - super(configuration, printer); - } - - @Override - public void visit(Name n, Void arg) { - printOrphanCommentsBeforeThisChildNode(n); - printComment(n.getComment(), arg); - printer.print(n.getIdentifier()); - printOrphanCommentsEnding(n); - } - - @Override - public void visit(SimpleName n, Void arg) { - printOrphanCommentsBeforeThisChildNode(n); - printComment(n.getComment(), arg); - - String identifier = n.getIdentifier(); - printer.print(getSimpleName(identifier)); - } - - @Override - public void visit(ClassOrInterfaceType n, Void arg) { - printOrphanCommentsBeforeThisChildNode(n); - printComment(n.getComment(), arg); - - printAnnotations(n.getAnnotations(), false, arg); - - n.getName().accept(this, arg); - - if (n.isUsingDiamondOperator()) { - printer.print("<>"); - } else { - printTypeArgs(n, arg); - } - } - - protected void printOrphanCommentsBeforeThisChildNode(final Node node) { - if (!getOption(DefaultPrinterConfiguration.ConfigOption.PRINT_COMMENTS).isPresent()) return; - if (node instanceof Comment) return; - - Node parent = node.getParentNode().orElse(null); - if (parent == null) return; - List everything = new ArrayList<>(parent.getChildNodes()); - sortByBeginPosition(everything); - int positionOfTheChild = -1; - for (int i = 0; i < everything.size(); ++i) { // indexOf is by equality, so this - // is used to index by identity - if (everything.get(i) == node) { - positionOfTheChild = i; - break; - } - } - if (positionOfTheChild == -1) { - throw new AssertionError("I am not a child of my parent."); - } - int positionOfPreviousChild = -1; - for (int i = positionOfTheChild - 1; i >= 0 && positionOfPreviousChild == -1; i--) { - if (!(everything.get(i) instanceof Comment)) positionOfPreviousChild = i; - } - for (int i = positionOfPreviousChild + 1; i < positionOfTheChild; i++) { - Node nodeToPrint = everything.get(i); - if (!(nodeToPrint instanceof Comment)) - throw new RuntimeException( - "Expected comment, instead " - + nodeToPrint.getClass() - + ". Position of previous child: " - + positionOfPreviousChild - + ", position of child " - + positionOfTheChild); - nodeToPrint.accept(this, null); - } - } - - private Optional getOption( - DefaultPrinterConfiguration.ConfigOption cOption) { - return configuration.get(new DefaultConfigurationOption(cOption)); - } - - protected void printOrphanCommentsEnding(final Node node) { - if (!getOption(DefaultPrinterConfiguration.ConfigOption.PRINT_COMMENTS).isPresent()) return; - - List everything = new ArrayList<>(node.getChildNodes()); - sortByBeginPosition(everything); - if (everything.isEmpty()) { - return; - } - - int commentsAtEnd = 0; - boolean findingComments = true; - while (findingComments && commentsAtEnd < everything.size()) { - Node last = everything.get(everything.size() - 1 - commentsAtEnd); - findingComments = (last instanceof Comment); - if (findingComments) { - commentsAtEnd++; - } - } - for (int i = 0; i < commentsAtEnd; i++) { - everything.get(everything.size() - commentsAtEnd + i).accept(this, null); - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.visitors; + +import static com.github.javaparser.utils.PositionUtils.sortByBeginPosition; +import static org.appdevforall.codeonthego.lsp.java.utils.JavaParserUtils.getSimpleName; + +import com.github.javaparser.ast.Node; +import com.github.javaparser.ast.comments.Comment; +import com.github.javaparser.ast.expr.Name; +import com.github.javaparser.ast.expr.SimpleName; +import com.github.javaparser.ast.type.ClassOrInterfaceType; +import com.github.javaparser.printer.DefaultPrettyPrinterVisitor; +import com.github.javaparser.printer.SourcePrinter; +import com.github.javaparser.printer.configuration.ConfigurationOption; +import com.github.javaparser.printer.configuration.DefaultConfigurationOption; +import com.github.javaparser.printer.configuration.DefaultPrinterConfiguration; +import com.github.javaparser.printer.configuration.PrinterConfiguration; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +public class PrettyPrintingVisitor extends DefaultPrettyPrinterVisitor { + + public PrettyPrintingVisitor(PrinterConfiguration configuration) { + super(configuration); + } + + public PrettyPrintingVisitor(PrinterConfiguration configuration, SourcePrinter printer) { + super(configuration, printer); + } + + @Override + public void visit(Name n, Void arg) { + printOrphanCommentsBeforeThisChildNode(n); + printComment(n.getComment(), arg); + printer.print(n.getIdentifier()); + printOrphanCommentsEnding(n); + } + + @Override + public void visit(SimpleName n, Void arg) { + printOrphanCommentsBeforeThisChildNode(n); + printComment(n.getComment(), arg); + + String identifier = n.getIdentifier(); + printer.print(getSimpleName(identifier)); + } + + @Override + public void visit(ClassOrInterfaceType n, Void arg) { + printOrphanCommentsBeforeThisChildNode(n); + printComment(n.getComment(), arg); + + printAnnotations(n.getAnnotations(), false, arg); + + n.getName().accept(this, arg); + + if (n.isUsingDiamondOperator()) { + printer.print("<>"); + } else { + printTypeArgs(n, arg); + } + } + + protected void printOrphanCommentsBeforeThisChildNode(final Node node) { + if (!getOption(DefaultPrinterConfiguration.ConfigOption.PRINT_COMMENTS).isPresent()) return; + if (node instanceof Comment) return; + + Node parent = node.getParentNode().orElse(null); + if (parent == null) return; + List everything = new ArrayList<>(parent.getChildNodes()); + sortByBeginPosition(everything); + int positionOfTheChild = -1; + for (int i = 0; i < everything.size(); ++i) { // indexOf is by equality, so this + // is used to index by identity + if (everything.get(i) == node) { + positionOfTheChild = i; + break; + } + } + if (positionOfTheChild == -1) { + throw new AssertionError("I am not a child of my parent."); + } + int positionOfPreviousChild = -1; + for (int i = positionOfTheChild - 1; i >= 0 && positionOfPreviousChild == -1; i--) { + if (!(everything.get(i) instanceof Comment)) positionOfPreviousChild = i; + } + for (int i = positionOfPreviousChild + 1; i < positionOfTheChild; i++) { + Node nodeToPrint = everything.get(i); + if (!(nodeToPrint instanceof Comment)) + throw new RuntimeException( + "Expected comment, instead " + + nodeToPrint.getClass() + + ". Position of previous child: " + + positionOfPreviousChild + + ", position of child " + + positionOfTheChild); + nodeToPrint.accept(this, null); + } + } + + private Optional getOption( + DefaultPrinterConfiguration.ConfigOption cOption) { + return configuration.get(new DefaultConfigurationOption(cOption)); + } + + protected void printOrphanCommentsEnding(final Node node) { + if (!getOption(DefaultPrinterConfiguration.ConfigOption.PRINT_COMMENTS).isPresent()) return; + + List everything = new ArrayList<>(node.getChildNodes()); + sortByBeginPosition(everything); + if (everything.isEmpty()) { + return; + } + + int commentsAtEnd = 0; + boolean findingComments = true; + while (findingComments && commentsAtEnd < everything.size()) { + Node last = everything.get(everything.size() - 1 - commentsAtEnd); + findingComments = (last instanceof Comment); + if (findingComments) { + commentsAtEnd++; + } + } + for (int i = 0; i < commentsAtEnd; i++) { + everything.get(everything.size() - commentsAtEnd + i).accept(this, null); + } + } +} diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/PrintingVisitor.kt b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/PrintingVisitor.kt similarity index 96% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/PrintingVisitor.kt rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/PrintingVisitor.kt index 5094206c48..796d1c3ca4 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/PrintingVisitor.kt +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/PrintingVisitor.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.visitors +package org.appdevforall.codeonthego.lsp.java.visitors import openjdk.tools.javac.tree.JCTree import openjdk.tools.javac.tree.JCTree.JCErroneous diff --git a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/PruneMethodBodies.java b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/PruneMethodBodies.java similarity index 97% rename from lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/PruneMethodBodies.java rename to lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/PruneMethodBodies.java index f4e72ef228..fb56cc537e 100644 --- a/lsp/java/src/main/java/com/itsaky/androidide/lsp/java/visitors/PruneMethodBodies.java +++ b/lsp/java/src/main/java/org/appdevforall/codeonthego/lsp/java/visitors/PruneMethodBodies.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.visitors; +package org.appdevforall.codeonthego.lsp.java.visitors; import java.io.IOException; import openjdk.source.tree.CompilationUnitTree; diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/JavaCompilerProviderTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/JavaCompilerProviderTest.kt similarity index 89% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/JavaCompilerProviderTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/JavaCompilerProviderTest.kt index 0dc18c70ef..5960a5f835 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/JavaCompilerProviderTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/JavaCompilerProviderTest.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java +package org.appdevforall.codeonthego.lsp.java import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.api.ModuleProject +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.api.ModuleProject import org.junit.Before import org.junit.Test import org.junit.runner.RunWith diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/JavaLSPTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/JavaLSPTest.kt similarity index 81% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/JavaLSPTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/JavaLSPTest.kt index 3fc4ff7219..ca87578944 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/JavaLSPTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/JavaLSPTest.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java +package org.appdevforall.codeonthego.lsp.java -import com.itsaky.androidide.lsp.api.ILanguageServerRegistry -import com.itsaky.androidide.lsp.api.LSPTest -import com.itsaky.androidide.lsp.java.compiler.JavaCompilerService -import com.itsaky.androidide.projects.util.findAppModule +import org.appdevforall.codeonthego.lsp.api.ILanguageServerRegistry +import org.appdevforall.codeonthego.lsp.api.LSPTest +import org.appdevforall.codeonthego.lsp.java.compiler.JavaCompilerService +import org.appdevforall.codeonthego.projects.util.findAppModule import org.junit.Before import org.junit.Ignore diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/actions/AddImportTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/actions/AddImportTest.kt similarity index 89% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/actions/AddImportTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/actions/AddImportTest.kt index a0bd8e7e86..233aba0e5a 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/actions/AddImportTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/actions/AddImportTest.kt @@ -1,69 +1,69 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.java.actions - -import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.java.JavaLSPTest -import com.itsaky.androidide.lsp.java.actions.diagnostics.AddImportAction -import kotlinx.coroutines.runBlocking -import org.junit.Before -import org.junit.Test -import org.junit.runner.RunWith -import org.robolectric.RobolectricTestRunner -import org.robolectric.annotation.Config - -/** @author Akash Yadav */ -@RunWith(RobolectricTestRunner::class) -@Config(manifest = Config.DEFAULT_VALUE_STRING) -class AddImportTest { - - @Before - fun setup() { - JavaLSPTest.setup() - } - - @Suppress("UNCHECKED_CAST") - @Test - fun addImport() { - JavaLSPTest.apply { - openFile("actions/AddImportAction") - val diagnostic = - runBlocking { - server.analyze(file!!).diagnostics.firstOrNull { - it.code == "compiler.err.cant.resolve.location" - } - } - - assertThat(diagnostic).isNotNull() - - val file = this.file!!.toFile() - val data = createActionData(diagnostic!!, file, this.file!!, this.server) - - val action = AddImportAction() - action.prepare(data) - assertThat(action.visible).isTrue() - assertThat(action.enabled).isTrue() - - val execResult = runBlocking { action.execAction(data) } - assertThat(execResult::class.java).isAssignableTo(Pair::class.java) - - val result = execResult as Pair, *> - assertThat(result.first).contains("java.util.stream.Stream") - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.java.actions + +import com.google.common.truth.Truth.assertThat +import org.appdevforall.codeonthego.lsp.java.JavaLSPTest +import org.appdevforall.codeonthego.lsp.java.actions.diagnostics.AddImportAction +import kotlinx.coroutines.runBlocking +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config + +/** @author Akash Yadav */ +@RunWith(RobolectricTestRunner::class) +@Config(manifest = Config.DEFAULT_VALUE_STRING) +class AddImportTest { + + @Before + fun setup() { + JavaLSPTest.setup() + } + + @Suppress("UNCHECKED_CAST") + @Test + fun addImport() { + JavaLSPTest.apply { + openFile("actions/AddImportAction") + val diagnostic = + runBlocking { + server.analyze(file!!).diagnostics.firstOrNull { + it.code == "compiler.err.cant.resolve.location" + } + } + + assertThat(diagnostic).isNotNull() + + val file = this.file!!.toFile() + val data = createActionData(diagnostic!!, file, this.file!!, this.server) + + val action = AddImportAction() + action.prepare(data) + assertThat(action.visible).isTrue() + assertThat(action.enabled).isTrue() + + val execResult = runBlocking { action.execAction(data) } + assertThat(execResult::class.java).isAssignableTo(Pair::class.java) + + val result = execResult as Pair, *> + assertThat(result.first).contains("java.util.stream.Stream") + } + } +} diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/actions/JavaCodeActionTooltipTagTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/actions/JavaCodeActionTooltipTagTest.kt similarity index 97% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/actions/JavaCodeActionTooltipTagTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/actions/JavaCodeActionTooltipTagTest.kt index 977a9f8aaf..778c812056 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/actions/JavaCodeActionTooltipTagTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/actions/JavaCodeActionTooltipTagTest.kt @@ -14,11 +14,11 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.actions +package org.appdevforall.codeonthego.lsp.java.actions import com.google.common.truth.Truth.assertThat import com.google.common.truth.Truth.assertWithMessage -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.junit.Test /** diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/compiler/CompilerTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/compiler/CompilerTest.kt similarity index 96% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/compiler/CompilerTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/compiler/CompilerTest.kt index 0de93074bb..457eb4b4bf 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/compiler/CompilerTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/compiler/CompilerTest.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.compiler +package org.appdevforall.codeonthego.lsp.java.compiler import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.java.JavaLSPTest +import org.appdevforall.codeonthego.lsp.java.JavaLSPTest import org.junit.Before import org.junit.Test import org.junit.runner.RunWith diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/debug/KotlinClassNamesTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/debug/KotlinClassNamesTest.kt similarity index 90% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/debug/KotlinClassNamesTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/debug/KotlinClassNamesTest.kt index 786456098b..8aa76f0661 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/debug/KotlinClassNamesTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/debug/KotlinClassNamesTest.kt @@ -14,13 +14,13 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.debug +package org.appdevforall.codeonthego.lsp.java.debug import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.java.debug.utils.classifierBinaryNameOrNull -import com.itsaky.androidide.lsp.java.debug.utils.fileFacadeBinaryName -import com.itsaky.androidide.lsp.java.debug.utils.isKotlinSource -import com.itsaky.androidide.lsp.java.debug.utils.kotlinBinaryNames +import org.appdevforall.codeonthego.lsp.java.debug.utils.classifierBinaryNameOrNull +import org.appdevforall.codeonthego.lsp.java.debug.utils.fileFacadeBinaryName +import org.appdevforall.codeonthego.lsp.java.debug.utils.isKotlinSource +import org.appdevforall.codeonthego.lsp.java.debug.utils.kotlinBinaryNames import org.junit.Test class KotlinClassNamesTest { diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/debug/KotlinLocalsTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/debug/KotlinLocalsTest.kt similarity index 95% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/debug/KotlinLocalsTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/debug/KotlinLocalsTest.kt index a8924ae6b0..9b3c05c9ee 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/debug/KotlinLocalsTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/debug/KotlinLocalsTest.kt @@ -14,12 +14,12 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.debug +package org.appdevforall.codeonthego.lsp.java.debug import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.java.debug.utils.isSyntheticKotlinLocal -import com.itsaky.androidide.lsp.java.debug.utils.kotlinDisplayName -import com.itsaky.androidide.lsp.java.debug.utils.kotlinLambdaScopes +import org.appdevforall.codeonthego.lsp.java.debug.utils.isSyntheticKotlinLocal +import org.appdevforall.codeonthego.lsp.java.debug.utils.kotlinDisplayName +import org.appdevforall.codeonthego.lsp.java.debug.utils.kotlinLambdaScopes import org.junit.Test class KotlinLocalsTest { diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/debug/SourceReferenceTypeSpecTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/debug/SourceReferenceTypeSpecTest.kt similarity index 94% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/debug/SourceReferenceTypeSpecTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/debug/SourceReferenceTypeSpecTest.kt index 3f1c48d754..24430c7d79 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/debug/SourceReferenceTypeSpecTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/debug/SourceReferenceTypeSpecTest.kt @@ -14,10 +14,10 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.debug +package org.appdevforall.codeonthego.lsp.java.debug import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.java.debug.utils.matchesSourcePath +import org.appdevforall.codeonthego.lsp.java.debug.utils.matchesSourcePath import org.junit.Test private const val KT_BREAKPOINT_PATH = diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/debug/StrataTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/debug/StrataTest.kt similarity index 95% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/debug/StrataTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/debug/StrataTest.kt index f116aeaf53..3b45d7cc9f 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/debug/StrataTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/debug/StrataTest.kt @@ -14,10 +14,10 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.debug +package org.appdevforall.codeonthego.lsp.java.debug import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.java.debug.utils.isInlinedBody +import org.appdevforall.codeonthego.lsp.java.debug.utils.isInlinedBody import org.junit.Test class StrataTest { diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/partial/PartialReparserImplTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/partial/PartialReparserImplTest.kt similarity index 90% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/partial/PartialReparserImplTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/partial/PartialReparserImplTest.kt index 75ad2cb63e..596cdf2eb1 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/partial/PartialReparserImplTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/partial/PartialReparserImplTest.kt @@ -15,17 +15,17 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.partial +package org.appdevforall.codeonthego.lsp.java.partial import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.eventbus.events.editor.ChangeType.INSERT -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent -import com.itsaky.androidide.lsp.java.JavaLSPTest -import com.itsaky.androidide.lsp.java.compiler.SourceFileObject -import com.itsaky.androidide.lsp.java.models.CompilationRequest -import com.itsaky.androidide.lsp.java.models.PartialReparseRequest -import com.itsaky.androidide.lsp.java.visitors.PrintingVisitor -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.eventbus.events.editor.ChangeType.INSERT +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent +import org.appdevforall.codeonthego.lsp.java.JavaLSPTest +import org.appdevforall.codeonthego.lsp.java.compiler.SourceFileObject +import org.appdevforall.codeonthego.lsp.java.models.CompilationRequest +import org.appdevforall.codeonthego.lsp.java.models.PartialReparseRequest +import org.appdevforall.codeonthego.lsp.java.visitors.PrintingVisitor +import org.appdevforall.codeonthego.models.Range import jdkx.lang.model.type.ArrayType import openjdk.source.tree.ExpressionStatementTree import openjdk.source.tree.LiteralTree diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/providers/JavaCompletionProviderTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/providers/JavaCompletionProviderTest.kt similarity index 88% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/providers/JavaCompletionProviderTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/providers/JavaCompletionProviderTest.kt index 70510ec5a1..f281240862 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/providers/JavaCompletionProviderTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/providers/JavaCompletionProviderTest.kt @@ -1,94 +1,94 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.java.providers - -import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.java.JavaLSPTest -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.progress.ICancelChecker -import org.junit.Before -import org.junit.Test -import org.junit.runner.RunWith -import org.robolectric.RobolectricTestRunner - -/** @author Akash Yadav */ -@RunWith(RobolectricTestRunner::class) -class JavaCompletionProviderTest { - - @Before - fun setup() { - JavaLSPTest.setup() - } - - @Test - fun locals() { - JavaLSPTest.apply { - openFile("completion/LocalsCompletionTest") - - val pos = cursorPosition() - val items = completionTitles(pos) - assertThat(items).containsAtLeast("aaString", "aaInt", "aaFloat", "aaDouble", "args") - } - } - - fun members() { - JavaLSPTest.apply { - // Complete members of String - openFile("completion/MembersCompletionTest") - - val pos = cursorPosition() - val items = completionTitles(pos) - assertThat(items) - .containsAtLeast("getClass", "toLowerCase", "toUpperCase", "substring", "charAt") - } - } - - @Test - fun lambdaVariableMemberAccess() { - JavaLSPTest.apply { - // Complete members of Throwable - openFile("completion/LambdaMembersCompletionTest") - - val pos = cursorPosition() - val items = completionTitles(pos) - assertThat(items) - .containsAtLeast("getMessage", "getCause", "getStackTrace", "printStackTrace") - } - } - - @Test - fun staticAccess() { - JavaLSPTest.apply { - // Complete static members of String - openFile("completion/StaticMembersCompletionTest") - - val pos = cursorPosition() - val items = completionTitles(pos) - assertThat(items) - .containsAtLeast("format", "join", "valueOf", "CASE_INSENSITIVE_ORDER", "class") - } - } - - private fun completionTitles(pos: Position): List { - return JavaLSPTest.server - .complete( - CompletionParams(pos, JavaLSPTest.file!!, ICancelChecker.NOOP).apply { prefix = "" }) - .items - .map { it.ideLabel } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.java.providers + +import com.google.common.truth.Truth.assertThat +import org.appdevforall.codeonthego.lsp.java.JavaLSPTest +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.progress.ICancelChecker +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner + +/** @author Akash Yadav */ +@RunWith(RobolectricTestRunner::class) +class JavaCompletionProviderTest { + + @Before + fun setup() { + JavaLSPTest.setup() + } + + @Test + fun locals() { + JavaLSPTest.apply { + openFile("completion/LocalsCompletionTest") + + val pos = cursorPosition() + val items = completionTitles(pos) + assertThat(items).containsAtLeast("aaString", "aaInt", "aaFloat", "aaDouble", "args") + } + } + + fun members() { + JavaLSPTest.apply { + // Complete members of String + openFile("completion/MembersCompletionTest") + + val pos = cursorPosition() + val items = completionTitles(pos) + assertThat(items) + .containsAtLeast("getClass", "toLowerCase", "toUpperCase", "substring", "charAt") + } + } + + @Test + fun lambdaVariableMemberAccess() { + JavaLSPTest.apply { + // Complete members of Throwable + openFile("completion/LambdaMembersCompletionTest") + + val pos = cursorPosition() + val items = completionTitles(pos) + assertThat(items) + .containsAtLeast("getMessage", "getCause", "getStackTrace", "printStackTrace") + } + } + + @Test + fun staticAccess() { + JavaLSPTest.apply { + // Complete static members of String + openFile("completion/StaticMembersCompletionTest") + + val pos = cursorPosition() + val items = completionTitles(pos) + assertThat(items) + .containsAtLeast("format", "join", "valueOf", "CASE_INSENSITIVE_ORDER", "class") + } + } + + private fun completionTitles(pos: Position): List { + return JavaLSPTest.server + .complete( + CompletionParams(pos, JavaLSPTest.file!!, ICancelChecker.NOOP).apply { prefix = "" }) + .items + .map { it.ideLabel } + } +} diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/providers/JavaSelectionProviderTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/providers/JavaSelectionProviderTest.kt similarity index 86% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/providers/JavaSelectionProviderTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/providers/JavaSelectionProviderTest.kt index cb891d9f14..5f539ecc30 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/providers/JavaSelectionProviderTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/providers/JavaSelectionProviderTest.kt @@ -1,108 +1,108 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.java.providers - -import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.eventbus.events.editor.ChangeType.NEW_TEXT -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent -import com.itsaky.androidide.lsp.java.JavaLSPTest -import com.itsaky.androidide.lsp.models.ExpandSelectionParams -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range -import io.github.rosemoe.sora.text.Content -import kotlinx.coroutines.runBlocking -import org.junit.Before -import org.junit.Test -import org.junit.runner.RunWith -import org.robolectric.RobolectricTestRunner - -/** @author Akash Yadav */ -@RunWith(RobolectricTestRunner::class) -class JavaSelectionProviderTest { - - @Before - fun setup() { - JavaLSPTest.setup() - } - - @Test - fun testSimpleSelectionExpansion() { - JavaLSPTest.apply { - openFile("selection/SimpleSelectionExpansionTest") - cursor = requireCursor() - deleteCursorText() - dispatchEvent( - DocumentChangeEvent(file!!, contents.toString(), contents.toString(), 1, NEW_TEXT, 0, - Range.NONE)) - - val range = findRange() - val expanded = runBlocking { server.expandSelection(ExpandSelectionParams(file!!, range)) } - - assertThat(expanded).isEqualTo(Range(Position(4, 27), Position(4, 41))) - } - } - - @Test - fun testMethodSelection() { - JavaLSPTest.apply { - openFile("selection/MethodBodySelectionExpansionTest") - - val start = Position(3, 43) - val end = Position(5, 5) - val range = Range(start, end) - - val expanded = runBlocking { server.expandSelection(ExpandSelectionParams(file!!, range)) } - assertThat(expanded).isEqualTo(Range(Position(3, 4), end)) - } - } - - @Test - fun testTryCatchSelection() { - JavaLSPTest.apply { - openFile("selection/TrySelectionExpansionTest") - - // Test expand selection if catch block is selected - val start = Position(7, 10) - val end = Position(8, 9) - val range = Range(start, end) - - val expanded = runBlocking { server.expandSelection(ExpandSelectionParams(file!!, range)) } - assertThat(expanded).isEqualTo(Range(Position(4, 8), Position(10, 9))) - } - } - - @Test - fun testTryFinallySelection() { - JavaLSPTest.apply { - openFile("selection/TrySelectionExpansionTest") - - // Test expand selection if catch block is selected - val start = Position(8, 18) - val end = Position(10, 9) - val range = Range(start, end) - - val expanded = runBlocking { server.expandSelection(ExpandSelectionParams(file!!, range)) } - assertThat(expanded).isEqualTo(Range(Position(4, 8), Position(10, 9))) - } - } - - private fun findRange(): Range { - val pos = Content(JavaLSPTest.contents!!).indexer.getCharPosition(JavaLSPTest.cursor) - val position = Position(pos.line, pos.column, pos.index) - return Range(position, position) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.java.providers + +import com.google.common.truth.Truth.assertThat +import org.appdevforall.codeonthego.eventbus.events.editor.ChangeType.NEW_TEXT +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent +import org.appdevforall.codeonthego.lsp.java.JavaLSPTest +import org.appdevforall.codeonthego.lsp.models.ExpandSelectionParams +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range +import io.github.rosemoe.sora.text.Content +import kotlinx.coroutines.runBlocking +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner + +/** @author Akash Yadav */ +@RunWith(RobolectricTestRunner::class) +class JavaSelectionProviderTest { + + @Before + fun setup() { + JavaLSPTest.setup() + } + + @Test + fun testSimpleSelectionExpansion() { + JavaLSPTest.apply { + openFile("selection/SimpleSelectionExpansionTest") + cursor = requireCursor() + deleteCursorText() + dispatchEvent( + DocumentChangeEvent(file!!, contents.toString(), contents.toString(), 1, NEW_TEXT, 0, + Range.NONE)) + + val range = findRange() + val expanded = runBlocking { server.expandSelection(ExpandSelectionParams(file!!, range)) } + + assertThat(expanded).isEqualTo(Range(Position(4, 27), Position(4, 41))) + } + } + + @Test + fun testMethodSelection() { + JavaLSPTest.apply { + openFile("selection/MethodBodySelectionExpansionTest") + + val start = Position(3, 43) + val end = Position(5, 5) + val range = Range(start, end) + + val expanded = runBlocking { server.expandSelection(ExpandSelectionParams(file!!, range)) } + assertThat(expanded).isEqualTo(Range(Position(3, 4), end)) + } + } + + @Test + fun testTryCatchSelection() { + JavaLSPTest.apply { + openFile("selection/TrySelectionExpansionTest") + + // Test expand selection if catch block is selected + val start = Position(7, 10) + val end = Position(8, 9) + val range = Range(start, end) + + val expanded = runBlocking { server.expandSelection(ExpandSelectionParams(file!!, range)) } + assertThat(expanded).isEqualTo(Range(Position(4, 8), Position(10, 9))) + } + } + + @Test + fun testTryFinallySelection() { + JavaLSPTest.apply { + openFile("selection/TrySelectionExpansionTest") + + // Test expand selection if catch block is selected + val start = Position(8, 18) + val end = Position(10, 9) + val range = Range(start, end) + + val expanded = runBlocking { server.expandSelection(ExpandSelectionParams(file!!, range)) } + assertThat(expanded).isEqualTo(Range(Position(4, 8), Position(10, 9))) + } + } + + private fun findRange(): Range { + val pos = Content(JavaLSPTest.contents!!).indexer.getCharPosition(JavaLSPTest.cursor) + val position = Position(pos.line, pos.column, pos.index) + return Range(position, position) + } +} diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodEditTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodEditTest.kt similarity index 98% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodEditTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodEditTest.kt index 615adff766..694cbdf71a 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodEditTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodEditTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor import com.google.common.truth.Truth.assertThat import com.google.common.truth.Truth.assertWithMessage diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodPlanTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodPlanTest.kt similarity index 99% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodPlanTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodPlanTest.kt index 61c8dad545..3b5ab1b096 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodPlanTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodPlanTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor import com.google.common.truth.Truth.assertThat import com.google.common.truth.Truth.assertWithMessage diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodRegionTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodRegionTest.kt similarity index 98% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodRegionTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodRegionTest.kt index 503a100e29..425faad0a7 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodRegionTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodRegionTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor import com.google.common.truth.Truth.assertThat import org.junit.After diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodSignatureTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodSignatureTest.kt similarity index 98% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodSignatureTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodSignatureTest.kt index 4b180050f3..a132c154f6 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractMethodSignatureTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractMethodSignatureTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor import com.google.common.truth.Truth.assertThat import org.junit.After diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractVariablePrimitivesTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractVariablePrimitivesTest.kt similarity index 95% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractVariablePrimitivesTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractVariablePrimitivesTest.kt index a18c9876cc..b038445500 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractVariablePrimitivesTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractVariablePrimitivesTest.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.refactor.BlockAnchor -import com.itsaky.androidide.lsp.refactor.BracelessBody -import com.itsaky.androidide.lsp.refactor.RewriteSpan -import com.itsaky.androidide.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.BlockAnchor +import org.appdevforall.codeonthego.lsp.refactor.BracelessBody +import org.appdevforall.codeonthego.lsp.refactor.RewriteSpan +import org.appdevforall.codeonthego.lsp.refactor.TextSpan import com.itsaky.androidide.resources.R import org.junit.Test import org.junit.runner.RunWith diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractVariableSoundnessTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractVariableSoundnessTest.kt similarity index 98% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractVariableSoundnessTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractVariableSoundnessTest.kt index 793592f115..6c8bfa31fe 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractVariableSoundnessTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractVariableSoundnessTest.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor import com.google.common.truth.Truth.assertThat import com.google.common.truth.Truth.assertWithMessage -import com.itsaky.androidide.lsp.refactor.RewriteSpan -import com.itsaky.androidide.lsp.ui.NameProblem -import com.itsaky.androidide.lsp.ui.validateVariableName +import org.appdevforall.codeonthego.lsp.refactor.RewriteSpan +import org.appdevforall.codeonthego.lsp.ui.NameProblem +import org.appdevforall.codeonthego.lsp.ui.validateVariableName import com.itsaky.androidide.resources.R import org.junit.After import org.junit.Test diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractionRegionSoundnessTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractionRegionSoundnessTest.kt similarity index 99% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractionRegionSoundnessTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractionRegionSoundnessTest.kt index bf2a7b3ef6..0077f5b339 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/ExtractionRegionSoundnessTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/ExtractionRegionSoundnessTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor import com.google.common.truth.Truth.assertThat import com.google.common.truth.Truth.assertWithMessage diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/JavacFixture.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/JavacFixture.kt similarity index 98% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/JavacFixture.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/JavacFixture.kt index 078bd35ba4..f9af3f193a 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/JavacFixture.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/JavacFixture.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor -import com.itsaky.androidide.lsp.refactor.RewriteSpan +import org.appdevforall.codeonthego.lsp.refactor.RewriteSpan import jdkx.tools.JavaFileManager import jdkx.tools.JavaFileObject import jdkx.tools.SimpleJavaFileObject diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/RegionAnalysisPrimitivesTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/RegionAnalysisPrimitivesTest.kt similarity index 97% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/RegionAnalysisPrimitivesTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/RegionAnalysisPrimitivesTest.kt index c286b85a67..7b5dffcb19 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/RegionAnalysisPrimitivesTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/RegionAnalysisPrimitivesTest.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.TextSpan import jdkx.lang.model.type.DeclaredType import openjdk.source.util.TreePath import org.junit.After diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/SourceNormalizerTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/SourceNormalizerTest.kt similarity index 96% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/SourceNormalizerTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/SourceNormalizerTest.kt index 89dd81c6c1..da3d9158c7 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/refactor/SourceNormalizerTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/refactor/SourceNormalizerTest.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.lsp.java.refactor +package org.appdevforall.codeonthego.lsp.java.refactor import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.refactor.detectIndentUnit +import org.appdevforall.codeonthego.lsp.refactor.detectIndentUnit import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.JUnit4 diff --git a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/utils/FindHelperTest.kt b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/utils/FindHelperTest.kt similarity index 85% rename from lsp/java/src/test/java/com/itsaky/androidide/lsp/java/utils/FindHelperTest.kt rename to lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/utils/FindHelperTest.kt index 33a0a5db36..50875e377b 100644 --- a/lsp/java/src/test/java/com/itsaky/androidide/lsp/java/utils/FindHelperTest.kt +++ b/lsp/java/src/test/java/org/appdevforall/codeonthego/lsp/java/utils/FindHelperTest.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.java.utils +package org.appdevforall.codeonthego.lsp.java.utils import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.java.JavaLSPTest -import com.itsaky.androidide.lsp.models.DefinitionParams -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.progress.ICancelChecker +import org.appdevforall.codeonthego.lsp.java.JavaLSPTest +import org.appdevforall.codeonthego.lsp.models.DefinitionParams +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.progress.ICancelChecker import kotlinx.coroutines.runBlocking import org.junit.Before import org.junit.Test diff --git a/lsp/java/src/test/resources/robolectric.properties b/lsp/java/src/test/resources/robolectric.properties index 6e648e38e2..c857416696 100644 --- a/lsp/java/src/test/resources/robolectric.properties +++ b/lsp/java/src/test/resources/robolectric.properties @@ -4,4 +4,4 @@ # override any application= setting on the abstract LSPTest base, so we declare it # module-wide here. Robolectric instantiates this class once per test, which fires # the init block and populates _baseInstance. -application=com.itsaky.androidide.app.BaseApplication +application=org.appdevforall.codeonthego.app.BaseApplication diff --git a/lsp/jvm-symbol-index/src/main/kotlin/org/appdevforall/codeonthego/indexing/jvm/JvmGeneratedIndexingService.kt b/lsp/jvm-symbol-index/src/main/kotlin/org/appdevforall/codeonthego/indexing/jvm/JvmGeneratedIndexingService.kt index 5a8c5ee4eb..58142556c0 100644 --- a/lsp/jvm-symbol-index/src/main/kotlin/org/appdevforall/codeonthego/indexing/jvm/JvmGeneratedIndexingService.kt +++ b/lsp/jvm-symbol-index/src/main/kotlin/org/appdevforall/codeonthego/indexing/jvm/JvmGeneratedIndexingService.kt @@ -1,9 +1,9 @@ package org.appdevforall.codeonthego.indexing.jvm import android.content.Context -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.projects.api.ModuleProject -import com.itsaky.androidide.tasks.cancelIfActive +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.projects.api.ModuleProject +import org.appdevforall.codeonthego.tasks.cancelIfActive import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/lsp/jvm-symbol-index/src/main/kotlin/org/appdevforall/codeonthego/indexing/jvm/JvmLibraryIndexingService.kt b/lsp/jvm-symbol-index/src/main/kotlin/org/appdevforall/codeonthego/indexing/jvm/JvmLibraryIndexingService.kt index 8b53c393dd..0d547d6dc1 100644 --- a/lsp/jvm-symbol-index/src/main/kotlin/org/appdevforall/codeonthego/indexing/jvm/JvmLibraryIndexingService.kt +++ b/lsp/jvm-symbol-index/src/main/kotlin/org/appdevforall/codeonthego/indexing/jvm/JvmLibraryIndexingService.kt @@ -1,11 +1,11 @@ package org.appdevforall.codeonthego.indexing.jvm import android.content.Context -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.projects.api.AndroidModule -import com.itsaky.androidide.projects.api.ModuleProject -import com.itsaky.androidide.projects.models.bootClassPaths -import com.itsaky.androidide.tasks.cancelIfActive +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.projects.api.AndroidModule +import org.appdevforall.codeonthego.projects.api.ModuleProject +import org.appdevforall.codeonthego.projects.models.bootClassPaths +import org.appdevforall.codeonthego.tasks.cancelIfActive import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/KotlinCodeActionsMenu.kt b/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/KotlinCodeActionsMenu.kt deleted file mode 100644 index 2e714edcec..0000000000 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/KotlinCodeActionsMenu.kt +++ /dev/null @@ -1,58 +0,0 @@ -package com.itsaky.androidide.lsp.kotlin - -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.actions.CommentLineAction -import com.itsaky.androidide.lsp.actions.IActionsMenuProvider -import com.itsaky.androidide.lsp.actions.SurroundWithTryCatchAction -import com.itsaky.androidide.lsp.actions.UncommentLineAction -import com.itsaky.androidide.lsp.kotlin.actions.AddImportAction -import com.itsaky.androidide.lsp.kotlin.actions.ExtractMethodAction -import com.itsaky.androidide.lsp.kotlin.actions.ExtractVariableAction -import com.itsaky.androidide.lsp.kotlin.actions.FindReferencesAction -import com.itsaky.androidide.lsp.kotlin.actions.GoToDefinitionAction -import com.itsaky.androidide.lsp.kotlin.actions.ImplementMembersAction -import com.itsaky.androidide.lsp.kotlin.actions.InlineVariableAction -import com.itsaky.androidide.lsp.kotlin.actions.NullSafetyAction -import com.itsaky.androidide.lsp.kotlin.actions.OrganizeImportsAction - -object KotlinCodeActionsMenu : IActionsMenuProvider { - internal const val KT_LANG = "kt" - private val KT_EXTS = listOf("kt", "kts") - private const val KT_LINE_COMMENT_TOKEN = "//" - private const val KT_CATCH_CLAUSE = "catch (e: Exception)" - private const val KT_CATCH_BODY = "e.printStackTrace()" - - override val actions: List = - listOf( - CommentLineAction( - KT_LANG, - KT_EXTS, - KT_LINE_COMMENT_TOKEN, - TooltipTag.EDITOR_CODE_ACTIONS_KT_COMMENT, - ), - UncommentLineAction( - KT_LANG, - KT_EXTS, - KT_LINE_COMMENT_TOKEN, - TooltipTag.EDITOR_CODE_ACTIONS_KT_UNCOMMENT, - ), - GoToDefinitionAction(), - FindReferencesAction(), - AddImportAction(), - OrganizeImportsAction(), - SurroundWithTryCatchAction( - KT_LANG, - KT_EXTS, - KotlinLanguageServer.SERVER_ID, - KT_CATCH_CLAUSE, - KT_CATCH_BODY, - TooltipTag.EDITOR_CODE_ACTIONS_KT_SURROUND_TRY_CATCH, - ), - NullSafetyAction(), - ImplementMembersAction(), - ExtractVariableAction(), - ExtractMethodAction(), - InlineVariableAction(), - ) -} diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/FileEventConsumer.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/FileEventConsumer.kt similarity index 82% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/FileEventConsumer.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/FileEventConsumer.kt index 0fc2feab55..ffe094b3bd 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/FileEventConsumer.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/FileEventConsumer.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin +package org.appdevforall.codeonthego.lsp.kotlin import java.nio.file.Path diff --git a/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/KotlinCodeActionsMenu.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/KotlinCodeActionsMenu.kt new file mode 100644 index 0000000000..9c4d155e9b --- /dev/null +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/KotlinCodeActionsMenu.kt @@ -0,0 +1,58 @@ +package org.appdevforall.codeonthego.lsp.kotlin + +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.actions.CommentLineAction +import org.appdevforall.codeonthego.lsp.actions.IActionsMenuProvider +import org.appdevforall.codeonthego.lsp.actions.SurroundWithTryCatchAction +import org.appdevforall.codeonthego.lsp.actions.UncommentLineAction +import org.appdevforall.codeonthego.lsp.kotlin.actions.AddImportAction +import org.appdevforall.codeonthego.lsp.kotlin.actions.ExtractMethodAction +import org.appdevforall.codeonthego.lsp.kotlin.actions.ExtractVariableAction +import org.appdevforall.codeonthego.lsp.kotlin.actions.FindReferencesAction +import org.appdevforall.codeonthego.lsp.kotlin.actions.GoToDefinitionAction +import org.appdevforall.codeonthego.lsp.kotlin.actions.ImplementMembersAction +import org.appdevforall.codeonthego.lsp.kotlin.actions.InlineVariableAction +import org.appdevforall.codeonthego.lsp.kotlin.actions.NullSafetyAction +import org.appdevforall.codeonthego.lsp.kotlin.actions.OrganizeImportsAction + +object KotlinCodeActionsMenu : IActionsMenuProvider { + internal const val KT_LANG = "kt" + private val KT_EXTS = listOf("kt", "kts") + private const val KT_LINE_COMMENT_TOKEN = "//" + private const val KT_CATCH_CLAUSE = "catch (e: Exception)" + private const val KT_CATCH_BODY = "e.printStackTrace()" + + override val actions: List = + listOf( + CommentLineAction( + KT_LANG, + KT_EXTS, + KT_LINE_COMMENT_TOKEN, + TooltipTag.EDITOR_CODE_ACTIONS_KT_COMMENT, + ), + UncommentLineAction( + KT_LANG, + KT_EXTS, + KT_LINE_COMMENT_TOKEN, + TooltipTag.EDITOR_CODE_ACTIONS_KT_UNCOMMENT, + ), + GoToDefinitionAction(), + FindReferencesAction(), + AddImportAction(), + OrganizeImportsAction(), + SurroundWithTryCatchAction( + KT_LANG, + KT_EXTS, + KotlinLanguageServer.SERVER_ID, + KT_CATCH_CLAUSE, + KT_CATCH_BODY, + TooltipTag.EDITOR_CODE_ACTIONS_KT_SURROUND_TRY_CATCH, + ), + NullSafetyAction(), + ImplementMembersAction(), + ExtractVariableAction(), + ExtractMethodAction(), + InlineVariableAction(), + ) +} diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/KotlinLanguageServer.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/KotlinLanguageServer.kt similarity index 80% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/KotlinLanguageServer.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/KotlinLanguageServer.kt index cc3558ee01..10a4c30904 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/KotlinLanguageServer.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/KotlinLanguageServer.kt @@ -15,53 +15,53 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.kotlin - -import com.itsaky.androidide.app.BaseApplication -import com.itsaky.androidide.app.configuration.IJdkDistributionProvider -import com.itsaky.androidide.eventbus.events.BuildCompletedEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentCloseEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentOpenEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentSaveEvent -import com.itsaky.androidide.eventbus.events.file.FileContentChangedEvent -import com.itsaky.androidide.eventbus.events.file.FileCreationEvent -import com.itsaky.androidide.eventbus.events.file.FileDeletionEvent -import com.itsaky.androidide.eventbus.events.file.FileRenameEvent -import com.itsaky.androidide.lsp.api.ILanguageClient -import com.itsaky.androidide.lsp.api.ILanguageServer -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.kotlin.compiler.CompilationEnvironment -import com.itsaky.androidide.lsp.kotlin.compiler.Compiler -import com.itsaky.androidide.lsp.kotlin.compiler.KotlinProjectModel -import com.itsaky.androidide.lsp.kotlin.completion.KotlinSnippetRepository -import com.itsaky.androidide.lsp.kotlin.completion.codeComplete -import com.itsaky.androidide.lsp.kotlin.diagnostic.collectDiagnosticsFor -import com.itsaky.androidide.lsp.kotlin.format.KotlinCodeFormatter -import com.itsaky.androidide.lsp.kotlin.navigation.findDefinitionAt -import com.itsaky.androidide.lsp.kotlin.navigation.findUsagesAt -import com.itsaky.androidide.lsp.kotlin.signaturehelp.doSignatureHelp -import com.itsaky.androidide.lsp.models.CodeFormatResult -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.DefinitionParams -import com.itsaky.androidide.lsp.models.DefinitionResult -import com.itsaky.androidide.lsp.models.DiagnosticResult -import com.itsaky.androidide.lsp.models.ExpandSelectionParams -import com.itsaky.androidide.lsp.models.FormatCodeParams -import com.itsaky.androidide.lsp.models.ReferenceParams -import com.itsaky.androidide.lsp.models.ReferenceResult -import com.itsaky.androidide.lsp.models.SignatureHelp -import com.itsaky.androidide.lsp.models.SignatureHelpParams -import com.itsaky.androidide.lsp.util.LSPEditorActions -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.projects.FileManager -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.projects.api.Workspace -import com.itsaky.androidide.tasks.createJobCancelChecker -import com.itsaky.androidide.utils.DocumentUtils -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.ifNotEmpty +package org.appdevforall.codeonthego.lsp.kotlin + +import org.appdevforall.codeonthego.app.BaseApplication +import org.appdevforall.codeonthego.app.configuration.IJdkDistributionProvider +import org.appdevforall.codeonthego.eventbus.events.BuildCompletedEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentCloseEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentOpenEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentSaveEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileContentChangedEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileCreationEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileDeletionEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileRenameEvent +import org.appdevforall.codeonthego.lsp.api.ILanguageClient +import org.appdevforall.codeonthego.lsp.api.ILanguageServer +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.kotlin.compiler.CompilationEnvironment +import org.appdevforall.codeonthego.lsp.kotlin.compiler.Compiler +import org.appdevforall.codeonthego.lsp.kotlin.compiler.KotlinProjectModel +import org.appdevforall.codeonthego.lsp.kotlin.completion.KotlinSnippetRepository +import org.appdevforall.codeonthego.lsp.kotlin.completion.codeComplete +import org.appdevforall.codeonthego.lsp.kotlin.diagnostic.collectDiagnosticsFor +import org.appdevforall.codeonthego.lsp.kotlin.format.KotlinCodeFormatter +import org.appdevforall.codeonthego.lsp.kotlin.navigation.findDefinitionAt +import org.appdevforall.codeonthego.lsp.kotlin.navigation.findUsagesAt +import org.appdevforall.codeonthego.lsp.kotlin.signaturehelp.doSignatureHelp +import org.appdevforall.codeonthego.lsp.models.CodeFormatResult +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.DefinitionParams +import org.appdevforall.codeonthego.lsp.models.DefinitionResult +import org.appdevforall.codeonthego.lsp.models.DiagnosticResult +import org.appdevforall.codeonthego.lsp.models.ExpandSelectionParams +import org.appdevforall.codeonthego.lsp.models.FormatCodeParams +import org.appdevforall.codeonthego.lsp.models.ReferenceParams +import org.appdevforall.codeonthego.lsp.models.ReferenceResult +import org.appdevforall.codeonthego.lsp.models.SignatureHelp +import org.appdevforall.codeonthego.lsp.models.SignatureHelpParams +import org.appdevforall.codeonthego.lsp.util.LSPEditorActions +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.projects.FileManager +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.projects.api.Workspace +import org.appdevforall.codeonthego.tasks.createJobCancelChecker +import org.appdevforall.codeonthego.utils.DocumentUtils +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.ifNotEmpty import io.sentry.Sentry import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.CoroutineScope diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/KotlinServerSettings.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/KotlinServerSettings.kt similarity index 90% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/KotlinServerSettings.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/KotlinServerSettings.kt index fa51c56c7f..6408681154 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/KotlinServerSettings.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/KotlinServerSettings.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.kotlin +package org.appdevforall.codeonthego.lsp.kotlin -import com.itsaky.androidide.lsp.util.PrefBasedServerSettings +import org.appdevforall.codeonthego.lsp.util.PrefBasedServerSettings class KotlinServerSettings private constructor() : PrefBasedServerSettings() { diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/AddImportAction.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/AddImportAction.kt similarity index 83% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/AddImportAction.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/AddImportAction.kt index 17bdd07f33..24fb2f2790 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/AddImportAction.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/AddImportAction.kt @@ -1,30 +1,30 @@ -package com.itsaky.androidide.lsp.kotlin.actions +package org.appdevforall.codeonthego.lsp.kotlin.actions import android.content.Context import android.view.View import android.widget.ListView -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.has -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.newDialogBuilder -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.api.ILanguageClient -import com.itsaky.androidide.lsp.kotlin.compiler.AbstractCompilationEnvironment -import com.itsaky.androidide.lsp.kotlin.compiler.index.findSymbolBySimpleName -import com.itsaky.androidide.lsp.kotlin.diagnostic.DiagnosticAction -import com.itsaky.androidide.lsp.kotlin.utils.insertImport -import com.itsaky.androidide.lsp.models.CodeActionItem -import com.itsaky.androidide.lsp.models.CodeActionKind -import com.itsaky.androidide.lsp.models.Command -import com.itsaky.androidide.lsp.models.DiagnosticItem -import com.itsaky.androidide.lsp.models.DocumentChange -import com.itsaky.androidide.lsp.models.TextEdit +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.has +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.newDialogBuilder +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.api.ILanguageClient +import org.appdevforall.codeonthego.lsp.kotlin.compiler.AbstractCompilationEnvironment +import org.appdevforall.codeonthego.lsp.kotlin.compiler.index.findSymbolBySimpleName +import org.appdevforall.codeonthego.lsp.kotlin.diagnostic.DiagnosticAction +import org.appdevforall.codeonthego.lsp.kotlin.utils.insertImport +import org.appdevforall.codeonthego.lsp.models.CodeActionItem +import org.appdevforall.codeonthego.lsp.models.CodeActionKind +import org.appdevforall.codeonthego.lsp.models.Command +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem +import org.appdevforall.codeonthego.lsp.models.DocumentChange +import org.appdevforall.codeonthego.lsp.models.TextEdit import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.applyLongPressRecursively -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashInfo +import org.appdevforall.codeonthego.utils.applyLongPressRecursively +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashInfo import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import java.nio.file.Path diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/BaseKotlinCodeAction.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/BaseKotlinCodeAction.kt similarity index 69% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/BaseKotlinCodeAction.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/BaseKotlinCodeAction.kt index 191c665976..317c0594ef 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/BaseKotlinCodeAction.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/BaseKotlinCodeAction.kt @@ -1,24 +1,24 @@ -package com.itsaky.androidide.lsp.kotlin.actions +package org.appdevforall.codeonthego.lsp.kotlin.actions import android.content.Context import android.graphics.drawable.Drawable import androidx.annotation.StringRes -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.EditorActionItem -import com.itsaky.androidide.actions.get -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.lsp.api.ILanguageClient -import com.itsaky.androidide.lsp.kotlin.KotlinLanguageServer -import com.itsaky.androidide.lsp.kotlin.diagnostic.DiagnosticAction -import com.itsaky.androidide.lsp.kotlin.diagnostic.KotlinDiagnosticExtra -import com.itsaky.androidide.lsp.kotlin.diagnostic.asAction -import com.itsaky.androidide.lsp.models.DiagnosticItem -import com.itsaky.androidide.lsp.models.DiagnosticsInSelection -import com.itsaky.androidide.utils.DocumentUtils +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.EditorActionItem +import org.appdevforall.codeonthego.actions.get +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.lsp.api.ILanguageClient +import org.appdevforall.codeonthego.lsp.kotlin.KotlinLanguageServer +import org.appdevforall.codeonthego.lsp.kotlin.diagnostic.DiagnosticAction +import org.appdevforall.codeonthego.lsp.kotlin.diagnostic.KotlinDiagnosticExtra +import org.appdevforall.codeonthego.lsp.kotlin.diagnostic.asAction +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem +import org.appdevforall.codeonthego.lsp.models.DiagnosticsInSelection +import org.appdevforall.codeonthego.utils.DocumentUtils import org.slf4j.Logger import org.slf4j.LoggerFactory import java.io.File diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/ExtractMethodAction.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/ExtractMethodAction.kt similarity index 79% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/ExtractMethodAction.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/ExtractMethodAction.kt index bb2f65644a..25f1c47583 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/ExtractMethodAction.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/ExtractMethodAction.kt @@ -1,36 +1,36 @@ -package com.itsaky.androidide.lsp.kotlin.actions +package org.appdevforall.codeonthego.lsp.kotlin.actions import android.content.Context -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.get -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.actions.requireEditor -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.kotlin.KotlinLanguageServer -import com.itsaky.androidide.lsp.kotlin.compiler.modules.ScheduledCancelChecker -import com.itsaky.androidide.lsp.kotlin.refactor.KOTLIN_NAME_MESSAGES -import com.itsaky.androidide.lsp.kotlin.refactor.candidateFor -import com.itsaky.androidide.lsp.kotlin.refactor.toMethodCandidateViews -import com.itsaky.androidide.lsp.kotlin.utils.refactor.ExtractMethodCandidate -import com.itsaky.androidide.lsp.kotlin.utils.refactor.ExtractMethodPlan -import com.itsaky.androidide.lsp.kotlin.utils.refactor.ExtractionRefusal -import com.itsaky.androidide.lsp.kotlin.utils.refactor.HARD_KEYWORDS -import com.itsaky.androidide.lsp.kotlin.utils.refactor.buildExtractMethodPlan -import com.itsaky.androidide.lsp.kotlin.utils.refactor.buildExtractMethodRewrites -import com.itsaky.androidide.lsp.models.CodeActionItem -import com.itsaky.androidide.lsp.models.CodeActionKind -import com.itsaky.androidide.lsp.models.Command -import com.itsaky.androidide.lsp.models.DocumentChange -import com.itsaky.androidide.lsp.refactor.toTextEdit -import com.itsaky.androidide.lsp.ui.ExtractMethodSelection -import com.itsaky.androidide.lsp.ui.ExtractMethodSheet -import com.itsaky.androidide.lsp.ui.findFragmentActivity -import com.itsaky.androidide.projects.FileManager +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.get +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.actions.requireEditor +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.kotlin.KotlinLanguageServer +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.ScheduledCancelChecker +import org.appdevforall.codeonthego.lsp.kotlin.refactor.KOTLIN_NAME_MESSAGES +import org.appdevforall.codeonthego.lsp.kotlin.refactor.candidateFor +import org.appdevforall.codeonthego.lsp.kotlin.refactor.toMethodCandidateViews +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.ExtractMethodCandidate +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.ExtractMethodPlan +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.ExtractionRefusal +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.HARD_KEYWORDS +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.buildExtractMethodPlan +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.buildExtractMethodRewrites +import org.appdevforall.codeonthego.lsp.models.CodeActionItem +import org.appdevforall.codeonthego.lsp.models.CodeActionKind +import org.appdevforall.codeonthego.lsp.models.Command +import org.appdevforall.codeonthego.lsp.models.DocumentChange +import org.appdevforall.codeonthego.lsp.refactor.toTextEdit +import org.appdevforall.codeonthego.lsp.ui.ExtractMethodSelection +import org.appdevforall.codeonthego.lsp.ui.ExtractMethodSheet +import org.appdevforall.codeonthego.lsp.ui.findFragmentActivity +import org.appdevforall.codeonthego.projects.FileManager import com.itsaky.androidide.resources.R -import com.itsaky.androidide.tasks.createJobCancelChecker -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashInfo +import org.appdevforall.codeonthego.tasks.createJobCancelChecker +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashInfo import java.nio.file.Path /** diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/ExtractVariableAction.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/ExtractVariableAction.kt similarity index 73% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/ExtractVariableAction.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/ExtractVariableAction.kt index 3fb178e44f..c65610ae77 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/ExtractVariableAction.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/ExtractVariableAction.kt @@ -1,33 +1,33 @@ -package com.itsaky.androidide.lsp.kotlin.actions - -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.get -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.actions.requireEditor -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.kotlin.KotlinLanguageServer -import com.itsaky.androidide.lsp.kotlin.compiler.modules.ScheduledCancelChecker -import com.itsaky.androidide.lsp.kotlin.refactor.KOTLIN_NAME_MESSAGES -import com.itsaky.androidide.lsp.kotlin.refactor.candidateAndScopeFor -import com.itsaky.androidide.lsp.kotlin.refactor.toCandidateViews -import com.itsaky.androidide.lsp.kotlin.utils.refactor.ExtractionPlan -import com.itsaky.androidide.lsp.kotlin.utils.refactor.HARD_KEYWORDS -import com.itsaky.androidide.lsp.kotlin.utils.refactor.buildExtractVariableRewrite -import com.itsaky.androidide.lsp.kotlin.utils.refactor.buildExtractionPlan -import com.itsaky.androidide.lsp.models.CodeActionItem -import com.itsaky.androidide.lsp.models.CodeActionKind -import com.itsaky.androidide.lsp.models.Command -import com.itsaky.androidide.lsp.models.DocumentChange -import com.itsaky.androidide.lsp.refactor.toTextEdit -import com.itsaky.androidide.lsp.ui.ExtractVariableSelection -import com.itsaky.androidide.lsp.ui.ExtractVariableSheet -import com.itsaky.androidide.lsp.ui.findFragmentActivity -import com.itsaky.androidide.projects.FileManager +package org.appdevforall.codeonthego.lsp.kotlin.actions + +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.get +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.actions.requireEditor +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.kotlin.KotlinLanguageServer +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.ScheduledCancelChecker +import org.appdevforall.codeonthego.lsp.kotlin.refactor.KOTLIN_NAME_MESSAGES +import org.appdevforall.codeonthego.lsp.kotlin.refactor.candidateAndScopeFor +import org.appdevforall.codeonthego.lsp.kotlin.refactor.toCandidateViews +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.ExtractionPlan +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.HARD_KEYWORDS +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.buildExtractVariableRewrite +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.buildExtractionPlan +import org.appdevforall.codeonthego.lsp.models.CodeActionItem +import org.appdevforall.codeonthego.lsp.models.CodeActionKind +import org.appdevforall.codeonthego.lsp.models.Command +import org.appdevforall.codeonthego.lsp.models.DocumentChange +import org.appdevforall.codeonthego.lsp.refactor.toTextEdit +import org.appdevforall.codeonthego.lsp.ui.ExtractVariableSelection +import org.appdevforall.codeonthego.lsp.ui.ExtractVariableSheet +import org.appdevforall.codeonthego.lsp.ui.findFragmentActivity +import org.appdevforall.codeonthego.projects.FileManager import com.itsaky.androidide.resources.R -import com.itsaky.androidide.tasks.createJobCancelChecker -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashInfo +import org.appdevforall.codeonthego.tasks.createJobCancelChecker +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashInfo import java.nio.file.Path /** diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/FindReferencesAction.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/FindReferencesAction.kt similarity index 83% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/FindReferencesAction.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/FindReferencesAction.kt index ab40a307da..1a7f5aeed2 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/FindReferencesAction.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/FindReferencesAction.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.lsp.kotlin.actions +package org.appdevforall.codeonthego.lsp.kotlin.actions -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.editor.api.ILspEditor -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.editor.api.ILspEditor +import org.appdevforall.codeonthego.idetooltips.TooltipTag import com.itsaky.androidide.resources.R import io.github.rosemoe.sora.widget.CodeEditor diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/GoToDefinitionAction.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/GoToDefinitionAction.kt similarity index 80% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/GoToDefinitionAction.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/GoToDefinitionAction.kt index 8b4b27aac0..2fb6154832 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/GoToDefinitionAction.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/GoToDefinitionAction.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.lsp.kotlin.actions +package org.appdevforall.codeonthego.lsp.kotlin.actions -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.editor.api.ILspEditor -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.editor.api.ILspEditor +import org.appdevforall.codeonthego.idetooltips.TooltipTag import com.itsaky.androidide.resources.R import io.github.rosemoe.sora.widget.CodeEditor diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/ImplementMembersAction.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/ImplementMembersAction.kt similarity index 87% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/ImplementMembersAction.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/ImplementMembersAction.kt index 4e59974342..6f99b37818 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/ImplementMembersAction.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/ImplementMembersAction.kt @@ -1,27 +1,27 @@ -package com.itsaky.androidide.lsp.kotlin.actions +package org.appdevforall.codeonthego.lsp.kotlin.actions -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.get -import com.itsaky.androidide.actions.requireEditor -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.kotlin.KotlinLanguageServer -import com.itsaky.androidide.lsp.kotlin.compiler.AbstractCompilationEnvironment -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPriority -import com.itsaky.androidide.lsp.kotlin.compiler.modules.isAnalysisCancellation -import com.itsaky.androidide.lsp.kotlin.compiler.modules.retryingOnPreemption -import com.itsaky.androidide.lsp.kotlin.utils.membersToImplement -import com.itsaky.androidide.lsp.kotlin.utils.renderOverrideStub -import com.itsaky.androidide.lsp.kotlin.utils.toRange -import com.itsaky.androidide.lsp.models.CodeActionItem -import com.itsaky.androidide.lsp.models.CodeActionKind -import com.itsaky.androidide.lsp.models.Command -import com.itsaky.androidide.lsp.models.DocumentChange -import com.itsaky.androidide.lsp.models.TextEdit -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.progress.ICancelChecker +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.get +import org.appdevforall.codeonthego.actions.requireEditor +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.kotlin.KotlinLanguageServer +import org.appdevforall.codeonthego.lsp.kotlin.compiler.AbstractCompilationEnvironment +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPriority +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.isAnalysisCancellation +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.retryingOnPreemption +import org.appdevforall.codeonthego.lsp.kotlin.utils.membersToImplement +import org.appdevforall.codeonthego.lsp.kotlin.utils.renderOverrideStub +import org.appdevforall.codeonthego.lsp.kotlin.utils.toRange +import org.appdevforall.codeonthego.lsp.models.CodeActionItem +import org.appdevforall.codeonthego.lsp.models.CodeActionKind +import org.appdevforall.codeonthego.lsp.models.Command +import org.appdevforall.codeonthego.lsp.models.DocumentChange +import org.appdevforall.codeonthego.lsp.models.TextEdit +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.progress.ICancelChecker import com.itsaky.androidide.resources.R -import com.itsaky.androidide.tasks.createJobCancelChecker +import org.appdevforall.codeonthego.tasks.createJobCancelChecker import org.jetbrains.kotlin.analysis.api.symbols.KaClassKind import org.jetbrains.kotlin.analysis.api.symbols.KaClassSymbol import org.jetbrains.kotlin.analysis.api.symbols.KaSymbolModality diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/InlineVariableAction.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/InlineVariableAction.kt similarity index 82% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/InlineVariableAction.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/InlineVariableAction.kt index 15d20080fa..ba13dc7a42 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/InlineVariableAction.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/InlineVariableAction.kt @@ -1,33 +1,33 @@ -package com.itsaky.androidide.lsp.kotlin.actions +package org.appdevforall.codeonthego.lsp.kotlin.actions import android.content.Context -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.get -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.actions.requireEditor -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.kotlin.KotlinLanguageServer -import com.itsaky.androidide.lsp.kotlin.compiler.modules.ScheduledCancelChecker -import com.itsaky.androidide.lsp.kotlin.refactor.ui.InlineVariableSheet -import com.itsaky.androidide.lsp.kotlin.utils.refactor.InlineMode -import com.itsaky.androidide.lsp.kotlin.utils.refactor.InlineRefusal -import com.itsaky.androidide.lsp.kotlin.utils.refactor.InlineReport -import com.itsaky.androidide.lsp.kotlin.utils.refactor.InlineVariablePlan -import com.itsaky.androidide.lsp.kotlin.utils.refactor.buildInlineVariablePlan -import com.itsaky.androidide.lsp.kotlin.utils.refactor.buildInlineVariableRewrites -import com.itsaky.androidide.lsp.kotlin.utils.refactor.reportFor -import com.itsaky.androidide.lsp.models.CodeActionItem -import com.itsaky.androidide.lsp.models.CodeActionKind -import com.itsaky.androidide.lsp.models.Command -import com.itsaky.androidide.lsp.models.DocumentChange -import com.itsaky.androidide.lsp.refactor.toTextEdit -import com.itsaky.androidide.lsp.ui.findFragmentActivity -import com.itsaky.androidide.projects.FileManager +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.get +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.actions.requireEditor +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.kotlin.KotlinLanguageServer +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.ScheduledCancelChecker +import org.appdevforall.codeonthego.lsp.kotlin.refactor.ui.InlineVariableSheet +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.InlineMode +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.InlineRefusal +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.InlineReport +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.InlineVariablePlan +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.buildInlineVariablePlan +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.buildInlineVariableRewrites +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.reportFor +import org.appdevforall.codeonthego.lsp.models.CodeActionItem +import org.appdevforall.codeonthego.lsp.models.CodeActionKind +import org.appdevforall.codeonthego.lsp.models.Command +import org.appdevforall.codeonthego.lsp.models.DocumentChange +import org.appdevforall.codeonthego.lsp.refactor.toTextEdit +import org.appdevforall.codeonthego.lsp.ui.findFragmentActivity +import org.appdevforall.codeonthego.projects.FileManager import com.itsaky.androidide.resources.R -import com.itsaky.androidide.tasks.createJobCancelChecker -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.flashInfo +import org.appdevforall.codeonthego.tasks.createJobCancelChecker +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.flashInfo import java.nio.file.Path /** diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/NullSafetyAction.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/NullSafetyAction.kt similarity index 82% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/NullSafetyAction.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/NullSafetyAction.kt index e0812716f2..74995cbc0a 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/NullSafetyAction.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/NullSafetyAction.kt @@ -1,28 +1,28 @@ -package com.itsaky.androidide.lsp.kotlin.actions +package org.appdevforall.codeonthego.lsp.kotlin.actions import android.content.Context import android.view.View import android.widget.ListView -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.actions.newDialogBuilder -import com.itsaky.androidide.actions.requireContext -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.api.ILanguageClient -import com.itsaky.androidide.lsp.kotlin.compiler.AbstractCompilationEnvironment -import com.itsaky.androidide.lsp.kotlin.diagnostic.DiagnosticAction -import com.itsaky.androidide.lsp.kotlin.utils.NullSafetyKind -import com.itsaky.androidide.lsp.kotlin.utils.NullSafetyVariant -import com.itsaky.androidide.lsp.kotlin.utils.findNullableMemberAccess -import com.itsaky.androidide.lsp.kotlin.utils.nullSafetyVariants -import com.itsaky.androidide.lsp.models.CodeActionItem -import com.itsaky.androidide.lsp.models.CodeActionKind -import com.itsaky.androidide.lsp.models.Command -import com.itsaky.androidide.lsp.models.DocumentChange +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.actions.newDialogBuilder +import org.appdevforall.codeonthego.actions.requireContext +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.api.ILanguageClient +import org.appdevforall.codeonthego.lsp.kotlin.compiler.AbstractCompilationEnvironment +import org.appdevforall.codeonthego.lsp.kotlin.diagnostic.DiagnosticAction +import org.appdevforall.codeonthego.lsp.kotlin.utils.NullSafetyKind +import org.appdevforall.codeonthego.lsp.kotlin.utils.NullSafetyVariant +import org.appdevforall.codeonthego.lsp.kotlin.utils.findNullableMemberAccess +import org.appdevforall.codeonthego.lsp.kotlin.utils.nullSafetyVariants +import org.appdevforall.codeonthego.lsp.models.CodeActionItem +import org.appdevforall.codeonthego.lsp.models.CodeActionKind +import org.appdevforall.codeonthego.lsp.models.Command +import org.appdevforall.codeonthego.lsp.models.DocumentChange import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.applyLongPressRecursively +import org.appdevforall.codeonthego.utils.applyLongPressRecursively import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/OrganizeImportsAction.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/OrganizeImportsAction.kt similarity index 76% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/OrganizeImportsAction.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/OrganizeImportsAction.kt index 7868543116..df53451427 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/OrganizeImportsAction.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/actions/OrganizeImportsAction.kt @@ -1,26 +1,26 @@ -package com.itsaky.androidide.lsp.kotlin.actions +package org.appdevforall.codeonthego.lsp.kotlin.actions -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.get -import com.itsaky.androidide.actions.requireFile -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.lsp.kotlin.KotlinLanguageServer -import com.itsaky.androidide.lsp.kotlin.compiler.AbstractCompilationEnvironment -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPriority -import com.itsaky.androidide.lsp.kotlin.compiler.modules.isAnalysisCancellation -import com.itsaky.androidide.lsp.kotlin.compiler.modules.retryingOnPreemption -import com.itsaky.androidide.lsp.kotlin.utils.collectImportUsage -import com.itsaky.androidide.lsp.kotlin.utils.organizedImportBlock -import com.itsaky.androidide.lsp.kotlin.utils.toRange -import com.itsaky.androidide.lsp.models.CodeActionItem -import com.itsaky.androidide.lsp.models.CodeActionKind -import com.itsaky.androidide.lsp.models.Command -import com.itsaky.androidide.lsp.models.DocumentChange -import com.itsaky.androidide.lsp.models.TextEdit -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.progress.ICancelChecker +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.get +import org.appdevforall.codeonthego.actions.requireFile +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.lsp.kotlin.KotlinLanguageServer +import org.appdevforall.codeonthego.lsp.kotlin.compiler.AbstractCompilationEnvironment +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPriority +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.isAnalysisCancellation +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.retryingOnPreemption +import org.appdevforall.codeonthego.lsp.kotlin.utils.collectImportUsage +import org.appdevforall.codeonthego.lsp.kotlin.utils.organizedImportBlock +import org.appdevforall.codeonthego.lsp.kotlin.utils.toRange +import org.appdevforall.codeonthego.lsp.models.CodeActionItem +import org.appdevforall.codeonthego.lsp.models.CodeActionKind +import org.appdevforall.codeonthego.lsp.models.Command +import org.appdevforall.codeonthego.lsp.models.DocumentChange +import org.appdevforall.codeonthego.lsp.models.TextEdit +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.progress.ICancelChecker import com.itsaky.androidide.resources.R -import com.itsaky.androidide.tasks.createJobCancelChecker +import org.appdevforall.codeonthego.tasks.createJobCancelChecker import org.slf4j.LoggerFactory import java.nio.file.Path diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/AbstractCompilationEnvironment.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/AbstractCompilationEnvironment.kt similarity index 94% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/AbstractCompilationEnvironment.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/AbstractCompilationEnvironment.kt index 2c031c6172..d18aa4c393 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/AbstractCompilationEnvironment.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/AbstractCompilationEnvironment.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.lsp.kotlin.compiler - -import com.itsaky.androidide.lsp.kotlin.compiler.index.KtSymbolIndex -import com.itsaky.androidide.lsp.kotlin.compiler.modules.KtModule -import com.itsaky.androidide.lsp.kotlin.compiler.modules.asFlatSequence -import com.itsaky.androidide.lsp.kotlin.compiler.modules.isSourceModule -import com.itsaky.androidide.lsp.kotlin.compiler.services.JavaModuleAccessibilityChecker -import com.itsaky.androidide.lsp.kotlin.compiler.services.JavaModuleAnnotationsProvider -import com.itsaky.androidide.lsp.kotlin.compiler.services.KtLspService -import com.itsaky.androidide.lsp.kotlin.compiler.services.WriteAccessGuard -import com.itsaky.androidide.lsp.kotlin.compiler.services.latestLanguageVersionSettings -import com.itsaky.androidide.lsp.kotlin.compiler.util.SLF4JLogger +package org.appdevforall.codeonthego.lsp.kotlin.compiler + +import org.appdevforall.codeonthego.lsp.kotlin.compiler.index.KtSymbolIndex +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.KtModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.asFlatSequence +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.isSourceModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.JavaModuleAccessibilityChecker +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.JavaModuleAnnotationsProvider +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.KtLspService +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.WriteAccessGuard +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.latestLanguageVersionSettings +import org.appdevforall.codeonthego.lsp.kotlin.compiler.util.SLF4JLogger import kotlinx.coroutines.runBlocking import kotlinx.coroutines.withTimeoutOrNull import org.jetbrains.kotlin.K1Deprecation diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/CompilationEnvironment.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/CompilationEnvironment.kt similarity index 88% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/CompilationEnvironment.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/CompilationEnvironment.kt index d39654012d..8ad79a76e5 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/CompilationEnvironment.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/CompilationEnvironment.kt @@ -1,22 +1,22 @@ -package com.itsaky.androidide.lsp.kotlin.compiler - -import com.itsaky.androidide.lsp.api.ILanguageClient -import com.itsaky.androidide.lsp.kotlin.compiler.index.KtSymbolIndex -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AbstractKtModule -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPreemptedException -import com.itsaky.androidide.lsp.kotlin.compiler.modules.KtModule -import com.itsaky.androidide.lsp.kotlin.compiler.modules.asFlatSequence -import com.itsaky.androidide.lsp.kotlin.compiler.modules.backingFilePath -import com.itsaky.androidide.lsp.kotlin.compiler.registrar.AnalysisApiServiceProviders -import com.itsaky.androidide.lsp.kotlin.compiler.registrar.LspAnalysisApiServiceRegistrar -import com.itsaky.androidide.lsp.kotlin.compiler.services.ProjectStructureProvider -import com.itsaky.androidide.lsp.kotlin.compiler.services.ResolutionScopeProvider -import com.itsaky.androidide.lsp.kotlin.diagnostic.collectDiagnosticsFor -import com.itsaky.androidide.lsp.kotlin.utils.SymbolVisibilityChecker -import com.itsaky.androidide.lsp.kotlin.utils.toVirtualFileOrNull -import com.itsaky.androidide.projects.FileManager -import com.itsaky.androidide.projects.api.Workspace -import com.itsaky.androidide.utils.KeyedDebouncingAction +package org.appdevforall.codeonthego.lsp.kotlin.compiler + +import org.appdevforall.codeonthego.lsp.api.ILanguageClient +import org.appdevforall.codeonthego.lsp.kotlin.compiler.index.KtSymbolIndex +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AbstractKtModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPreemptedException +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.KtModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.asFlatSequence +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.backingFilePath +import org.appdevforall.codeonthego.lsp.kotlin.compiler.registrar.AnalysisApiServiceProviders +import org.appdevforall.codeonthego.lsp.kotlin.compiler.registrar.LspAnalysisApiServiceRegistrar +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.ProjectStructureProvider +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.ResolutionScopeProvider +import org.appdevforall.codeonthego.lsp.kotlin.diagnostic.collectDiagnosticsFor +import org.appdevforall.codeonthego.lsp.kotlin.utils.SymbolVisibilityChecker +import org.appdevforall.codeonthego.lsp.kotlin.utils.toVirtualFileOrNull +import org.appdevforall.codeonthego.projects.FileManager +import org.appdevforall.codeonthego.projects.api.Workspace +import org.appdevforall.codeonthego.utils.KeyedDebouncingAction import io.sentry.Sentry import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineExceptionHandler diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/CompilationKind.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/CompilationKind.kt similarity index 93% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/CompilationKind.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/CompilationKind.kt index 59777e4712..9f4ec3a5aa 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/CompilationKind.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/CompilationKind.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler +package org.appdevforall.codeonthego.lsp.kotlin.compiler import java.nio.file.Path import kotlin.io.path.extension diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/Compiler.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/Compiler.kt similarity index 92% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/Compiler.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/Compiler.kt index 3ebca7fc5c..7f7f80b483 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/Compiler.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/Compiler.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.lsp.kotlin.compiler +package org.appdevforall.codeonthego.lsp.kotlin.compiler -import com.itsaky.androidide.lsp.api.ILanguageClient -import com.itsaky.androidide.projects.api.Workspace -import com.itsaky.androidide.utils.DocumentUtils +import org.appdevforall.codeonthego.lsp.api.ILanguageClient +import org.appdevforall.codeonthego.projects.api.Workspace +import org.appdevforall.codeonthego.utils.DocumentUtils import org.jetbrains.kotlin.com.intellij.openapi.vfs.StandardFileSystems import org.jetbrains.kotlin.com.intellij.openapi.vfs.VirtualFileManager import org.jetbrains.kotlin.com.intellij.openapi.vfs.VirtualFileSystem diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/CompilerExts.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/CompilerExts.kt similarity index 79% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/CompilerExts.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/CompilerExts.kt index 28e8dcdf9b..f9110cbdbf 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/CompilerExts.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/CompilerExts.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler +package org.appdevforall.codeonthego.lsp.kotlin.compiler import org.jetbrains.kotlin.config.JvmTarget import org.jetbrains.kotlin.config.LanguageVersion diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/IncrementalModificationTracker.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/IncrementalModificationTracker.kt similarity index 89% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/IncrementalModificationTracker.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/IncrementalModificationTracker.kt index 032341591d..2c9ae31fac 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/IncrementalModificationTracker.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/IncrementalModificationTracker.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler +package org.appdevforall.codeonthego.lsp.kotlin.compiler import org.jetbrains.kotlin.com.intellij.openapi.util.ModificationTracker import java.util.concurrent.atomic.AtomicLong diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/KotlinApplicationEnvironmentPin.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/KotlinApplicationEnvironmentPin.kt similarity index 92% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/KotlinApplicationEnvironmentPin.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/KotlinApplicationEnvironmentPin.kt index ea0039e34b..bf6988b392 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/KotlinApplicationEnvironmentPin.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/KotlinApplicationEnvironmentPin.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler +package org.appdevforall.codeonthego.lsp.kotlin.compiler import org.jetbrains.kotlin.K1Deprecation import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.Companion.getOrCreateApplicationEnvironmentForProduction as acquireApplicationEnvironment diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/KotlinProjectModel.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/KotlinProjectModel.kt similarity index 94% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/KotlinProjectModel.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/KotlinProjectModel.kt index f4f2ded5f2..2ea01e5732 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/KotlinProjectModel.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/KotlinProjectModel.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.lsp.kotlin.compiler +package org.appdevforall.codeonthego.lsp.kotlin.compiler -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.projects.api.Workspace +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.projects.api.Workspace import org.appdevforall.codeonthego.indexing.jvm.JVM_GENERATED_SYMBOL_INDEX import org.appdevforall.codeonthego.indexing.jvm.JVM_LIBRARY_SYMBOL_INDEX import org.appdevforall.codeonthego.indexing.jvm.JvmSymbolIndex diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/ReadWriteLock.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/ReadWriteLock.kt similarity index 91% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/ReadWriteLock.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/ReadWriteLock.kt index bd9c000672..d67904bde1 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/ReadWriteLock.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/ReadWriteLock.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler +package org.appdevforall.codeonthego.lsp.kotlin.compiler import org.jetbrains.kotlin.com.intellij.openapi.project.Project import org.jetbrains.kotlin.com.intellij.openapi.util.Key diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/WorkspaceExts.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/WorkspaceExts.kt similarity index 76% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/WorkspaceExts.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/WorkspaceExts.kt index 7d07076842..03c6f9b66b 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/WorkspaceExts.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/WorkspaceExts.kt @@ -1,14 +1,14 @@ -package com.itsaky.androidide.lsp.kotlin.compiler - -import com.itsaky.androidide.lsp.kotlin.compiler.modules.KtLibraryModule -import com.itsaky.androidide.lsp.kotlin.compiler.modules.KtModule -import com.itsaky.androidide.lsp.kotlin.compiler.modules.KtSourceModule -import com.itsaky.androidide.lsp.kotlin.compiler.modules.buildKtLibraryModule -import com.itsaky.androidide.lsp.kotlin.compiler.modules.buildKtSourceModule -import com.itsaky.androidide.projects.api.AndroidModule -import com.itsaky.androidide.projects.api.ModuleProject -import com.itsaky.androidide.projects.api.Workspace -import com.itsaky.androidide.projects.models.bootClassPaths +package org.appdevforall.codeonthego.lsp.kotlin.compiler + +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.KtLibraryModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.KtModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.KtSourceModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.buildKtLibraryModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.buildKtSourceModule +import org.appdevforall.codeonthego.projects.api.AndroidModule +import org.appdevforall.codeonthego.projects.api.ModuleProject +import org.appdevforall.codeonthego.projects.api.Workspace +import org.appdevforall.codeonthego.projects.models.bootClassPaths import org.jetbrains.kotlin.com.intellij.core.CoreApplicationEnvironment import org.jetbrains.kotlin.com.intellij.openapi.project.Project import org.slf4j.LoggerFactory diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/IndexCommand.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/IndexCommand.kt similarity index 89% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/IndexCommand.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/IndexCommand.kt index 29e3d94a10..f97e34d71a 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/IndexCommand.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/IndexCommand.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.index +package org.appdevforall.codeonthego.lsp.kotlin.compiler.index import org.jetbrains.kotlin.com.intellij.openapi.vfs.VirtualFile import org.jetbrains.kotlin.psi.KtFile diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/IndexWorker.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/IndexWorker.kt similarity index 93% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/IndexWorker.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/IndexWorker.kt index 6f6099b20c..5925c0d824 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/IndexWorker.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/IndexWorker.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.index - -import com.itsaky.androidide.lsp.kotlin.compiler.CompilationEnvironment -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPreemptedException -import com.itsaky.androidide.lsp.kotlin.compiler.modules.backingFilePath -import com.itsaky.androidide.lsp.kotlin.compiler.read -import com.itsaky.androidide.progress.ICancelChecker -import com.itsaky.androidide.utils.KeyedDebouncingAction +package org.appdevforall.codeonthego.lsp.kotlin.compiler.index + +import org.appdevforall.codeonthego.lsp.kotlin.compiler.CompilationEnvironment +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPreemptedException +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.backingFilePath +import org.appdevforall.codeonthego.lsp.kotlin.compiler.read +import org.appdevforall.codeonthego.progress.ICancelChecker +import org.appdevforall.codeonthego.utils.KeyedDebouncingAction import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.isActive diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/KtSymbolIndex.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/KtSymbolIndex.kt similarity index 95% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/KtSymbolIndex.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/KtSymbolIndex.kt index 7c3625d422..69d08915c5 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/KtSymbolIndex.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/KtSymbolIndex.kt @@ -1,19 +1,19 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.index +package org.appdevforall.codeonthego.lsp.kotlin.compiler.index import com.github.benmanes.caffeine.cache.Caffeine -import com.itsaky.androidide.lsp.kotlin.compiler.CompilationKind -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPriority -import com.itsaky.androidide.lsp.kotlin.compiler.modules.KtModule -import com.itsaky.androidide.lsp.kotlin.compiler.modules.ScheduledCancelChecker -import com.itsaky.androidide.lsp.kotlin.compiler.modules.UnpinnedAnalysis -import com.itsaky.androidide.lsp.kotlin.compiler.modules.analyzeMaybeDangling -import com.itsaky.androidide.lsp.kotlin.compiler.modules.backingFilePath -import com.itsaky.androidide.lsp.kotlin.compiler.read -import com.itsaky.androidide.lsp.kotlin.compiler.services.ProjectStructureProvider -import com.itsaky.androidide.lsp.kotlin.compiler.write -import com.itsaky.androidide.lsp.kotlin.utils.toVirtualFileOrNull -import com.itsaky.androidide.projects.FileManager -import com.itsaky.androidide.utils.DocumentUtils +import org.appdevforall.codeonthego.lsp.kotlin.compiler.CompilationKind +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPriority +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.KtModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.ScheduledCancelChecker +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.UnpinnedAnalysis +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.analyzeMaybeDangling +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.backingFilePath +import org.appdevforall.codeonthego.lsp.kotlin.compiler.read +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.ProjectStructureProvider +import org.appdevforall.codeonthego.lsp.kotlin.compiler.write +import org.appdevforall.codeonthego.lsp.kotlin.utils.toVirtualFileOrNull +import org.appdevforall.codeonthego.projects.FileManager +import org.appdevforall.codeonthego.utils.DocumentUtils import io.sentry.Sentry import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.CoroutineScope diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/LiveKtFile.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/LiveKtFile.kt similarity index 93% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/LiveKtFile.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/LiveKtFile.kt index 5d468f9f72..54f984013f 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/LiveKtFile.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/LiveKtFile.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.index +package org.appdevforall.codeonthego.lsp.kotlin.compiler.index -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPriority -import com.itsaky.androidide.lsp.kotlin.compiler.modules.ScheduledCancelChecker +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPriority +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.ScheduledCancelChecker import org.jetbrains.kotlin.analysis.api.KaSession import org.jetbrains.kotlin.psi.KtElement import org.jetbrains.kotlin.psi.KtFile @@ -34,7 +34,7 @@ internal annotation class UnpinnedKtFileAccess * This marker cannot cover the whole door: the Analysis API interfaces the service providers implement * re-export the instances through their own public members, which may not carry an opt-in marker * (`OPT_IN_MARKER_ON_OVERRIDE`). Those routes are caught at the sink instead, by - * [com.itsaky.androidide.lsp.kotlin.compiler.modules.UnpinnedAnalysis]. + * [org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.UnpinnedAnalysis]. */ @RequiresOptIn( level = RequiresOptIn.Level.ERROR, diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/ScanningWorker.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/ScanningWorker.kt similarity index 79% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/ScanningWorker.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/ScanningWorker.kt index 3f2c06fdec..1d5a84e1bd 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/ScanningWorker.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/ScanningWorker.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.index +package org.appdevforall.codeonthego.lsp.kotlin.compiler.index -import com.itsaky.androidide.lsp.kotlin.compiler.CompilationKind -import com.itsaky.androidide.lsp.kotlin.compiler.modules.KtModule -import com.itsaky.androidide.lsp.kotlin.compiler.modules.asFlatSequence -import com.itsaky.androidide.lsp.kotlin.compiler.modules.isSourceModule -import com.itsaky.androidide.lsp.kotlin.utils.toNioPathOrNull +import org.appdevforall.codeonthego.lsp.kotlin.compiler.CompilationKind +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.KtModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.asFlatSequence +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.isSourceModule +import org.appdevforall.codeonthego.lsp.kotlin.utils.toNioPathOrNull import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.isActive import org.appdevforall.codeonthego.indexing.jvm.JvmSymbolIndex diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/SourceFileIndexer.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/SourceFileIndexer.kt similarity index 96% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/SourceFileIndexer.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/SourceFileIndexer.kt index 313b9acc49..d11034e879 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/SourceFileIndexer.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/SourceFileIndexer.kt @@ -1,14 +1,14 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.index - -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPriority -import com.itsaky.androidide.lsp.kotlin.compiler.modules.ScheduledCancelChecker -import com.itsaky.androidide.lsp.kotlin.compiler.modules.UnpinnedAnalysis -import com.itsaky.androidide.lsp.kotlin.compiler.modules.analyzeMaybeDangling -import com.itsaky.androidide.lsp.kotlin.compiler.modules.backingFilePath -import com.itsaky.androidide.lsp.kotlin.compiler.read -import com.itsaky.androidide.lsp.kotlin.utils.toNioPathOrNull -import com.itsaky.androidide.progress.ICancelChecker -import com.itsaky.androidide.projects.FileManager +package org.appdevforall.codeonthego.lsp.kotlin.compiler.index + +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPriority +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.ScheduledCancelChecker +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.UnpinnedAnalysis +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.analyzeMaybeDangling +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.backingFilePath +import org.appdevforall.codeonthego.lsp.kotlin.compiler.read +import org.appdevforall.codeonthego.lsp.kotlin.utils.toNioPathOrNull +import org.appdevforall.codeonthego.progress.ICancelChecker +import org.appdevforall.codeonthego.projects.FileManager import io.sentry.Attachment import io.sentry.Sentry import kotlinx.coroutines.CancellationException @@ -61,7 +61,7 @@ import kotlin.io.path.pathString private val logger = LoggerFactory.getLogger( - "com.itsaky.androidide.lsp.kotlin.compiler.index.SourceFileIndexer", + "org.appdevforall.codeonthego.lsp.kotlin.compiler.index.SourceFileIndexer", ) /** diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/WorkerQueue.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/WorkerQueue.kt similarity index 96% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/WorkerQueue.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/WorkerQueue.kt index 186a0cf6fa..8df8bc956f 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/index/WorkerQueue.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/index/WorkerQueue.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.index +package org.appdevforall.codeonthego.lsp.kotlin.compiler.index import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.selects.select diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/AbstractKtModule.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/AbstractKtModule.kt similarity index 97% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/AbstractKtModule.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/AbstractKtModule.kt index 9c1f603ef0..23eb4db3f2 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/AbstractKtModule.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/AbstractKtModule.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.modules +package org.appdevforall.codeonthego.lsp.kotlin.compiler.modules import io.sentry.Sentry import org.jetbrains.kotlin.analysis.api.KaExperimentalApi diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/AbstractSourceModule.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/AbstractSourceModule.kt similarity index 91% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/AbstractSourceModule.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/AbstractSourceModule.kt index 7ffef26605..bb9d4dae1d 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/AbstractSourceModule.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/AbstractSourceModule.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.modules +package org.appdevforall.codeonthego.lsp.kotlin.compiler.modules -import com.itsaky.androidide.lsp.kotlin.compiler.read -import com.itsaky.androidide.lsp.kotlin.compiler.services.ProjectStructureProvider +import org.appdevforall.codeonthego.lsp.kotlin.compiler.read +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.ProjectStructureProvider import org.jetbrains.kotlin.com.intellij.openapi.module.Module import org.jetbrains.kotlin.com.intellij.openapi.project.Project import org.jetbrains.kotlin.com.intellij.openapi.vfs.VirtualFile diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/AnalysisScheduler.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/AnalysisScheduler.kt similarity index 98% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/AnalysisScheduler.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/AnalysisScheduler.kt index c4874af24d..9254b75a10 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/AnalysisScheduler.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/AnalysisScheduler.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.modules +package org.appdevforall.codeonthego.lsp.kotlin.compiler.modules -import com.itsaky.androidide.progress.ICancelChecker +import org.appdevforall.codeonthego.progress.ICancelChecker import org.slf4j.Logger import org.slf4j.LoggerFactory import java.util.concurrent.CancellationException diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/AnalysisThreadContext.java b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/AnalysisThreadContext.java similarity index 95% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/AnalysisThreadContext.java rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/AnalysisThreadContext.java index 730a9e586c..6a21e1d800 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/AnalysisThreadContext.java +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/AnalysisThreadContext.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.modules; +package org.appdevforall.codeonthego.lsp.kotlin.compiler.modules; import kotlin.coroutines.CoroutineContext; import kotlinx.coroutines.Job; diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/CancelCheckerProgressIndicator.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/CancelCheckerProgressIndicator.kt similarity index 91% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/CancelCheckerProgressIndicator.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/CancelCheckerProgressIndicator.kt index 5c78877e27..3169d0b00d 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/CancelCheckerProgressIndicator.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/CancelCheckerProgressIndicator.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.modules +package org.appdevforall.codeonthego.lsp.kotlin.compiler.modules -import com.itsaky.androidide.progress.ICancelChecker +import org.appdevforall.codeonthego.progress.ICancelChecker import org.jetbrains.kotlin.com.intellij.openapi.progress.ProcessCanceledException import org.jetbrains.kotlin.com.intellij.openapi.progress.util.AbstractProgressIndicatorBase diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/KtFileExts.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/KtFileExts.kt similarity index 96% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/KtFileExts.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/KtFileExts.kt index afaf57b50e..9f202a80a6 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/KtFileExts.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/KtFileExts.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.modules +package org.appdevforall.codeonthego.lsp.kotlin.compiler.modules import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Job @@ -44,8 +44,8 @@ private val logger = LoggerFactory.getLogger("KtFileExts") * delegate's `CancellationException`) so preempted work is rescheduled, not silently dropped. * * **Footgun:** analysis holds the *read* side of the non-upgradeable - * [com.itsaky.androidide.lsp.kotlin.compiler.read] lock, so code inside an `analyze` block must never - * call [com.itsaky.androidide.lsp.kotlin.compiler.write] — read → write on the same thread deadlocks. + * [org.appdevforall.codeonthego.lsp.kotlin.compiler.read] lock, so code inside an `analyze` block must never + * call [org.appdevforall.codeonthego.lsp.kotlin.compiler.write] — read → write on the same thread deadlocks. */ internal inline fun withAnalysisLock( priority: AnalysisPriority, diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/KtLibraryModule.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/KtLibraryModule.kt similarity index 96% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/KtLibraryModule.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/KtLibraryModule.kt index aaca94149e..785e0a4a06 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/KtLibraryModule.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/KtLibraryModule.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.modules +package org.appdevforall.codeonthego.lsp.kotlin.compiler.modules -import com.itsaky.androidide.lsp.kotlin.compiler.DEFAULT_JVM_TARGET -import com.itsaky.androidide.lsp.kotlin.compiler.read +import org.appdevforall.codeonthego.lsp.kotlin.compiler.DEFAULT_JVM_TARGET +import org.appdevforall.codeonthego.lsp.kotlin.compiler.read import org.jetbrains.kotlin.analysis.api.KaExperimentalApi import org.jetbrains.kotlin.analysis.api.KaImplementationDetail import org.jetbrains.kotlin.analysis.api.KaPlatformInterface diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/KtModule.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/KtModule.kt similarity index 96% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/KtModule.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/KtModule.kt index 92a7c684a3..091b3145e1 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/KtModule.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/KtModule.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.modules +package org.appdevforall.codeonthego.lsp.kotlin.compiler.modules import org.jetbrains.kotlin.analysis.api.KaPlatformInterface import org.jetbrains.kotlin.analysis.api.projectStructure.KaModule diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/KtSourceModule.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/KtSourceModule.kt similarity index 90% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/KtSourceModule.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/KtSourceModule.kt index cb62f1cf90..63a5338923 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/KtSourceModule.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/KtSourceModule.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.modules +package org.appdevforall.codeonthego.lsp.kotlin.compiler.modules -import com.itsaky.androidide.lsp.kotlin.compiler.DEFAULT_JVM_TARGET -import com.itsaky.androidide.lsp.kotlin.compiler.DEFAULT_LANGUAGE_VERSION -import com.itsaky.androidide.projects.api.ModuleProject +import org.appdevforall.codeonthego.lsp.kotlin.compiler.DEFAULT_JVM_TARGET +import org.appdevforall.codeonthego.lsp.kotlin.compiler.DEFAULT_LANGUAGE_VERSION +import org.appdevforall.codeonthego.projects.api.ModuleProject import org.jetbrains.kotlin.analysis.api.KaExperimentalApi import org.jetbrains.kotlin.analysis.api.KaPlatformInterface import org.jetbrains.kotlin.analysis.api.projectStructure.KaSourceModule diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/NotUnderContentRootModule.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/NotUnderContentRootModule.kt similarity index 95% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/NotUnderContentRootModule.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/NotUnderContentRootModule.kt index 0de0b4282c..b0fa28d344 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/modules/NotUnderContentRootModule.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/modules/NotUnderContentRootModule.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.modules +package org.appdevforall.codeonthego.lsp.kotlin.compiler.modules import org.jetbrains.kotlin.analysis.api.KaExperimentalApi import org.jetbrains.kotlin.analysis.api.KaPlatformInterface diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/registrar/AnalysisApiServiceProvider.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/registrar/AnalysisApiServiceProvider.kt similarity index 98% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/registrar/AnalysisApiServiceProvider.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/registrar/AnalysisApiServiceProvider.kt index b3f7c0a841..8a800c81f4 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/registrar/AnalysisApiServiceProvider.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/registrar/AnalysisApiServiceProvider.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.registrar +package org.appdevforall.codeonthego.lsp.kotlin.compiler.registrar import org.jetbrains.kotlin.com.intellij.mock.MockComponentManager import kotlin.reflect.KClass diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/registrar/AnalysisApiServiceProviders.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/registrar/AnalysisApiServiceProviders.kt similarity index 77% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/registrar/AnalysisApiServiceProviders.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/registrar/AnalysisApiServiceProviders.kt index 363651fef4..73fd541e5e 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/registrar/AnalysisApiServiceProviders.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/registrar/AnalysisApiServiceProviders.kt @@ -1,17 +1,17 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.registrar +package org.appdevforall.codeonthego.lsp.kotlin.compiler.registrar -import com.itsaky.androidide.lsp.kotlin.compiler.services.AnalysisPermissionOptions -import com.itsaky.androidide.lsp.kotlin.compiler.services.AnnotationsResolverFactory -import com.itsaky.androidide.lsp.kotlin.compiler.services.DeclarationProviderFactory -import com.itsaky.androidide.lsp.kotlin.compiler.services.DeclarationProviderMerger -import com.itsaky.androidide.lsp.kotlin.compiler.services.ModificationTrackerFactory -import com.itsaky.androidide.lsp.kotlin.compiler.services.ModuleDependentsProvider -import com.itsaky.androidide.lsp.kotlin.compiler.services.NoOpAsyncExecutionService -import com.itsaky.androidide.lsp.kotlin.compiler.services.PackagePartProviderFactory -import com.itsaky.androidide.lsp.kotlin.compiler.services.PackageProviderFactory -import com.itsaky.androidide.lsp.kotlin.compiler.services.PackageProviderMerger -import com.itsaky.androidide.lsp.kotlin.compiler.services.PlatformSettings -import com.itsaky.androidide.lsp.kotlin.compiler.services.ProjectStructureProvider +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.AnalysisPermissionOptions +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.AnnotationsResolverFactory +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.DeclarationProviderFactory +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.DeclarationProviderMerger +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.ModificationTrackerFactory +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.ModuleDependentsProvider +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.NoOpAsyncExecutionService +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.PackagePartProviderFactory +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.PackageProviderFactory +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.PackageProviderMerger +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.PlatformSettings +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.ProjectStructureProvider import org.jetbrains.kotlin.analysis.api.KaImplementationDetail import org.jetbrains.kotlin.analysis.api.platform.KotlinPlatformSettings import org.jetbrains.kotlin.analysis.api.platform.declarations.KotlinAnnotationsResolverFactory diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/registrar/LspAnalysisApiServiceRegistrar.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/registrar/LspAnalysisApiServiceRegistrar.kt similarity index 96% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/registrar/LspAnalysisApiServiceRegistrar.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/registrar/LspAnalysisApiServiceRegistrar.kt index 92454ac27d..20afcd0bc1 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/registrar/LspAnalysisApiServiceRegistrar.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/registrar/LspAnalysisApiServiceRegistrar.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.registrar +package org.appdevforall.codeonthego.lsp.kotlin.compiler.registrar import org.jetbrains.kotlin.analysis.api.KaImplementationDetail import org.jetbrains.kotlin.analysis.api.standalone.base.projectStructure.AnalysisApiSimpleServiceRegistrar diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/AnalysisPermissionOptions.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/AnalysisPermissionOptions.kt similarity index 81% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/AnalysisPermissionOptions.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/AnalysisPermissionOptions.kt index 6dbe0e491e..7698e55990 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/AnalysisPermissionOptions.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/AnalysisPermissionOptions.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.services +package org.appdevforall.codeonthego.lsp.kotlin.compiler.services import org.jetbrains.kotlin.analysis.api.platform.permissions.KotlinAnalysisPermissionOptions diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/AnnotationsResolver.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/AnnotationsResolver.kt similarity index 94% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/AnnotationsResolver.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/AnnotationsResolver.kt index f0637296f6..544a49e565 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/AnnotationsResolver.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/AnnotationsResolver.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.services +package org.appdevforall.codeonthego.lsp.kotlin.compiler.services -import com.itsaky.androidide.lsp.kotlin.compiler.index.KtSymbolIndex -import com.itsaky.androidide.lsp.kotlin.compiler.index.ResolutionSideKtFileAccess -import com.itsaky.androidide.lsp.kotlin.compiler.modules.KtModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.index.KtSymbolIndex +import org.appdevforall.codeonthego.lsp.kotlin.compiler.index.ResolutionSideKtFileAccess +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.KtModule import org.jetbrains.kotlin.analysis.api.platform.declarations.KotlinAnnotationsResolver import org.jetbrains.kotlin.analysis.api.platform.declarations.KotlinAnnotationsResolverFactory import org.jetbrains.kotlin.analysis.api.platform.declarations.KotlinDeclarationProvider diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/DeclarationsProvider.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/DeclarationsProvider.kt similarity index 94% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/DeclarationsProvider.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/DeclarationsProvider.kt index fddf89d779..bb9584f489 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/DeclarationsProvider.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/DeclarationsProvider.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.services +package org.appdevforall.codeonthego.lsp.kotlin.compiler.services -import com.itsaky.androidide.lsp.kotlin.compiler.index.KtSymbolIndex -import com.itsaky.androidide.lsp.kotlin.compiler.index.ResolutionSideKtFileAccess -import com.itsaky.androidide.lsp.kotlin.compiler.index.filesForPackage -import com.itsaky.androidide.lsp.kotlin.compiler.modules.KtModule -import com.itsaky.androidide.lsp.kotlin.compiler.read +import org.appdevforall.codeonthego.lsp.kotlin.compiler.index.KtSymbolIndex +import org.appdevforall.codeonthego.lsp.kotlin.compiler.index.ResolutionSideKtFileAccess +import org.appdevforall.codeonthego.lsp.kotlin.compiler.index.filesForPackage +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.KtModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.read import org.jetbrains.kotlin.analysis.api.platform.declarations.KotlinCompositeDeclarationProvider import org.jetbrains.kotlin.analysis.api.platform.declarations.KotlinDeclarationProvider import org.jetbrains.kotlin.analysis.api.platform.declarations.KotlinDeclarationProviderFactory diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/DirectInheritorsProvider.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/DirectInheritorsProvider.kt similarity index 93% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/DirectInheritorsProvider.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/DirectInheritorsProvider.kt index bd69c5758c..3af04bcf20 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/DirectInheritorsProvider.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/DirectInheritorsProvider.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.services +package org.appdevforall.codeonthego.lsp.kotlin.compiler.services -import com.itsaky.androidide.lsp.kotlin.compiler.index.KtSymbolIndex -import com.itsaky.androidide.lsp.kotlin.compiler.index.ResolutionSideKtFileAccess -import com.itsaky.androidide.lsp.kotlin.compiler.modules.KtModule -import com.itsaky.androidide.lsp.kotlin.compiler.modules.asFlatSequence -import com.itsaky.androidide.lsp.kotlin.compiler.modules.isSourceModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.index.KtSymbolIndex +import org.appdevforall.codeonthego.lsp.kotlin.compiler.index.ResolutionSideKtFileAccess +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.KtModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.asFlatSequence +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.isSourceModule import org.jetbrains.kotlin.analysis.api.KaImplementationDetail import org.jetbrains.kotlin.analysis.api.fir.utils.isSubclassOf import org.jetbrains.kotlin.analysis.api.platform.declarations.KotlinDirectInheritorsProvider diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/JavaModuleAccessibilityChecker.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/JavaModuleAccessibilityChecker.kt similarity index 95% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/JavaModuleAccessibilityChecker.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/JavaModuleAccessibilityChecker.kt index c6dff05a08..54432b8ec5 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/JavaModuleAccessibilityChecker.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/JavaModuleAccessibilityChecker.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.services +package org.appdevforall.codeonthego.lsp.kotlin.compiler.services import org.jetbrains.kotlin.analysis.api.platform.java.KotlinJavaModuleAccessibilityChecker import org.jetbrains.kotlin.analysis.api.platform.java.KotlinJavaModuleAccessibilityError diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/JavaModuleAnnotationsProvider.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/JavaModuleAnnotationsProvider.kt similarity index 90% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/JavaModuleAnnotationsProvider.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/JavaModuleAnnotationsProvider.kt index c1a05127e3..f05230b53f 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/JavaModuleAnnotationsProvider.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/JavaModuleAnnotationsProvider.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.services +package org.appdevforall.codeonthego.lsp.kotlin.compiler.services import org.jetbrains.kotlin.analysis.api.KaNonPublicApi import org.jetbrains.kotlin.analysis.api.platform.java.KotlinJavaModuleJavaAnnotationsProvider diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/KtLspService.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/KtLspService.kt similarity index 55% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/KtLspService.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/KtLspService.kt index 2ead27bcdb..19a963c9bf 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/KtLspService.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/KtLspService.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.services +package org.appdevforall.codeonthego.lsp.kotlin.compiler.services -import com.itsaky.androidide.lsp.kotlin.compiler.index.KtSymbolIndex -import com.itsaky.androidide.lsp.kotlin.compiler.modules.KtModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.index.KtSymbolIndex +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.KtModule import org.jetbrains.kotlin.cli.jvm.index.JavaRoot import org.jetbrains.kotlin.com.intellij.mock.MockProject diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/LanguageSettings.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/LanguageSettings.kt similarity index 84% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/LanguageSettings.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/LanguageSettings.kt index d661755914..7dcf606c41 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/LanguageSettings.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/LanguageSettings.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.services +package org.appdevforall.codeonthego.lsp.kotlin.compiler.services import org.jetbrains.kotlin.config.ApiVersion import org.jetbrains.kotlin.config.LanguageVersion diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/ModificationTrackerFactory.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/ModificationTrackerFactory.kt similarity index 80% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/ModificationTrackerFactory.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/ModificationTrackerFactory.kt index 167b968eb0..58dd094aad 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/ModificationTrackerFactory.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/ModificationTrackerFactory.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.services +package org.appdevforall.codeonthego.lsp.kotlin.compiler.services import org.jetbrains.kotlin.analysis.api.platform.modification.KotlinModificationTrackerByEventFactoryBase import org.jetbrains.kotlin.com.intellij.openapi.project.Project diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/ModuleDependentsProvider.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/ModuleDependentsProvider.kt similarity index 91% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/ModuleDependentsProvider.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/ModuleDependentsProvider.kt index d334483f9c..261985a9a2 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/ModuleDependentsProvider.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/ModuleDependentsProvider.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.services +package org.appdevforall.codeonthego.lsp.kotlin.compiler.services -import com.itsaky.androidide.lsp.kotlin.compiler.index.KtSymbolIndex -import com.itsaky.androidide.lsp.kotlin.compiler.modules.KtModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.index.KtSymbolIndex +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.KtModule import org.jetbrains.kotlin.analysis.api.platform.projectStructure.KotlinModuleDependentsProviderBase import org.jetbrains.kotlin.analysis.api.projectStructure.KaModule import org.jetbrains.kotlin.analysis.api.projectStructure.allDirectDependencies diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/NoOpAsyncExecutionService.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/NoOpAsyncExecutionService.kt similarity index 99% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/NoOpAsyncExecutionService.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/NoOpAsyncExecutionService.kt index bc88cd8739..a71db43248 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/NoOpAsyncExecutionService.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/NoOpAsyncExecutionService.kt @@ -1,6 +1,6 @@ @file:Suppress("UnstableApiUsage") -package com.itsaky.androidide.lsp.kotlin.compiler.services +package org.appdevforall.codeonthego.lsp.kotlin.compiler.services import org.jetbrains.concurrency.CancellablePromise import org.jetbrains.concurrency.Promise diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/PackageProvider.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/PackageProvider.kt similarity index 89% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/PackageProvider.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/PackageProvider.kt index 0a65305983..8587fbf1c5 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/PackageProvider.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/PackageProvider.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.services +package org.appdevforall.codeonthego.lsp.kotlin.compiler.services -import com.itsaky.androidide.lsp.kotlin.compiler.index.KtSymbolIndex -import com.itsaky.androidide.lsp.kotlin.compiler.index.packageExistsInSource -import com.itsaky.androidide.lsp.kotlin.compiler.index.subpackageNames -import com.itsaky.androidide.lsp.kotlin.compiler.modules.KtModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.index.KtSymbolIndex +import org.appdevforall.codeonthego.lsp.kotlin.compiler.index.packageExistsInSource +import org.appdevforall.codeonthego.lsp.kotlin.compiler.index.subpackageNames +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.KtModule import org.jetbrains.kotlin.analysis.api.platform.mergeSpecificProviders import org.jetbrains.kotlin.analysis.api.platform.packages.KotlinCompositePackageProvider import org.jetbrains.kotlin.analysis.api.platform.packages.KotlinPackagePartProviderFactory diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/PlatformSettings.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/PlatformSettings.kt similarity index 84% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/PlatformSettings.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/PlatformSettings.kt index d297e756a1..76e865535e 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/PlatformSettings.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/PlatformSettings.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.services +package org.appdevforall.codeonthego.lsp.kotlin.compiler.services import org.jetbrains.kotlin.analysis.api.platform.KotlinDeserializedDeclarationsOrigin import org.jetbrains.kotlin.analysis.api.platform.KotlinPlatformSettings diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/ProjectStructureProvider.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/ProjectStructureProvider.kt similarity index 93% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/ProjectStructureProvider.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/ProjectStructureProvider.kt index e9b5704529..0cf45b87ab 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/ProjectStructureProvider.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/ProjectStructureProvider.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.services +package org.appdevforall.codeonthego.lsp.kotlin.compiler.services -import com.itsaky.androidide.lsp.kotlin.compiler.index.KtSymbolIndex -import com.itsaky.androidide.lsp.kotlin.compiler.modules.KtModule -import com.itsaky.androidide.lsp.kotlin.compiler.modules.NotUnderContentRootModule -import com.itsaky.androidide.lsp.kotlin.compiler.modules.backingFilePath +import org.appdevforall.codeonthego.lsp.kotlin.compiler.index.KtSymbolIndex +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.KtModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.NotUnderContentRootModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.backingFilePath import org.jetbrains.kotlin.analysis.api.KaExperimentalApi import org.jetbrains.kotlin.analysis.api.KaPlatformInterface import org.jetbrains.kotlin.analysis.api.platform.projectStructure.KotlinProjectStructureProvider diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/ResolutionScopeProvider.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/ResolutionScopeProvider.kt similarity index 95% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/ResolutionScopeProvider.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/ResolutionScopeProvider.kt index f68031b742..e9bc9d0a3f 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/ResolutionScopeProvider.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/ResolutionScopeProvider.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.services +package org.appdevforall.codeonthego.lsp.kotlin.compiler.services import org.jetbrains.kotlin.analysis.api.impl.base.projectStructure.KaBaseResolutionScopeProvider import org.jetbrains.kotlin.analysis.api.platform.projectStructure.KaResolutionScope diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/WriteAccessGuard.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/WriteAccessGuard.kt similarity index 82% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/WriteAccessGuard.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/WriteAccessGuard.kt index bc9bfd9a48..b3891dee4b 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/services/WriteAccessGuard.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/services/WriteAccessGuard.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.services +package org.appdevforall.codeonthego.lsp.kotlin.compiler.services import org.jetbrains.kotlin.com.intellij.openapi.editor.Document import org.jetbrains.kotlin.com.intellij.openapi.editor.impl.DocumentWriteAccessGuard diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/util/SLF4JLogger.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/util/SLF4JLogger.kt similarity index 95% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/util/SLF4JLogger.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/util/SLF4JLogger.kt index dac66e7160..9610ec0895 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/compiler/util/SLF4JLogger.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/compiler/util/SLF4JLogger.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.compiler.util +package org.appdevforall.codeonthego.lsp.kotlin.compiler.util import org.jetbrains.kotlin.com.intellij.openapi.diagnostic.Logger import org.slf4j.LoggerFactory diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/AdvancedKotlinEditHandler.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/AdvancedKotlinEditHandler.kt similarity index 81% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/AdvancedKotlinEditHandler.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/AdvancedKotlinEditHandler.kt index 72903f627e..e018b4e556 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/AdvancedKotlinEditHandler.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/AdvancedKotlinEditHandler.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.lsp.kotlin.completion +package org.appdevforall.codeonthego.lsp.kotlin.completion -import com.itsaky.androidide.lsp.kotlin.compiler.index.UnpinnedKtFileAccess -import com.itsaky.androidide.lsp.kotlin.utils.AnalysisContext -import com.itsaky.androidide.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.kotlin.compiler.index.UnpinnedKtFileAccess +import org.appdevforall.codeonthego.lsp.kotlin.utils.AnalysisContext +import org.appdevforall.codeonthego.lsp.models.CompletionItem import io.github.rosemoe.sora.text.Content import io.github.rosemoe.sora.widget.CodeEditor import org.jetbrains.kotlin.psi.KtFile diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/BaseKotlinEditHandler.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/BaseKotlinEditHandler.kt similarity index 65% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/BaseKotlinEditHandler.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/BaseKotlinEditHandler.kt index 81479a265e..9ef6cb12a2 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/BaseKotlinEditHandler.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/BaseKotlinEditHandler.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.lsp.kotlin.completion +package org.appdevforall.codeonthego.lsp.kotlin.completion -import com.itsaky.androidide.editor.api.ILspEditor -import com.itsaky.androidide.lsp.edits.DefaultEditHandler -import com.itsaky.androidide.lsp.models.Command +import org.appdevforall.codeonthego.editor.api.ILspEditor +import org.appdevforall.codeonthego.lsp.edits.DefaultEditHandler +import org.appdevforall.codeonthego.lsp.models.Command import io.github.rosemoe.sora.widget.CodeEditor /** diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/CompletionContext.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/CompletionContext.kt similarity index 82% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/CompletionContext.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/CompletionContext.kt index a87b6891a9..e9237df4c7 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/CompletionContext.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/CompletionContext.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.completion +package org.appdevforall.codeonthego.lsp.kotlin.completion /** * The context for the providing code completions in a file. diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/ContextKeywords.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/ContextKeywords.kt similarity index 96% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/ContextKeywords.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/ContextKeywords.kt index 433963f83e..f0cc151b66 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/ContextKeywords.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/ContextKeywords.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.completion +package org.appdevforall.codeonthego.lsp.kotlin.completion import org.jetbrains.kotlin.lexer.KtKeywordToken import org.jetbrains.kotlin.lexer.KtTokens.* diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/ContextResolver.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/ContextResolver.kt similarity index 99% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/ContextResolver.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/ContextResolver.kt index 3878cb57ac..2a0adbd885 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/ContextResolver.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/ContextResolver.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.completion +package org.appdevforall.codeonthego.lsp.kotlin.completion import org.jetbrains.kotlin.analysis.api.KaSession import org.jetbrains.kotlin.analysis.api.components.KaScopeContext diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/DeclarationContext.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/DeclarationContext.kt similarity index 90% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/DeclarationContext.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/DeclarationContext.kt index 27f3de4703..04dc61f9dd 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/DeclarationContext.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/DeclarationContext.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.completion +package org.appdevforall.codeonthego.lsp.kotlin.completion /** * Defines the possible declaration contexts of the element at cursor position. diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinAutoImportEditHandler.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/KotlinAutoImportEditHandler.kt similarity index 64% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinAutoImportEditHandler.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/KotlinAutoImportEditHandler.kt index 0b568fc04b..dbae16921b 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinAutoImportEditHandler.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/KotlinAutoImportEditHandler.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.lsp.kotlin.completion +package org.appdevforall.codeonthego.lsp.kotlin.completion -import com.itsaky.androidide.lsp.kotlin.utils.AnalysisContext -import com.itsaky.androidide.lsp.kotlin.utils.insertImport -import com.itsaky.androidide.lsp.models.ClassCompletionData -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.util.RewriteHelper +import org.appdevforall.codeonthego.lsp.kotlin.utils.AnalysisContext +import org.appdevforall.codeonthego.lsp.kotlin.utils.insertImport +import org.appdevforall.codeonthego.lsp.models.ClassCompletionData +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.util.RewriteHelper import io.github.rosemoe.sora.widget.CodeEditor import org.appdevforall.codeonthego.indexing.jvm.JvmSymbol import org.jetbrains.kotlin.psi.KtFile diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinCompletionItem.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/KotlinCompletionItem.kt similarity index 59% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinCompletionItem.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/KotlinCompletionItem.kt index 9847201e1b..37587699a3 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinCompletionItem.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/KotlinCompletionItem.kt @@ -1,13 +1,13 @@ -package com.itsaky.androidide.lsp.kotlin.completion +package org.appdevforall.codeonthego.lsp.kotlin.completion -import com.itsaky.androidide.lsp.edits.IEditHandler -import com.itsaky.androidide.lsp.models.Command -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionItemKind -import com.itsaky.androidide.lsp.models.ICompletionData -import com.itsaky.androidide.lsp.models.InsertTextFormat -import com.itsaky.androidide.lsp.models.MatchLevel -import com.itsaky.androidide.lsp.models.TextEdit +import org.appdevforall.codeonthego.lsp.edits.IEditHandler +import org.appdevforall.codeonthego.lsp.models.Command +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind +import org.appdevforall.codeonthego.lsp.models.ICompletionData +import org.appdevforall.codeonthego.lsp.models.InsertTextFormat +import org.appdevforall.codeonthego.lsp.models.MatchLevel +import org.appdevforall.codeonthego.lsp.models.TextEdit class KotlinCompletionItem( ideLabel: String, diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinCompletions.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/KotlinCompletions.kt similarity index 93% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinCompletions.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/KotlinCompletions.kt index 66acf35355..51dda1e318 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinCompletions.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/KotlinCompletions.kt @@ -1,32 +1,32 @@ @file:Suppress("ktlint:standard:max-line-length") -package com.itsaky.androidide.lsp.kotlin.completion - -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.api.describeSnippet -import com.itsaky.androidide.lsp.kotlin.compiler.CompilationEnvironment -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPreemptedException -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPriority -import com.itsaky.androidide.lsp.kotlin.compiler.modules.ScheduledCancelChecker -import com.itsaky.androidide.lsp.kotlin.compiler.modules.isAnalysisCancellation -import com.itsaky.androidide.lsp.kotlin.utils.AnalysisContext -import com.itsaky.androidide.lsp.kotlin.utils.ContextKeywords -import com.itsaky.androidide.lsp.kotlin.utils.ModifierFilter -import com.itsaky.androidide.lsp.kotlin.utils.containingTopLevelClassDeclaration -import com.itsaky.androidide.lsp.kotlin.utils.renderName -import com.itsaky.androidide.lsp.kotlin.utils.resolveAnalysisContext -import com.itsaky.androidide.lsp.models.ClassCompletionData -import com.itsaky.androidide.lsp.models.Command -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionItemKind -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.InsertTextFormat -import com.itsaky.androidide.lsp.models.MatchLevel -import com.itsaky.androidide.preferences.utils.indentationString -import com.itsaky.androidide.progress.ICancelChecker -import com.itsaky.androidide.progress.ProgressManager -import com.itsaky.androidide.projects.FileManager +package org.appdevforall.codeonthego.lsp.kotlin.completion + +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.api.describeSnippet +import org.appdevforall.codeonthego.lsp.kotlin.compiler.CompilationEnvironment +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPreemptedException +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPriority +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.ScheduledCancelChecker +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.isAnalysisCancellation +import org.appdevforall.codeonthego.lsp.kotlin.utils.AnalysisContext +import org.appdevforall.codeonthego.lsp.kotlin.utils.ContextKeywords +import org.appdevforall.codeonthego.lsp.kotlin.utils.ModifierFilter +import org.appdevforall.codeonthego.lsp.kotlin.utils.containingTopLevelClassDeclaration +import org.appdevforall.codeonthego.lsp.kotlin.utils.renderName +import org.appdevforall.codeonthego.lsp.kotlin.utils.resolveAnalysisContext +import org.appdevforall.codeonthego.lsp.models.ClassCompletionData +import org.appdevforall.codeonthego.lsp.models.Command +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.InsertTextFormat +import org.appdevforall.codeonthego.lsp.models.MatchLevel +import org.appdevforall.codeonthego.preferences.utils.indentationString +import org.appdevforall.codeonthego.progress.ICancelChecker +import org.appdevforall.codeonthego.progress.ProgressManager +import org.appdevforall.codeonthego.projects.FileManager import io.github.rosemoe.sora.lang.completion.CompletionCancelledException import org.appdevforall.codeonthego.indexing.jvm.JvmClassInfo import org.appdevforall.codeonthego.indexing.jvm.JvmFunctionInfo diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinSnippetRepository.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/KotlinSnippetRepository.kt similarity index 57% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinSnippetRepository.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/KotlinSnippetRepository.kt index 89dcc1161e..c7bd70423f 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinSnippetRepository.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/KotlinSnippetRepository.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.lsp.kotlin.completion +package org.appdevforall.codeonthego.lsp.kotlin.completion -import com.itsaky.androidide.lsp.snippets.ISnippet -import com.itsaky.androidide.lsp.snippets.SnippetLanguage -import com.itsaky.androidide.lsp.snippets.SnippetRegistry +import org.appdevforall.codeonthego.lsp.snippets.ISnippet +import org.appdevforall.codeonthego.lsp.snippets.SnippetLanguage +import org.appdevforall.codeonthego.lsp.snippets.SnippetRegistry object KotlinSnippetRepository { val snippets: Map> diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinSnippetScope.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/KotlinSnippetScope.kt similarity index 83% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinSnippetScope.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/KotlinSnippetScope.kt index a3d5a9d47b..b3bffa8fe5 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinSnippetScope.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/KotlinSnippetScope.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.kotlin.completion +package org.appdevforall.codeonthego.lsp.kotlin.completion -import com.itsaky.androidide.lsp.snippets.ISnippetScope +import org.appdevforall.codeonthego.lsp.snippets.ISnippetScope /** * Snippet scopes for Kotlin source files. diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/ModifierFilter.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/ModifierFilter.kt similarity index 98% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/ModifierFilter.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/ModifierFilter.kt index 5f0710e1d8..82747981e4 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/ModifierFilter.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/completion/ModifierFilter.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.completion +package org.appdevforall.codeonthego.lsp.kotlin.completion import org.jetbrains.kotlin.com.intellij.psi.tree.TokenSet import org.jetbrains.kotlin.lexer.KtModifierKeywordToken diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/diagnostic/KotlinDiagnosticProvider.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/diagnostic/KotlinDiagnosticProvider.kt similarity index 90% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/diagnostic/KotlinDiagnosticProvider.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/diagnostic/KotlinDiagnosticProvider.kt index d74cec13f9..eef52882f1 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/diagnostic/KotlinDiagnosticProvider.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/diagnostic/KotlinDiagnosticProvider.kt @@ -1,13 +1,13 @@ -package com.itsaky.androidide.lsp.kotlin.diagnostic - -import com.itsaky.androidide.lsp.kotlin.compiler.CompilationEnvironment -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPriority -import com.itsaky.androidide.lsp.kotlin.compiler.modules.ScheduledCancelChecker -import com.itsaky.androidide.lsp.kotlin.utils.toRange -import com.itsaky.androidide.lsp.models.DiagnosticItem -import com.itsaky.androidide.lsp.models.DiagnosticResult -import com.itsaky.androidide.lsp.models.DiagnosticSeverity -import com.itsaky.androidide.progress.ICancelChecker +package org.appdevforall.codeonthego.lsp.kotlin.diagnostic + +import org.appdevforall.codeonthego.lsp.kotlin.compiler.CompilationEnvironment +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPriority +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.ScheduledCancelChecker +import org.appdevforall.codeonthego.lsp.kotlin.utils.toRange +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem +import org.appdevforall.codeonthego.lsp.models.DiagnosticResult +import org.appdevforall.codeonthego.lsp.models.DiagnosticSeverity +import org.appdevforall.codeonthego.progress.ICancelChecker import kotlinx.coroutines.CancellationException import org.jetbrains.kotlin.analysis.api.KaExperimentalApi import org.jetbrains.kotlin.analysis.api.components.KaDiagnosticCheckerFilter diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/format/KotlinCodeFormatter.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/format/KotlinCodeFormatter.kt similarity index 76% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/format/KotlinCodeFormatter.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/format/KotlinCodeFormatter.kt index 3bf84e0139..b4b89def0d 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/format/KotlinCodeFormatter.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/format/KotlinCodeFormatter.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.lsp.kotlin.format +package org.appdevforall.codeonthego.lsp.kotlin.format import com.facebook.ktfmt.format.Formatter import com.facebook.ktfmt.format.ParseError -import com.itsaky.androidide.lsp.models.CodeFormatException -import com.itsaky.androidide.lsp.models.CodeFormatResult +import org.appdevforall.codeonthego.lsp.models.CodeFormatException +import org.appdevforall.codeonthego.lsp.models.CodeFormatResult internal object KotlinCodeFormatter { fun format(content: CharSequence): CodeFormatResult { diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/navigation/FindUsages.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/navigation/FindUsages.kt similarity index 94% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/navigation/FindUsages.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/navigation/FindUsages.kt index a4ec1bac93..dc187ff412 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/navigation/FindUsages.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/navigation/FindUsages.kt @@ -1,23 +1,23 @@ -package com.itsaky.androidide.lsp.kotlin.navigation - -import com.itsaky.androidide.lsp.kotlin.compiler.AbstractCompilationEnvironment -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPreemptedException -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPriority -import com.itsaky.androidide.lsp.kotlin.compiler.modules.KtModule -import com.itsaky.androidide.lsp.kotlin.compiler.modules.ScheduledCancelChecker -import com.itsaky.androidide.lsp.kotlin.compiler.modules.asFlatSequence -import com.itsaky.androidide.lsp.kotlin.compiler.modules.backingFilePath -import com.itsaky.androidide.lsp.kotlin.compiler.modules.isAnalysisCancellation -import com.itsaky.androidide.lsp.kotlin.compiler.modules.isSourceModule -import com.itsaky.androidide.lsp.kotlin.compiler.modules.retryingOnPreemption -import com.itsaky.androidide.lsp.kotlin.compiler.services.ProjectStructureProvider -import com.itsaky.androidide.lsp.kotlin.utils.rangeOf -import com.itsaky.androidide.lsp.models.ReferenceParams -import com.itsaky.androidide.lsp.models.ReferenceResult -import com.itsaky.androidide.models.Location -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.progress.ICancelChecker -import com.itsaky.androidide.projects.FileManager +package org.appdevforall.codeonthego.lsp.kotlin.navigation + +import org.appdevforall.codeonthego.lsp.kotlin.compiler.AbstractCompilationEnvironment +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPreemptedException +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPriority +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.KtModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.ScheduledCancelChecker +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.asFlatSequence +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.backingFilePath +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.isAnalysisCancellation +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.isSourceModule +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.retryingOnPreemption +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.ProjectStructureProvider +import org.appdevforall.codeonthego.lsp.kotlin.utils.rangeOf +import org.appdevforall.codeonthego.lsp.models.ReferenceParams +import org.appdevforall.codeonthego.lsp.models.ReferenceResult +import org.appdevforall.codeonthego.models.Location +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.progress.ICancelChecker +import org.appdevforall.codeonthego.projects.FileManager import org.jetbrains.kotlin.analysis.api.KaSession import org.jetbrains.kotlin.analysis.api.platform.projectStructure.KotlinModuleDependentsProvider import org.jetbrains.kotlin.analysis.api.symbols.KaCallableSymbol diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/navigation/GoToDefinition.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/navigation/GoToDefinition.kt similarity index 91% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/navigation/GoToDefinition.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/navigation/GoToDefinition.kt index c58258ee28..c593e2b9ac 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/navigation/GoToDefinition.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/navigation/GoToDefinition.kt @@ -1,18 +1,18 @@ -package com.itsaky.androidide.lsp.kotlin.navigation - -import com.itsaky.androidide.lsp.kotlin.compiler.AbstractCompilationEnvironment -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPreemptedException -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPriority -import com.itsaky.androidide.lsp.kotlin.compiler.modules.backingFilePath -import com.itsaky.androidide.lsp.kotlin.compiler.modules.isAnalysisCancellation -import com.itsaky.androidide.lsp.kotlin.compiler.modules.retryingOnPreemption -import com.itsaky.androidide.lsp.kotlin.utils.rangeOf -import com.itsaky.androidide.lsp.kotlin.utils.toRange -import com.itsaky.androidide.lsp.models.DefinitionParams -import com.itsaky.androidide.lsp.models.DefinitionResult -import com.itsaky.androidide.models.Location -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.progress.ICancelChecker +package org.appdevforall.codeonthego.lsp.kotlin.navigation + +import org.appdevforall.codeonthego.lsp.kotlin.compiler.AbstractCompilationEnvironment +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPreemptedException +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPriority +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.backingFilePath +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.isAnalysisCancellation +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.retryingOnPreemption +import org.appdevforall.codeonthego.lsp.kotlin.utils.rangeOf +import org.appdevforall.codeonthego.lsp.kotlin.utils.toRange +import org.appdevforall.codeonthego.lsp.models.DefinitionParams +import org.appdevforall.codeonthego.lsp.models.DefinitionResult +import org.appdevforall.codeonthego.models.Location +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.progress.ICancelChecker import org.jetbrains.kotlin.analysis.api.KaSession import org.jetbrains.kotlin.analysis.api.components.containingDeclaration import org.jetbrains.kotlin.analysis.api.resolution.successfulFunctionCallOrNull diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/navigation/ReferenceAtCaret.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/navigation/ReferenceAtCaret.kt similarity index 98% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/navigation/ReferenceAtCaret.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/navigation/ReferenceAtCaret.kt index 755352688a..085978f38f 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/navigation/ReferenceAtCaret.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/navigation/ReferenceAtCaret.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.navigation +package org.appdevforall.codeonthego.lsp.kotlin.navigation import org.jetbrains.kotlin.com.intellij.psi.PsiElement import org.jetbrains.kotlin.com.intellij.psi.tree.IElementType diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/navigation/TargetAtCaret.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/navigation/TargetAtCaret.kt similarity index 98% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/navigation/TargetAtCaret.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/navigation/TargetAtCaret.kt index 3d7e2e2179..6ed9462c83 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/navigation/TargetAtCaret.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/navigation/TargetAtCaret.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.navigation +package org.appdevforall.codeonthego.lsp.kotlin.navigation import org.jetbrains.kotlin.com.intellij.psi.PsiElement import org.jetbrains.kotlin.com.intellij.psi.util.PsiTreeUtil diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/refactor/KotlinExtractMethodUi.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/refactor/KotlinExtractMethodUi.kt similarity index 67% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/refactor/KotlinExtractMethodUi.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/refactor/KotlinExtractMethodUi.kt index a2ad8b1723..47b65cd8a5 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/refactor/KotlinExtractMethodUi.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/refactor/KotlinExtractMethodUi.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.lsp.kotlin.refactor +package org.appdevforall.codeonthego.lsp.kotlin.refactor -import com.itsaky.androidide.lsp.kotlin.utils.refactor.ExtractMethodCandidate -import com.itsaky.androidide.lsp.kotlin.utils.refactor.ExtractMethodPlan -import com.itsaky.androidide.lsp.kotlin.utils.refactor.signaturePrefix -import com.itsaky.androidide.lsp.kotlin.utils.refactor.signatureSuffix -import com.itsaky.androidide.lsp.ui.ExtractMethodSelection -import com.itsaky.androidide.lsp.ui.MethodCandidateView +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.ExtractMethodCandidate +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.ExtractMethodPlan +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.signaturePrefix +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.signatureSuffix +import org.appdevforall.codeonthego.lsp.ui.ExtractMethodSelection +import org.appdevforall.codeonthego.lsp.ui.MethodCandidateView /** * The plan as the shared sheet sees it: labels, names and the two halves of the signature, no PSI and diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/refactor/KotlinExtractVariableUi.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/refactor/KotlinExtractVariableUi.kt similarity index 76% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/refactor/KotlinExtractVariableUi.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/refactor/KotlinExtractVariableUi.kt index 28640cae5f..fbaa34a542 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/refactor/KotlinExtractVariableUi.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/refactor/KotlinExtractVariableUi.kt @@ -1,12 +1,12 @@ -package com.itsaky.androidide.lsp.kotlin.refactor +package org.appdevforall.codeonthego.lsp.kotlin.refactor -import com.itsaky.androidide.lsp.kotlin.utils.refactor.CandidateExpression -import com.itsaky.androidide.lsp.kotlin.utils.refactor.ExtractionPlan -import com.itsaky.androidide.lsp.kotlin.utils.refactor.ScopeOption -import com.itsaky.androidide.lsp.ui.CandidateView -import com.itsaky.androidide.lsp.ui.ExtractVariableSelection -import com.itsaky.androidide.lsp.ui.NameMessages -import com.itsaky.androidide.lsp.ui.ScopeView +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.CandidateExpression +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.ExtractionPlan +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.ScopeOption +import org.appdevforall.codeonthego.lsp.ui.CandidateView +import org.appdevforall.codeonthego.lsp.ui.ExtractVariableSelection +import org.appdevforall.codeonthego.lsp.ui.NameMessages +import org.appdevforall.codeonthego.lsp.ui.ScopeView import com.itsaky.androidide.resources.R /** diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/refactor/ui/InlineVariableSheet.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/refactor/ui/InlineVariableSheet.kt similarity index 89% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/refactor/ui/InlineVariableSheet.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/refactor/ui/InlineVariableSheet.kt index de6797f797..3cd8edf45c 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/refactor/ui/InlineVariableSheet.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/refactor/ui/InlineVariableSheet.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.refactor.ui +package org.appdevforall.codeonthego.lsp.kotlin.refactor.ui import android.os.Bundle import android.view.LayoutInflater @@ -8,9 +8,9 @@ import androidx.compose.ui.platform.ComposeView import androidx.compose.ui.platform.ViewCompositionStrategy import androidx.fragment.app.FragmentActivity import com.google.android.material.bottomsheet.BottomSheetDialogFragment -import com.itsaky.androidide.common.compose.IdeTheme -import com.itsaky.androidide.lsp.kotlin.utils.refactor.InlineMode -import com.itsaky.androidide.lsp.kotlin.utils.refactor.InlineVariablePlan +import org.appdevforall.codeonthego.common.compose.IdeTheme +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.InlineMode +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.InlineVariablePlan /** * Hosts [InlineVariableSheetContent]. diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/refactor/ui/InlineVariableSheetContent.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/refactor/ui/InlineVariableSheetContent.kt similarity index 88% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/refactor/ui/InlineVariableSheetContent.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/refactor/ui/InlineVariableSheetContent.kt index 6a30384cc5..910586d2e1 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/refactor/ui/InlineVariableSheetContent.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/refactor/ui/InlineVariableSheetContent.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.refactor.ui +package org.appdevforall.codeonthego.lsp.kotlin.refactor.ui import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -17,12 +17,12 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.unit.dp -import com.itsaky.androidide.lsp.kotlin.utils.refactor.InlineLabel -import com.itsaky.androidide.lsp.kotlin.utils.refactor.InlineMode -import com.itsaky.androidide.lsp.kotlin.utils.refactor.InlineVariablePlan -import com.itsaky.androidide.lsp.kotlin.utils.refactor.labelFor -import com.itsaky.androidide.lsp.kotlin.utils.refactor.substitutionTextFor -import com.itsaky.androidide.lsp.ui.LabelledSection +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.InlineLabel +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.InlineMode +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.InlineVariablePlan +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.labelFor +import org.appdevforall.codeonthego.lsp.kotlin.utils.refactor.substitutionTextFor +import org.appdevforall.codeonthego.lsp.ui.LabelledSection import com.itsaky.androidide.resources.R /** What the sheet reports back up; it never touches the document itself. */ diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/signaturehelp/ActiveParameterResolver.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/signaturehelp/ActiveParameterResolver.kt similarity index 96% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/signaturehelp/ActiveParameterResolver.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/signaturehelp/ActiveParameterResolver.kt index 616047c42b..38d34e6e8c 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/signaturehelp/ActiveParameterResolver.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/signaturehelp/ActiveParameterResolver.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.signaturehelp +package org.appdevforall.codeonthego.lsp.kotlin.signaturehelp import org.jetbrains.kotlin.analysis.api.KaSession import org.jetbrains.kotlin.analysis.api.resolution.KaFunctionCall diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/signaturehelp/CallAtCursorFinder.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/signaturehelp/CallAtCursorFinder.kt similarity index 96% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/signaturehelp/CallAtCursorFinder.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/signaturehelp/CallAtCursorFinder.kt index e2bafbf1b9..7db2579bf9 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/signaturehelp/CallAtCursorFinder.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/signaturehelp/CallAtCursorFinder.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.signaturehelp +package org.appdevforall.codeonthego.lsp.kotlin.signaturehelp import org.jetbrains.kotlin.com.intellij.psi.PsiElement import org.jetbrains.kotlin.psi.KtCallElement diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/signaturehelp/KotlinSignatureHelp.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/signaturehelp/KotlinSignatureHelp.kt similarity index 86% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/signaturehelp/KotlinSignatureHelp.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/signaturehelp/KotlinSignatureHelp.kt index c7d40c881f..3ee601228a 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/signaturehelp/KotlinSignatureHelp.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/signaturehelp/KotlinSignatureHelp.kt @@ -1,13 +1,13 @@ -package com.itsaky.androidide.lsp.kotlin.signaturehelp +package org.appdevforall.codeonthego.lsp.kotlin.signaturehelp -import com.itsaky.androidide.lsp.kotlin.compiler.CompilationEnvironment -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPreemptedException -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPriority -import com.itsaky.androidide.lsp.kotlin.compiler.modules.ScheduledCancelChecker -import com.itsaky.androidide.lsp.kotlin.compiler.modules.isAnalysisCancellation -import com.itsaky.androidide.lsp.models.SignatureHelp -import com.itsaky.androidide.lsp.models.SignatureHelpParams -import com.itsaky.androidide.lsp.models.SignatureInformation +import org.appdevforall.codeonthego.lsp.kotlin.compiler.CompilationEnvironment +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPreemptedException +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPriority +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.ScheduledCancelChecker +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.isAnalysisCancellation +import org.appdevforall.codeonthego.lsp.models.SignatureHelp +import org.appdevforall.codeonthego.lsp.models.SignatureHelpParams +import org.appdevforall.codeonthego.lsp.models.SignatureInformation import org.jetbrains.kotlin.analysis.api.KaSession import org.jetbrains.kotlin.analysis.api.resolution.KaFunctionCall import org.jetbrains.kotlin.analysis.api.resolution.successfulFunctionCallOrNull diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/signaturehelp/SignatureInfoBuilder.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/signaturehelp/SignatureInfoBuilder.kt similarity index 82% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/signaturehelp/SignatureInfoBuilder.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/signaturehelp/SignatureInfoBuilder.kt index 0ecfd3bb4d..de17639226 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/signaturehelp/SignatureInfoBuilder.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/signaturehelp/SignatureInfoBuilder.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.lsp.kotlin.signaturehelp +package org.appdevforall.codeonthego.lsp.kotlin.signaturehelp -import com.itsaky.androidide.lsp.kotlin.utils.renderName -import com.itsaky.androidide.lsp.models.MarkupContent -import com.itsaky.androidide.lsp.models.ParameterInformation -import com.itsaky.androidide.lsp.models.SignatureInformation +import org.appdevforall.codeonthego.lsp.kotlin.utils.renderName +import org.appdevforall.codeonthego.lsp.models.MarkupContent +import org.appdevforall.codeonthego.lsp.models.ParameterInformation +import org.appdevforall.codeonthego.lsp.models.SignatureInformation import org.jetbrains.kotlin.analysis.api.KaExperimentalApi import org.jetbrains.kotlin.analysis.api.KaSession import org.jetbrains.kotlin.analysis.api.symbols.KaConstructorSymbol diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/AbstractMemberStubs.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/AbstractMemberStubs.kt similarity index 99% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/AbstractMemberStubs.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/AbstractMemberStubs.kt index 66c2eb9520..926f751c24 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/AbstractMemberStubs.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/AbstractMemberStubs.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.utils +package org.appdevforall.codeonthego.lsp.kotlin.utils import org.jetbrains.kotlin.analysis.api.KaExperimentalApi import org.jetbrains.kotlin.analysis.api.KaSession diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/ContextKeywords.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/ContextKeywords.kt similarity index 94% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/ContextKeywords.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/ContextKeywords.kt index c446c08c14..499e0112e9 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/ContextKeywords.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/ContextKeywords.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.kotlin.utils +package org.appdevforall.codeonthego.lsp.kotlin.utils -import com.itsaky.androidide.lsp.kotlin.completion.DeclarationContext +import org.appdevforall.codeonthego.lsp.kotlin.completion.DeclarationContext import org.jetbrains.kotlin.lexer.KtKeywordToken import org.jetbrains.kotlin.lexer.KtTokens diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/ContextResolver.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/ContextResolver.kt similarity index 93% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/ContextResolver.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/ContextResolver.kt index 51318536ab..f0880e14a4 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/ContextResolver.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/ContextResolver.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.lsp.kotlin.utils +package org.appdevforall.codeonthego.lsp.kotlin.utils -import com.itsaky.androidide.lsp.kotlin.compiler.CompilationEnvironment -import com.itsaky.androidide.lsp.kotlin.completion.DeclarationContext -import com.itsaky.androidide.lsp.kotlin.completion.DeclarationKind -import com.itsaky.androidide.lsp.models.MatchLevel +import org.appdevforall.codeonthego.lsp.kotlin.compiler.CompilationEnvironment +import org.appdevforall.codeonthego.lsp.kotlin.completion.DeclarationContext +import org.appdevforall.codeonthego.lsp.kotlin.completion.DeclarationKind +import org.appdevforall.codeonthego.lsp.models.MatchLevel import org.jetbrains.kotlin.analysis.api.KaSession import org.jetbrains.kotlin.analysis.api.components.KaScopeContext import org.jetbrains.kotlin.analysis.api.scopes.KaScope diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/EditExts.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/EditExts.kt similarity index 92% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/EditExts.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/EditExts.kt index 0b86603991..853a02b092 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/EditExts.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/EditExts.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.lsp.kotlin.utils +package org.appdevforall.codeonthego.lsp.kotlin.utils -import com.itsaky.androidide.lsp.models.TextEdit -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.lsp.models.TextEdit +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range import org.jetbrains.kotlin.com.intellij.openapi.util.TextRange import org.jetbrains.kotlin.com.intellij.psi.PsiDocumentManager import org.jetbrains.kotlin.com.intellij.psi.PsiElement diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/ImportOrganizer.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/ImportOrganizer.kt similarity index 98% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/ImportOrganizer.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/ImportOrganizer.kt index 0e261dc2fc..d28eb2e873 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/ImportOrganizer.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/ImportOrganizer.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.utils +package org.appdevforall.codeonthego.lsp.kotlin.utils import org.jetbrains.kotlin.com.intellij.psi.util.PsiTreeUtil import org.jetbrains.kotlin.kdoc.psi.api.KDoc diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/ImportUsageCollector.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/ImportUsageCollector.kt similarity index 98% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/ImportUsageCollector.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/ImportUsageCollector.kt index cacdb775fe..2fed74d380 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/ImportUsageCollector.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/ImportUsageCollector.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.utils +package org.appdevforall.codeonthego.lsp.kotlin.utils import org.jetbrains.kotlin.analysis.api.KaSession import org.jetbrains.kotlin.analysis.api.resolution.successfulFunctionCallOrNull diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/ModifierFilter.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/ModifierFilter.kt similarity index 96% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/ModifierFilter.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/ModifierFilter.kt index 406f9f0ac8..369bde8c13 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/ModifierFilter.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/ModifierFilter.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.lsp.kotlin.utils +package org.appdevforall.codeonthego.lsp.kotlin.utils -import com.itsaky.androidide.lsp.kotlin.completion.DeclarationContext -import com.itsaky.androidide.lsp.kotlin.completion.DeclarationKind +import org.appdevforall.codeonthego.lsp.kotlin.completion.DeclarationContext +import org.appdevforall.codeonthego.lsp.kotlin.completion.DeclarationKind import org.jetbrains.kotlin.com.intellij.psi.tree.TokenSet import org.jetbrains.kotlin.lexer.KtModifierKeywordToken import org.jetbrains.kotlin.lexer.KtTokens.* diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/NullSafetyFix.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/NullSafetyFix.kt similarity index 96% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/NullSafetyFix.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/NullSafetyFix.kt index 6566f34aca..48c3008c92 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/NullSafetyFix.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/NullSafetyFix.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.kotlin.utils +package org.appdevforall.codeonthego.lsp.kotlin.utils -import com.itsaky.androidide.lsp.models.TextEdit +import org.appdevforall.codeonthego.lsp.models.TextEdit import org.jetbrains.kotlin.com.intellij.openapi.util.TextRange import org.jetbrains.kotlin.com.intellij.psi.PsiFile import org.jetbrains.kotlin.com.intellij.psi.util.PsiTreeUtil diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/SymbolExts.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/SymbolExts.kt similarity index 92% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/SymbolExts.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/SymbolExts.kt index 502d5c3aea..115b42c0c5 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/SymbolExts.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/SymbolExts.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.utils +package org.appdevforall.codeonthego.lsp.kotlin.utils import org.jetbrains.kotlin.analysis.api.KaContextParameterApi import org.jetbrains.kotlin.analysis.api.KaSession diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/SymbolVisibilityChecker.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/SymbolVisibilityChecker.kt similarity index 95% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/SymbolVisibilityChecker.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/SymbolVisibilityChecker.kt index 69c4c612c2..7141440ce8 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/SymbolVisibilityChecker.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/SymbolVisibilityChecker.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.kotlin.utils +package org.appdevforall.codeonthego.lsp.kotlin.utils -import com.itsaky.androidide.lsp.kotlin.compiler.services.ProjectStructureProvider +import org.appdevforall.codeonthego.lsp.kotlin.compiler.services.ProjectStructureProvider import org.appdevforall.codeonthego.indexing.jvm.JvmSymbol import org.appdevforall.codeonthego.indexing.jvm.JvmVisibility import org.jetbrains.kotlin.analysis.api.projectStructure.KaModule diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/TypeRendering.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/TypeRendering.kt similarity index 92% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/TypeRendering.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/TypeRendering.kt index 21daf40527..9779e9e634 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/TypeRendering.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/TypeRendering.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.utils +package org.appdevforall.codeonthego.lsp.kotlin.utils import org.jetbrains.kotlin.analysis.api.KaContextParameterApi import org.jetbrains.kotlin.analysis.api.KaExperimentalApi diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/VirtualFileExts.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/VirtualFileExts.kt similarity index 86% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/VirtualFileExts.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/VirtualFileExts.kt index a5bc54fc80..36dbb50706 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/VirtualFileExts.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/VirtualFileExts.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.utils +package org.appdevforall.codeonthego.lsp.kotlin.utils import org.jetbrains.kotlin.com.intellij.openapi.vfs.VirtualFile import org.jetbrains.kotlin.com.intellij.openapi.vfs.VirtualFileManager diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/CandidateExpressions.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/CandidateExpressions.kt similarity index 98% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/CandidateExpressions.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/CandidateExpressions.kt index 81542cfd82..6f79cd3a5b 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/CandidateExpressions.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/CandidateExpressions.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.kotlin.utils.refactor +package org.appdevforall.codeonthego.lsp.kotlin.utils.refactor -import com.itsaky.androidide.lsp.refactor.MAX_CANDIDATES +import org.appdevforall.codeonthego.lsp.refactor.MAX_CANDIDATES import org.jetbrains.kotlin.com.intellij.psi.PsiElement import org.jetbrains.kotlin.com.intellij.psi.PsiWhiteSpace import org.jetbrains.kotlin.com.intellij.psi.util.PsiTreeUtil diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractMethodEdit.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractMethodEdit.kt similarity index 92% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractMethodEdit.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractMethodEdit.kt index f5e8b5a308..1587263dae 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractMethodEdit.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractMethodEdit.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.lsp.kotlin.utils.refactor +package org.appdevforall.codeonthego.lsp.kotlin.utils.refactor -import com.itsaky.androidide.lsp.refactor.RewriteSpan -import com.itsaky.androidide.lsp.refactor.TextSpan -import com.itsaky.androidide.lsp.refactor.detectIndentUnit -import com.itsaky.androidide.lsp.refactor.detectNewline -import com.itsaky.androidide.lsp.refactor.leadingIndentAt +import org.appdevforall.codeonthego.lsp.refactor.RewriteSpan +import org.appdevforall.codeonthego.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.detectIndentUnit +import org.appdevforall.codeonthego.lsp.refactor.detectNewline +import org.appdevforall.codeonthego.lsp.refactor.leadingIndentAt /** * The two replacements an extraction performs: the new function, and the call that replaces the diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractMethodPlan.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractMethodPlan.kt similarity index 96% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractMethodPlan.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractMethodPlan.kt index 0268ed2dd3..75c1c9d3fd 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractMethodPlan.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractMethodPlan.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.kotlin.utils.refactor +package org.appdevforall.codeonthego.lsp.kotlin.utils.refactor -import com.itsaky.androidide.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.TextSpan /** One derived parameter of the new function. Names are the originals, unchanged (R5). */ data class MethodParameter( @@ -186,7 +186,7 @@ data class ExtractMethodPlan( * Everything the signature says before the method's name. * * Split from [signatureSuffix] rather than rendered whole because the sheet's preview follows what the - * user types, and [com.itsaky.androidide.lsp.ui.MethodCandidateView] carries the two halves. Both this and + * user types, and [org.appdevforall.codeonthego.lsp.ui.MethodCandidateView] carries the two halves. Both this and * [buildExtractMethodRewrites] compose them through [signatureText], so there is one derivation and * the preview cannot drift from the declaration (R11). */ diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractMethodPlanner.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractMethodPlanner.kt similarity index 91% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractMethodPlanner.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractMethodPlanner.kt index efed4a68bf..2fd1c34ace 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractMethodPlanner.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractMethodPlanner.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.lsp.kotlin.utils.refactor +package org.appdevforall.codeonthego.lsp.kotlin.utils.refactor -import com.itsaky.androidide.lsp.kotlin.compiler.AbstractCompilationEnvironment -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPriority -import com.itsaky.androidide.lsp.kotlin.compiler.modules.ScheduledCancelChecker +import org.appdevforall.codeonthego.lsp.kotlin.compiler.AbstractCompilationEnvironment +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPriority +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.ScheduledCancelChecker import org.slf4j.LoggerFactory import java.nio.file.Path import kotlin.coroutines.cancellation.CancellationException diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractVariableEdit.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractVariableEdit.kt similarity index 84% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractVariableEdit.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractVariableEdit.kt index ff585fc33c..fd67901658 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractVariableEdit.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractVariableEdit.kt @@ -1,12 +1,12 @@ -package com.itsaky.androidide.lsp.kotlin.utils.refactor +package org.appdevforall.codeonthego.lsp.kotlin.utils.refactor -import com.itsaky.androidide.lsp.refactor.RewriteSpan -import com.itsaky.androidide.lsp.refactor.TextSpan -import com.itsaky.androidide.lsp.refactor.detectNewline -import com.itsaky.androidide.lsp.refactor.existingBlockRewrite -import com.itsaky.androidide.lsp.refactor.replaceOccurrences -import com.itsaky.androidide.lsp.refactor.startOfWhitespaceBefore -import com.itsaky.androidide.lsp.refactor.wrapInBracesRewrite +import org.appdevforall.codeonthego.lsp.refactor.RewriteSpan +import org.appdevforall.codeonthego.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.detectNewline +import org.appdevforall.codeonthego.lsp.refactor.existingBlockRewrite +import org.appdevforall.codeonthego.lsp.refactor.replaceOccurrences +import org.appdevforall.codeonthego.lsp.refactor.startOfWhitespaceBefore +import org.appdevforall.codeonthego.lsp.refactor.wrapInBracesRewrite /** * Builds the extraction rewrite, or null when the inputs cannot produce one. diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractVariablePlanner.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractVariablePlanner.kt similarity index 92% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractVariablePlanner.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractVariablePlanner.kt index fa315c28a0..6d07710d5b 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractVariablePlanner.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractVariablePlanner.kt @@ -1,16 +1,16 @@ -package com.itsaky.androidide.lsp.kotlin.utils.refactor - -import com.itsaky.androidide.lsp.kotlin.compiler.AbstractCompilationEnvironment -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPriority -import com.itsaky.androidide.lsp.kotlin.compiler.modules.ScheduledCancelChecker -import com.itsaky.androidide.lsp.kotlin.utils.renderName -import com.itsaky.androidide.lsp.refactor.BlockPlacement -import com.itsaky.androidide.lsp.refactor.TextSpan -import com.itsaky.androidide.lsp.refactor.blockPlacementFor -import com.itsaky.androidide.lsp.refactor.excludeUnsoundOccurrences -import com.itsaky.androidide.lsp.refactor.hoistSkipsWrite -import com.itsaky.androidide.lsp.refactor.hoistsOverLoopWrite -import com.itsaky.androidide.lsp.refactor.servableOccurrences +package org.appdevforall.codeonthego.lsp.kotlin.utils.refactor + +import org.appdevforall.codeonthego.lsp.kotlin.compiler.AbstractCompilationEnvironment +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPriority +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.ScheduledCancelChecker +import org.appdevforall.codeonthego.lsp.kotlin.utils.renderName +import org.appdevforall.codeonthego.lsp.refactor.BlockPlacement +import org.appdevforall.codeonthego.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.blockPlacementFor +import org.appdevforall.codeonthego.lsp.refactor.excludeUnsoundOccurrences +import org.appdevforall.codeonthego.lsp.refactor.hoistSkipsWrite +import org.appdevforall.codeonthego.lsp.refactor.hoistsOverLoopWrite +import org.appdevforall.codeonthego.lsp.refactor.servableOccurrences import org.jetbrains.kotlin.analysis.api.KaExperimentalApi import org.jetbrains.kotlin.analysis.api.KaSession import org.jetbrains.kotlin.analysis.api.symbols.KaCallableSymbol diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractionPlan.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractionPlan.kt similarity index 95% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractionPlan.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractionPlan.kt index 37bf40cbc1..aa3bcefb8b 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractionPlan.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractionPlan.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.lsp.kotlin.utils.refactor +package org.appdevforall.codeonthego.lsp.kotlin.utils.refactor -import com.itsaky.androidide.lsp.refactor.BlockAnchor -import com.itsaky.androidide.lsp.refactor.BracelessBody -import com.itsaky.androidide.lsp.refactor.MAX_CANDIDATES -import com.itsaky.androidide.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.BlockAnchor +import org.appdevforall.codeonthego.lsp.refactor.BracelessBody +import org.appdevforall.codeonthego.lsp.refactor.MAX_CANDIDATES +import org.appdevforall.codeonthego.lsp.refactor.TextSpan /** * How the new declaration is woven into an anchor scope. Kotlin scopes are not all blocks, so three diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractionRegion.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractionRegion.kt similarity index 97% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractionRegion.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractionRegion.kt index a199e1f22d..b80bb25cfe 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ExtractionRegion.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ExtractionRegion.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.kotlin.utils.refactor +package org.appdevforall.codeonthego.lsp.kotlin.utils.refactor -import com.itsaky.androidide.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.TextSpan import org.jetbrains.kotlin.com.intellij.psi.PsiElement import org.jetbrains.kotlin.psi.KtBlockExpression import org.jetbrains.kotlin.psi.KtExpression diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/InlineVariableEdit.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/InlineVariableEdit.kt similarity index 93% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/InlineVariableEdit.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/InlineVariableEdit.kt index 27e5f98447..7c32d6be71 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/InlineVariableEdit.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/InlineVariableEdit.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.lsp.kotlin.utils.refactor +package org.appdevforall.codeonthego.lsp.kotlin.utils.refactor -import com.itsaky.androidide.lsp.refactor.RewriteSpan -import com.itsaky.androidide.lsp.refactor.TextSpan -import com.itsaky.androidide.lsp.refactor.detectNewline -import com.itsaky.androidide.lsp.refactor.leadingIndentAt -import com.itsaky.androidide.lsp.refactor.lineStartOffset +import org.appdevforall.codeonthego.lsp.refactor.RewriteSpan +import org.appdevforall.codeonthego.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.detectNewline +import org.appdevforall.codeonthego.lsp.refactor.leadingIndentAt +import org.appdevforall.codeonthego.lsp.refactor.lineStartOffset /** * The edits one inline performs: one replacement per inlined reference plus, when the declaration is diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/InlineVariablePlan.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/InlineVariablePlan.kt similarity index 98% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/InlineVariablePlan.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/InlineVariablePlan.kt index 1c642a5c51..44916d2586 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/InlineVariablePlan.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/InlineVariablePlan.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.kotlin.utils.refactor +package org.appdevforall.codeonthego.lsp.kotlin.utils.refactor -import com.itsaky.androidide.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.TextSpan /** * Where the cursor was when the action ran. Recorded because mode availability depends on it: only a diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/InlineVariablePlanner.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/InlineVariablePlanner.kt similarity index 98% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/InlineVariablePlanner.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/InlineVariablePlanner.kt index c6363619a4..e963701237 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/InlineVariablePlanner.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/InlineVariablePlanner.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.lsp.kotlin.utils.refactor +package org.appdevforall.codeonthego.lsp.kotlin.utils.refactor -import com.itsaky.androidide.lsp.kotlin.compiler.AbstractCompilationEnvironment -import com.itsaky.androidide.lsp.kotlin.compiler.modules.AnalysisPriority -import com.itsaky.androidide.lsp.kotlin.compiler.modules.ScheduledCancelChecker -import com.itsaky.androidide.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.kotlin.compiler.AbstractCompilationEnvironment +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.AnalysisPriority +import org.appdevforall.codeonthego.lsp.kotlin.compiler.modules.ScheduledCancelChecker +import org.appdevforall.codeonthego.lsp.refactor.TextSpan import org.jetbrains.kotlin.analysis.api.KaSession import org.jetbrains.kotlin.analysis.api.resolution.KaCallableMemberCall import org.jetbrains.kotlin.analysis.api.resolution.KaImplicitReceiverValue diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/MethodSignature.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/MethodSignature.kt similarity index 99% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/MethodSignature.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/MethodSignature.kt index 5f17525f96..65be355a13 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/MethodSignature.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/MethodSignature.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.lsp.kotlin.utils.refactor +package org.appdevforall.codeonthego.lsp.kotlin.utils.refactor -import com.itsaky.androidide.lsp.refactor.TextSpan -import com.itsaky.androidide.lsp.refactor.leadingIndentAt -import com.itsaky.androidide.lsp.refactor.uniqueName +import org.appdevforall.codeonthego.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.leadingIndentAt +import org.appdevforall.codeonthego.lsp.refactor.uniqueName import org.jetbrains.kotlin.analysis.api.KaSession import org.jetbrains.kotlin.analysis.api.resolution.KaCallableMemberCall import org.jetbrains.kotlin.analysis.api.resolution.KaCompoundArrayAccessCall diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/NameSuggestion.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/NameSuggestion.kt similarity index 87% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/NameSuggestion.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/NameSuggestion.kt index 7ed4d9d182..07f3e230fc 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/NameSuggestion.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/NameSuggestion.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.lsp.kotlin.utils.refactor +package org.appdevforall.codeonthego.lsp.kotlin.utils.refactor -import com.itsaky.androidide.lsp.refactor.FALLBACK_NAME -import com.itsaky.androidide.lsp.refactor.nameFromType -import com.itsaky.androidide.lsp.refactor.stripAccessorPrefix -import com.itsaky.androidide.lsp.refactor.uniqueName -import com.itsaky.androidide.lsp.ui.isIdentifier +import org.appdevforall.codeonthego.lsp.refactor.FALLBACK_NAME +import org.appdevforall.codeonthego.lsp.refactor.nameFromType +import org.appdevforall.codeonthego.lsp.refactor.stripAccessorPrefix +import org.appdevforall.codeonthego.lsp.refactor.uniqueName +import org.appdevforall.codeonthego.lsp.ui.isIdentifier import org.jetbrains.kotlin.psi.KtArrayAccessExpression import org.jetbrains.kotlin.psi.KtCallExpression import org.jetbrains.kotlin.psi.KtExpression diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/Occurrences.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/Occurrences.kt similarity index 99% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/Occurrences.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/Occurrences.kt index 1e122698ee..ff47e89cab 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/Occurrences.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/Occurrences.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.kotlin.utils.refactor +package org.appdevforall.codeonthego.lsp.kotlin.utils.refactor -import com.itsaky.androidide.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.TextSpan import org.jetbrains.kotlin.analysis.api.KaSession import org.jetbrains.kotlin.analysis.api.symbols.KaSymbol import org.jetbrains.kotlin.analysis.api.symbols.KaValueParameterSymbol diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/RefactoringPlan.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/RefactoringPlan.kt similarity index 91% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/RefactoringPlan.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/RefactoringPlan.kt index 666fe2f74a..c0b800d521 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/RefactoringPlan.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/RefactoringPlan.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.kotlin.utils.refactor +package org.appdevforall.codeonthego.lsp.kotlin.utils.refactor /** * What every interactive refactoring's background pass returns. diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ScopeChain.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ScopeChain.kt similarity index 96% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ScopeChain.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ScopeChain.kt index 68d6fa856f..d61649dfd4 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/ScopeChain.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/ScopeChain.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.lsp.kotlin.utils.refactor +package org.appdevforall.codeonthego.lsp.kotlin.utils.refactor -import com.itsaky.androidide.lsp.refactor.BlockAnchor -import com.itsaky.androidide.lsp.refactor.BracelessBody -import com.itsaky.androidide.lsp.refactor.TextSpan -import com.itsaky.androidide.lsp.refactor.detectIndentUnit -import com.itsaky.androidide.lsp.refactor.leadingIndentAt +import org.appdevforall.codeonthego.lsp.refactor.BlockAnchor +import org.appdevforall.codeonthego.lsp.refactor.BracelessBody +import org.appdevforall.codeonthego.lsp.refactor.TextSpan +import org.appdevforall.codeonthego.lsp.refactor.detectIndentUnit +import org.appdevforall.codeonthego.lsp.refactor.leadingIndentAt import org.jetbrains.kotlin.com.intellij.psi.PsiElement import org.jetbrains.kotlin.com.intellij.psi.util.PsiTreeUtil import org.jetbrains.kotlin.psi.KtAnonymousInitializer diff --git a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/TypeText.kt b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/TypeText.kt similarity index 98% rename from lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/TypeText.kt rename to lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/TypeText.kt index 799186d4ab..1797f22553 100644 --- a/lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/refactor/TypeText.kt +++ b/lsp/kotlin/src/main/java/org/appdevforall/codeonthego/lsp/kotlin/utils/refactor/TypeText.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.lsp.kotlin.utils.refactor +package org.appdevforall.codeonthego.lsp.kotlin.utils.refactor -import com.itsaky.androidide.lsp.kotlin.utils.renderName +import org.appdevforall.codeonthego.lsp.kotlin.utils.renderName import org.jetbrains.kotlin.analysis.api.KaExperimentalApi import org.jetbrains.kotlin.analysis.api.KaSession import org.jetbrains.kotlin.analysis.api.renderer.types.impl.KaTypeRendererForSource diff --git a/lsp/kotlin/src/main/resources/META-INF/kt-lsp/kt-lsp.xml b/lsp/kotlin/src/main/resources/META-INF/kt-lsp/kt-lsp.xml index 95cb5855bf..b0028ca511 100644 --- a/lsp/kotlin/src/main/resources/META-INF/kt-lsp/kt-lsp.xml +++ b/lsp/kotlin/src/main/resources/META-INF/kt-lsp/kt-lsp.xml @@ -3,12 +3,12 @@ . */ -package com.itsaky.androidide.lsp +package org.appdevforall.codeonthego.lsp -import com.itsaky.androidide.progress.ICancelChecker +import org.appdevforall.codeonthego.progress.ICancelChecker /** * Parameters for requests which support cancellation. diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/LspParams.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/LspParams.kt similarity index 95% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/LspParams.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/LspParams.kt index 6c55f89542..588326c1c6 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/LspParams.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/LspParams.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp +package org.appdevforall.codeonthego.lsp /** * Marker interface for LSP parameters. diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/edits/DefaultEditHandler.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/edits/DefaultEditHandler.kt similarity index 91% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/edits/DefaultEditHandler.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/edits/DefaultEditHandler.kt index 7fe800ef98..63dc38670d 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/edits/DefaultEditHandler.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/edits/DefaultEditHandler.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.edits +package org.appdevforall.codeonthego.lsp.edits import android.os.Looper -import com.itsaky.androidide.lsp.models.Command -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.InsertTextFormat.SNIPPET -import com.itsaky.androidide.lsp.util.RewriteHelper -import com.itsaky.androidide.tasks.runOnUiThread +import org.appdevforall.codeonthego.lsp.models.Command +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.InsertTextFormat.SNIPPET +import org.appdevforall.codeonthego.lsp.util.RewriteHelper +import org.appdevforall.codeonthego.tasks.runOnUiThread import io.github.rosemoe.sora.lang.completion.snippet.parser.CodeSnippetParser import io.github.rosemoe.sora.text.Content import io.github.rosemoe.sora.text.batchEdit diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/edits/IEditHandler.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/edits/IEditHandler.kt similarity index 91% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/edits/IEditHandler.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/edits/IEditHandler.kt index 099741750d..b5506cb5c9 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/edits/IEditHandler.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/edits/IEditHandler.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.edits +package org.appdevforall.codeonthego.lsp.edits -import com.itsaky.androidide.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionItem import io.github.rosemoe.sora.text.Content import io.github.rosemoe.sora.widget.CodeEditor diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/CodeActions.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/CodeActions.kt similarity index 93% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/models/CodeActions.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/CodeActions.kt index 85ea74955e..0e8e036b12 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/CodeActions.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/CodeActions.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.models +package org.appdevforall.codeonthego.lsp.models -import com.itsaky.androidide.lsp.models.CodeActionKind.None +import org.appdevforall.codeonthego.lsp.models.CodeActionKind.None import java.nio.file.Path /** diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/CodeFormatException.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/CodeFormatException.kt similarity index 66% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/models/CodeFormatException.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/CodeFormatException.kt index db1efea645..f3985b8b3e 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/CodeFormatException.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/CodeFormatException.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.models +package org.appdevforall.codeonthego.lsp.models class CodeFormatException( message: String, diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/CodeFormatting.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/CodeFormatting.kt similarity index 94% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/models/CodeFormatting.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/CodeFormatting.kt index a7209bf9f6..cc67b59a1d 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/CodeFormatting.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/CodeFormatting.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.models +package org.appdevforall.codeonthego.lsp.models -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.models.Range /** * Parameters containing data required to format source code. diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/CompletionData.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/CompletionData.kt similarity index 98% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/models/CompletionData.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/CompletionData.kt index 7ff9a2cb59..447e477111 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/CompletionData.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/CompletionData.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.models +package org.appdevforall.codeonthego.lsp.models /** Contains information about a completion item. */ interface ICompletionData diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/CompletionItemComparator.java b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/CompletionItemComparator.java similarity index 93% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/models/CompletionItemComparator.java rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/CompletionItemComparator.java index 3ea4f1f1ac..2a4a6324ce 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/CompletionItemComparator.java +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/CompletionItemComparator.java @@ -1,32 +1,32 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.models; - -import java.util.Comparator; - -/** - * @author Akash Yadav - */ -class CompletionItemComparator { - static int compare(CompletionItem one, CompletionItem two) { - return Comparator.comparing(item -> ((CompletionItem) item).getMatchLevel().ordinal()) - .thenComparing(item -> ((CompletionItem) item).getIdeSortText()) - .thenComparing(item -> ((CompletionItem) item).getIdeLabel()) - .compare(one, two); - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.models; + +import java.util.Comparator; + +/** + * @author Akash Yadav + */ +class CompletionItemComparator { + static int compare(CompletionItem one, CompletionItem two) { + return Comparator.comparing(item -> ((CompletionItem) item).getMatchLevel().ordinal()) + .thenComparing(item -> ((CompletionItem) item).getIdeSortText()) + .thenComparing(item -> ((CompletionItem) item).getIdeLabel()) + .compare(one, two); + } +} diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Completions.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Completions.kt similarity index 87% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Completions.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Completions.kt index 1d460b5984..3a37a8acbe 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Completions.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Completions.kt @@ -1,326 +1,326 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.models - -import com.itsaky.androidide.fuzzysearch.FuzzySearch -import com.itsaky.androidide.lsp.CancellableRequestParams -import com.itsaky.androidide.lsp.edits.DefaultEditHandler -import com.itsaky.androidide.lsp.edits.IEditHandler -import com.itsaky.androidide.lsp.models.CompletionItemKind.NONE -import com.itsaky.androidide.lsp.models.InsertTextFormat.PLAIN_TEXT -import com.itsaky.androidide.lsp.models.MatchLevel.CASE_INSENSITIVE_EQUAL -import com.itsaky.androidide.lsp.models.MatchLevel.CASE_INSENSITIVE_PREFIX -import com.itsaky.androidide.lsp.models.MatchLevel.CASE_SENSITIVE_EQUAL -import com.itsaky.androidide.lsp.models.MatchLevel.CASE_SENSITIVE_PREFIX -import com.itsaky.androidide.lsp.models.MatchLevel.NO_MATCH -import com.itsaky.androidide.lsp.models.MatchLevel.PARTIAL_MATCH -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.progress.ICancelChecker -import io.github.rosemoe.sora.lang.completion.snippet.CodeSnippet -import io.github.rosemoe.sora.text.CharPosition -import io.github.rosemoe.sora.text.Content -import io.github.rosemoe.sora.widget.CodeEditor -import java.nio.file.Path -import java.util.function.Consumer - -const val DEFAULT_MIN_MATCH_RATIO = 59 - -data class CompletionParams( - var position: Position, - var file: Path, - override val cancelChecker: ICancelChecker -) : CancellableRequestParams { - var content: CharSequence? = null - var prefix: String? = null - - fun requirePrefix(): String { - if (prefix == null) { - throw IllegalArgumentException("Prefix is required but none was provided") - } - - return prefix as String - } - - fun requireContents(): CharSequence { - if (content == null) { - throw IllegalArgumentException("Content is required but no content was provided!") - } - return content as CharSequence - } -} - -open class CompletionResult(items: Collection) { - val items: List = run { - var temp = items.toMutableList() - temp.sort() - if (TRIM_TO_MAX && temp.size > MAX_ITEMS) { - temp = temp.subList(0, MAX_ITEMS) - } - return@run temp - } - - var isIncomplete = this.items.size < items.size - var isCached = false - - companion object { - const val MAX_ITEMS = 50 - @JvmField - val EMPTY = CompletionResult(listOf()) - - var TRIM_TO_MAX = true - - @JvmStatic - @JvmOverloads - fun mapAndFilter( - src: CompletionResult, - partial: String, - map: Consumer = Consumer {} - ): CompletionResult { - val newItems = src.items.toMutableList() - newItems.forEach(map) - newItems.removeIf { !it.ideLabel.startsWith(partial) } - return CompletionResult(newItems) - } - } - - constructor() : this(listOf()) - - fun add(item: CompletionItem) { - if (isIncomplete) { - // Max limit has been reached - return - } - - if (items is MutableList) { - this.items.add(item) - } - this.isIncomplete = this.items.size >= MAX_ITEMS - } - - fun markCached() { - this.isCached = true - } - - override fun toString(): String { - return android.text.TextUtils.join("\n", items) - } -} - -open class CompletionItem( - var ideLabel: String, - var detail: String, - insertText: String?, - insertTextFormat: InsertTextFormat?, - sortText: String?, - var command: Command?, - var completionKind: CompletionItemKind, - var matchLevel: MatchLevel, - var additionalTextEdits: List?, - var data: ICompletionData?, - var editHandler: IEditHandler = DefaultEditHandler() -) : - io.github.rosemoe.sora.lang.completion.CompletionItem(ideLabel, detail), - Comparable { - - var ideSortText: String? = sortText - get() { - if (field == null) { - return ideLabel - } - - return field - } - - var insertText: String = insertText ?: "" - get() { - if (field.isEmpty()) { - return this.ideLabel - } - - return field - } - - var insertTextFormat: InsertTextFormat = insertTextFormat ?: PLAIN_TEXT - var additionalEditHandler: IEditHandler? = null - var snippetDescription: SnippetDescription? = null - var overrideTypeText: String? = null - - constructor() : - this( - "", // label - "", // detail - null, // insertText - null, // insertTextFormat - null, // sortText - null, // command - NONE, // kind - NO_MATCH, // match level - ArrayList(), // additionalEdits - null // data - ) - - companion object { - - @JvmStatic - @JvmOverloads - fun matchLevel( - candidate: String, - partial: String, - minMatchRatio: Int = DEFAULT_MIN_MATCH_RATIO - ): MatchLevel { - if (candidate.startsWith(partial)) { - return if (candidate.length == partial.length) { - CASE_SENSITIVE_EQUAL - } else { - CASE_SENSITIVE_PREFIX - } - } - - val lowerCandidate = candidate.lowercase() - val lowerPartial = partial.lowercase() - if (lowerCandidate.startsWith(lowerPartial)) { - return if (lowerCandidate.length == lowerPartial.length) { - CASE_INSENSITIVE_EQUAL - } else { - CASE_INSENSITIVE_PREFIX - } - } - - val ratio = FuzzySearch.ratio(candidate, partial) - if (ratio > minMatchRatio) { - return PARTIAL_MATCH - } - - return NO_MATCH - } - } - - override fun performCompletion(editor: CodeEditor, text: Content, position: CharPosition) { - editHandler.performEdits(this, editor, text, position.line, position.column, position.index) - } - - override fun performCompletion(editor: CodeEditor, text: Content, line: Int, column: Int) { - throw UnsupportedOperationException() - } - - override fun compareTo(other: CompletionItem): Int { - return CompletionItemComparator.compare(this, other) - } - - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other !is CompletionItem) return false - - if (ideLabel != other.ideLabel) return false - if (detail != other.detail) return false - if (command != other.command) return false - if (completionKind != other.completionKind) return false - if (matchLevel != other.matchLevel) return false - if (additionalTextEdits != other.additionalTextEdits) return false - if (data != other.data) return false - if (ideSortText != other.ideSortText) return false - if (insertText != other.insertText) return false - if (insertTextFormat != other.insertTextFormat) return false - if (editHandler != other.editHandler) return false - if (additionalEditHandler != other.additionalEditHandler) return false - if (overrideTypeText != other.overrideTypeText) return false - - return true - } - - override fun hashCode(): Int { - var result = ideLabel.hashCode() - result = 31 * result + detail.hashCode() - result = 31 * result + (command?.hashCode() ?: 0) - result = 31 * result + completionKind.hashCode() - result = 31 * result + matchLevel.hashCode() - result = 31 * result + (additionalTextEdits?.hashCode() ?: 0) - result = 31 * result + (data?.hashCode() ?: 0) - result = 31 * result + (ideSortText?.hashCode() ?: 0) - result = 31 * result + insertText.hashCode() - result = 31 * result + insertTextFormat.hashCode() - result = 31 * result + editHandler.hashCode() - result = 31 * result + (additionalEditHandler?.hashCode() ?: 0) - result = 31 * result + (overrideTypeText?.hashCode() ?: 0) - return result - } - - override fun toString(): String { - return "CompletionItem(label='$ideLabel', detail='$detail', command=$command, kind=$completionKind, matchLevel=$matchLevel, additionalTextEdits=$additionalTextEdits, data=$data, sortText=$ideSortText, insertText='$insertText', insertTextFormat=$insertTextFormat, editHandler=$editHandler, additionalEditHandler=$additionalEditHandler, overrideTypeText=$overrideTypeText)" - } -} - -data class SnippetDescription -@JvmOverloads -constructor( - val selectedLength: Int, - val deleteSelected: Boolean = true, - val snippet: CodeSnippet? = null, - val allowCommandExecution: Boolean = false -) - -data class Command(var title: String, var command: String) { - companion object { - - /** Action for triggering a signature help request to the language server. */ - const val TRIGGER_PARAMETER_HINTS = "editor.action.triggerParameterHints" - val CMD_TRIGGER_PARAMETER_HINTS = Command("Trigger parameter hints", TRIGGER_PARAMETER_HINTS) - - /** Action for triggering a completion request to the language server. */ - const val TRIGGER_COMPLETION = "editor.action.triggerCompletionRequest" - val CMD_TRIGGER_COMPLETION = Command("Trigger completion", TRIGGER_COMPLETION) - - /** Action for triggering code format action automatically. */ - const val FORMAT_CODE = "editor.action.formatCode" - val CMD_FORMAT_CODE = Command("Format code", FORMAT_CODE) - } -} - -enum class CompletionItemKind { - KEYWORD, - VARIABLE, - PROPERTY, - FIELD, - ENUM_MEMBER, - CONSTRUCTOR, - METHOD, - FUNCTION, - TYPE_PARAMETER, - CLASS, - INTERFACE, - ENUM, - ANNOTATION_TYPE, - MODULE, - SNIPPET, - VALUE, - NONE -} - -enum class MatchLevel { - CASE_SENSITIVE_EQUAL, - CASE_INSENSITIVE_EQUAL, - CASE_SENSITIVE_PREFIX, - CASE_INSENSITIVE_PREFIX, - PARTIAL_MATCH, - NO_MATCH -} - -enum class InsertTextFormat { - PLAIN_TEXT, - SNIPPET -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.models + +import com.itsaky.androidide.fuzzysearch.FuzzySearch +import org.appdevforall.codeonthego.lsp.CancellableRequestParams +import org.appdevforall.codeonthego.lsp.edits.DefaultEditHandler +import org.appdevforall.codeonthego.lsp.edits.IEditHandler +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind.NONE +import org.appdevforall.codeonthego.lsp.models.InsertTextFormat.PLAIN_TEXT +import org.appdevforall.codeonthego.lsp.models.MatchLevel.CASE_INSENSITIVE_EQUAL +import org.appdevforall.codeonthego.lsp.models.MatchLevel.CASE_INSENSITIVE_PREFIX +import org.appdevforall.codeonthego.lsp.models.MatchLevel.CASE_SENSITIVE_EQUAL +import org.appdevforall.codeonthego.lsp.models.MatchLevel.CASE_SENSITIVE_PREFIX +import org.appdevforall.codeonthego.lsp.models.MatchLevel.NO_MATCH +import org.appdevforall.codeonthego.lsp.models.MatchLevel.PARTIAL_MATCH +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.progress.ICancelChecker +import io.github.rosemoe.sora.lang.completion.snippet.CodeSnippet +import io.github.rosemoe.sora.text.CharPosition +import io.github.rosemoe.sora.text.Content +import io.github.rosemoe.sora.widget.CodeEditor +import java.nio.file.Path +import java.util.function.Consumer + +const val DEFAULT_MIN_MATCH_RATIO = 59 + +data class CompletionParams( + var position: Position, + var file: Path, + override val cancelChecker: ICancelChecker +) : CancellableRequestParams { + var content: CharSequence? = null + var prefix: String? = null + + fun requirePrefix(): String { + if (prefix == null) { + throw IllegalArgumentException("Prefix is required but none was provided") + } + + return prefix as String + } + + fun requireContents(): CharSequence { + if (content == null) { + throw IllegalArgumentException("Content is required but no content was provided!") + } + return content as CharSequence + } +} + +open class CompletionResult(items: Collection) { + val items: List = run { + var temp = items.toMutableList() + temp.sort() + if (TRIM_TO_MAX && temp.size > MAX_ITEMS) { + temp = temp.subList(0, MAX_ITEMS) + } + return@run temp + } + + var isIncomplete = this.items.size < items.size + var isCached = false + + companion object { + const val MAX_ITEMS = 50 + @JvmField + val EMPTY = CompletionResult(listOf()) + + var TRIM_TO_MAX = true + + @JvmStatic + @JvmOverloads + fun mapAndFilter( + src: CompletionResult, + partial: String, + map: Consumer = Consumer {} + ): CompletionResult { + val newItems = src.items.toMutableList() + newItems.forEach(map) + newItems.removeIf { !it.ideLabel.startsWith(partial) } + return CompletionResult(newItems) + } + } + + constructor() : this(listOf()) + + fun add(item: CompletionItem) { + if (isIncomplete) { + // Max limit has been reached + return + } + + if (items is MutableList) { + this.items.add(item) + } + this.isIncomplete = this.items.size >= MAX_ITEMS + } + + fun markCached() { + this.isCached = true + } + + override fun toString(): String { + return android.text.TextUtils.join("\n", items) + } +} + +open class CompletionItem( + var ideLabel: String, + var detail: String, + insertText: String?, + insertTextFormat: InsertTextFormat?, + sortText: String?, + var command: Command?, + var completionKind: CompletionItemKind, + var matchLevel: MatchLevel, + var additionalTextEdits: List?, + var data: ICompletionData?, + var editHandler: IEditHandler = DefaultEditHandler() +) : + io.github.rosemoe.sora.lang.completion.CompletionItem(ideLabel, detail), + Comparable { + + var ideSortText: String? = sortText + get() { + if (field == null) { + return ideLabel + } + + return field + } + + var insertText: String = insertText ?: "" + get() { + if (field.isEmpty()) { + return this.ideLabel + } + + return field + } + + var insertTextFormat: InsertTextFormat = insertTextFormat ?: PLAIN_TEXT + var additionalEditHandler: IEditHandler? = null + var snippetDescription: SnippetDescription? = null + var overrideTypeText: String? = null + + constructor() : + this( + "", // label + "", // detail + null, // insertText + null, // insertTextFormat + null, // sortText + null, // command + NONE, // kind + NO_MATCH, // match level + ArrayList(), // additionalEdits + null // data + ) + + companion object { + + @JvmStatic + @JvmOverloads + fun matchLevel( + candidate: String, + partial: String, + minMatchRatio: Int = DEFAULT_MIN_MATCH_RATIO + ): MatchLevel { + if (candidate.startsWith(partial)) { + return if (candidate.length == partial.length) { + CASE_SENSITIVE_EQUAL + } else { + CASE_SENSITIVE_PREFIX + } + } + + val lowerCandidate = candidate.lowercase() + val lowerPartial = partial.lowercase() + if (lowerCandidate.startsWith(lowerPartial)) { + return if (lowerCandidate.length == lowerPartial.length) { + CASE_INSENSITIVE_EQUAL + } else { + CASE_INSENSITIVE_PREFIX + } + } + + val ratio = FuzzySearch.ratio(candidate, partial) + if (ratio > minMatchRatio) { + return PARTIAL_MATCH + } + + return NO_MATCH + } + } + + override fun performCompletion(editor: CodeEditor, text: Content, position: CharPosition) { + editHandler.performEdits(this, editor, text, position.line, position.column, position.index) + } + + override fun performCompletion(editor: CodeEditor, text: Content, line: Int, column: Int) { + throw UnsupportedOperationException() + } + + override fun compareTo(other: CompletionItem): Int { + return CompletionItemComparator.compare(this, other) + } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is CompletionItem) return false + + if (ideLabel != other.ideLabel) return false + if (detail != other.detail) return false + if (command != other.command) return false + if (completionKind != other.completionKind) return false + if (matchLevel != other.matchLevel) return false + if (additionalTextEdits != other.additionalTextEdits) return false + if (data != other.data) return false + if (ideSortText != other.ideSortText) return false + if (insertText != other.insertText) return false + if (insertTextFormat != other.insertTextFormat) return false + if (editHandler != other.editHandler) return false + if (additionalEditHandler != other.additionalEditHandler) return false + if (overrideTypeText != other.overrideTypeText) return false + + return true + } + + override fun hashCode(): Int { + var result = ideLabel.hashCode() + result = 31 * result + detail.hashCode() + result = 31 * result + (command?.hashCode() ?: 0) + result = 31 * result + completionKind.hashCode() + result = 31 * result + matchLevel.hashCode() + result = 31 * result + (additionalTextEdits?.hashCode() ?: 0) + result = 31 * result + (data?.hashCode() ?: 0) + result = 31 * result + (ideSortText?.hashCode() ?: 0) + result = 31 * result + insertText.hashCode() + result = 31 * result + insertTextFormat.hashCode() + result = 31 * result + editHandler.hashCode() + result = 31 * result + (additionalEditHandler?.hashCode() ?: 0) + result = 31 * result + (overrideTypeText?.hashCode() ?: 0) + return result + } + + override fun toString(): String { + return "CompletionItem(label='$ideLabel', detail='$detail', command=$command, kind=$completionKind, matchLevel=$matchLevel, additionalTextEdits=$additionalTextEdits, data=$data, sortText=$ideSortText, insertText='$insertText', insertTextFormat=$insertTextFormat, editHandler=$editHandler, additionalEditHandler=$additionalEditHandler, overrideTypeText=$overrideTypeText)" + } +} + +data class SnippetDescription +@JvmOverloads +constructor( + val selectedLength: Int, + val deleteSelected: Boolean = true, + val snippet: CodeSnippet? = null, + val allowCommandExecution: Boolean = false +) + +data class Command(var title: String, var command: String) { + companion object { + + /** Action for triggering a signature help request to the language server. */ + const val TRIGGER_PARAMETER_HINTS = "editor.action.triggerParameterHints" + val CMD_TRIGGER_PARAMETER_HINTS = Command("Trigger parameter hints", TRIGGER_PARAMETER_HINTS) + + /** Action for triggering a completion request to the language server. */ + const val TRIGGER_COMPLETION = "editor.action.triggerCompletionRequest" + val CMD_TRIGGER_COMPLETION = Command("Trigger completion", TRIGGER_COMPLETION) + + /** Action for triggering code format action automatically. */ + const val FORMAT_CODE = "editor.action.formatCode" + val CMD_FORMAT_CODE = Command("Format code", FORMAT_CODE) + } +} + +enum class CompletionItemKind { + KEYWORD, + VARIABLE, + PROPERTY, + FIELD, + ENUM_MEMBER, + CONSTRUCTOR, + METHOD, + FUNCTION, + TYPE_PARAMETER, + CLASS, + INTERFACE, + ENUM, + ANNOTATION_TYPE, + MODULE, + SNIPPET, + VALUE, + NONE +} + +enum class MatchLevel { + CASE_SENSITIVE_EQUAL, + CASE_INSENSITIVE_EQUAL, + CASE_SENSITIVE_PREFIX, + CASE_INSENSITIVE_PREFIX, + PARTIAL_MATCH, + NO_MATCH +} + +enum class InsertTextFormat { + PLAIN_TEXT, + SNIPPET +} diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Definitions.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Definitions.kt similarity index 79% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Definitions.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Definitions.kt index 51dcd66689..d93d9cf5b7 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Definitions.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Definitions.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.models +package org.appdevforall.codeonthego.lsp.models -import com.itsaky.androidide.lsp.CancellableRequestParams -import com.itsaky.androidide.models.Location -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.progress.ICancelChecker +import org.appdevforall.codeonthego.lsp.CancellableRequestParams +import org.appdevforall.codeonthego.models.Location +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.progress.ICancelChecker import java.nio.file.Path /** @author Akash Yadav */ diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Diagnostics.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Diagnostics.kt similarity index 85% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Diagnostics.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Diagnostics.kt index 35fbc51277..8018fee491 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Diagnostics.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Diagnostics.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.models +package org.appdevforall.codeonthego.lsp.models -import com.itsaky.androidide.lsp.models.DiagnosticSeverity.ERROR -import com.itsaky.androidide.lsp.models.DiagnosticSeverity.HINT -import com.itsaky.androidide.lsp.models.DiagnosticSeverity.INFO -import com.itsaky.androidide.lsp.models.DiagnosticSeverity.WARNING -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.lsp.models.DiagnosticSeverity.ERROR +import org.appdevforall.codeonthego.lsp.models.DiagnosticSeverity.HINT +import org.appdevforall.codeonthego.lsp.models.DiagnosticSeverity.INFO +import org.appdevforall.codeonthego.lsp.models.DiagnosticSeverity.WARNING +import org.appdevforall.codeonthego.models.Range import io.github.rosemoe.sora.lang.diagnostic.DiagnosticRegion import io.github.rosemoe.sora.lang.diagnostic.DiagnosticRegion.SEVERITY_ERROR import io.github.rosemoe.sora.lang.diagnostic.DiagnosticRegion.SEVERITY_NONE diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Edits.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Edits.kt similarity index 93% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Edits.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Edits.kt index 0b2d7f2f26..c883ac3b27 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Edits.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Edits.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.models +package org.appdevforall.codeonthego.lsp.models -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.models.Range /** * Represents a line-column based text edit. The text in the given [range] must be replaced with the diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/ExpandSelectionParams.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/ExpandSelectionParams.kt similarity index 89% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/models/ExpandSelectionParams.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/ExpandSelectionParams.kt index a3381a4caa..d78573a397 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/ExpandSelectionParams.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/ExpandSelectionParams.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.models +package org.appdevforall.codeonthego.lsp.models -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.models.Range import java.nio.file.Path data class ExpandSelectionParams(var file: Path, var selection: Range) diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/HighlightToken.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/HighlightToken.kt similarity index 93% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/models/HighlightToken.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/HighlightToken.kt index b5a926c617..f4bb0f73ae 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/HighlightToken.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/HighlightToken.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.models +package org.appdevforall.codeonthego.lsp.models -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.models.Range /** * Model class for a syntax highlighting token. diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Initialization.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Initialization.kt similarity index 96% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Initialization.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Initialization.kt index 95410d4d91..e2f2e4f051 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Initialization.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Initialization.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.models +package org.appdevforall.codeonthego.lsp.models import java.nio.file.Path diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/LSPFailure.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/LSPFailure.kt similarity index 95% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/models/LSPFailure.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/LSPFailure.kt index 85ee5f849e..22120fefb1 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/LSPFailure.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/LSPFailure.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.models +package org.appdevforall.codeonthego.lsp.models /** * Describes the type of failure that was caused by the language server. diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Markups.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Markups.kt similarity index 88% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Markups.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Markups.kt index 24b27be1f7..79e601cb57 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Markups.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Markups.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.models +package org.appdevforall.codeonthego.lsp.models -import com.itsaky.androidide.lsp.models.MarkupKind.PLAIN +import org.appdevforall.codeonthego.lsp.models.MarkupKind.PLAIN data class MarkupContent(var value: String, var kind: MarkupKind) { constructor() : this("", PLAIN) diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/References.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/References.kt similarity index 79% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/models/References.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/References.kt index e1320ec5d2..267b92a27a 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/References.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/References.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.models +package org.appdevforall.codeonthego.lsp.models -import com.itsaky.androidide.lsp.CancellableRequestParams -import com.itsaky.androidide.models.Location -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.progress.ICancelChecker +import org.appdevforall.codeonthego.lsp.CancellableRequestParams +import org.appdevforall.codeonthego.models.Location +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.progress.ICancelChecker import java.nio.file.Path /** @author Akash Yadav */ diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Signatures.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Signatures.kt similarity index 87% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Signatures.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Signatures.kt index c5219e211e..0f7a00f4ce 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/Signatures.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/Signatures.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.models +package org.appdevforall.codeonthego.lsp.models -import com.itsaky.androidide.lsp.CancellableRequestParams -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.progress.ICancelChecker +import org.appdevforall.codeonthego.lsp.CancellableRequestParams +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.progress.ICancelChecker import java.nio.file.Path import java.util.Collections diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/TextDocument.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/TextDocument.kt similarity index 89% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/models/TextDocument.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/TextDocument.kt index 5fbfdd878c..f32c5ffc2e 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/models/TextDocument.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/models/TextDocument.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.models +package org.appdevforall.codeonthego.lsp.models -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.models.Range import java.nio.file.Path data class ShowDocumentParams(var file: Path, var selection: Range) diff --git a/lsp/models/src/main/java/com/itsaky/androidide/lsp/util/RewriteHelper.kt b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/util/RewriteHelper.kt similarity index 93% rename from lsp/models/src/main/java/com/itsaky/androidide/lsp/util/RewriteHelper.kt rename to lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/util/RewriteHelper.kt index 5ff6979c1e..ed4c5fb04c 100644 --- a/lsp/models/src/main/java/com/itsaky/androidide/lsp/util/RewriteHelper.kt +++ b/lsp/models/src/main/java/org/appdevforall/codeonthego/lsp/util/RewriteHelper.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.util +package org.appdevforall.codeonthego.lsp.util import androidx.annotation.UiThread -import com.itsaky.androidide.lsp.models.TextEdit +import org.appdevforall.codeonthego.lsp.models.TextEdit import io.github.rosemoe.sora.widget.CodeEditor /** @author Akash Yadav */ diff --git a/lsp/refactor-core/src/main/java/com/itsaky/androidide/lsp/refactor/BlockRewrite.kt b/lsp/refactor-core/src/main/java/org/appdevforall/codeonthego/lsp/refactor/BlockRewrite.kt similarity index 99% rename from lsp/refactor-core/src/main/java/com/itsaky/androidide/lsp/refactor/BlockRewrite.kt rename to lsp/refactor-core/src/main/java/org/appdevforall/codeonthego/lsp/refactor/BlockRewrite.kt index 3d879e1da2..4bdd326e57 100644 --- a/lsp/refactor-core/src/main/java/com/itsaky/androidide/lsp/refactor/BlockRewrite.kt +++ b/lsp/refactor-core/src/main/java/org/appdevforall/codeonthego/lsp/refactor/BlockRewrite.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.refactor +package org.appdevforall.codeonthego.lsp.refactor /** * The geometry of a scope that already has a `{ ... }` body, which is where a declaration lands in the diff --git a/lsp/refactor-core/src/main/java/com/itsaky/androidide/lsp/refactor/NamePrimitives.kt b/lsp/refactor-core/src/main/java/org/appdevforall/codeonthego/lsp/refactor/NamePrimitives.kt similarity index 97% rename from lsp/refactor-core/src/main/java/com/itsaky/androidide/lsp/refactor/NamePrimitives.kt rename to lsp/refactor-core/src/main/java/org/appdevforall/codeonthego/lsp/refactor/NamePrimitives.kt index b600f771cd..111609b0f5 100644 --- a/lsp/refactor-core/src/main/java/com/itsaky/androidide/lsp/refactor/NamePrimitives.kt +++ b/lsp/refactor-core/src/main/java/org/appdevforall/codeonthego/lsp/refactor/NamePrimitives.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.refactor +package org.appdevforall.codeonthego.lsp.refactor // The language-independent half of name suggestion: what a name looks like, not what the language // allows. Picking a name from an expression's *shape* stays per-language, since only a language server diff --git a/lsp/refactor-core/src/main/java/com/itsaky/androidide/lsp/refactor/RewriteSpan.kt b/lsp/refactor-core/src/main/java/org/appdevforall/codeonthego/lsp/refactor/RewriteSpan.kt similarity index 82% rename from lsp/refactor-core/src/main/java/com/itsaky/androidide/lsp/refactor/RewriteSpan.kt rename to lsp/refactor-core/src/main/java/org/appdevforall/codeonthego/lsp/refactor/RewriteSpan.kt index a9bd571889..5144cca252 100644 --- a/lsp/refactor-core/src/main/java/com/itsaky/androidide/lsp/refactor/RewriteSpan.kt +++ b/lsp/refactor-core/src/main/java/org/appdevforall/codeonthego/lsp/refactor/RewriteSpan.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.lsp.refactor +package org.appdevforall.codeonthego.lsp.refactor -import com.itsaky.androidide.lsp.models.TextEdit -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.lsp.models.TextEdit +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range /** * Deliberately a single replacement, not a list of edits: `IDELanguageClientImpl.applyActionEdits` runs diff --git a/lsp/refactor-core/src/main/java/com/itsaky/androidide/lsp/refactor/SourceText.kt b/lsp/refactor-core/src/main/java/org/appdevforall/codeonthego/lsp/refactor/SourceText.kt similarity index 98% rename from lsp/refactor-core/src/main/java/com/itsaky/androidide/lsp/refactor/SourceText.kt rename to lsp/refactor-core/src/main/java/org/appdevforall/codeonthego/lsp/refactor/SourceText.kt index 32d298eaec..768bc966b6 100644 --- a/lsp/refactor-core/src/main/java/com/itsaky/androidide/lsp/refactor/SourceText.kt +++ b/lsp/refactor-core/src/main/java/org/appdevforall/codeonthego/lsp/refactor/SourceText.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.refactor +package org.appdevforall.codeonthego.lsp.refactor // The offset arithmetic every extract refactoring needs, with no notion of a language in it. These were // duplicated per language server until ADFA-5047; none of them touches a javac `Tree` or a diff --git a/lsp/refactor-core/src/main/java/com/itsaky/androidide/lsp/refactor/TextSpan.kt b/lsp/refactor-core/src/main/java/org/appdevforall/codeonthego/lsp/refactor/TextSpan.kt similarity index 91% rename from lsp/refactor-core/src/main/java/com/itsaky/androidide/lsp/refactor/TextSpan.kt rename to lsp/refactor-core/src/main/java/org/appdevforall/codeonthego/lsp/refactor/TextSpan.kt index 19d4d371da..11bcf26d1e 100644 --- a/lsp/refactor-core/src/main/java/com/itsaky/androidide/lsp/refactor/TextSpan.kt +++ b/lsp/refactor-core/src/main/java/org/appdevforall/codeonthego/lsp/refactor/TextSpan.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.refactor +package org.appdevforall.codeonthego.lsp.refactor /** A half-open offset range `[start, end)` into the analysed file's text. */ data class TextSpan( diff --git a/lsp/refactor-core/src/test/java/com/itsaky/androidide/lsp/refactor/RefactorCoreTest.kt b/lsp/refactor-core/src/test/java/org/appdevforall/codeonthego/lsp/refactor/RefactorCoreTest.kt similarity index 99% rename from lsp/refactor-core/src/test/java/com/itsaky/androidide/lsp/refactor/RefactorCoreTest.kt rename to lsp/refactor-core/src/test/java/org/appdevforall/codeonthego/lsp/refactor/RefactorCoreTest.kt index 1fc3923487..4b2f795892 100644 --- a/lsp/refactor-core/src/test/java/com/itsaky/androidide/lsp/refactor/RefactorCoreTest.kt +++ b/lsp/refactor-core/src/test/java/org/appdevforall/codeonthego/lsp/refactor/RefactorCoreTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.refactor +package org.appdevforall.codeonthego.lsp.refactor import com.google.common.truth.Truth.assertThat import org.junit.Test diff --git a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractMethodContract.kt b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractMethodContract.kt similarity index 97% rename from lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractMethodContract.kt rename to lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractMethodContract.kt index 87a6137c54..d8bd1f3f57 100644 --- a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractMethodContract.kt +++ b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractMethodContract.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.ui +package org.appdevforall.codeonthego.lsp.ui /** * What the extract-method sheet needs to know about one extractable region. diff --git a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractMethodSheet.kt b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractMethodSheet.kt similarity index 97% rename from lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractMethodSheet.kt rename to lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractMethodSheet.kt index 78cf89cd40..9427096a44 100644 --- a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractMethodSheet.kt +++ b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractMethodSheet.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.ui +package org.appdevforall.codeonthego.lsp.ui import android.os.Bundle import android.view.LayoutInflater @@ -11,7 +11,7 @@ import androidx.fragment.app.FragmentActivity import androidx.fragment.app.viewModels import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.google.android.material.bottomsheet.BottomSheetDialogFragment -import com.itsaky.androidide.common.compose.IdeTheme +import org.appdevforall.codeonthego.common.compose.IdeTheme /** * Hosts [ExtractMethodSheetContent], for whichever language server showed it. diff --git a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractMethodSheetContent.kt b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractMethodSheetContent.kt similarity index 98% rename from lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractMethodSheetContent.kt rename to lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractMethodSheetContent.kt index 773332a7c1..3bd4e1ad12 100644 --- a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractMethodSheetContent.kt +++ b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractMethodSheetContent.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.ui +package org.appdevforall.codeonthego.lsp.ui import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column diff --git a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractMethodUiState.kt b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractMethodUiState.kt similarity index 96% rename from lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractMethodUiState.kt rename to lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractMethodUiState.kt index 9f39e77088..aac2b453d1 100644 --- a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractMethodUiState.kt +++ b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractMethodUiState.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.ui +package org.appdevforall.codeonthego.lsp.ui /** * Everything the extract-method sheet renders. diff --git a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractMethodViewModel.kt b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractMethodViewModel.kt similarity index 98% rename from lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractMethodViewModel.kt rename to lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractMethodViewModel.kt index feed4ec55d..c1b1a094af 100644 --- a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractMethodViewModel.kt +++ b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractMethodViewModel.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.ui +package org.appdevforall.codeonthego.lsp.ui import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider diff --git a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractVariableContract.kt b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractVariableContract.kt similarity index 98% rename from lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractVariableContract.kt rename to lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractVariableContract.kt index db1b1993c4..14fb6cfab2 100644 --- a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractVariableContract.kt +++ b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractVariableContract.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.ui +package org.appdevforall.codeonthego.lsp.ui /** * What the extract-variable sheet needs to know about one candidate expression. diff --git a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractVariableSheet.kt b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractVariableSheet.kt similarity index 97% rename from lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractVariableSheet.kt rename to lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractVariableSheet.kt index 43c58b45c6..194e9ad42d 100644 --- a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractVariableSheet.kt +++ b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractVariableSheet.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.ui +package org.appdevforall.codeonthego.lsp.ui import android.content.Context import android.content.ContextWrapper @@ -13,7 +13,7 @@ import androidx.fragment.app.FragmentActivity import androidx.fragment.app.viewModels import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.google.android.material.bottomsheet.BottomSheetDialogFragment -import com.itsaky.androidide.common.compose.IdeTheme +import org.appdevforall.codeonthego.common.compose.IdeTheme /** * Hosts [ExtractVariableSheetContent], for whichever language server showed it. diff --git a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractVariableSheetContent.kt b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractVariableSheetContent.kt similarity index 99% rename from lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractVariableSheetContent.kt rename to lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractVariableSheetContent.kt index e9cbda743f..272850b37a 100644 --- a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractVariableSheetContent.kt +++ b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractVariableSheetContent.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.ui +package org.appdevforall.codeonthego.lsp.ui import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column diff --git a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractVariableUiState.kt b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractVariableUiState.kt similarity index 97% rename from lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractVariableUiState.kt rename to lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractVariableUiState.kt index f5100663fa..9b2c6a0df3 100644 --- a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractVariableUiState.kt +++ b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractVariableUiState.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.ui +package org.appdevforall.codeonthego.lsp.ui /** * Everything the extract-variable sheet renders, derived entirely from the [CandidateView]s it was diff --git a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractVariableViewModel.kt b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractVariableViewModel.kt similarity index 99% rename from lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractVariableViewModel.kt rename to lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractVariableViewModel.kt index 6ac01e095c..cd13d7f1e2 100644 --- a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/ExtractVariableViewModel.kt +++ b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/ExtractVariableViewModel.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.ui +package org.appdevforall.codeonthego.lsp.ui import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider diff --git a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/SheetComponents.kt b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/SheetComponents.kt similarity index 97% rename from lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/SheetComponents.kt rename to lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/SheetComponents.kt index 73dfff3dd5..afb235b878 100644 --- a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/SheetComponents.kt +++ b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/SheetComponents.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.ui +package org.appdevforall.codeonthego.lsp.ui import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column diff --git a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/VariableName.kt b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/VariableName.kt similarity index 97% rename from lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/VariableName.kt rename to lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/VariableName.kt index dc36e96e03..571b397e04 100644 --- a/lsp/ui/src/main/java/com/itsaky/androidide/lsp/ui/VariableName.kt +++ b/lsp/ui/src/main/java/org/appdevforall/codeonthego/lsp/ui/VariableName.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.ui +package org.appdevforall.codeonthego.lsp.ui /** Why a proposed name cannot be used. Null-free alternative to throwing for user input. */ enum class NameProblem { diff --git a/lsp/ui/src/test/java/com/itsaky/androidide/lsp/ui/ExtractMethodViewModelTest.kt b/lsp/ui/src/test/java/org/appdevforall/codeonthego/lsp/ui/ExtractMethodViewModelTest.kt similarity index 99% rename from lsp/ui/src/test/java/com/itsaky/androidide/lsp/ui/ExtractMethodViewModelTest.kt rename to lsp/ui/src/test/java/org/appdevforall/codeonthego/lsp/ui/ExtractMethodViewModelTest.kt index 332cad7c01..e79d086f13 100644 --- a/lsp/ui/src/test/java/com/itsaky/androidide/lsp/ui/ExtractMethodViewModelTest.kt +++ b/lsp/ui/src/test/java/org/appdevforall/codeonthego/lsp/ui/ExtractMethodViewModelTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.ui +package org.appdevforall.codeonthego.lsp.ui import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse diff --git a/lsp/ui/src/test/java/com/itsaky/androidide/lsp/ui/ExtractVariableViewModelTest.kt b/lsp/ui/src/test/java/org/appdevforall/codeonthego/lsp/ui/ExtractVariableViewModelTest.kt similarity index 99% rename from lsp/ui/src/test/java/com/itsaky/androidide/lsp/ui/ExtractVariableViewModelTest.kt rename to lsp/ui/src/test/java/org/appdevforall/codeonthego/lsp/ui/ExtractVariableViewModelTest.kt index 32c1a936b5..d1de1b41b8 100644 --- a/lsp/ui/src/test/java/com/itsaky/androidide/lsp/ui/ExtractVariableViewModelTest.kt +++ b/lsp/ui/src/test/java/org/appdevforall/codeonthego/lsp/ui/ExtractVariableViewModelTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.ui +package org.appdevforall.codeonthego.lsp.ui import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/XMLLanguageServer.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/XMLLanguageServer.kt similarity index 63% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/XMLLanguageServer.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/XMLLanguageServer.kt index 491e869660..ab1babc1af 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/XMLLanguageServer.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/XMLLanguageServer.kt @@ -14,35 +14,35 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml +package org.appdevforall.codeonthego.lsp.xml import androidx.annotation.RestrictTo -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent -import com.itsaky.androidide.lsp.api.ICompletionProvider -import com.itsaky.androidide.lsp.api.ILanguageClient -import com.itsaky.androidide.lsp.api.ILanguageServer -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.models.CodeFormatResult -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.DefinitionParams -import com.itsaky.androidide.lsp.models.DefinitionResult -import com.itsaky.androidide.lsp.models.DiagnosticResult -import com.itsaky.androidide.lsp.models.ExpandSelectionParams -import com.itsaky.androidide.lsp.models.FormatCodeParams -import com.itsaky.androidide.lsp.models.LSPFailure -import com.itsaky.androidide.lsp.models.ReferenceParams -import com.itsaky.androidide.lsp.models.ReferenceResult -import com.itsaky.androidide.lsp.models.SignatureHelp -import com.itsaky.androidide.lsp.models.SignatureHelpParams -import com.itsaky.androidide.lsp.util.NoCompletionsProvider -import com.itsaky.androidide.lsp.xml.models.XMLServerSettings -import com.itsaky.androidide.lsp.xml.providers.AdvancedEditProvider.onContentChange -import com.itsaky.androidide.lsp.xml.providers.CodeFormatProvider -import com.itsaky.androidide.lsp.xml.providers.XmlCompletionProvider -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.projects.api.Workspace -import com.itsaky.androidide.utils.DocumentUtils +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent +import org.appdevforall.codeonthego.lsp.api.ICompletionProvider +import org.appdevforall.codeonthego.lsp.api.ILanguageClient +import org.appdevforall.codeonthego.lsp.api.ILanguageServer +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.models.CodeFormatResult +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.DefinitionParams +import org.appdevforall.codeonthego.lsp.models.DefinitionResult +import org.appdevforall.codeonthego.lsp.models.DiagnosticResult +import org.appdevforall.codeonthego.lsp.models.ExpandSelectionParams +import org.appdevforall.codeonthego.lsp.models.FormatCodeParams +import org.appdevforall.codeonthego.lsp.models.LSPFailure +import org.appdevforall.codeonthego.lsp.models.ReferenceParams +import org.appdevforall.codeonthego.lsp.models.ReferenceResult +import org.appdevforall.codeonthego.lsp.models.SignatureHelp +import org.appdevforall.codeonthego.lsp.models.SignatureHelpParams +import org.appdevforall.codeonthego.lsp.util.NoCompletionsProvider +import org.appdevforall.codeonthego.lsp.xml.models.XMLServerSettings +import org.appdevforall.codeonthego.lsp.xml.providers.AdvancedEditProvider.onContentChange +import org.appdevforall.codeonthego.lsp.xml.providers.CodeFormatProvider +import org.appdevforall.codeonthego.lsp.xml.providers.XmlCompletionProvider +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.projects.api.Workspace +import org.appdevforall.codeonthego.utils.DocumentUtils import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/edits/AttrValueEditHandler.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/edits/AttrValueEditHandler.kt similarity index 94% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/edits/AttrValueEditHandler.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/edits/AttrValueEditHandler.kt index f0dae9283c..802e92190f 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/edits/AttrValueEditHandler.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/edits/AttrValueEditHandler.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.edits +package org.appdevforall.codeonthego.lsp.xml.edits /** * Handles insertion of attribute values. diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/edits/QualifiedValueEditHandler.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/edits/QualifiedValueEditHandler.kt similarity index 85% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/edits/QualifiedValueEditHandler.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/edits/QualifiedValueEditHandler.kt index 1d9ecc8fa9..86dcdb39b3 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/edits/QualifiedValueEditHandler.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/edits/QualifiedValueEditHandler.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.edits +package org.appdevforall.codeonthego.lsp.xml.edits -import com.itsaky.androidide.lsp.edits.DefaultEditHandler -import com.itsaky.androidide.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.edits.DefaultEditHandler +import org.appdevforall.codeonthego.lsp.models.CompletionItem /** * Handles edits for attribute values with qualified binary names. The default implementation in diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/edits/TagEditHandler.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/edits/TagEditHandler.kt similarity index 94% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/edits/TagEditHandler.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/edits/TagEditHandler.kt index 15be787c11..27c48f5098 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/edits/TagEditHandler.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/edits/TagEditHandler.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.edits +package org.appdevforall.codeonthego.lsp.xml.edits /** * Handles insertion of a tag name. diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/models/XMLFormattingOptions.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/models/XMLFormattingOptions.kt similarity index 90% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/models/XMLFormattingOptions.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/models/XMLFormattingOptions.kt index 686a3483b0..24368d50ea 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/models/XMLFormattingOptions.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/models/XMLFormattingOptions.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.models +package org.appdevforall.codeonthego.lsp.xml.models -import com.itsaky.androidide.lsp.xml.providers.format.FormatElementCategory -import com.itsaky.androidide.lsp.xml.providers.format.FormatElementCategory.PreserveSpace -import com.itsaky.androidide.preferences.internal.XmlPreferences +import org.appdevforall.codeonthego.lsp.xml.providers.format.FormatElementCategory +import org.appdevforall.codeonthego.lsp.xml.providers.format.FormatElementCategory.PreserveSpace +import org.appdevforall.codeonthego.preferences.internal.XmlPreferences import org.eclipse.lemminx.dom.DOMElement import org.eclipse.lemminx.dom.builder.BaseXmlFormattingOptions import org.eclipse.lemminx.dom.builder.EmptyElements diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/models/XMLServerSettings.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/models/XMLServerSettings.kt similarity index 89% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/models/XMLServerSettings.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/models/XMLServerSettings.kt index 2614e32a04..10b22d021f 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/models/XMLServerSettings.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/models/XMLServerSettings.kt @@ -14,9 +14,9 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.models +package org.appdevforall.codeonthego.lsp.xml.models -import com.itsaky.androidide.lsp.util.PrefBasedServerSettings +import org.appdevforall.codeonthego.lsp.util.PrefBasedServerSettings /** * Preferences based settings for XML language server. diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/AdvancedEditProvider.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/AdvancedEditProvider.kt similarity index 89% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/AdvancedEditProvider.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/AdvancedEditProvider.kt index b499ba5126..b58c7acf4e 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/AdvancedEditProvider.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/AdvancedEditProvider.kt @@ -15,19 +15,19 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers - -import com.itsaky.androidide.eventbus.events.editor.ChangeType -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent -import com.itsaky.androidide.lsp.api.ILanguageServerRegistry -import com.itsaky.androidide.lsp.models.CodeActionItem -import com.itsaky.androidide.lsp.models.CodeActionKind -import com.itsaky.androidide.lsp.models.DocumentChange -import com.itsaky.androidide.lsp.models.PerformCodeActionParams -import com.itsaky.androidide.lsp.models.TextEdit -import com.itsaky.androidide.lsp.xml.XMLLanguageServer -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.projects.FileManager +package org.appdevforall.codeonthego.lsp.xml.providers + +import org.appdevforall.codeonthego.eventbus.events.editor.ChangeType +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent +import org.appdevforall.codeonthego.lsp.api.ILanguageServerRegistry +import org.appdevforall.codeonthego.lsp.models.CodeActionItem +import org.appdevforall.codeonthego.lsp.models.CodeActionKind +import org.appdevforall.codeonthego.lsp.models.DocumentChange +import org.appdevforall.codeonthego.lsp.models.PerformCodeActionParams +import org.appdevforall.codeonthego.lsp.models.TextEdit +import org.appdevforall.codeonthego.lsp.xml.XMLLanguageServer +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.projects.FileManager import com.itsaky.androidide.treesitter.TSParser import com.itsaky.androidide.treesitter.TSQuery import com.itsaky.androidide.treesitter.TSQueryCapture diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/CodeFormatProvider.java b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/CodeFormatProvider.java similarity index 74% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/CodeFormatProvider.java rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/CodeFormatProvider.java index 1fd4fe39d3..7f60e811eb 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/CodeFormatProvider.java +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/CodeFormatProvider.java @@ -1,32 +1,32 @@ -package com.itsaky.androidide.lsp.xml.providers; - -import com.itsaky.androidide.lsp.models.CodeFormatResult; -import com.itsaky.androidide.lsp.models.FormatCodeParams; -import com.itsaky.androidide.lsp.xml.providers.format.XMLFormatter; -import com.itsaky.androidide.utils.StopWatch; -import org.eclipse.lemminx.dom.DOMParser; -import org.eclipse.lemminx.uriresolver.URIResolverExtensionManager; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class CodeFormatProvider { - - private static final Logger LOG = LoggerFactory.getLogger(CodeFormatProvider.class); - - public CodeFormatResult format(FormatCodeParams params) { - final CharSequence input = params.getContent(); - final var watch = new StopWatch("Formatting XML code"); - try { - final var document = - DOMParser.getInstance() - .parse(input.toString(), "UTF-8", new URIResolverExtensionManager()); - final var edits = new XMLFormatter().format(document, params.getRange()); - return new CodeFormatResult(false, edits); - } catch (Throwable error) { - LOG.error("Error formatting code using DOM formatter", error); - return CodeFormatResult.NONE; - } finally { - watch.log(); - } - } -} +package org.appdevforall.codeonthego.lsp.xml.providers; + +import org.appdevforall.codeonthego.lsp.models.CodeFormatResult; +import org.appdevforall.codeonthego.lsp.models.FormatCodeParams; +import org.appdevforall.codeonthego.lsp.xml.providers.format.XMLFormatter; +import org.appdevforall.codeonthego.utils.StopWatch; +import org.eclipse.lemminx.dom.DOMParser; +import org.eclipse.lemminx.uriresolver.URIResolverExtensionManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class CodeFormatProvider { + + private static final Logger LOG = LoggerFactory.getLogger(CodeFormatProvider.class); + + public CodeFormatResult format(FormatCodeParams params) { + final CharSequence input = params.getContent(); + final var watch = new StopWatch("Formatting XML code"); + try { + final var document = + DOMParser.getInstance() + .parse(input.toString(), "UTF-8", new URIResolverExtensionManager()); + final var edits = new XMLFormatter().format(document, params.getRange()); + return new CodeFormatResult(false, edits); + } catch (Throwable error) { + LOG.error("Error formatting code using DOM formatter", error); + return CodeFormatResult.NONE; + } finally { + watch.log(); + } + } +} diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/XmlCompletionProvider.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/XmlCompletionProvider.kt similarity index 69% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/XmlCompletionProvider.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/XmlCompletionProvider.kt index 9a3e4c2a8d..5cb6679a11 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/XmlCompletionProvider.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/XmlCompletionProvider.kt @@ -1,213 +1,213 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.xml.providers - -import com.android.SdkConstants.ANDROID_MANIFEST_XML -import com.android.aaptcompiler.AaptResourceType.ANIM -import com.android.aaptcompiler.AaptResourceType.ANIMATOR -import com.android.aaptcompiler.AaptResourceType.DRAWABLE -import com.android.aaptcompiler.AaptResourceType.LAYOUT -import com.android.aaptcompiler.AaptResourceType.MENU -import com.android.aaptcompiler.AaptResourceType.TRANSITION -import com.android.aaptcompiler.ResourcePathData -import com.android.aaptcompiler.extractPathData -import com.itsaky.androidide.lsp.api.AbstractServiceProvider -import com.itsaky.androidide.lsp.api.ICompletionProvider -import com.itsaky.androidide.lsp.api.IServerSettings -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.CompletionResult.Companion.EMPTY -import com.itsaky.androidide.lsp.xml.providers.completion.AttrValueCompletionProvider -import com.itsaky.androidide.lsp.xml.providers.completion.IXmlCompletionProvider -import com.itsaky.androidide.lsp.xml.providers.completion.canCompleteManifest -import com.itsaky.androidide.lsp.xml.providers.completion.common.CommonAttrCompletionProvider -import com.itsaky.androidide.lsp.xml.providers.completion.etc.InheritingAttrCompletionProvider -import com.itsaky.androidide.lsp.xml.providers.completion.layout.LayoutAttrCompletionProvider -import com.itsaky.androidide.lsp.xml.providers.completion.layout.LayoutTagCompletionProvider -import com.itsaky.androidide.lsp.xml.providers.completion.manifest.ManifestAttrCompletionProvider -import com.itsaky.androidide.lsp.xml.providers.completion.manifest.ManifestAttrValueCompletionProvider -import com.itsaky.androidide.lsp.xml.providers.completion.manifest.ManifestTagCompletionProvider -import com.itsaky.androidide.lsp.xml.utils.AnimTagTransformer -import com.itsaky.androidide.lsp.xml.utils.AnimatorTagTransformer -import com.itsaky.androidide.lsp.xml.utils.DrawableTagTransformer -import com.itsaky.androidide.lsp.xml.utils.ITagTransformer -import com.itsaky.androidide.lsp.xml.utils.MenuTagTransformer -import com.itsaky.androidide.lsp.xml.utils.NoOpTagTransformer -import com.itsaky.androidide.lsp.xml.utils.TransitionTagTransformer -import com.itsaky.androidide.lsp.xml.utils.XmlUtils -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType.ATTRIBUTE -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType.ATTRIBUTE_VALUE -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType.TAG -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType.UNKNOWN -import com.itsaky.androidide.lsp.xml.utils.forTransitionAttr -import com.itsaky.androidide.utils.CharSequenceReader -import com.itsaky.androidide.utils.StopWatch -import io.github.rosemoe.sora.text.ContentReference -import org.eclipse.lemminx.dom.DOMParser -import org.eclipse.lemminx.uriresolver.URIResolverExtensionManager -import org.slf4j.LoggerFactory -import java.io.Reader -import kotlin.io.path.name - -/** - * Completion provider for XML files. - * - * @author Akash Yadav - */ -class XmlCompletionProvider(settings: IServerSettings) : - AbstractServiceProvider(), ICompletionProvider { - - companion object { - - private val log = LoggerFactory.getLogger(XmlCompletionProvider::class.java) - } - - init { - super.applySettings(settings) - } - - override fun complete(params: CompletionParams): CompletionResult { - return try { - val watch = - StopWatch( - "Complete at ${params.file.name}:${params.position.line}:${params.position.column}" - ) - doComplete(params).also { watch.log() } - } catch (error: Throwable) { - log.error("An error occurred while computing XML completions", error) - EMPTY - } - } - - private fun doComplete(params: CompletionParams): CompletionResult { - val contents = toString(contents = params.requireContents()) - val document = - DOMParser.getInstance().parse(contents, "http://schemas.android.com/apk/res/android", - URIResolverExtensionManager()) - val type = XmlUtils.getNodeType(document, params.position.requireIndex()) - - if (type == UNKNOWN) { - log.warn("Unknown node type. Aborting completion.") - return EMPTY - } - - val prefix = XmlUtils.getPrefix(document, params.position.requireIndex(), type) ?: return EMPTY - if (prefix.isBlank() && type != ATTRIBUTE_VALUE) { - return EMPTY - } - - val pathData = extractPathData(params.file.toFile()) - - val completer = - getCompleter(pathData, type) - ?: run { - log.error( - "No completer available for resource type '{}' and node type '{}'", pathData.type, type - ) - return EMPTY - } - - return completer.complete(params, pathData, document, type, prefix) - } - - private fun toString(contents: CharSequence): String { - return getReader(contents).use { it.readText() } - } - - private fun getReader(contents: CharSequence): Reader = - if (contents is ContentReference) { - contents.createReader() - } else { - CharSequenceReader(contents) - } - - private fun getCompleter(pathData: ResourcePathData, type: NodeType): IXmlCompletionProvider? { - return when (pathData.type) { - LAYOUT -> createLayoutCompleter(type) - TRANSITION -> createTransitionCompleter(type) - null -> createNullTypeCompleter(pathData, type) - else -> createCommonCompleter(pathData, type) - } - } - - private fun createTransitionCompleter(type: NodeType): IXmlCompletionProvider? { - return when (type) { - ATTRIBUTE -> - InheritingAttrCompletionProvider(::forTransitionAttr, TransitionTagTransformer, this) - - ATTRIBUTE_VALUE -> AttrValueCompletionProvider(this) - else -> null - } - } - - private fun createCommonCompleter( - pathData: ResourcePathData, - type: NodeType - ): IXmlCompletionProvider? { - return when (type) { - ATTRIBUTE -> CommonAttrCompletionProvider(tagTransformerFor(pathData), this) - ATTRIBUTE_VALUE -> AttrValueCompletionProvider(this) - else -> null - } - } - - private fun tagTransformerFor(pathData: ResourcePathData): ITagTransformer { - return when (pathData.type) { - ANIM -> AnimTagTransformer - ANIMATOR -> AnimatorTagTransformer - DRAWABLE -> DrawableTagTransformer - MENU -> MenuTagTransformer - else -> NoOpTagTransformer - } - } - - private fun createNullTypeCompleter( - pathData: ResourcePathData, - type: NodeType - ): IXmlCompletionProvider? { - - // In test cases - if (canCompleteManifest(pathData, type)) { - return createManifestCompleter(type) - } - - return when (pathData.file.name) { - ANDROID_MANIFEST_XML -> createManifestCompleter(type) - else -> null - } - } - - private fun createManifestCompleter(type: NodeType): IXmlCompletionProvider? { - return when (type) { - TAG -> ManifestTagCompletionProvider(this) - ATTRIBUTE -> ManifestAttrCompletionProvider(this) - ATTRIBUTE_VALUE -> ManifestAttrValueCompletionProvider(this) - else -> null - } - } - - private fun createLayoutCompleter(type: NodeType): IXmlCompletionProvider? { - return when (type) { - TAG -> LayoutTagCompletionProvider(this) - ATTRIBUTE -> LayoutAttrCompletionProvider(this) - ATTRIBUTE_VALUE -> AttrValueCompletionProvider(this) - else -> null - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.xml.providers + +import com.android.SdkConstants.ANDROID_MANIFEST_XML +import com.android.aaptcompiler.AaptResourceType.ANIM +import com.android.aaptcompiler.AaptResourceType.ANIMATOR +import com.android.aaptcompiler.AaptResourceType.DRAWABLE +import com.android.aaptcompiler.AaptResourceType.LAYOUT +import com.android.aaptcompiler.AaptResourceType.MENU +import com.android.aaptcompiler.AaptResourceType.TRANSITION +import com.android.aaptcompiler.ResourcePathData +import com.android.aaptcompiler.extractPathData +import org.appdevforall.codeonthego.lsp.api.AbstractServiceProvider +import org.appdevforall.codeonthego.lsp.api.ICompletionProvider +import org.appdevforall.codeonthego.lsp.api.IServerSettings +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.CompletionResult.Companion.EMPTY +import org.appdevforall.codeonthego.lsp.xml.providers.completion.AttrValueCompletionProvider +import org.appdevforall.codeonthego.lsp.xml.providers.completion.IXmlCompletionProvider +import org.appdevforall.codeonthego.lsp.xml.providers.completion.canCompleteManifest +import org.appdevforall.codeonthego.lsp.xml.providers.completion.common.CommonAttrCompletionProvider +import org.appdevforall.codeonthego.lsp.xml.providers.completion.etc.InheritingAttrCompletionProvider +import org.appdevforall.codeonthego.lsp.xml.providers.completion.layout.LayoutAttrCompletionProvider +import org.appdevforall.codeonthego.lsp.xml.providers.completion.layout.LayoutTagCompletionProvider +import org.appdevforall.codeonthego.lsp.xml.providers.completion.manifest.ManifestAttrCompletionProvider +import org.appdevforall.codeonthego.lsp.xml.providers.completion.manifest.ManifestAttrValueCompletionProvider +import org.appdevforall.codeonthego.lsp.xml.providers.completion.manifest.ManifestTagCompletionProvider +import org.appdevforall.codeonthego.lsp.xml.utils.AnimTagTransformer +import org.appdevforall.codeonthego.lsp.xml.utils.AnimatorTagTransformer +import org.appdevforall.codeonthego.lsp.xml.utils.DrawableTagTransformer +import org.appdevforall.codeonthego.lsp.xml.utils.ITagTransformer +import org.appdevforall.codeonthego.lsp.xml.utils.MenuTagTransformer +import org.appdevforall.codeonthego.lsp.xml.utils.NoOpTagTransformer +import org.appdevforall.codeonthego.lsp.xml.utils.TransitionTagTransformer +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType.ATTRIBUTE +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType.ATTRIBUTE_VALUE +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType.TAG +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType.UNKNOWN +import org.appdevforall.codeonthego.lsp.xml.utils.forTransitionAttr +import org.appdevforall.codeonthego.utils.CharSequenceReader +import org.appdevforall.codeonthego.utils.StopWatch +import io.github.rosemoe.sora.text.ContentReference +import org.eclipse.lemminx.dom.DOMParser +import org.eclipse.lemminx.uriresolver.URIResolverExtensionManager +import org.slf4j.LoggerFactory +import java.io.Reader +import kotlin.io.path.name + +/** + * Completion provider for XML files. + * + * @author Akash Yadav + */ +class XmlCompletionProvider(settings: IServerSettings) : + AbstractServiceProvider(), ICompletionProvider { + + companion object { + + private val log = LoggerFactory.getLogger(XmlCompletionProvider::class.java) + } + + init { + super.applySettings(settings) + } + + override fun complete(params: CompletionParams): CompletionResult { + return try { + val watch = + StopWatch( + "Complete at ${params.file.name}:${params.position.line}:${params.position.column}" + ) + doComplete(params).also { watch.log() } + } catch (error: Throwable) { + log.error("An error occurred while computing XML completions", error) + EMPTY + } + } + + private fun doComplete(params: CompletionParams): CompletionResult { + val contents = toString(contents = params.requireContents()) + val document = + DOMParser.getInstance().parse(contents, "http://schemas.android.com/apk/res/android", + URIResolverExtensionManager()) + val type = XmlUtils.getNodeType(document, params.position.requireIndex()) + + if (type == UNKNOWN) { + log.warn("Unknown node type. Aborting completion.") + return EMPTY + } + + val prefix = XmlUtils.getPrefix(document, params.position.requireIndex(), type) ?: return EMPTY + if (prefix.isBlank() && type != ATTRIBUTE_VALUE) { + return EMPTY + } + + val pathData = extractPathData(params.file.toFile()) + + val completer = + getCompleter(pathData, type) + ?: run { + log.error( + "No completer available for resource type '{}' and node type '{}'", pathData.type, type + ) + return EMPTY + } + + return completer.complete(params, pathData, document, type, prefix) + } + + private fun toString(contents: CharSequence): String { + return getReader(contents).use { it.readText() } + } + + private fun getReader(contents: CharSequence): Reader = + if (contents is ContentReference) { + contents.createReader() + } else { + CharSequenceReader(contents) + } + + private fun getCompleter(pathData: ResourcePathData, type: NodeType): IXmlCompletionProvider? { + return when (pathData.type) { + LAYOUT -> createLayoutCompleter(type) + TRANSITION -> createTransitionCompleter(type) + null -> createNullTypeCompleter(pathData, type) + else -> createCommonCompleter(pathData, type) + } + } + + private fun createTransitionCompleter(type: NodeType): IXmlCompletionProvider? { + return when (type) { + ATTRIBUTE -> + InheritingAttrCompletionProvider(::forTransitionAttr, TransitionTagTransformer, this) + + ATTRIBUTE_VALUE -> AttrValueCompletionProvider(this) + else -> null + } + } + + private fun createCommonCompleter( + pathData: ResourcePathData, + type: NodeType + ): IXmlCompletionProvider? { + return when (type) { + ATTRIBUTE -> CommonAttrCompletionProvider(tagTransformerFor(pathData), this) + ATTRIBUTE_VALUE -> AttrValueCompletionProvider(this) + else -> null + } + } + + private fun tagTransformerFor(pathData: ResourcePathData): ITagTransformer { + return when (pathData.type) { + ANIM -> AnimTagTransformer + ANIMATOR -> AnimatorTagTransformer + DRAWABLE -> DrawableTagTransformer + MENU -> MenuTagTransformer + else -> NoOpTagTransformer + } + } + + private fun createNullTypeCompleter( + pathData: ResourcePathData, + type: NodeType + ): IXmlCompletionProvider? { + + // In test cases + if (canCompleteManifest(pathData, type)) { + return createManifestCompleter(type) + } + + return when (pathData.file.name) { + ANDROID_MANIFEST_XML -> createManifestCompleter(type) + else -> null + } + } + + private fun createManifestCompleter(type: NodeType): IXmlCompletionProvider? { + return when (type) { + TAG -> ManifestTagCompletionProvider(this) + ATTRIBUTE -> ManifestAttrCompletionProvider(this) + ATTRIBUTE_VALUE -> ManifestAttrValueCompletionProvider(this) + else -> null + } + } + + private fun createLayoutCompleter(type: NodeType): IXmlCompletionProvider? { + return when (type) { + TAG -> LayoutTagCompletionProvider(this) + ATTRIBUTE -> LayoutAttrCompletionProvider(this) + ATTRIBUTE_VALUE -> AttrValueCompletionProvider(this) + else -> null + } + } +} diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/AttrCompletionProvider.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/AttrCompletionProvider.kt similarity index 92% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/AttrCompletionProvider.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/AttrCompletionProvider.kt index af954c6422..a8dbe505cf 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/AttrCompletionProvider.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/AttrCompletionProvider.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion +package org.appdevforall.codeonthego.lsp.xml.providers.completion import com.android.aaptcompiler.AaptResourceType.STYLEABLE import com.android.aaptcompiler.ConfigDescription @@ -24,17 +24,17 @@ import com.android.aaptcompiler.ResourceGroup import com.android.aaptcompiler.ResourcePathData import com.android.aaptcompiler.ResourceTablePackage import com.android.aaptcompiler.Styleable -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.api.ICompletionProvider -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.MatchLevel.NO_MATCH -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType.ATTRIBUTE -import com.itsaky.androidide.xml.resources.ResourceTableRegistry -import com.itsaky.androidide.xml.widgets.Widget -import com.itsaky.androidide.xml.widgets.WidgetTable +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.api.ICompletionProvider +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.MatchLevel.NO_MATCH +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType.ATTRIBUTE +import org.appdevforall.codeonthego.xml.resources.ResourceTableRegistry +import org.appdevforall.codeonthego.xml.widgets.Widget +import org.appdevforall.codeonthego.xml.widgets.WidgetTable import org.eclipse.lemminx.dom.DOMDocument import org.eclipse.lemminx.dom.DOMNode diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/AttrValueCompletionProvider.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/AttrValueCompletionProvider.kt similarity index 90% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/AttrValueCompletionProvider.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/AttrValueCompletionProvider.kt index c69ea2f96a..81e1758a68 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/AttrValueCompletionProvider.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/AttrValueCompletionProvider.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion +package org.appdevforall.codeonthego.lsp.xml.providers.completion import com.android.SdkConstants.ANDROID_URI import com.android.aapt.Resources.Attribute.FormatFlags @@ -37,23 +37,23 @@ import com.android.aaptcompiler.ConfigDescription import com.android.aaptcompiler.ResourcePathData import com.android.aaptcompiler.ResourceTable import com.android.aaptcompiler.ResourceTablePackage -import com.itsaky.androidide.aapt.findEntries -import com.itsaky.androidide.lsp.api.ICompletionProvider -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.CompletionResult.Companion.EMPTY -import com.itsaky.androidide.lsp.models.CompletionResult.Companion.MAX_ITEMS -import com.itsaky.androidide.lsp.models.MatchLevel.NO_MATCH -import com.itsaky.androidide.lsp.xml.edits.QualifiedValueEditHandler -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType.ATTRIBUTE_VALUE -import com.itsaky.androidide.lsp.xml.utils.dimensionUnits -import com.itsaky.androidide.xml.resources.ResourceTableRegistry -import com.itsaky.androidide.xml.utils.attrValue_qualifiedRef -import com.itsaky.androidide.xml.utils.attrValue_qualifiedRefWithIncompletePckOrType -import com.itsaky.androidide.xml.utils.attrValue_qualifiedRefWithIncompleteType -import com.itsaky.androidide.xml.utils.attrValue_unqualifiedRef +import org.appdevforall.codeonthego.aapt.findEntries +import org.appdevforall.codeonthego.lsp.api.ICompletionProvider +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.CompletionResult.Companion.EMPTY +import org.appdevforall.codeonthego.lsp.models.CompletionResult.Companion.MAX_ITEMS +import org.appdevforall.codeonthego.lsp.models.MatchLevel.NO_MATCH +import org.appdevforall.codeonthego.lsp.xml.edits.QualifiedValueEditHandler +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType.ATTRIBUTE_VALUE +import org.appdevforall.codeonthego.lsp.xml.utils.dimensionUnits +import org.appdevforall.codeonthego.xml.resources.ResourceTableRegistry +import org.appdevforall.codeonthego.xml.utils.attrValue_qualifiedRef +import org.appdevforall.codeonthego.xml.utils.attrValue_qualifiedRefWithIncompletePckOrType +import org.appdevforall.codeonthego.xml.utils.attrValue_qualifiedRefWithIncompleteType +import org.appdevforall.codeonthego.xml.utils.attrValue_unqualifiedRef import org.eclipse.lemminx.dom.DOMDocument /** diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/IXmlCompletionProvider.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/IXmlCompletionProvider.kt similarity index 85% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/IXmlCompletionProvider.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/IXmlCompletionProvider.kt index 31a36f1309..df0c047109 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/IXmlCompletionProvider.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/IXmlCompletionProvider.kt @@ -15,33 +15,33 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion +package org.appdevforall.codeonthego.lsp.xml.providers.completion import com.android.aaptcompiler.Reference import com.android.aaptcompiler.ResourcePathData import com.android.aaptcompiler.ResourceTable -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.api.ICompletionProvider -import com.itsaky.androidide.lsp.api.describeSnippet -import com.itsaky.androidide.lsp.models.ClassCompletionData -import com.itsaky.androidide.lsp.models.Command -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionItemKind.CLASS -import com.itsaky.androidide.lsp.models.CompletionItemKind.FIELD -import com.itsaky.androidide.lsp.models.CompletionItemKind.VALUE -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.InsertTextFormat.PLAIN_TEXT -import com.itsaky.androidide.lsp.models.InsertTextFormat.SNIPPET -import com.itsaky.androidide.lsp.models.MatchLevel -import com.itsaky.androidide.lsp.xml.edits.AttrValueEditHandler -import com.itsaky.androidide.lsp.xml.edits.QualifiedValueEditHandler -import com.itsaky.androidide.lsp.xml.edits.TagEditHandler -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType.ATTRIBUTE -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType.ATTRIBUTE_VALUE -import com.itsaky.androidide.utils.DocumentUtils -import com.itsaky.androidide.xml.resources.ResourceTableRegistry +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.api.ICompletionProvider +import org.appdevforall.codeonthego.lsp.api.describeSnippet +import org.appdevforall.codeonthego.lsp.models.ClassCompletionData +import org.appdevforall.codeonthego.lsp.models.Command +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind.CLASS +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind.FIELD +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind.VALUE +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.InsertTextFormat.PLAIN_TEXT +import org.appdevforall.codeonthego.lsp.models.InsertTextFormat.SNIPPET +import org.appdevforall.codeonthego.lsp.models.MatchLevel +import org.appdevforall.codeonthego.lsp.xml.edits.AttrValueEditHandler +import org.appdevforall.codeonthego.lsp.xml.edits.QualifiedValueEditHandler +import org.appdevforall.codeonthego.lsp.xml.edits.TagEditHandler +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType.ATTRIBUTE +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType.ATTRIBUTE_VALUE +import org.appdevforall.codeonthego.utils.DocumentUtils +import org.appdevforall.codeonthego.xml.resources.ResourceTableRegistry import org.eclipse.lemminx.dom.DOMAttr import org.eclipse.lemminx.dom.DOMDocument import org.eclipse.lemminx.dom.DOMNode diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/common/CommonAttrCompletionProvider.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/common/CommonAttrCompletionProvider.kt similarity index 85% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/common/CommonAttrCompletionProvider.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/common/CommonAttrCompletionProvider.kt index 0a8b2d810f..e67af3d815 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/common/CommonAttrCompletionProvider.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/common/CommonAttrCompletionProvider.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion.common +package org.appdevforall.codeonthego.lsp.xml.providers.completion.common import com.android.aaptcompiler.ConfigDescription import com.android.aaptcompiler.ResourceGroup import com.android.aaptcompiler.Styleable -import com.itsaky.androidide.lsp.api.ICompletionProvider -import com.itsaky.androidide.lsp.xml.providers.completion.AttrCompletionProvider -import com.itsaky.androidide.lsp.xml.utils.ITagTransformer +import org.appdevforall.codeonthego.lsp.api.ICompletionProvider +import org.appdevforall.codeonthego.lsp.xml.providers.completion.AttrCompletionProvider +import org.appdevforall.codeonthego.lsp.xml.utils.ITagTransformer import org.eclipse.lemminx.dom.DOMNode /** diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/etc/InheritingAttrCompletionProvider.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/etc/InheritingAttrCompletionProvider.kt similarity index 86% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/etc/InheritingAttrCompletionProvider.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/etc/InheritingAttrCompletionProvider.kt index 0a5f2a262c..86c52173c1 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/etc/InheritingAttrCompletionProvider.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/etc/InheritingAttrCompletionProvider.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion.etc +package org.appdevforall.codeonthego.lsp.xml.providers.completion.etc import com.android.aaptcompiler.ResourceGroup import com.android.aaptcompiler.Styleable -import com.itsaky.androidide.lsp.api.ICompletionProvider -import com.itsaky.androidide.lsp.xml.providers.completion.AttrCompletionProvider -import com.itsaky.androidide.lsp.xml.utils.ITagTransformer +import org.appdevforall.codeonthego.lsp.api.ICompletionProvider +import org.appdevforall.codeonthego.lsp.xml.providers.completion.AttrCompletionProvider +import org.appdevforall.codeonthego.lsp.xml.utils.ITagTransformer import org.eclipse.lemminx.dom.DOMNode /** diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/layout/LayoutAttrCompletionProvider.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/layout/LayoutAttrCompletionProvider.kt similarity index 75% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/layout/LayoutAttrCompletionProvider.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/layout/LayoutAttrCompletionProvider.kt index c0459c10c3..222148e23e 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/layout/LayoutAttrCompletionProvider.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/layout/LayoutAttrCompletionProvider.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion.layout +package org.appdevforall.codeonthego.lsp.xml.providers.completion.layout import com.android.aaptcompiler.ResourcePathData -import com.itsaky.androidide.lsp.api.ICompletionProvider -import com.itsaky.androidide.lsp.xml.providers.completion.AttrCompletionProvider -import com.itsaky.androidide.lsp.xml.providers.completion.canCompleteLayout -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType +import org.appdevforall.codeonthego.lsp.api.ICompletionProvider +import org.appdevforall.codeonthego.lsp.xml.providers.completion.AttrCompletionProvider +import org.appdevforall.codeonthego.lsp.xml.providers.completion.canCompleteLayout +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType /** * Attribute completion provider for layout files. diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/layout/LayoutTagCompletionProvider.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/layout/LayoutTagCompletionProvider.kt similarity index 76% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/layout/LayoutTagCompletionProvider.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/layout/LayoutTagCompletionProvider.kt index 90d10aef76..f090c2296d 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/layout/LayoutTagCompletionProvider.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/layout/LayoutTagCompletionProvider.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion.layout +package org.appdevforall.codeonthego.lsp.xml.providers.completion.layout import com.android.aaptcompiler.ResourcePathData -import com.itsaky.androidide.lsp.api.ICompletionProvider -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.xml.providers.completion.IXmlCompletionProvider -import com.itsaky.androidide.lsp.xml.providers.completion.canCompleteLayout -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType.TAG +import org.appdevforall.codeonthego.lsp.api.ICompletionProvider +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.xml.providers.completion.IXmlCompletionProvider +import org.appdevforall.codeonthego.lsp.xml.providers.completion.canCompleteLayout +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType.TAG import org.eclipse.lemminx.dom.DOMDocument /** diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/layout/QualifiedTagCompleter.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/layout/QualifiedTagCompleter.kt similarity index 76% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/layout/QualifiedTagCompleter.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/layout/QualifiedTagCompleter.kt index b6a9c82197..ca16592d82 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/layout/QualifiedTagCompleter.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/layout/QualifiedTagCompleter.kt @@ -15,21 +15,21 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion.layout +package org.appdevforall.codeonthego.lsp.xml.providers.completion.layout import com.android.aaptcompiler.ResourcePathData -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.api.ICompletionProvider -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.MatchLevel.NO_MATCH -import com.itsaky.androidide.lsp.xml.providers.completion.match -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType -import com.itsaky.androidide.projects.api.ModuleProject -import com.itsaky.androidide.utils.ClassTrie -import com.itsaky.androidide.xml.internal.widgets.DefaultWidgetTable -import com.itsaky.androidide.xml.widgets.WidgetTable +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.api.ICompletionProvider +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.MatchLevel.NO_MATCH +import org.appdevforall.codeonthego.lsp.xml.providers.completion.match +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType +import org.appdevforall.codeonthego.projects.api.ModuleProject +import org.appdevforall.codeonthego.utils.ClassTrie +import org.appdevforall.codeonthego.xml.internal.widgets.DefaultWidgetTable +import org.appdevforall.codeonthego.xml.widgets.WidgetTable import org.eclipse.lemminx.dom.DOMDocument /** diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/layout/SimpleTagCompleter.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/layout/SimpleTagCompleter.kt similarity index 78% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/layout/SimpleTagCompleter.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/layout/SimpleTagCompleter.kt index 8b03d222a2..5ece3b35f3 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/layout/SimpleTagCompleter.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/layout/SimpleTagCompleter.kt @@ -15,18 +15,18 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion.layout +package org.appdevforall.codeonthego.lsp.xml.providers.completion.layout import com.android.aaptcompiler.ResourcePathData -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.api.ICompletionProvider -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType -import com.itsaky.androidide.projects.api.ModuleProject -import com.itsaky.androidide.utils.ClassTrie -import com.itsaky.androidide.xml.widgets.WidgetTable +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.api.ICompletionProvider +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType +import org.appdevforall.codeonthego.projects.api.ModuleProject +import org.appdevforall.codeonthego.utils.ClassTrie +import org.appdevforall.codeonthego.xml.widgets.WidgetTable import org.eclipse.lemminx.dom.DOMDocument /** diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/layoutFileCompletions.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/layoutFileCompletions.kt similarity index 87% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/layoutFileCompletions.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/layoutFileCompletions.kt index 5c68b9a38f..e9522a7fde 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/layoutFileCompletions.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/layoutFileCompletions.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion +package org.appdevforall.codeonthego.lsp.xml.providers.completion import com.android.aaptcompiler.AaptResourceType.LAYOUT import com.android.aaptcompiler.ResourcePathData -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType /** * @author Akash Yadav diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/manifest/ManifestAttrCompletionProvider.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/manifest/ManifestAttrCompletionProvider.kt similarity index 73% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/manifest/ManifestAttrCompletionProvider.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/manifest/ManifestAttrCompletionProvider.kt index 31cad9a7ac..aa2de41c1b 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/manifest/ManifestAttrCompletionProvider.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/manifest/ManifestAttrCompletionProvider.kt @@ -15,19 +15,19 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion.manifest +package org.appdevforall.codeonthego.lsp.xml.providers.completion.manifest import com.android.aaptcompiler.ConfigDescription import com.android.aaptcompiler.ResourceGroup import com.android.aaptcompiler.ResourcePathData import com.android.aaptcompiler.Styleable -import com.itsaky.androidide.lsp.api.ICompletionProvider -import com.itsaky.androidide.lsp.xml.providers.completion.AttrCompletionProvider -import com.itsaky.androidide.lsp.xml.providers.completion.MANIFEST_TAG_PREFIX -import com.itsaky.androidide.lsp.xml.providers.completion.canCompleteManifest -import com.itsaky.androidide.lsp.xml.providers.completion.manifestResourceTable -import com.itsaky.androidide.lsp.xml.providers.completion.transformToEntryName -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType +import org.appdevforall.codeonthego.lsp.api.ICompletionProvider +import org.appdevforall.codeonthego.lsp.xml.providers.completion.AttrCompletionProvider +import org.appdevforall.codeonthego.lsp.xml.providers.completion.MANIFEST_TAG_PREFIX +import org.appdevforall.codeonthego.lsp.xml.providers.completion.canCompleteManifest +import org.appdevforall.codeonthego.lsp.xml.providers.completion.manifestResourceTable +import org.appdevforall.codeonthego.lsp.xml.providers.completion.transformToEntryName +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType import org.eclipse.lemminx.dom.DOMNode /** diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/manifest/ManifestAttrValueCompletionProvider.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/manifest/ManifestAttrValueCompletionProvider.kt similarity index 81% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/manifest/ManifestAttrValueCompletionProvider.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/manifest/ManifestAttrValueCompletionProvider.kt index 971b269159..4a2d422aa1 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/manifest/ManifestAttrValueCompletionProvider.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/manifest/ManifestAttrValueCompletionProvider.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion.manifest +package org.appdevforall.codeonthego.lsp.xml.providers.completion.manifest import com.android.SdkConstants import com.android.SdkConstants.ANDROID_NS_NAME_PREFIX @@ -26,25 +26,25 @@ import com.android.SdkConstants.TAG_RECEIVER import com.android.SdkConstants.TAG_SERVICE import com.android.aaptcompiler.ResourcePathData import com.android.aaptcompiler.ResourceTable -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.api.ICompletionProvider -import com.itsaky.androidide.lsp.models.ClassCompletionData -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionItemKind.FIELD -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.CompletionResult.Companion.EMPTY -import com.itsaky.androidide.lsp.models.FieldCompletionData -import com.itsaky.androidide.lsp.models.InsertTextFormat.PLAIN_TEXT -import com.itsaky.androidide.lsp.models.MatchLevel.NO_MATCH -import com.itsaky.androidide.lsp.xml.providers.completion.AttrValueCompletionProvider -import com.itsaky.androidide.lsp.xml.providers.completion.manifestResourceTable -import com.itsaky.androidide.lsp.xml.providers.completion.match -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType -import com.itsaky.androidide.projects.api.AndroidModule -import com.itsaky.androidide.projects.api.ModuleProject -import com.itsaky.androidide.xml.permissions.Permission -import com.itsaky.androidide.xml.resources.ResourceTableRegistry +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.api.ICompletionProvider +import org.appdevforall.codeonthego.lsp.models.ClassCompletionData +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionItemKind.FIELD +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.CompletionResult.Companion.EMPTY +import org.appdevforall.codeonthego.lsp.models.FieldCompletionData +import org.appdevforall.codeonthego.lsp.models.InsertTextFormat.PLAIN_TEXT +import org.appdevforall.codeonthego.lsp.models.MatchLevel.NO_MATCH +import org.appdevforall.codeonthego.lsp.xml.providers.completion.AttrValueCompletionProvider +import org.appdevforall.codeonthego.lsp.xml.providers.completion.manifestResourceTable +import org.appdevforall.codeonthego.lsp.xml.providers.completion.match +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType +import org.appdevforall.codeonthego.projects.api.AndroidModule +import org.appdevforall.codeonthego.projects.api.ModuleProject +import org.appdevforall.codeonthego.xml.permissions.Permission +import org.appdevforall.codeonthego.xml.resources.ResourceTableRegistry import org.eclipse.lemminx.dom.DOMDocument /** diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/manifest/ManifestTagCompletionProvider.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/manifest/ManifestTagCompletionProvider.kt similarity index 66% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/manifest/ManifestTagCompletionProvider.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/manifest/ManifestTagCompletionProvider.kt index ae3e054829..c77bcfe936 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/manifest/ManifestTagCompletionProvider.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/manifest/ManifestTagCompletionProvider.kt @@ -15,25 +15,25 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion.manifest +package org.appdevforall.codeonthego.lsp.xml.providers.completion.manifest import com.android.aaptcompiler.AaptResourceType.STYLEABLE import com.android.aaptcompiler.ResourcePathData -import com.itsaky.androidide.aapt.findEntries -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.api.ICompletionProvider -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.lsp.models.CompletionResult -import com.itsaky.androidide.lsp.models.CompletionResult.Companion.EMPTY -import com.itsaky.androidide.lsp.models.MatchLevel.NO_MATCH -import com.itsaky.androidide.lsp.xml.providers.completion.IXmlCompletionProvider -import com.itsaky.androidide.lsp.xml.providers.completion.MANIFEST_TAG_PREFIX -import com.itsaky.androidide.lsp.xml.providers.completion.canCompleteManifest -import com.itsaky.androidide.lsp.xml.providers.completion.transformToTagName -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType.TAG -import com.itsaky.androidide.xml.resources.ResourceTableRegistry +import org.appdevforall.codeonthego.aapt.findEntries +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.api.ICompletionProvider +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.lsp.models.CompletionResult +import org.appdevforall.codeonthego.lsp.models.CompletionResult.Companion.EMPTY +import org.appdevforall.codeonthego.lsp.models.MatchLevel.NO_MATCH +import org.appdevforall.codeonthego.lsp.xml.providers.completion.IXmlCompletionProvider +import org.appdevforall.codeonthego.lsp.xml.providers.completion.MANIFEST_TAG_PREFIX +import org.appdevforall.codeonthego.lsp.xml.providers.completion.canCompleteManifest +import org.appdevforall.codeonthego.lsp.xml.providers.completion.transformToTagName +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType.TAG +import org.appdevforall.codeonthego.xml.resources.ResourceTableRegistry import org.eclipse.lemminx.dom.DOMDocument /** diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/manifestFileCompletions.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/manifestFileCompletions.kt similarity index 81% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/manifestFileCompletions.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/manifestFileCompletions.kt index 70d58b7636..c1e688a4d4 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/manifestFileCompletions.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/manifestFileCompletions.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion +package org.appdevforall.codeonthego.lsp.xml.providers.completion import com.android.SdkConstants.ANDROID_MANIFEST_XML import com.android.aaptcompiler.ResourcePathData import com.android.aaptcompiler.ResourceTable -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType -import com.itsaky.androidide.utils.VMUtils -import com.itsaky.androidide.xml.resources.ResourceTableRegistry +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType +import org.appdevforall.codeonthego.utils.VMUtils +import org.appdevforall.codeonthego.xml.resources.ResourceTableRegistry const val MANIFEST_TAG_PREFIX = "AndroidManifest" diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/xmlCompletions.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/xmlCompletions.kt similarity index 88% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/xmlCompletions.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/xmlCompletions.kt index 0dc735727f..093c1e7935 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/completion/xmlCompletions.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/xmlCompletions.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion +package org.appdevforall.codeonthego.lsp.xml.providers.completion import com.android.aaptcompiler.ResourceTable -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.models.CompletionItem.Companion.matchLevel -import com.itsaky.androidide.lsp.models.MatchLevel -import com.itsaky.androidide.lsp.models.MatchLevel.NO_MATCH -import com.itsaky.androidide.xml.resources.ResourceTableRegistry +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.models.CompletionItem.Companion.matchLevel +import org.appdevforall.codeonthego.lsp.models.MatchLevel +import org.appdevforall.codeonthego.lsp.models.MatchLevel.NO_MATCH +import org.appdevforall.codeonthego.xml.resources.ResourceTableRegistry import org.eclipse.lemminx.dom.DOMNode import kotlin.math.min diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMAttributeFormatter.java b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMAttributeFormatter.java similarity index 95% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMAttributeFormatter.java rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMAttributeFormatter.java index b34ebe7177..c8db9aa9c0 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMAttributeFormatter.java +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMAttributeFormatter.java @@ -1,169 +1,169 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -/******************************************************************************* - * Copyright (c) 2022 Red Hat Inc. and others. - * All rights reserved. This program and the accompanying materials - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v20.html - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat Inc. - initial API and implementation - *******************************************************************************/ -package com.itsaky.androidide.lsp.xml.providers.format; - -import com.itsaky.androidide.lsp.models.TextEdit; -import java.util.List; -import org.eclipse.lemminx.dom.DOMAttr; -import org.eclipse.lemminx.utils.StringUtils; - -/** - * DOM attribute formatter. - * - * @author Angelo ZERR - */ -public class DOMAttributeFormatter { - - private final XMLFormatterDocumentNew formatterDocument; - - public DOMAttributeFormatter(XMLFormatterDocumentNew formatterDocument) { - this.formatterDocument = formatterDocument; - } - - public void formatAttribute( - DOMAttr attr, - int prevOffset, - boolean singleAttribute, - boolean useSettings, - XMLFormattingConstraints parentConstraints, - List edits) { - // 1) format before attribute name : indent left of the attribute name - // ex : - // attr0='name'[space]attr1='name' - - // Adjust the startAttr to avoid ignoring invalid content - // ex : - // must be adjusted with to keep the invalid content "" - int from = prevOffset; - int to = attr.getStart(); - replaceLeftSpacesWithOneSpace(from, to, edits); - } - - // 2) format delimiter : remove whitespaces between '=' - // ex : - // --> - String originalValue = attr.getOriginalValue(); - if (originalValue != null) { - if (originalValue.charAt(0) != getQuotationAsChar() - && StringUtils.isQuote(originalValue.charAt(0))) { - replaceQuoteWithPreferred( - attr.getNodeAttrValue().getStart(), attr.getNodeAttrValue().getStart() + 1, edits); - } - if (originalValue.charAt(originalValue.length() - 1) != getQuotationAsChar() - && StringUtils.isQuote(originalValue.charAt(originalValue.length() - 1))) { - replaceQuoteWithPreferred( - attr.getNodeAttrValue().getEnd() - 1, attr.getNodeAttrValue().getEnd(), edits); - } - } - } - - private void formatAttributeValue(DOMAttr attr, int indentLevel, List edits) { - formatterDocument.formatAttributeValue(attr, indentLevel, edits); - } - - private void replaceQuoteWithPreferred(int from, int to, List edits) { - formatterDocument.replaceQuoteWithPreferred(from, to, edits); - } - - private void replaceLeftSpacesWithOneSpace(int from, int to, List edits) { - formatterDocument.replaceLeftSpacesWithOneSpace(from, to, edits); - } - - private void replaceLeftSpacesWithIndentation( - int indentLevel, int leftLimit, int to, boolean addLineSeparator, List edits) { - formatterDocument.replaceLeftSpacesWithIndentation( - indentLevel, leftLimit, to, addLineSeparator, edits); - } - - private void removeLeftSpaces(int from, int to, List edits) { - formatterDocument.removeLeftSpaces(from, to, edits); - } - - private boolean isSplitAttributes() { - return formatterDocument.getSharedSettings().getFormattingOptions().isSplitAttributes(); - } - - private int getSplitAttributesIndentSize() { - return formatterDocument - .getSharedSettings() - .getFormattingOptions() - .getSplitAttributesIndentSize(); - } - - boolean isPreserveAttributeLineBreaks() { - return formatterDocument - .getSharedSettings() - .getFormattingOptions() - .isPreserveAttributeLineBreaks(); - } - - private boolean hasLineBreak(int prevOffset, int start) { - return formatterDocument.hasLineBreak(prevOffset, start); - } - - private char getQuotationAsChar() { - return '"'; - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +/******************************************************************************* + * Copyright (c) 2022 Red Hat Inc. and others. + * All rights reserved. This program and the accompanying materials + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat Inc. - initial API and implementation + *******************************************************************************/ +package org.appdevforall.codeonthego.lsp.xml.providers.format; + +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import java.util.List; +import org.eclipse.lemminx.dom.DOMAttr; +import org.eclipse.lemminx.utils.StringUtils; + +/** + * DOM attribute formatter. + * + * @author Angelo ZERR + */ +public class DOMAttributeFormatter { + + private final XMLFormatterDocumentNew formatterDocument; + + public DOMAttributeFormatter(XMLFormatterDocumentNew formatterDocument) { + this.formatterDocument = formatterDocument; + } + + public void formatAttribute( + DOMAttr attr, + int prevOffset, + boolean singleAttribute, + boolean useSettings, + XMLFormattingConstraints parentConstraints, + List edits) { + // 1) format before attribute name : indent left of the attribute name + // ex : + // attr0='name'[space]attr1='name' + + // Adjust the startAttr to avoid ignoring invalid content + // ex : + // must be adjusted with to keep the invalid content "" + int from = prevOffset; + int to = attr.getStart(); + replaceLeftSpacesWithOneSpace(from, to, edits); + } + + // 2) format delimiter : remove whitespaces between '=' + // ex : + // --> + String originalValue = attr.getOriginalValue(); + if (originalValue != null) { + if (originalValue.charAt(0) != getQuotationAsChar() + && StringUtils.isQuote(originalValue.charAt(0))) { + replaceQuoteWithPreferred( + attr.getNodeAttrValue().getStart(), attr.getNodeAttrValue().getStart() + 1, edits); + } + if (originalValue.charAt(originalValue.length() - 1) != getQuotationAsChar() + && StringUtils.isQuote(originalValue.charAt(originalValue.length() - 1))) { + replaceQuoteWithPreferred( + attr.getNodeAttrValue().getEnd() - 1, attr.getNodeAttrValue().getEnd(), edits); + } + } + } + + private void formatAttributeValue(DOMAttr attr, int indentLevel, List edits) { + formatterDocument.formatAttributeValue(attr, indentLevel, edits); + } + + private void replaceQuoteWithPreferred(int from, int to, List edits) { + formatterDocument.replaceQuoteWithPreferred(from, to, edits); + } + + private void replaceLeftSpacesWithOneSpace(int from, int to, List edits) { + formatterDocument.replaceLeftSpacesWithOneSpace(from, to, edits); + } + + private void replaceLeftSpacesWithIndentation( + int indentLevel, int leftLimit, int to, boolean addLineSeparator, List edits) { + formatterDocument.replaceLeftSpacesWithIndentation( + indentLevel, leftLimit, to, addLineSeparator, edits); + } + + private void removeLeftSpaces(int from, int to, List edits) { + formatterDocument.removeLeftSpaces(from, to, edits); + } + + private boolean isSplitAttributes() { + return formatterDocument.getSharedSettings().getFormattingOptions().isSplitAttributes(); + } + + private int getSplitAttributesIndentSize() { + return formatterDocument + .getSharedSettings() + .getFormattingOptions() + .getSplitAttributesIndentSize(); + } + + boolean isPreserveAttributeLineBreaks() { + return formatterDocument + .getSharedSettings() + .getFormattingOptions() + .isPreserveAttributeLineBreaks(); + } + + private boolean hasLineBreak(int prevOffset, int start) { + return formatterDocument.hasLineBreak(prevOffset, start); + } + + private char getQuotationAsChar() { + return '"'; + } +} diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMCDATAFormatter.java b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMCDATAFormatter.java similarity index 96% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMCDATAFormatter.java rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMCDATAFormatter.java index de7944ea97..54b518e25b 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMCDATAFormatter.java +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMCDATAFormatter.java @@ -26,10 +26,10 @@ * Contributors: * Red Hat Inc. - initial API and implementation *******************************************************************************/ -package com.itsaky.androidide.lsp.xml.providers.format; +package org.appdevforall.codeonthego.lsp.xml.providers.format; -import com.itsaky.androidide.lsp.models.TextEdit; -import com.itsaky.androidide.preferences.internal.EditorPreferences; +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences; import java.util.List; import org.eclipse.lemminx.dom.DOMCDATASection; diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMCommentFormatter.java b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMCommentFormatter.java similarity index 95% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMCommentFormatter.java rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMCommentFormatter.java index cff03062d4..b1179adc59 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMCommentFormatter.java +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMCommentFormatter.java @@ -26,10 +26,10 @@ * Contributors: * Red Hat Inc. - initial API and implementation *******************************************************************************/ -package com.itsaky.androidide.lsp.xml.providers.format; +package org.appdevforall.codeonthego.lsp.xml.providers.format; -import com.itsaky.androidide.lsp.models.TextEdit; -import com.itsaky.androidide.preferences.internal.EditorPreferences; +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences; import java.util.List; import org.eclipse.lemminx.dom.DOMComment; diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMDocTypeFormatter.java b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMDocTypeFormatter.java similarity index 96% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMDocTypeFormatter.java rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMDocTypeFormatter.java index f50d1de5fe..de24170777 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMDocTypeFormatter.java +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMDocTypeFormatter.java @@ -1,274 +1,274 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -/******************************************************************************* - * Copyright (c) 2022 Red Hat Inc. and others. - * All rights reserved. This program and the accompanying materials - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v20.html - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat Inc. - initial API and implementation - *******************************************************************************/ -package com.itsaky.androidide.lsp.xml.providers.format; - -import com.itsaky.androidide.lsp.models.TextEdit; -import java.util.List; -import org.eclipse.lemminx.dom.DOMDocumentType; -import org.eclipse.lemminx.dom.DOMNode; -import org.eclipse.lemminx.dom.DTDAttlistDecl; -import org.eclipse.lemminx.dom.DTDDeclNode; -import org.eclipse.lemminx.dom.DTDDeclParameter; -import org.eclipse.lemminx.utils.StringUtils; -import org.w3c.dom.Node; - -/** - * DOM docType formatter. - * - * @author Angelo ZERR - */ -public class DOMDocTypeFormatter { - - private final XMLFormatterDocumentNew formatterDocument; - - public DOMDocTypeFormatter(XMLFormatterDocumentNew formatterDocument) { - this.formatterDocument = formatterDocument; - } - - public void formatDocType( - DOMDocumentType docType, - XMLFormattingConstraints parentConstraints, - int start, - int end, - List edits) { - boolean isDTD = docType.getOwnerDocument().isDTD(); - if (isDTD) { - formatDTD(docType, parentConstraints, start, end, edits); - } else { - List parameters = docType.getParameters(); - if (!parameters.isEmpty()) { - for (DTDDeclParameter parameter : parameters) { - replaceLeftSpacesWithOneSpace(docType.getStart(), parameter.getStart(), edits); - if (docType.isInternalSubset(parameter)) { - // level + 1 since the 'level' value is the doctype tag's level - XMLFormattingConstraints constraints = new XMLFormattingConstraints(); - constraints.copyConstraints(parentConstraints); - constraints.setIndentLevel(constraints.getIndentLevel() + 1); - formatDTD(docType, constraints, start, end, edits); - } - } - int quoteStart = getDocTypeIdStart(docType); - int quoteEnd = getDocTypeIdEnd(docType); - - if (quoteStart != -1 && quoteEnd != -1) { - // replace current quote with preferred quote in the case: - // - formatterDocument.replaceQuoteWithPreferred(quoteStart, quoteStart + 1, edits); - formatterDocument.replaceQuoteWithPreferred(quoteEnd - 1, quoteEnd, edits); - } - } - } - DTDDeclParameter internalSubset = docType.getInternalSubsetNode(); - if (internalSubset == null) { - if (docType.isClosed()) { - // Remove space between content and end bracket in case of no internal subset - // Example: - int startDocType = docType.getStart(); - int endDocType = docType.getEnd() - 1; - removeLeftSpaces(startDocType, endDocType, edits); - } - } else { - // Add new line at end of internal subset - // |]> - int startDocType = internalSubset.getStart(); - int endDocType = internalSubset.getEnd() - 1; - String lineDelimiter = formatterDocument.getLineDelimiter(); - replaceLeftSpacesWith(startDocType, endDocType, lineDelimiter, edits); - } - } - - private void formatDTD( - DOMDocumentType docType, - XMLFormattingConstraints parentConstraints, - int start, - int end, - List edits) { - boolean addLineSeparator = !docType.getOwnerDocument().isDTD(); - for (DOMNode child : docType.getChildren()) { - switch (child.getNodeType()) { - case DOMNode.DTD_ELEMENT_DECL_NODE: - case DOMNode.DTD_ATT_LIST_NODE: - case Node.ENTITY_NODE: - case DOMNode.DTD_NOTATION_DECL: - // Format DTD node declaration, for example: - // - DTDDeclNode nodeDecl = (DTDDeclNode) child; - formatDTDNodeDecl(nodeDecl, parentConstraints, addLineSeparator, edits); - addLineSeparator = true; - break; - - default: - // unknown, so just leave alone for now but make sure to update - // available line width - int width = updateLineWidthWithLastLine(child, parentConstraints.getAvailableLineWidth()); - parentConstraints.setAvailableLineWidth(width); - } - } - } - - private int updateLineWidthWithLastLine(DOMNode child, int availableLineWidth) { - return formatterDocument.updateLineWidthWithLastLine(child, availableLineWidth); - } - - private void formatDTDNodeDecl( - DTDDeclNode nodeDecl, - XMLFormattingConstraints parentConstraints, - boolean addLineSeparator, - List edits) { - // 1) indent the DTD element, entity, notation declaration - // before formatting : [space][space] - // after formatting : - replaceLeftSpacesWithIndentation( - parentConstraints.getIndentLevel(), - nodeDecl.getParentNode().getStart(), - nodeDecl.getStart(), - addLineSeparator, - edits); - - // 2 separate each parameters with one space - // before formatting : - // after formatting : - DTDAttlistDecl attlist = nodeDecl.isDTDAttListDecl() ? (DTDAttlistDecl) nodeDecl : null; - if (attlist != null) { - int indentLevel = nodeDecl.getOwnerDocument().isDTD() ? 1 : 2; - List internalDecls = attlist.getInternalChildren(); - if (internalDecls == null) { - int previousOffset = attlist.getStart(); - for (DTDDeclParameter parameter : attlist.getParameters()) { - // Normalize space at the start of parameter to a single space for ATTLIST, for - // example: - // - replaceLeftSpacesWithOneSpace(previousOffset, parameter.getStart(), edits); - // replace current quote with preferred quote in the case: - // - replaceQuoteWithPreferred(nodeDecl, parameter, edits); - previousOffset = parameter.getEnd(); - } - } else { - boolean multipleInternalAttlistDecls = false; - List params = attlist.getParameters(); - DTDDeclParameter parameter; - int previousOffset = attlist.getStart(); - for (int i = 0; i < params.size(); i++) { - parameter = params.get(i); - if (attlist.getNameParameter().equals(parameter)) { - replaceLeftSpacesWithOneSpace(previousOffset, parameter.getStart(), edits); - if (attlist.getParameters().size() > 1) { // has parameters after elementName - multipleInternalAttlistDecls = true; - } - } else { - if (multipleInternalAttlistDecls && i == 1) { - replaceLeftSpacesWithIndentation( - indentLevel, previousOffset, parameter.getStart(), true, edits); - } else { - replaceLeftSpacesWithOneSpace(previousOffset, parameter.getStart(), edits); - } - } - previousOffset = parameter.getEnd(); - } - - for (DTDAttlistDecl attlistDecl : internalDecls) { - params = attlistDecl.getParameters(); - previousOffset = attlistDecl.getStart(); - for (int i = 0; i < params.size(); i++) { - parameter = params.get(i); - if (i == 0) { - replaceLeftSpacesWithIndentation( - indentLevel, previousOffset, parameter.getStart(), true, edits); - } else { - replaceLeftSpacesWithOneSpace(previousOffset, parameter.getStart(), edits); - } - previousOffset = parameter.getEnd(); - } - } - } - } else { - List parameters = nodeDecl.getParameters(); - if (!parameters.isEmpty()) { - int previousOffset = nodeDecl.getStart(); - for (DTDDeclParameter parameter : parameters) { - // Normalize space at the start of parameter to a single space for non-ATTLIST, - // for example: - // - replaceLeftSpacesWithOneSpace(previousOffset, parameter.getStart(), edits); - // replace current quote with preferred quote in the case: - // - replaceQuoteWithPreferred(nodeDecl, parameter, edits); - previousOffset = parameter.getEnd(); - } - } - } - } - - private void replaceLeftSpacesWith(int from, int to, String replacement, List edits) { - formatterDocument.replaceLeftSpacesWith(from, to, replacement, edits); - } - - private void replaceLeftSpacesWithOneSpace(int from, int to, List edits) { - formatterDocument.replaceLeftSpacesWithOneSpace(from, to, edits); - } - - private int replaceLeftSpacesWithIndentation( - int indentLevel, int from, int to, boolean addLineSeparator, List edits) { - return formatterDocument.replaceLeftSpacesWithIndentation( - indentLevel, from, to, addLineSeparator, edits); - } - - private void removeLeftSpaces(int from, int to, List edits) { - formatterDocument.removeLeftSpaces(from, to, edits); - } - - private static int getDocTypeIdStart(DOMDocumentType docType) { - if (docType.getPublicIdNode() != null) { - return docType.getPublicIdNode().getStart(); - } else if (docType.getSystemIdNode() != null) { - return docType.getSystemIdNode().getStart(); - } else return -1; - } - - private static int getDocTypeIdEnd(DOMDocumentType docType) { - if (docType.getPublicIdNode() != null) { - return docType.getPublicIdNode().getEnd(); - } else if (docType.getSystemIdNode() != null) { - return docType.getSystemIdNode().getEnd(); - } else return -1; - } - - private void replaceQuoteWithPreferred( - DTDDeclNode nodeDecl, DTDDeclParameter parameter, List edits) { - int paramStart = parameter.getStart(); - int paramEnd = parameter.getEnd(); - if (StringUtils.isQuote(nodeDecl.getOwnerDocument().getText().charAt(paramStart)) - && StringUtils.isQuote(nodeDecl.getOwnerDocument().getText().charAt(paramEnd - 1))) { - formatterDocument.replaceQuoteWithPreferred(paramStart, paramStart + 1, edits); - formatterDocument.replaceQuoteWithPreferred(paramEnd - 1, paramEnd, edits); - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +/******************************************************************************* + * Copyright (c) 2022 Red Hat Inc. and others. + * All rights reserved. This program and the accompanying materials + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat Inc. - initial API and implementation + *******************************************************************************/ +package org.appdevforall.codeonthego.lsp.xml.providers.format; + +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import java.util.List; +import org.eclipse.lemminx.dom.DOMDocumentType; +import org.eclipse.lemminx.dom.DOMNode; +import org.eclipse.lemminx.dom.DTDAttlistDecl; +import org.eclipse.lemminx.dom.DTDDeclNode; +import org.eclipse.lemminx.dom.DTDDeclParameter; +import org.eclipse.lemminx.utils.StringUtils; +import org.w3c.dom.Node; + +/** + * DOM docType formatter. + * + * @author Angelo ZERR + */ +public class DOMDocTypeFormatter { + + private final XMLFormatterDocumentNew formatterDocument; + + public DOMDocTypeFormatter(XMLFormatterDocumentNew formatterDocument) { + this.formatterDocument = formatterDocument; + } + + public void formatDocType( + DOMDocumentType docType, + XMLFormattingConstraints parentConstraints, + int start, + int end, + List edits) { + boolean isDTD = docType.getOwnerDocument().isDTD(); + if (isDTD) { + formatDTD(docType, parentConstraints, start, end, edits); + } else { + List parameters = docType.getParameters(); + if (!parameters.isEmpty()) { + for (DTDDeclParameter parameter : parameters) { + replaceLeftSpacesWithOneSpace(docType.getStart(), parameter.getStart(), edits); + if (docType.isInternalSubset(parameter)) { + // level + 1 since the 'level' value is the doctype tag's level + XMLFormattingConstraints constraints = new XMLFormattingConstraints(); + constraints.copyConstraints(parentConstraints); + constraints.setIndentLevel(constraints.getIndentLevel() + 1); + formatDTD(docType, constraints, start, end, edits); + } + } + int quoteStart = getDocTypeIdStart(docType); + int quoteEnd = getDocTypeIdEnd(docType); + + if (quoteStart != -1 && quoteEnd != -1) { + // replace current quote with preferred quote in the case: + // + formatterDocument.replaceQuoteWithPreferred(quoteStart, quoteStart + 1, edits); + formatterDocument.replaceQuoteWithPreferred(quoteEnd - 1, quoteEnd, edits); + } + } + } + DTDDeclParameter internalSubset = docType.getInternalSubsetNode(); + if (internalSubset == null) { + if (docType.isClosed()) { + // Remove space between content and end bracket in case of no internal subset + // Example: + int startDocType = docType.getStart(); + int endDocType = docType.getEnd() - 1; + removeLeftSpaces(startDocType, endDocType, edits); + } + } else { + // Add new line at end of internal subset + // |]> + int startDocType = internalSubset.getStart(); + int endDocType = internalSubset.getEnd() - 1; + String lineDelimiter = formatterDocument.getLineDelimiter(); + replaceLeftSpacesWith(startDocType, endDocType, lineDelimiter, edits); + } + } + + private void formatDTD( + DOMDocumentType docType, + XMLFormattingConstraints parentConstraints, + int start, + int end, + List edits) { + boolean addLineSeparator = !docType.getOwnerDocument().isDTD(); + for (DOMNode child : docType.getChildren()) { + switch (child.getNodeType()) { + case DOMNode.DTD_ELEMENT_DECL_NODE: + case DOMNode.DTD_ATT_LIST_NODE: + case Node.ENTITY_NODE: + case DOMNode.DTD_NOTATION_DECL: + // Format DTD node declaration, for example: + // + DTDDeclNode nodeDecl = (DTDDeclNode) child; + formatDTDNodeDecl(nodeDecl, parentConstraints, addLineSeparator, edits); + addLineSeparator = true; + break; + + default: + // unknown, so just leave alone for now but make sure to update + // available line width + int width = updateLineWidthWithLastLine(child, parentConstraints.getAvailableLineWidth()); + parentConstraints.setAvailableLineWidth(width); + } + } + } + + private int updateLineWidthWithLastLine(DOMNode child, int availableLineWidth) { + return formatterDocument.updateLineWidthWithLastLine(child, availableLineWidth); + } + + private void formatDTDNodeDecl( + DTDDeclNode nodeDecl, + XMLFormattingConstraints parentConstraints, + boolean addLineSeparator, + List edits) { + // 1) indent the DTD element, entity, notation declaration + // before formatting : [space][space] + // after formatting : + replaceLeftSpacesWithIndentation( + parentConstraints.getIndentLevel(), + nodeDecl.getParentNode().getStart(), + nodeDecl.getStart(), + addLineSeparator, + edits); + + // 2 separate each parameters with one space + // before formatting : + // after formatting : + DTDAttlistDecl attlist = nodeDecl.isDTDAttListDecl() ? (DTDAttlistDecl) nodeDecl : null; + if (attlist != null) { + int indentLevel = nodeDecl.getOwnerDocument().isDTD() ? 1 : 2; + List internalDecls = attlist.getInternalChildren(); + if (internalDecls == null) { + int previousOffset = attlist.getStart(); + for (DTDDeclParameter parameter : attlist.getParameters()) { + // Normalize space at the start of parameter to a single space for ATTLIST, for + // example: + // + replaceLeftSpacesWithOneSpace(previousOffset, parameter.getStart(), edits); + // replace current quote with preferred quote in the case: + // + replaceQuoteWithPreferred(nodeDecl, parameter, edits); + previousOffset = parameter.getEnd(); + } + } else { + boolean multipleInternalAttlistDecls = false; + List params = attlist.getParameters(); + DTDDeclParameter parameter; + int previousOffset = attlist.getStart(); + for (int i = 0; i < params.size(); i++) { + parameter = params.get(i); + if (attlist.getNameParameter().equals(parameter)) { + replaceLeftSpacesWithOneSpace(previousOffset, parameter.getStart(), edits); + if (attlist.getParameters().size() > 1) { // has parameters after elementName + multipleInternalAttlistDecls = true; + } + } else { + if (multipleInternalAttlistDecls && i == 1) { + replaceLeftSpacesWithIndentation( + indentLevel, previousOffset, parameter.getStart(), true, edits); + } else { + replaceLeftSpacesWithOneSpace(previousOffset, parameter.getStart(), edits); + } + } + previousOffset = parameter.getEnd(); + } + + for (DTDAttlistDecl attlistDecl : internalDecls) { + params = attlistDecl.getParameters(); + previousOffset = attlistDecl.getStart(); + for (int i = 0; i < params.size(); i++) { + parameter = params.get(i); + if (i == 0) { + replaceLeftSpacesWithIndentation( + indentLevel, previousOffset, parameter.getStart(), true, edits); + } else { + replaceLeftSpacesWithOneSpace(previousOffset, parameter.getStart(), edits); + } + previousOffset = parameter.getEnd(); + } + } + } + } else { + List parameters = nodeDecl.getParameters(); + if (!parameters.isEmpty()) { + int previousOffset = nodeDecl.getStart(); + for (DTDDeclParameter parameter : parameters) { + // Normalize space at the start of parameter to a single space for non-ATTLIST, + // for example: + // + replaceLeftSpacesWithOneSpace(previousOffset, parameter.getStart(), edits); + // replace current quote with preferred quote in the case: + // + replaceQuoteWithPreferred(nodeDecl, parameter, edits); + previousOffset = parameter.getEnd(); + } + } + } + } + + private void replaceLeftSpacesWith(int from, int to, String replacement, List edits) { + formatterDocument.replaceLeftSpacesWith(from, to, replacement, edits); + } + + private void replaceLeftSpacesWithOneSpace(int from, int to, List edits) { + formatterDocument.replaceLeftSpacesWithOneSpace(from, to, edits); + } + + private int replaceLeftSpacesWithIndentation( + int indentLevel, int from, int to, boolean addLineSeparator, List edits) { + return formatterDocument.replaceLeftSpacesWithIndentation( + indentLevel, from, to, addLineSeparator, edits); + } + + private void removeLeftSpaces(int from, int to, List edits) { + formatterDocument.removeLeftSpaces(from, to, edits); + } + + private static int getDocTypeIdStart(DOMDocumentType docType) { + if (docType.getPublicIdNode() != null) { + return docType.getPublicIdNode().getStart(); + } else if (docType.getSystemIdNode() != null) { + return docType.getSystemIdNode().getStart(); + } else return -1; + } + + private static int getDocTypeIdEnd(DOMDocumentType docType) { + if (docType.getPublicIdNode() != null) { + return docType.getPublicIdNode().getEnd(); + } else if (docType.getSystemIdNode() != null) { + return docType.getSystemIdNode().getEnd(); + } else return -1; + } + + private void replaceQuoteWithPreferred( + DTDDeclNode nodeDecl, DTDDeclParameter parameter, List edits) { + int paramStart = parameter.getStart(); + int paramEnd = parameter.getEnd(); + if (StringUtils.isQuote(nodeDecl.getOwnerDocument().getText().charAt(paramStart)) + && StringUtils.isQuote(nodeDecl.getOwnerDocument().getText().charAt(paramEnd - 1))) { + formatterDocument.replaceQuoteWithPreferred(paramStart, paramStart + 1, edits); + formatterDocument.replaceQuoteWithPreferred(paramEnd - 1, paramEnd, edits); + } + } +} diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMElementFormatter.java b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMElementFormatter.java similarity index 96% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMElementFormatter.java rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMElementFormatter.java index a1a68fe1a4..4aaf130111 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMElementFormatter.java +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMElementFormatter.java @@ -1,547 +1,547 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -/******************************************************************************* - * Copyright (c) 2022 Red Hat Inc. and others. - * All rights reserved. This program and the accompanying materials - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v20.html - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat Inc. - initial API and implementation - *******************************************************************************/ -package com.itsaky.androidide.lsp.xml.providers.format; - -import com.itsaky.androidide.lsp.models.TextEdit; -import java.util.List; -import org.eclipse.lemminx.commons.BadLocationException; -import org.eclipse.lemminx.dom.DOMAttr; -import org.eclipse.lemminx.dom.DOMElement; -import org.eclipse.lemminx.dom.builder.EmptyElements; -import org.eclipse.lemminx.utils.StringUtils; - -/** - * DOM element formatter. - * - * @author Angelo ZERR - */ -public class DOMElementFormatter { - - private final XMLFormatterDocumentNew formatterDocument; - - private final DOMAttributeFormatter attributeFormatter; - - public DOMElementFormatter( - XMLFormatterDocumentNew formatterDocument, DOMAttributeFormatter attributeFormatter) { - this.formatterDocument = formatterDocument; - this.attributeFormatter = attributeFormatter; - } - - public void formatElement( - DOMElement element, - XMLFormattingConstraints parentConstraints, - int start, - int end, - List edits) { - EmptyElements emptyElements = getEmptyElements(element); - - // Format start tag element with proper indentation - int indentLevel = parentConstraints.getIndentLevel(); - int nb = formatStartTagElement(element, parentConstraints, emptyElements, end, edits); - - if (emptyElements == EmptyElements.Ignore) { - // Format children of the element - XMLFormattingConstraints constraints = new XMLFormattingConstraints(); - constraints.copyConstraints(parentConstraints); - if ((element.isClosed())) { - constraints.setIndentLevel(indentLevel + 1); - } - constraints.setFormatElementCategory(getFormatElementCategory(element, parentConstraints)); - constraints.setAvailableLineWidth(getMaxLineWidth() - nb); - - formatChildren(element, constraints, start, end, edits); - - // Format end tag element with proper indentation - if (element.hasEndTag()) { - formatEndTagElement(element, parentConstraints, constraints, edits); - } - } - } - - private int formatStartTagElement( - DOMElement element, - XMLFormattingConstraints parentConstraints, - EmptyElements emptyElements, - int end, - List edits) { - if (!element.hasStartTag()) { - // ex : example text - // after formatting: \n example text - int parentStartCloseOffset = element.getParentElement().getStartTagCloseOffset() + 1; - if (parentStartCloseOffset != startTagOffset - && StringUtils.isWhitespace( - formatterDocument.getText(), parentStartCloseOffset, startTagOffset)) { - int nbSpaces = - replaceLeftSpacesWithIndentation( - indentLevel, parentStartCloseOffset, startTagOffset, !addLineSeparator, edits); - width = nbSpaces + element.getStartTagCloseOffset() - startTagOffset; - } - break; - case IgnoreSpace: - // If preserve new lines - int preservedNewLines = getPreservedNewlines(); - int currentNewLineCount = - getExistingNewLineCount( - formatterDocument.getText(), startTagOffset, formatterDocument.getLineDelimiter()); - if (currentNewLineCount > preservedNewLines) { - replaceLeftSpacesWithIndentationWithMultiNewLines( - indentLevel, 0, startTagOffset, preservedNewLines + 1, edits); - } else { - // remove spaces and indent - int nbSpaces = - replaceLeftSpacesWithIndentation( - indentLevel, 0, startTagOffset, !addLineSeparator, edits); - width = nbSpaces + element.getStartTagCloseOffset() - startTagOffset; - } - case NormalizeSpace: - break; - } - - if (formatElementCategory != FormatElementCategory.PreserveSpace) { - formatAttributes(element, parentConstraints, edits); - - boolean formatted = false; - switch (emptyElements) { - case Expand: - { - if (element.isSelfClosed()) { - // Expand empty element: -> - StringBuilder tag = new StringBuilder(); - tag.append(">"); - tag.append("'); - // get the from offset: - // - - // - - int from = getOffsetAfterStartTagOrLastAttribute(element); - // get the to offset: - // - | - // - | - int to = element.getEnd(); - // replace with > - // - - // - - createTextEditIfNeeded(from, to, tag.toString(), edits); - formatted = true; - } - break; - } - case Collapse: - { - // Collapse empty element: -> - if (!element.isSelfClosed() && (end == -1 || element.getEndTagOpenOffset() + 1 < end)) { - // Do not Collapse if range is does not cover the element - StringBuilder tag = new StringBuilder(); - if (isSpaceBeforeEmptyCloseTag()) { - tag.append(" "); - } - tag.append("/>"); - // get the from offset: - // - - // - - int from = getOffsetAfterStartTagOrLastAttribute(element); - // get the to offset: - // - | - // - | - int to = element.getEnd(); - // replace with /> - // - - // - - createTextEditIfNeeded(from, to, tag.toString(), edits); - formatted = true; - } - break; - } - default: - } - - if (!formatted) { - if (element.isStartTagClosed() || element.isSelfClosed()) { - formatElementStartTagOrSelfClosed(element, parentConstraints, edits); - } - } - } - return width; - } - - private static int getOffsetAfterStartTagOrLastAttribute(DOMElement element) { - DOMAttr attr = getLastAttribute(element); - if (attr != null) { - return attr.getEnd(); - } - return element.getOffsetAfterStartTag(); - } - - private int formatAttributes( - DOMElement element, XMLFormattingConstraints parentConstraints, List edits) { - if (element.hasAttributes()) { - List attributes = element.getAttributeNodes(); - // initialize the previous offset with the start tag: - // . - int prevOffset = element.getOffsetAfterStartTag(); - boolean singleAttribute = attributes.size() == 1; - for (DOMAttr attr : attributes) { - // Format current attribute - attributeFormatter.formatAttribute( - attr, prevOffset, singleAttribute, true, parentConstraints, edits); - // set the previous offset with end of the current attribute: - // ) according to {@code - * XMLFormattingOptions#isPreserveAttrLineBreaks()} - * - *

{@code XMLFormattingOptions#isPreserveAttrLineBreaks()}: If true, must add a newline + - * indent before the closing bracket if the last attribute of the element and the closing bracket - * are in different lines. - * - * @param element - * @throws BadLocationException - */ - private void formatElementStartTagOrSelfClosed( - DOMElement element, XMLFormattingConstraints parentConstraints, List edits) { - // - // - int startTagClose = element.getOffsetBeforeCloseOfStartTag(); - // - // - int startTagOpen = element.getOffsetAfterStartTag(); - String replace = ""; - boolean spaceBeforeEmptyCloseTag = isSpaceBeforeEmptyCloseTag(); - if (isPreserveAttributeLineBreaks() - && element.hasAttributes() - && hasLineBreak(getLastAttribute(element).getEnd(), startTagClose)) { - spaceBeforeEmptyCloseTag = false; - int indentLevel = parentConstraints.getIndentLevel(); - if (indentLevel == 0) { - // - - // Add newline when there is no indent - replace = formatterDocument.getLineDelimiter(); - } else { - // \n - // - // Add newline with indent according to indent level - replaceLeftSpacesWithIndentation(indentLevel, startTagOpen, startTagClose, true, edits); - return; - } - } else if (shouldFormatClosingBracketNewLine(element)) { - int indentLevel = parentConstraints.getIndentLevel(); - replaceLeftSpacesWithIndentation( - indentLevel + getSplitAttributesIndentSize(), startTagOpen, startTagClose, true, edits); - return; - } - if (element.isSelfClosed()) { - if (spaceBeforeEmptyCloseTag) { - // --> - replace = replace + " "; - } - } - // remove spaces from the offset of start tag and start tag close - // --> - // --> - replaceLeftSpacesWith(startTagOpen, startTagClose, replace, edits); - } - - private int formatEndTagElement( - DOMElement element, - XMLFormattingConstraints parentConstraints, - XMLFormattingConstraints constraints, - List edits) { - // 1) remove / add some spaces on the left of the end tag element - // before formatting : [space][space] - // after formatting : - int indentLevel = parentConstraints.getIndentLevel(); - FormatElementCategory formatElementCategory = constraints.getFormatElementCategory(); - int endTagOffset = element.getEndTagOpenOffset(); - - switch (formatElementCategory) { - case PreserveSpace: - // Preserve existing spaces - break; - case MixedContent: - // Remove spaces and indent if the last child is an element, not text - // before formatting: example text - // after formatting: example text \n - if (element.getLastChild().isElement() - && Character.isWhitespace(formatterDocument.getText().charAt(endTagOffset - 1))) { - replaceLeftSpacesWithIndentation( - indentLevel, element.getStartTagCloseOffset(), endTagOffset, true, edits); - } - break; - case IgnoreSpace: - // If preserve new lines - int preservedNewLines = getPreservedNewlines(); - int currentNewLineCount = - getExistingNewLineCount( - formatterDocument.getText(), endTagOffset, formatterDocument.getLineDelimiter()); - if (currentNewLineCount > preservedNewLines) { - replaceLeftSpacesWithIndentationWithMultiNewLines( - indentLevel, - element.getStartTagCloseOffset(), - endTagOffset, - preservedNewLines + 1, - edits); - } else { - // remove spaces and indent - replaceLeftSpacesWithIndentation( - indentLevel, element.getStartTagCloseOffset(), endTagOffset, true, edits); - break; - } - case NormalizeSpace: - break; - } - // 2) remove some spaces between the end tag and and close bracket - // before formatting : - // after formatting : - if (element.isEndTagClosed()) { - int endTagCloseOffset = element.getEndTagCloseOffset(); - removeLeftSpaces(element.getEndTagOpenOffset(), endTagCloseOffset, edits); - } - return 0; - } - - /** - * Return the number of new lines in the whitespaces to the left of the given offset. - * - * @param text the xml text. - * @param offset the offset to begin the count from. - * @param delimiter the delimiter. - * @return the number of new lines in the whitespaces to the left of the given offset. - */ - private int getExistingNewLineCount(String text, int offset, String delimiter) { - boolean delimiterHasTwoCharacters = delimiter.length() == 2; - int newLineCounter = 0; - for (int i = offset; i > 0; i--) { - String c; - if (!Character.isWhitespace(text.charAt(i - 1))) { - if (!delimiterHasTwoCharacters) { - c = String.valueOf(text.charAt(i)); - if (delimiter.equals(c)) { - newLineCounter++; - } - } - return newLineCounter; - } - if (delimiterHasTwoCharacters) { - c = text.substring(i - 2, i); - if (delimiter.equals(c)) { - newLineCounter++; - i--; // skip the second char of the delimiter - } - } else { - c = String.valueOf(text.charAt(i)); - if (delimiter.equals(c)) { - newLineCounter++; - } - } - } - return newLineCounter; - } - - /** - * Return the option to use to generate empty elements. - * - * @param element the DOM element - * @return the option to use to generate empty elements. - */ - private EmptyElements getEmptyElements(DOMElement element) { - EmptyElements emptyElements = getEmptyElements(); - if (emptyElements != EmptyElements.Ignore) { - if (element.isClosed() && element.isEmpty()) { - // Element is empty and closed - switch (emptyElements) { - case Expand: - case Collapse: - { - if (isPreserveEmptyContent()) { - // preserve content - if (element.hasChildNodes()) { - // The element is empty and contains somes spaces which must be preserved - return EmptyElements.Ignore; - } - } - return emptyElements; - } - default: - return emptyElements; - } - } - } - return EmptyElements.Ignore; - } - - /** - * Return true if conditions are met to format according to the closingBracketNewLine setting. - * - *

1. splitAttribute must be set to true 2. there must be at least 2 attributes in the element - * - * @param element the DOM element - * @return true if should format according to closingBracketNewLine setting. - */ - private boolean shouldFormatClosingBracketNewLine(DOMElement element) { - boolean isSingleAttribute = - element.getAttributeNodes() == null || element.getAttributeNodes().size() == 1; - return (formatterDocument.getSharedSettings().getFormattingOptions().isClosingBracketNewLine() - && isSplitAttributes() - && !isSingleAttribute); - } - - private void replaceLeftSpacesWith(int from, int to, String replace, List edits) { - formatterDocument.replaceLeftSpacesWith(from, to, replace, edits); - } - - private int replaceLeftSpacesWithIndentation( - int indentLevel, int from, int to, boolean addLineSeparator, List edits) { - return formatterDocument.replaceLeftSpacesWithIndentation( - indentLevel, from, to, addLineSeparator, edits); - } - - private int replaceLeftSpacesWithIndentationWithMultiNewLines( - int indentLevel, int from, int to, int newLineCount, List edits) { - return formatterDocument.replaceLeftSpacesWithIndentationWithMultiNewLines( - indentLevel, from, to, newLineCount, edits); - } - - private void removeLeftSpaces(int from, int to, List edits) { - formatterDocument.removeLeftSpaces(from, to, edits); - } - - private void createTextEditIfNeeded( - int from, int to, String expectedContent, List edits) { - formatterDocument.createTextEditIfNeeded(from, to, expectedContent, edits); - } - - /** - * Returns true if the DOM document have some line break in the given range [from, to] and false - * otherwise. - * - * @param from the from offset range. - * @param to the to offset range. - * @return true if the DOM document have some line break in the given range [from, to] and false - * otherwise. - */ - private boolean hasLineBreak(int from, int to) { - return formatterDocument.hasLineBreak(from, to); - } - - /** - * Returns the last attribute of the given DOMelement and null otherwise. - * - * @param element the DOM element. - * @return the last attribute of the given DOMelement and null otherwise. - */ - private static DOMAttr getLastAttribute(DOMElement element) { - if (!element.hasAttributes()) { - return null; - } - List attributes = element.getAttributeNodes(); - return attributes.get(attributes.size() - 1); - } - - private int getPreservedNewlines() { - return formatterDocument.getSharedSettings().getFormattingOptions().getPreservedNewLines(); - } - - private boolean isPreserveAttributeLineBreaks() { - return formatterDocument - .getSharedSettings() - .getFormattingOptions() - .isPreserveAttributeLineBreaks(); - } - - private boolean isSplitAttributes() { - return formatterDocument.getSharedSettings().getFormattingOptions().isSplitAttributes(); - } - - private int getSplitAttributesIndentSize() { - return formatterDocument - .getSharedSettings() - .getFormattingOptions() - .getSplitAttributesIndentSize(); - } - - private boolean isSpaceBeforeEmptyCloseTag() { - return formatterDocument - .getSharedSettings() - .getFormattingOptions() - .isSpaceBeforeEmptyCloseTag(); - } - - private EmptyElements getEmptyElements() { - return formatterDocument.getSharedSettings().getFormattingOptions().getEmptyElementsBehavior(); - } - - private boolean isPreserveEmptyContent() { - return formatterDocument.getSharedSettings().getFormattingOptions().isPreserveEmptyContent(); - } - - private void formatChildren( - DOMElement element, - XMLFormattingConstraints constraints, - int start, - int end, - List edits) { - formatterDocument.formatChildren(element, constraints, start, end, edits); - } - - private FormatElementCategory getFormatElementCategory( - DOMElement element, XMLFormattingConstraints parentConstraints) { - return formatterDocument.getFormatElementCategory(element, parentConstraints); - } - - private int getMaxLineWidth() { - return formatterDocument.getMaxLineWidth(); - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +/******************************************************************************* + * Copyright (c) 2022 Red Hat Inc. and others. + * All rights reserved. This program and the accompanying materials + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat Inc. - initial API and implementation + *******************************************************************************/ +package org.appdevforall.codeonthego.lsp.xml.providers.format; + +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import java.util.List; +import org.eclipse.lemminx.commons.BadLocationException; +import org.eclipse.lemminx.dom.DOMAttr; +import org.eclipse.lemminx.dom.DOMElement; +import org.eclipse.lemminx.dom.builder.EmptyElements; +import org.eclipse.lemminx.utils.StringUtils; + +/** + * DOM element formatter. + * + * @author Angelo ZERR + */ +public class DOMElementFormatter { + + private final XMLFormatterDocumentNew formatterDocument; + + private final DOMAttributeFormatter attributeFormatter; + + public DOMElementFormatter( + XMLFormatterDocumentNew formatterDocument, DOMAttributeFormatter attributeFormatter) { + this.formatterDocument = formatterDocument; + this.attributeFormatter = attributeFormatter; + } + + public void formatElement( + DOMElement element, + XMLFormattingConstraints parentConstraints, + int start, + int end, + List edits) { + EmptyElements emptyElements = getEmptyElements(element); + + // Format start tag element with proper indentation + int indentLevel = parentConstraints.getIndentLevel(); + int nb = formatStartTagElement(element, parentConstraints, emptyElements, end, edits); + + if (emptyElements == EmptyElements.Ignore) { + // Format children of the element + XMLFormattingConstraints constraints = new XMLFormattingConstraints(); + constraints.copyConstraints(parentConstraints); + if ((element.isClosed())) { + constraints.setIndentLevel(indentLevel + 1); + } + constraints.setFormatElementCategory(getFormatElementCategory(element, parentConstraints)); + constraints.setAvailableLineWidth(getMaxLineWidth() - nb); + + formatChildren(element, constraints, start, end, edits); + + // Format end tag element with proper indentation + if (element.hasEndTag()) { + formatEndTagElement(element, parentConstraints, constraints, edits); + } + } + } + + private int formatStartTagElement( + DOMElement element, + XMLFormattingConstraints parentConstraints, + EmptyElements emptyElements, + int end, + List edits) { + if (!element.hasStartTag()) { + // ex : example text + // after formatting: \n example text + int parentStartCloseOffset = element.getParentElement().getStartTagCloseOffset() + 1; + if (parentStartCloseOffset != startTagOffset + && StringUtils.isWhitespace( + formatterDocument.getText(), parentStartCloseOffset, startTagOffset)) { + int nbSpaces = + replaceLeftSpacesWithIndentation( + indentLevel, parentStartCloseOffset, startTagOffset, !addLineSeparator, edits); + width = nbSpaces + element.getStartTagCloseOffset() - startTagOffset; + } + break; + case IgnoreSpace: + // If preserve new lines + int preservedNewLines = getPreservedNewlines(); + int currentNewLineCount = + getExistingNewLineCount( + formatterDocument.getText(), startTagOffset, formatterDocument.getLineDelimiter()); + if (currentNewLineCount > preservedNewLines) { + replaceLeftSpacesWithIndentationWithMultiNewLines( + indentLevel, 0, startTagOffset, preservedNewLines + 1, edits); + } else { + // remove spaces and indent + int nbSpaces = + replaceLeftSpacesWithIndentation( + indentLevel, 0, startTagOffset, !addLineSeparator, edits); + width = nbSpaces + element.getStartTagCloseOffset() - startTagOffset; + } + case NormalizeSpace: + break; + } + + if (formatElementCategory != FormatElementCategory.PreserveSpace) { + formatAttributes(element, parentConstraints, edits); + + boolean formatted = false; + switch (emptyElements) { + case Expand: + { + if (element.isSelfClosed()) { + // Expand empty element: -> + StringBuilder tag = new StringBuilder(); + tag.append(">"); + tag.append("'); + // get the from offset: + // - + // - + int from = getOffsetAfterStartTagOrLastAttribute(element); + // get the to offset: + // - | + // - | + int to = element.getEnd(); + // replace with > + // - + // - + createTextEditIfNeeded(from, to, tag.toString(), edits); + formatted = true; + } + break; + } + case Collapse: + { + // Collapse empty element: -> + if (!element.isSelfClosed() && (end == -1 || element.getEndTagOpenOffset() + 1 < end)) { + // Do not Collapse if range is does not cover the element + StringBuilder tag = new StringBuilder(); + if (isSpaceBeforeEmptyCloseTag()) { + tag.append(" "); + } + tag.append("/>"); + // get the from offset: + // - + // - + int from = getOffsetAfterStartTagOrLastAttribute(element); + // get the to offset: + // - | + // - | + int to = element.getEnd(); + // replace with /> + // - + // - + createTextEditIfNeeded(from, to, tag.toString(), edits); + formatted = true; + } + break; + } + default: + } + + if (!formatted) { + if (element.isStartTagClosed() || element.isSelfClosed()) { + formatElementStartTagOrSelfClosed(element, parentConstraints, edits); + } + } + } + return width; + } + + private static int getOffsetAfterStartTagOrLastAttribute(DOMElement element) { + DOMAttr attr = getLastAttribute(element); + if (attr != null) { + return attr.getEnd(); + } + return element.getOffsetAfterStartTag(); + } + + private int formatAttributes( + DOMElement element, XMLFormattingConstraints parentConstraints, List edits) { + if (element.hasAttributes()) { + List attributes = element.getAttributeNodes(); + // initialize the previous offset with the start tag: + // . + int prevOffset = element.getOffsetAfterStartTag(); + boolean singleAttribute = attributes.size() == 1; + for (DOMAttr attr : attributes) { + // Format current attribute + attributeFormatter.formatAttribute( + attr, prevOffset, singleAttribute, true, parentConstraints, edits); + // set the previous offset with end of the current attribute: + // ) according to {@code + * XMLFormattingOptions#isPreserveAttrLineBreaks()} + * + *

{@code XMLFormattingOptions#isPreserveAttrLineBreaks()}: If true, must add a newline + + * indent before the closing bracket if the last attribute of the element and the closing bracket + * are in different lines. + * + * @param element + * @throws BadLocationException + */ + private void formatElementStartTagOrSelfClosed( + DOMElement element, XMLFormattingConstraints parentConstraints, List edits) { + // + // + int startTagClose = element.getOffsetBeforeCloseOfStartTag(); + // + // + int startTagOpen = element.getOffsetAfterStartTag(); + String replace = ""; + boolean spaceBeforeEmptyCloseTag = isSpaceBeforeEmptyCloseTag(); + if (isPreserveAttributeLineBreaks() + && element.hasAttributes() + && hasLineBreak(getLastAttribute(element).getEnd(), startTagClose)) { + spaceBeforeEmptyCloseTag = false; + int indentLevel = parentConstraints.getIndentLevel(); + if (indentLevel == 0) { + // + + // Add newline when there is no indent + replace = formatterDocument.getLineDelimiter(); + } else { + // \n + // + // Add newline with indent according to indent level + replaceLeftSpacesWithIndentation(indentLevel, startTagOpen, startTagClose, true, edits); + return; + } + } else if (shouldFormatClosingBracketNewLine(element)) { + int indentLevel = parentConstraints.getIndentLevel(); + replaceLeftSpacesWithIndentation( + indentLevel + getSplitAttributesIndentSize(), startTagOpen, startTagClose, true, edits); + return; + } + if (element.isSelfClosed()) { + if (spaceBeforeEmptyCloseTag) { + // --> + replace = replace + " "; + } + } + // remove spaces from the offset of start tag and start tag close + // --> + // --> + replaceLeftSpacesWith(startTagOpen, startTagClose, replace, edits); + } + + private int formatEndTagElement( + DOMElement element, + XMLFormattingConstraints parentConstraints, + XMLFormattingConstraints constraints, + List edits) { + // 1) remove / add some spaces on the left of the end tag element + // before formatting : [space][space] + // after formatting : + int indentLevel = parentConstraints.getIndentLevel(); + FormatElementCategory formatElementCategory = constraints.getFormatElementCategory(); + int endTagOffset = element.getEndTagOpenOffset(); + + switch (formatElementCategory) { + case PreserveSpace: + // Preserve existing spaces + break; + case MixedContent: + // Remove spaces and indent if the last child is an element, not text + // before formatting: example text + // after formatting: example text \n + if (element.getLastChild().isElement() + && Character.isWhitespace(formatterDocument.getText().charAt(endTagOffset - 1))) { + replaceLeftSpacesWithIndentation( + indentLevel, element.getStartTagCloseOffset(), endTagOffset, true, edits); + } + break; + case IgnoreSpace: + // If preserve new lines + int preservedNewLines = getPreservedNewlines(); + int currentNewLineCount = + getExistingNewLineCount( + formatterDocument.getText(), endTagOffset, formatterDocument.getLineDelimiter()); + if (currentNewLineCount > preservedNewLines) { + replaceLeftSpacesWithIndentationWithMultiNewLines( + indentLevel, + element.getStartTagCloseOffset(), + endTagOffset, + preservedNewLines + 1, + edits); + } else { + // remove spaces and indent + replaceLeftSpacesWithIndentation( + indentLevel, element.getStartTagCloseOffset(), endTagOffset, true, edits); + break; + } + case NormalizeSpace: + break; + } + // 2) remove some spaces between the end tag and and close bracket + // before formatting : + // after formatting : + if (element.isEndTagClosed()) { + int endTagCloseOffset = element.getEndTagCloseOffset(); + removeLeftSpaces(element.getEndTagOpenOffset(), endTagCloseOffset, edits); + } + return 0; + } + + /** + * Return the number of new lines in the whitespaces to the left of the given offset. + * + * @param text the xml text. + * @param offset the offset to begin the count from. + * @param delimiter the delimiter. + * @return the number of new lines in the whitespaces to the left of the given offset. + */ + private int getExistingNewLineCount(String text, int offset, String delimiter) { + boolean delimiterHasTwoCharacters = delimiter.length() == 2; + int newLineCounter = 0; + for (int i = offset; i > 0; i--) { + String c; + if (!Character.isWhitespace(text.charAt(i - 1))) { + if (!delimiterHasTwoCharacters) { + c = String.valueOf(text.charAt(i)); + if (delimiter.equals(c)) { + newLineCounter++; + } + } + return newLineCounter; + } + if (delimiterHasTwoCharacters) { + c = text.substring(i - 2, i); + if (delimiter.equals(c)) { + newLineCounter++; + i--; // skip the second char of the delimiter + } + } else { + c = String.valueOf(text.charAt(i)); + if (delimiter.equals(c)) { + newLineCounter++; + } + } + } + return newLineCounter; + } + + /** + * Return the option to use to generate empty elements. + * + * @param element the DOM element + * @return the option to use to generate empty elements. + */ + private EmptyElements getEmptyElements(DOMElement element) { + EmptyElements emptyElements = getEmptyElements(); + if (emptyElements != EmptyElements.Ignore) { + if (element.isClosed() && element.isEmpty()) { + // Element is empty and closed + switch (emptyElements) { + case Expand: + case Collapse: + { + if (isPreserveEmptyContent()) { + // preserve content + if (element.hasChildNodes()) { + // The element is empty and contains somes spaces which must be preserved + return EmptyElements.Ignore; + } + } + return emptyElements; + } + default: + return emptyElements; + } + } + } + return EmptyElements.Ignore; + } + + /** + * Return true if conditions are met to format according to the closingBracketNewLine setting. + * + *

1. splitAttribute must be set to true 2. there must be at least 2 attributes in the element + * + * @param element the DOM element + * @return true if should format according to closingBracketNewLine setting. + */ + private boolean shouldFormatClosingBracketNewLine(DOMElement element) { + boolean isSingleAttribute = + element.getAttributeNodes() == null || element.getAttributeNodes().size() == 1; + return (formatterDocument.getSharedSettings().getFormattingOptions().isClosingBracketNewLine() + && isSplitAttributes() + && !isSingleAttribute); + } + + private void replaceLeftSpacesWith(int from, int to, String replace, List edits) { + formatterDocument.replaceLeftSpacesWith(from, to, replace, edits); + } + + private int replaceLeftSpacesWithIndentation( + int indentLevel, int from, int to, boolean addLineSeparator, List edits) { + return formatterDocument.replaceLeftSpacesWithIndentation( + indentLevel, from, to, addLineSeparator, edits); + } + + private int replaceLeftSpacesWithIndentationWithMultiNewLines( + int indentLevel, int from, int to, int newLineCount, List edits) { + return formatterDocument.replaceLeftSpacesWithIndentationWithMultiNewLines( + indentLevel, from, to, newLineCount, edits); + } + + private void removeLeftSpaces(int from, int to, List edits) { + formatterDocument.removeLeftSpaces(from, to, edits); + } + + private void createTextEditIfNeeded( + int from, int to, String expectedContent, List edits) { + formatterDocument.createTextEditIfNeeded(from, to, expectedContent, edits); + } + + /** + * Returns true if the DOM document have some line break in the given range [from, to] and false + * otherwise. + * + * @param from the from offset range. + * @param to the to offset range. + * @return true if the DOM document have some line break in the given range [from, to] and false + * otherwise. + */ + private boolean hasLineBreak(int from, int to) { + return formatterDocument.hasLineBreak(from, to); + } + + /** + * Returns the last attribute of the given DOMelement and null otherwise. + * + * @param element the DOM element. + * @return the last attribute of the given DOMelement and null otherwise. + */ + private static DOMAttr getLastAttribute(DOMElement element) { + if (!element.hasAttributes()) { + return null; + } + List attributes = element.getAttributeNodes(); + return attributes.get(attributes.size() - 1); + } + + private int getPreservedNewlines() { + return formatterDocument.getSharedSettings().getFormattingOptions().getPreservedNewLines(); + } + + private boolean isPreserveAttributeLineBreaks() { + return formatterDocument + .getSharedSettings() + .getFormattingOptions() + .isPreserveAttributeLineBreaks(); + } + + private boolean isSplitAttributes() { + return formatterDocument.getSharedSettings().getFormattingOptions().isSplitAttributes(); + } + + private int getSplitAttributesIndentSize() { + return formatterDocument + .getSharedSettings() + .getFormattingOptions() + .getSplitAttributesIndentSize(); + } + + private boolean isSpaceBeforeEmptyCloseTag() { + return formatterDocument + .getSharedSettings() + .getFormattingOptions() + .isSpaceBeforeEmptyCloseTag(); + } + + private EmptyElements getEmptyElements() { + return formatterDocument.getSharedSettings().getFormattingOptions().getEmptyElementsBehavior(); + } + + private boolean isPreserveEmptyContent() { + return formatterDocument.getSharedSettings().getFormattingOptions().isPreserveEmptyContent(); + } + + private void formatChildren( + DOMElement element, + XMLFormattingConstraints constraints, + int start, + int end, + List edits) { + formatterDocument.formatChildren(element, constraints, start, end, edits); + } + + private FormatElementCategory getFormatElementCategory( + DOMElement element, XMLFormattingConstraints parentConstraints) { + return formatterDocument.getFormatElementCategory(element, parentConstraints); + } + + private int getMaxLineWidth() { + return formatterDocument.getMaxLineWidth(); + } +} diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMProcessingInstructionFormatter.java b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMProcessingInstructionFormatter.java similarity index 94% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMProcessingInstructionFormatter.java rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMProcessingInstructionFormatter.java index 9f364f5d08..0b744e66ba 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMProcessingInstructionFormatter.java +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMProcessingInstructionFormatter.java @@ -1,88 +1,88 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -/******************************************************************************* - * Copyright (c) 2022 Red Hat Inc. and others. - * All rights reserved. This program and the accompanying materials - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v20.html - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat Inc. - initial API and implementation - *******************************************************************************/ -package com.itsaky.androidide.lsp.xml.providers.format; - -import com.itsaky.androidide.lsp.models.TextEdit; -import java.util.List; -import org.eclipse.lemminx.dom.DOMAttr; -import org.eclipse.lemminx.dom.DOMProcessingInstruction; - -/** - * DOM processing instruction formatter. - * - * @author Angelo ZERR - */ -public class DOMProcessingInstructionFormatter { - - private final XMLFormatterDocumentNew formatterDocument; - - private final DOMAttributeFormatter attributeFormatter; - - public DOMProcessingInstructionFormatter( - XMLFormatterDocumentNew formatterDocument, DOMAttributeFormatter attributeFormatter) { - this.formatterDocument = formatterDocument; - this.attributeFormatter = attributeFormatter; - } - - public void formatProcessingInstruction( - DOMProcessingInstruction processingInstruction, - XMLFormattingConstraints parentConstraints, - List edits) { - int prevOffset = processingInstruction.getStartContent(); - // 1. format attributes : attributes must be in a same line separate with only - // one space - if (processingInstruction.hasAttributes()) { - // --- - // --> - List attributes = processingInstruction.getAttributeNodes(); - boolean singleAttribute = attributes.size() == 1; - for (DOMAttr attr : attributes) { - attributeFormatter.formatAttribute( - attr, prevOffset, singleAttribute, false, parentConstraints, edits); - prevOffset = attr.getEnd(); - } - } - // 2. format end of processing instruction : remove extra space between the last - // attribute value and the end of processing instruction - // --- - // --> - if (processingInstruction.isClosed()) { - // it ends with ?> - int endPIOffset = processingInstruction.getEnd() - 2; - if (prevOffset != endPIOffset) { - replaceLeftSpacesWith(prevOffset, endPIOffset, "", edits); - } - } - } - - private void replaceLeftSpacesWith( - int leftLimit, int to, String replacement, List edits) { - formatterDocument.replaceLeftSpacesWith(leftLimit, to, replacement, edits); - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +/******************************************************************************* + * Copyright (c) 2022 Red Hat Inc. and others. + * All rights reserved. This program and the accompanying materials + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat Inc. - initial API and implementation + *******************************************************************************/ +package org.appdevforall.codeonthego.lsp.xml.providers.format; + +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import java.util.List; +import org.eclipse.lemminx.dom.DOMAttr; +import org.eclipse.lemminx.dom.DOMProcessingInstruction; + +/** + * DOM processing instruction formatter. + * + * @author Angelo ZERR + */ +public class DOMProcessingInstructionFormatter { + + private final XMLFormatterDocumentNew formatterDocument; + + private final DOMAttributeFormatter attributeFormatter; + + public DOMProcessingInstructionFormatter( + XMLFormatterDocumentNew formatterDocument, DOMAttributeFormatter attributeFormatter) { + this.formatterDocument = formatterDocument; + this.attributeFormatter = attributeFormatter; + } + + public void formatProcessingInstruction( + DOMProcessingInstruction processingInstruction, + XMLFormattingConstraints parentConstraints, + List edits) { + int prevOffset = processingInstruction.getStartContent(); + // 1. format attributes : attributes must be in a same line separate with only + // one space + if (processingInstruction.hasAttributes()) { + // --- + // --> + List attributes = processingInstruction.getAttributeNodes(); + boolean singleAttribute = attributes.size() == 1; + for (DOMAttr attr : attributes) { + attributeFormatter.formatAttribute( + attr, prevOffset, singleAttribute, false, parentConstraints, edits); + prevOffset = attr.getEnd(); + } + } + // 2. format end of processing instruction : remove extra space between the last + // attribute value and the end of processing instruction + // --- + // --> + if (processingInstruction.isClosed()) { + // it ends with ?> + int endPIOffset = processingInstruction.getEnd() - 2; + if (prevOffset != endPIOffset) { + replaceLeftSpacesWith(prevOffset, endPIOffset, "", edits); + } + } + } + + private void replaceLeftSpacesWith( + int leftLimit, int to, String replacement, List edits) { + formatterDocument.replaceLeftSpacesWith(leftLimit, to, replacement, edits); + } +} diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMTextFormatter.java b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMTextFormatter.java similarity index 95% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMTextFormatter.java rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMTextFormatter.java index 30ff4365f0..49fc757bdd 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/DOMTextFormatter.java +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/DOMTextFormatter.java @@ -1,134 +1,134 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -/******************************************************************************* - * Copyright (c) 2022 Red Hat Inc. and others. - * All rights reserved. This program and the accompanying materials - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v20.html - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat Inc. - initial API and implementation - *******************************************************************************/ -package com.itsaky.androidide.lsp.xml.providers.format; - -import com.itsaky.androidide.lsp.models.TextEdit; -import java.util.List; -import org.eclipse.lemminx.dom.DOMText; - -/** - * DOM text formatter. - * - * @author Angelo ZERR - */ -public class DOMTextFormatter { - - private final XMLFormatterDocumentNew formatterDocument; - - public DOMTextFormatter(XMLFormatterDocumentNew formatterDocument) { - this.formatterDocument = formatterDocument; - } - - public void formatText( - DOMText textNode, XMLFormattingConstraints parentConstraints, List edits) { - // Don't format the spacing in text for case of preserve empty content setting - if (isPreserveEmptyContent()) { - return; - } - FormatElementCategory formatElementCategory = parentConstraints.getFormatElementCategory(); - String text = formatterDocument.getText(); - int availableLineWidth = parentConstraints.getAvailableLineWidth(); - - int spaceStart = -1; - int spaceEnd = -1; - boolean containsNewLine = false; - - for (int i = textNode.getStart(); i < textNode.getEnd(); i++) { - char c = text.charAt(i); - if (Character.isWhitespace(c)) { - // Whitespaces... - if (isLineSeparator(c)) { - containsNewLine = true; - } - if (spaceStart == -1) { - spaceStart = i; - } else { - spaceEnd = i; - } - } else { - // Text content... - int contentStart = i; - while (i < textNode.getEnd() + 1 && !Character.isWhitespace(text.charAt(i + 1))) { - i++; - } - - int contentEnd = i; - availableLineWidth -= (contentEnd - contentStart); - - if (formatElementCategory != FormatElementCategory.PreserveSpace - && formatElementCategory != FormatElementCategory.IgnoreSpace) { - if (availableLineWidth <= 0) { - if (spaceStart != -1) { - insertLineBreak(spaceStart, contentStart, edits); - availableLineWidth = getMaxLineWidth(); - } - } else if (isJoinContentLines() - || (spaceStart == textNode.getStart() || !containsNewLine)) { - // Case of isJoinContent == true: join all text content with single space - // Case of isJoinContent == false: normalize space only between element start - // tag and start of text content or doesn't contain a new line - replaceSpacesWithOneSpace(spaceStart, spaceEnd, edits); - containsNewLine = false; - } - } - - spaceStart = -1; - spaceEnd = -1; - } - } - if (formatElementCategory != FormatElementCategory.PreserveSpace - && formatElementCategory != FormatElementCategory.IgnoreSpace) { - replaceSpacesWithOneSpace(spaceStart, spaceEnd, edits); - } - } - - private static boolean isLineSeparator(char c) { - return c == '\r' || c == '\n'; - } - - private int getMaxLineWidth() { - return formatterDocument.getMaxLineWidth(); - } - - private void insertLineBreak(int start, int end, List edits) { - formatterDocument.insertLineBreak(start, end, edits); - } - - private boolean isPreserveEmptyContent() { - return formatterDocument.getSharedSettings().getFormattingOptions().isPreserveEmptyContent(); - } - - private void replaceSpacesWithOneSpace(int spaceStart, int spaceEnd, List edits) { - formatterDocument.replaceSpacesWithOneSpace(spaceStart, spaceEnd, edits); - } - - private boolean isJoinContentLines() { - return formatterDocument.getSharedSettings().getFormattingOptions().isJoinContentLines(); - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +/******************************************************************************* + * Copyright (c) 2022 Red Hat Inc. and others. + * All rights reserved. This program and the accompanying materials + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat Inc. - initial API and implementation + *******************************************************************************/ +package org.appdevforall.codeonthego.lsp.xml.providers.format; + +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import java.util.List; +import org.eclipse.lemminx.dom.DOMText; + +/** + * DOM text formatter. + * + * @author Angelo ZERR + */ +public class DOMTextFormatter { + + private final XMLFormatterDocumentNew formatterDocument; + + public DOMTextFormatter(XMLFormatterDocumentNew formatterDocument) { + this.formatterDocument = formatterDocument; + } + + public void formatText( + DOMText textNode, XMLFormattingConstraints parentConstraints, List edits) { + // Don't format the spacing in text for case of preserve empty content setting + if (isPreserveEmptyContent()) { + return; + } + FormatElementCategory formatElementCategory = parentConstraints.getFormatElementCategory(); + String text = formatterDocument.getText(); + int availableLineWidth = parentConstraints.getAvailableLineWidth(); + + int spaceStart = -1; + int spaceEnd = -1; + boolean containsNewLine = false; + + for (int i = textNode.getStart(); i < textNode.getEnd(); i++) { + char c = text.charAt(i); + if (Character.isWhitespace(c)) { + // Whitespaces... + if (isLineSeparator(c)) { + containsNewLine = true; + } + if (spaceStart == -1) { + spaceStart = i; + } else { + spaceEnd = i; + } + } else { + // Text content... + int contentStart = i; + while (i < textNode.getEnd() + 1 && !Character.isWhitespace(text.charAt(i + 1))) { + i++; + } + + int contentEnd = i; + availableLineWidth -= (contentEnd - contentStart); + + if (formatElementCategory != FormatElementCategory.PreserveSpace + && formatElementCategory != FormatElementCategory.IgnoreSpace) { + if (availableLineWidth <= 0) { + if (spaceStart != -1) { + insertLineBreak(spaceStart, contentStart, edits); + availableLineWidth = getMaxLineWidth(); + } + } else if (isJoinContentLines() + || (spaceStart == textNode.getStart() || !containsNewLine)) { + // Case of isJoinContent == true: join all text content with single space + // Case of isJoinContent == false: normalize space only between element start + // tag and start of text content or doesn't contain a new line + replaceSpacesWithOneSpace(spaceStart, spaceEnd, edits); + containsNewLine = false; + } + } + + spaceStart = -1; + spaceEnd = -1; + } + } + if (formatElementCategory != FormatElementCategory.PreserveSpace + && formatElementCategory != FormatElementCategory.IgnoreSpace) { + replaceSpacesWithOneSpace(spaceStart, spaceEnd, edits); + } + } + + private static boolean isLineSeparator(char c) { + return c == '\r' || c == '\n'; + } + + private int getMaxLineWidth() { + return formatterDocument.getMaxLineWidth(); + } + + private void insertLineBreak(int start, int end, List edits) { + formatterDocument.insertLineBreak(start, end, edits); + } + + private boolean isPreserveEmptyContent() { + return formatterDocument.getSharedSettings().getFormattingOptions().isPreserveEmptyContent(); + } + + private void replaceSpacesWithOneSpace(int spaceStart, int spaceEnd, List edits) { + formatterDocument.replaceSpacesWithOneSpace(spaceStart, spaceEnd, edits); + } + + private boolean isJoinContentLines() { + return formatterDocument.getSharedSettings().getFormattingOptions().isJoinContentLines(); + } +} diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/FormatElementCategory.java b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/FormatElementCategory.java similarity index 95% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/FormatElementCategory.java rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/FormatElementCategory.java index 21d7ef613b..9c32592fdf 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/FormatElementCategory.java +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/FormatElementCategory.java @@ -1,74 +1,74 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -/******************************************************************************* -* Copyright (c) 2022 Red Hat Inc. and others. -* All rights reserved. This program and the accompanying materials -* which accompanies this distribution, and is available at -* http://www.eclipse.org/legal/epl-v20.html -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* Red Hat Inc. - initial API and implementation -*******************************************************************************/ -package com.itsaky.androidide.lsp.xml.providers.format; - -/** - * Format element catagory. - * - * @author Angelo ZERR - * - * @see https://www.oxygenxml.com/doc/versions/24.0/ug-editorEclipse/topics/format-and-indent-xml.html - */ -public enum FormatElementCategory { - - /** - * In the Ignore space category, all whitespace is considered insignificant. - * This generally applies to content that consists only of elements nested - * inside other elements, with no text content. - */ - IgnoreSpace, - - /** - * In the normalize space category, a single whitespace character between - * character strings is considered significant and all other spaces are - * considered insignificant. Therefore, all consecutive whitespaces will be - * replaced with a single space. This generally applies to elements that contain - * text content only. - */ - NormalizeSpace, - - /** - * In the mixed content category, a single whitespace between text characters is - * considered significant and all other spaces are considered insignificant. - */ - MixedContent, - - /** - * In the preserve space category, all whitespace in the element is regarded as - * significant. No changes are made to the spaces in elements in this category. - * However, child elements may be in another category, and may be treated - * differently. - * - * Attribute values are always in the preserve space category. The spaces - * between attributes in an element tag are always in the default space - * category. - * - */ - PreserveSpace -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +/******************************************************************************* +* Copyright (c) 2022 Red Hat Inc. and others. +* All rights reserved. This program and the accompanying materials +* which accompanies this distribution, and is available at +* http://www.eclipse.org/legal/epl-v20.html +* +* SPDX-License-Identifier: EPL-2.0 +* +* Contributors: +* Red Hat Inc. - initial API and implementation +*******************************************************************************/ +package org.appdevforall.codeonthego.lsp.xml.providers.format; + +/** + * Format element catagory. + * + * @author Angelo ZERR + * + * @see https://www.oxygenxml.com/doc/versions/24.0/ug-editorEclipse/topics/format-and-indent-xml.html + */ +public enum FormatElementCategory { + + /** + * In the Ignore space category, all whitespace is considered insignificant. + * This generally applies to content that consists only of elements nested + * inside other elements, with no text content. + */ + IgnoreSpace, + + /** + * In the normalize space category, a single whitespace character between + * character strings is considered significant and all other spaces are + * considered insignificant. Therefore, all consecutive whitespaces will be + * replaced with a single space. This generally applies to elements that contain + * text content only. + */ + NormalizeSpace, + + /** + * In the mixed content category, a single whitespace between text characters is + * considered significant and all other spaces are considered insignificant. + */ + MixedContent, + + /** + * In the preserve space category, all whitespace in the element is regarded as + * significant. No changes are made to the spaces in elements in this category. + * However, child elements may be in another category, and may be treated + * differently. + * + * Attribute values are always in the preserve space category. The spaces + * between attributes in an element tag are always in the default space + * category. + * + */ + PreserveSpace +} diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/TextEditUtils.java b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/TextEditUtils.java similarity index 94% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/TextEditUtils.java rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/TextEditUtils.java index 9d387eaaab..720e12ffa1 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/TextEditUtils.java +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/TextEditUtils.java @@ -1,202 +1,202 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -/******************************************************************************* - * Copyright (c) 2022 Red Hat Inc. and others. - * All rights reserved. This program and the accompanying materials - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v20.html - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat Inc. - initial API and implementation - *******************************************************************************/ -package com.itsaky.androidide.lsp.xml.providers.format; - -import com.itsaky.androidide.lsp.models.TextEdit; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.stream.Collectors; -import org.eclipse.lemminx.commons.BadLocationException; -import org.eclipse.lemminx.commons.TextDocument; - -/** - * Utilities for {@link TextEdit}. - * - * @author Angelo ZERR - */ -public class TextEditUtils { - - private static final Logger LOGGER = Logger.getLogger(TextEditUtils.class.getName()); - - /** - * Returns the {@link TextEdit} to insert the given expected content from the given range (from, - * to) of the given text document and null otherwise. - * - * @param from the range from. - * @param to the range to. - * @param expectedContent the expected content. - * @param textDocument the text document. - * @return the {@link TextEdit} to insert the given expected content from the given range (from, - * to) of the given text document and null otherwise. - */ - public static TextEdit createTextEditIfNeeded( - int from, int to, String expectedContent, TextDocument textDocument) { - String text = textDocument.getText(); - - // Check if content from the range [from, to] is the same than expected content - if (isMatchExpectedContent(from, to, expectedContent, text)) { - // The expected content exists, no need to create a TextEdit - return null; - } - - // Insert the expected content. - try { - Position endPos = textDocument.positionAt(to); - Position startPos = to == from ? endPos : textDocument.positionAt(from); - Range range = new Range(startPos, endPos); - return new TextEdit(range, expectedContent); - } catch (BadLocationException e) { - LOGGER.log(Level.SEVERE, e.getMessage(), e); - } - return null; - } - - /** - * Returns true if the given content from the range [from, to] of the given text is the same than - * expected content and false otherwise. - * - * @param from the from range. - * @param to the to range. - * @param expectedContent the expected content. - * @param text the text document. - * @return true if the given content from the range [from, to] of the given text is the same than - * expected content and false otherwise. - */ - private static boolean isMatchExpectedContent( - int from, int to, String expectedContent, String text) { - if (expectedContent.length() == to - from) { - int j = 0; - for (int i = from; i < to; i++) { - char c = text.charAt(i); - if (expectedContent.charAt(j) != c) { - return false; - } - j++; - } - } else { - return false; - } - return true; - } - - public static String applyEdits(TextDocument document, List edits) - throws BadLocationException { - String text = document.getText(); - List sortedEdits = - mergeSort( - edits /* .map(getWellformedEdit) */, - (a, b) -> { - int diff = a.getRange().getStart().getLine() - b.getRange().getStart().getLine(); - if (diff == 0) { - return a.getRange().getStart().getColumn() - - b.getRange().getStart().getColumn(); - } - return diff; - }); - int lastModifiedOffset = 0; - List spans = new ArrayList<>(); - for (TextEdit e : sortedEdits) { - int startOffset = document.offsetAt(e.getRange().getStart()); - if (startOffset < lastModifiedOffset) { - throw new Error("Overlapping edit"); - } else if (startOffset > lastModifiedOffset) { - spans.add(text.substring(lastModifiedOffset, startOffset)); - } - if (e.getNewText() != null) { - spans.add(e.getNewText()); - } - lastModifiedOffset = document.offsetAt(e.getRange().getEnd()); - } - spans.add(text.substring(lastModifiedOffset)); - return spans.stream() // - .collect(Collectors.joining()); - } - - private static List mergeSort(List data, Comparator comparator) { - if (data.size() <= 1) { - // sorted - return data; - } - int p = (data.size() / 2) | 0; - List left = data.subList(0, p); - List right = data.subList(p, data.size()); - - mergeSort(left, comparator); - mergeSort(right, comparator); - - int leftIdx = 0; - int rightIdx = 0; - int i = 0; - while (leftIdx < left.size() && rightIdx < right.size()) { - int ret = comparator.compare(left.get(leftIdx), right.get(rightIdx)); - if (ret <= 0) { - // smaller_equal -> take left to preserve order - data.set(i++, left.get(leftIdx++)); - } else { - // greater -> take right - data.set(i++, right.get(rightIdx++)); - } - } - while (leftIdx < left.size()) { - data.set(i++, left.get(leftIdx++)); - } - while (rightIdx < right.size()) { - data.set(i++, right.get(rightIdx++)); - } - return data; - } - - /** - * Returns the offset of the first whitespace that's found in the given range [leftLimit,to] from - * the left of the to, and leftLimit otherwise. - * - * @param leftLimit the left limit range. - * @param to the to range. - * @return the offset of the first whitespace that's found in the given range [leftLimit,to] from - * the left of the to, and leftLimit otherwise. - */ - public static int adjustOffsetWithLeftWhitespaces(int leftLimit, int to, String text) { - if (to == 0) { - return -1; - } - for (int i = to - 1; i >= leftLimit; i--) { - char c = text.charAt(i); - if (!Character.isWhitespace(c)) { - // The current character is not a whitespace, return the offset of the character - return i + 1; - } - } - return leftLimit; - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +/******************************************************************************* + * Copyright (c) 2022 Red Hat Inc. and others. + * All rights reserved. This program and the accompanying materials + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat Inc. - initial API and implementation + *******************************************************************************/ +package org.appdevforall.codeonthego.lsp.xml.providers.format; + +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.stream.Collectors; +import org.eclipse.lemminx.commons.BadLocationException; +import org.eclipse.lemminx.commons.TextDocument; + +/** + * Utilities for {@link TextEdit}. + * + * @author Angelo ZERR + */ +public class TextEditUtils { + + private static final Logger LOGGER = Logger.getLogger(TextEditUtils.class.getName()); + + /** + * Returns the {@link TextEdit} to insert the given expected content from the given range (from, + * to) of the given text document and null otherwise. + * + * @param from the range from. + * @param to the range to. + * @param expectedContent the expected content. + * @param textDocument the text document. + * @return the {@link TextEdit} to insert the given expected content from the given range (from, + * to) of the given text document and null otherwise. + */ + public static TextEdit createTextEditIfNeeded( + int from, int to, String expectedContent, TextDocument textDocument) { + String text = textDocument.getText(); + + // Check if content from the range [from, to] is the same than expected content + if (isMatchExpectedContent(from, to, expectedContent, text)) { + // The expected content exists, no need to create a TextEdit + return null; + } + + // Insert the expected content. + try { + Position endPos = textDocument.positionAt(to); + Position startPos = to == from ? endPos : textDocument.positionAt(from); + Range range = new Range(startPos, endPos); + return new TextEdit(range, expectedContent); + } catch (BadLocationException e) { + LOGGER.log(Level.SEVERE, e.getMessage(), e); + } + return null; + } + + /** + * Returns true if the given content from the range [from, to] of the given text is the same than + * expected content and false otherwise. + * + * @param from the from range. + * @param to the to range. + * @param expectedContent the expected content. + * @param text the text document. + * @return true if the given content from the range [from, to] of the given text is the same than + * expected content and false otherwise. + */ + private static boolean isMatchExpectedContent( + int from, int to, String expectedContent, String text) { + if (expectedContent.length() == to - from) { + int j = 0; + for (int i = from; i < to; i++) { + char c = text.charAt(i); + if (expectedContent.charAt(j) != c) { + return false; + } + j++; + } + } else { + return false; + } + return true; + } + + public static String applyEdits(TextDocument document, List edits) + throws BadLocationException { + String text = document.getText(); + List sortedEdits = + mergeSort( + edits /* .map(getWellformedEdit) */, + (a, b) -> { + int diff = a.getRange().getStart().getLine() - b.getRange().getStart().getLine(); + if (diff == 0) { + return a.getRange().getStart().getColumn() + - b.getRange().getStart().getColumn(); + } + return diff; + }); + int lastModifiedOffset = 0; + List spans = new ArrayList<>(); + for (TextEdit e : sortedEdits) { + int startOffset = document.offsetAt(e.getRange().getStart()); + if (startOffset < lastModifiedOffset) { + throw new Error("Overlapping edit"); + } else if (startOffset > lastModifiedOffset) { + spans.add(text.substring(lastModifiedOffset, startOffset)); + } + if (e.getNewText() != null) { + spans.add(e.getNewText()); + } + lastModifiedOffset = document.offsetAt(e.getRange().getEnd()); + } + spans.add(text.substring(lastModifiedOffset)); + return spans.stream() // + .collect(Collectors.joining()); + } + + private static List mergeSort(List data, Comparator comparator) { + if (data.size() <= 1) { + // sorted + return data; + } + int p = (data.size() / 2) | 0; + List left = data.subList(0, p); + List right = data.subList(p, data.size()); + + mergeSort(left, comparator); + mergeSort(right, comparator); + + int leftIdx = 0; + int rightIdx = 0; + int i = 0; + while (leftIdx < left.size() && rightIdx < right.size()) { + int ret = comparator.compare(left.get(leftIdx), right.get(rightIdx)); + if (ret <= 0) { + // smaller_equal -> take left to preserve order + data.set(i++, left.get(leftIdx++)); + } else { + // greater -> take right + data.set(i++, right.get(rightIdx++)); + } + } + while (leftIdx < left.size()) { + data.set(i++, left.get(leftIdx++)); + } + while (rightIdx < right.size()) { + data.set(i++, right.get(rightIdx++)); + } + return data; + } + + /** + * Returns the offset of the first whitespace that's found in the given range [leftLimit,to] from + * the left of the to, and leftLimit otherwise. + * + * @param leftLimit the left limit range. + * @param to the to range. + * @return the offset of the first whitespace that's found in the given range [leftLimit,to] from + * the left of the to, and leftLimit otherwise. + */ + public static int adjustOffsetWithLeftWhitespaces(int leftLimit, int to, String text) { + if (to == 0) { + return -1; + } + for (int i = to - 1; i >= leftLimit; i--) { + char c = text.charAt(i); + if (!Character.isWhitespace(c)) { + // The current character is not a whitespace, return the offset of the character + return i + 1; + } + } + return leftLimit; + } +} diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/XMLFormatter.java b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/XMLFormatter.java similarity index 90% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/XMLFormatter.java rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/XMLFormatter.java index a0148d944e..a2c07c8de8 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/XMLFormatter.java +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/XMLFormatter.java @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.format; +package org.appdevforall.codeonthego.lsp.xml.providers.format; -import com.itsaky.androidide.lsp.models.TextEdit; -import com.itsaky.androidide.models.Range; +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import org.appdevforall.codeonthego.models.Range; import java.util.List; import org.eclipse.lemminx.commons.BadLocationException; import org.eclipse.lemminx.dom.DOMDocument; diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/XMLFormatterDocument.java b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/XMLFormatterDocument.java similarity index 95% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/XMLFormatterDocument.java rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/XMLFormatterDocument.java index 5d2bdc0498..5f52d848b2 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/XMLFormatterDocument.java +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/XMLFormatterDocument.java @@ -1,810 +1,810 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -/** - * Copyright (c) 2022 Red Hat, Inc. and others. All rights reserved. This program and the - * accompanying materials are made available under the terms of the Eclipse Public License v2.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v20.html - * - *

SPDX-License-Identifier: EPL-2.0 - * - *

Contributors: Red Hat Inc. - initial API and implementation - */ -package com.itsaky.androidide.lsp.xml.providers.format; - -import com.itsaky.androidide.lsp.models.TextEdit; -import com.itsaky.androidide.lsp.xml.models.XMLServerSettings; -import com.itsaky.androidide.lsp.xml.utils.XMLBuilder; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; -import com.itsaky.androidide.preferences.internal.EditorPreferences; -import java.util.ArrayList; -import java.util.List; -import org.eclipse.lemminx.commons.BadLocationException; -import org.eclipse.lemminx.commons.TextDocument; -import org.eclipse.lemminx.dom.DOMAttr; -import org.eclipse.lemminx.dom.DOMCDATASection; -import org.eclipse.lemminx.dom.DOMComment; -import org.eclipse.lemminx.dom.DOMDocument; -import org.eclipse.lemminx.dom.DOMDocumentType; -import org.eclipse.lemminx.dom.DOMElement; -import org.eclipse.lemminx.dom.DOMNode; -import org.eclipse.lemminx.dom.DOMParser; -import org.eclipse.lemminx.dom.DOMProcessingInstruction; -import org.eclipse.lemminx.dom.DOMText; -import org.eclipse.lemminx.dom.DTDAttlistDecl; -import org.eclipse.lemminx.dom.DTDDeclNode; -import org.eclipse.lemminx.dom.DTDDeclParameter; -import org.eclipse.lemminx.dom.builder.EmptyElements; - -/** - * Default XML formatter which generates one text edit by rewriting the DOM node which must be - * formatted. - * - * @author Angelo ZERR - */ -public class XMLFormatterDocument { - - private final TextDocument textDocument; - private final Range range; - private final XMLServerSettings sharedSettings = XMLServerSettings.INSTANCE; - private final EmptyElements emptyElements; - - private int startOffset; - private int endOffset; - private DOMDocument fullDomDocument; - private DOMDocument rangeDomDocument; - private XMLBuilder xmlBuilder; - private int indentLevel; - private boolean linefeedOnNextWrite; - private boolean withinDTDContent; - - /** - * XML formatter document. - */ - public XMLFormatterDocument(TextDocument textDocument, Range range) { - this.textDocument = textDocument; - this.range = range; - this.emptyElements = sharedSettings.getFormattingOptions().getEmptyElementsBehavior(); - this.linefeedOnNextWrite = false; - } - - /** - * Returns a List containing a single TextEdit, containing the newly formatted changes of - * this.textDocument - * - * @return List containing a single TextEdit - * @throws BadLocationException - */ - public List format() throws BadLocationException { - this.fullDomDocument = - DOMParser.getInstance().parse(textDocument.getText(), textDocument.getUri(), null, false); - if (isRangeFormatting()) { - setupRangeFormatting(range); - } else { - setupFullFormatting(range); - } - - this.indentLevel = getStartingIndentLevel(); - format(this.rangeDomDocument); - - List textEdits = getFormatTextEdit(); - return textEdits; - } - - private boolean isRangeFormatting() { - return this.range != null; - } - - private void setupRangeFormatting(Range range) throws BadLocationException { - int startOffset = this.textDocument.offsetAt(range.getStart()); - int endOffset = this.textDocument.offsetAt(range.getEnd()); - - Position startPosition = this.textDocument.positionAt(startOffset); - Position endPosition = this.textDocument.positionAt(endOffset); - enlargePositionToGutters(startPosition, endPosition); - - this.startOffset = this.textDocument.offsetAt(startPosition); - this.endOffset = this.textDocument.offsetAt(endPosition); - - String fullText = this.textDocument.getText(); - String rangeText = fullText.substring(this.startOffset, this.endOffset); - - withinDTDContent = this.fullDomDocument.isWithinInternalDTD(startOffset); - String uri = this.textDocument.getUri(); - if (withinDTDContent) { - uri += ".dtd"; - } - this.rangeDomDocument = DOMParser.getInstance().parse(rangeText, uri, null, false); - - if (containsTextWithinStartTag()) { - adjustOffsetToStartTag(); - rangeText = fullText.substring(this.startOffset, this.endOffset); - this.rangeDomDocument = DOMParser.getInstance().parse(rangeText, uri, null, false); - } - - this.xmlBuilder = new XMLBuilder("", textDocument.lineDelimiter(startPosition.getLine())); - } - - private boolean containsTextWithinStartTag() { - - if (this.rangeDomDocument.getChildren().size() < 1) { - return false; - } - - DOMNode firstChild = this.rangeDomDocument.getChild(0); - if (!firstChild.isText()) { - return false; - } - - int tagContentOffset = firstChild.getStart(); - int fullDocOffset = getFullOffsetFromRangeOffset(tagContentOffset); - DOMNode fullNode = this.fullDomDocument.findNodeAt(fullDocOffset); - - if (!fullNode.isElement()) { - return false; - } - return ((DOMElement) fullNode).isInStartTag(fullDocOffset); - } - - private void adjustOffsetToStartTag() throws BadLocationException { - int tagContentOffset = this.rangeDomDocument.getChild(0).getStart(); - int fullDocOffset = getFullOffsetFromRangeOffset(tagContentOffset); - DOMNode fullNode = this.fullDomDocument.findNodeAt(fullDocOffset); - Position nodePosition = this.textDocument.positionAt(fullNode.getStart()); - nodePosition.setColumn(0); - this.startOffset = this.textDocument.offsetAt(nodePosition); - } - - private void setupFullFormatting(Range range) throws BadLocationException { - this.startOffset = 0; - this.endOffset = textDocument.getText().length(); - this.rangeDomDocument = this.fullDomDocument; - - Position startPosition = textDocument.positionAt(startOffset); - this.xmlBuilder = new XMLBuilder("", textDocument.lineDelimiter(startPosition.getLine())); - } - - private void enlargePositionToGutters(Position start, Position end) throws BadLocationException { - start.setColumn(0); - - if (end.getColumn() == 0 && end.getLine() > 0) { - end.setLine(end.getLine() - 1); - } - - end.setColumn(this.textDocument.lineText(end.getLine()).length()); - } - - private int getStartingIndentLevel() throws BadLocationException { - if (withinDTDContent) { - return 1; - } - DOMNode startNode = this.fullDomDocument.findNodeAt(this.startOffset); - if (startNode.isOwnerDocument()) { - return 0; - } - - DOMNode startNodeParent = startNode.getParentNode(); - - if (startNodeParent.isOwnerDocument()) { - return 0; - } - - // the starting indent level is the parent's indent level + 1 - int startNodeIndentLevel = getNodeIndentLevel(startNodeParent) + 1; - return startNodeIndentLevel; - } - - private int getNodeIndentLevel(DOMNode node) throws BadLocationException { - - Position nodePosition = this.textDocument.positionAt(node.getStart()); - String textBeforeNode = - this.textDocument - .lineText(nodePosition.getLine()) - .substring(0, nodePosition.getColumn() + 1); - - int spaceOrTab = getSpaceOrTabStartOfString(textBeforeNode); - - if (EditorPreferences.INSTANCE.getUseSoftTab()) { - return (spaceOrTab / EditorPreferences.INSTANCE.getTabSize()); - } - return spaceOrTab; - } - - private int getSpaceOrTabStartOfString(String string) { - int i = 0; - int spaceOrTab = 0; - while (i < string.length() && (string.charAt(i) == ' ' || string.charAt(i) == '\t')) { - spaceOrTab++; - i++; - } - return spaceOrTab; - } - - private DOMElement getFullDocElemFromRangeElem(DOMElement elemFromRangeDoc) { - int fullOffset = -1; - - if (elemFromRangeDoc.hasStartTag()) { - fullOffset = getFullOffsetFromRangeOffset(elemFromRangeDoc.getStartTagOpenOffset()) + 1; - // +1 because offset must be here: <|root - // for DOMNode.findNodeAt() to find the correct element - } else if (elemFromRangeDoc.hasEndTag()) { - fullOffset = getFullOffsetFromRangeOffset(elemFromRangeDoc.getEndTagOpenOffset()) + 1; - // +1 because offset must be here: <|/root - // for DOMNode.findNodeAt() to find the correct element - } else { - return null; - } - - DOMElement elemFromFullDoc = (DOMElement) this.fullDomDocument.findNodeAt(fullOffset); - return elemFromFullDoc; - } - - private int getFullOffsetFromRangeOffset(int rangeOffset) { - return rangeOffset + this.startOffset; - } - - private boolean startTagExistsInRangeDocument(DOMNode node) { - if (!node.isElement()) { - return false; - } - - return ((DOMElement) node).hasStartTag(); - } - - private boolean startTagExistsInFullDocument(DOMNode node) { - if (!node.isElement()) { - return false; - } - - DOMElement elemFromFullDoc = getFullDocElemFromRangeElem((DOMElement) node); - - if (elemFromFullDoc == null) { - return false; - } - - return elemFromFullDoc.hasStartTag(); - } - - private void format(DOMNode node) throws BadLocationException { - - if (linefeedOnNextWrite && (!node.isText() || !((DOMText) node).isWhitespace())) { - this.xmlBuilder.linefeed(); - linefeedOnNextWrite = false; - } - - if (node.getNodeType() != DOMNode.DOCUMENT_NODE) { - boolean doLineFeed = - !node.getOwnerDocument().isDTD() - && !(node.isComment() && ((DOMComment) node).isCommentSameLineEndTag()) - && (!node.isText() - || (!((DOMText) node).isWhitespace() && ((DOMText) node).hasSiblings())); - - if (this.indentLevel > 0 && doLineFeed) { - // add new line + indent - if (!node.isChildOfOwnerDocument() || node.getPreviousNonTextSibling() != null) { - this.xmlBuilder.linefeed(); - } - - if (!startTagExistsInRangeDocument(node) && startTagExistsInFullDocument(node)) { - DOMNode startNode = getFullDocElemFromRangeElem((DOMElement) node); - int currentIndentLevel = getNodeIndentLevel(startNode); - this.xmlBuilder.indent(currentIndentLevel); - this.indentLevel = currentIndentLevel; - } else { - this.xmlBuilder.indent(this.indentLevel); - } - } - if (node.isElement()) { - // Format Element - formatElement((DOMElement) node); - } else if (node.isCDATA()) { - // Format CDATA - formatCDATA((DOMCDATASection) node); - } else if (node.isComment()) { - // Format comment - formatComment((DOMComment) node); - } else if (node.isProcessingInstruction()) { - // Format processing instruction - formatProcessingInstruction(node); - } else if (node.isProlog()) { - // Format prolog - formatProlog(node); - } else if (node.isText()) { - // Format Text - formatText((DOMText) node); - } else if (node.isDoctype()) { - // Format document type - formatDocumentType((DOMDocumentType) node); - } - } else if (node.hasChildNodes()) { - // Other nodes kind like root - for (DOMNode child : node.getChildren()) { - format(child); - } - } - } - - /** - * Format the given DOM prolog - * - * @param node the DOM prolog to format. - */ - private void formatProlog(DOMNode node) { - addPrologToXMLBuilder(node, this.xmlBuilder); - linefeedOnNextWrite = true; - } - - /** - * Format the given DOM text node. - * - * @param textNode the DOM text node to format. - */ - private void formatText(DOMText textNode) { - String content = textNode.getData(); - if (textNode.equals(this.fullDomDocument.getLastChild())) { - xmlBuilder.addContent(content); - } else { - xmlBuilder.addContent( - content, textNode.isWhitespace(), textNode.hasSiblings(), textNode.getDelimiter()); - } - } - - /** - * Format the given DOM document type. - * - * @param documentType the DOM document type to format. - */ - private void formatDocumentType(DOMDocumentType documentType) { - boolean isDTD = documentType.getOwnerDocument().isDTD(); - if (!isDTD) { - this.xmlBuilder.startDoctype(); - List params = documentType.getParameters(); - - for (DTDDeclParameter param : params) { - if (!documentType.isInternalSubset(param)) { - xmlBuilder.addParameter(param.getParameter()); - } else { - xmlBuilder.startDoctypeInternalSubset(); - xmlBuilder.linefeed(); - // level + 1 since the 'level' value is the doctype tag's level - formatDTD(documentType, this.indentLevel + 1, this.endOffset, this.xmlBuilder); - xmlBuilder.linefeed(); - xmlBuilder.endDoctypeInternalSubset(); - } - } - if (documentType.isClosed()) { - xmlBuilder.endDoctype(); - } - linefeedOnNextWrite = true; - - } else { - formatDTD(documentType, this.indentLevel, this.endOffset, this.xmlBuilder); - } - } - - /** - * Format the given DOM ProcessingIntsruction. - */ - private void formatProcessingInstruction(DOMNode node) { - addPIToXMLBuilder(node, this.xmlBuilder); - if (this.indentLevel == 0) { - this.xmlBuilder.linefeed(); - } - } - - /** - * Format the given DOM Comment - */ - private void formatComment(DOMComment comment) { - this.xmlBuilder.startComment(comment); - this.xmlBuilder.addContentComment(comment.getData()); - if (comment.isClosed()) { - // Generate --> only if comment is closed. - this.xmlBuilder.endComment(); - } - if (this.indentLevel == 0) { - linefeedOnNextWrite = true; - } - } - - /** - * Format the given DOM CDATA - */ - private void formatCDATA(DOMCDATASection cdata) { - this.xmlBuilder.startCDATA(); - this.xmlBuilder.addContentCDATA(cdata.getData()); - if (cdata.isClosed()) { - // Generate ]> only if CDATA is closed. - this.xmlBuilder.endCDATA(); - } - } - - /** - * Format the given DOM element - * - * @param element the DOM element to format. - * @throws BadLocationException - */ - private void formatElement(DOMElement element) throws BadLocationException { - String tag = element.getTagName(); - if (element.hasEndTag() && !element.hasStartTag()) { - // bad element without start tag (ex: <\root>) - xmlBuilder.endElement(tag, element.isEndTagClosed()); - } else { - // generate start element - xmlBuilder.startElement(tag, false); - if (element.hasAttributes()) { - formatAttributes(element); - } - - EmptyElements emptyElements = getEmptyElements(element); - switch (emptyElements) { - case Expand: - // Expand empty element: -> - xmlBuilder.closeStartElement(); - // end tag element is done, only if the element is closed - // the format, doesn't fix the close tag - this.xmlBuilder.endElement(tag, true); - break; - case Collapse: - // Collapse empty element: -> - formatElementStartTagSelfCloseBracket(element); - break; - default: - if (element.isStartTagClosed()) { - formatElementStartTagCloseBracket(element); - } - boolean hasElements = false; - if (element.hasChildNodes()) { - // element has body - - this.indentLevel++; - for (DOMNode child : element.getChildren()) { - hasElements = hasElements || !child.isText(); - format(child); - } - this.indentLevel--; - } - if (element.hasEndTag()) { - if (hasElements) { - this.xmlBuilder.linefeed(); - this.xmlBuilder.indent(this.indentLevel); - } - // end tag element is done, only if the element is closed - // the format, doesn't fix the close tag - if (element.hasEndTag() && element.getEndTagOpenOffset() <= this.endOffset) { - this.xmlBuilder.endElement(tag, element.isEndTagClosed()); - } else { - formatElementStartTagSelfCloseBracket(element); - } - } else if (element.isSelfClosed()) { - formatElementStartTagSelfCloseBracket(element); - } - } - } - } - - /** - * Formats the start tag's closing bracket (>) according to - * {@code XMLFormattingOptions#isPreserveAttrLineBreaks()} - * - *

{@code XMLFormattingOptions#isPreserveAttrLineBreaks()}: If true, must add a newline + - * indent before the closing bracket if the last attribute of the element and the closing bracket - * are in different lines. - * - * @param element - * @throws BadLocationException - */ - private void formatElementStartTagCloseBracket(DOMElement element) throws BadLocationException { - if (this.sharedSettings.getFormattingOptions().isPreserveAttributeLineBreaks() - && element.hasAttributes() - && !isSameLine(getLastAttribute(element).getEnd(), element.getStartTagCloseOffset())) { - xmlBuilder.linefeed(); - this.xmlBuilder.indent(this.indentLevel); - } - xmlBuilder.closeStartElement(); - } - - /** - * Formats the self-closing tag (/>) according to - * {@code XMLFormattingOptions#isPreserveAttrLineBreaks()} - * - *

{@code XMLFormattingOptions#isPreserveAttrLineBreaks()}: If true, must add a newline + - * indent before the self-closing tag if the last attribute of the element and the closing bracket - * are in different lines. - * - * @param element - * @throws BadLocationException - */ - private void formatElementStartTagSelfCloseBracket(DOMElement element) - throws BadLocationException { - if (this.sharedSettings.getFormattingOptions().isPreserveAttributeLineBreaks() - && element.hasAttributes()) { - int elementEndOffset = element.getEnd(); - if (element.isStartTagClosed()) { - elementEndOffset = element.getStartTagCloseOffset(); - } - if (!isSameLine(getLastAttribute(element).getEnd(), elementEndOffset)) { - this.xmlBuilder.linefeed(); - this.xmlBuilder.indent(this.indentLevel); - } - } - - this.xmlBuilder.selfCloseElement(); - } - - private void formatAttributes(DOMElement element) throws BadLocationException { - List attributes = element.getAttributeNodes(); - boolean isSingleAttribute = hasSingleAttributeInFullDoc(element); - int prevOffset = element.getStart(); - for (DOMAttr attr : attributes) { - formatAttribute(attr, isSingleAttribute, prevOffset); - prevOffset = attr.getEnd(); - } - if ((this.sharedSettings.getFormattingOptions().isClosingBracketNewLine() - && this.sharedSettings.getFormattingOptions().isSplitAttributes()) - && !isSingleAttribute) { - xmlBuilder.linefeed(); - // Indent by tag + splitAttributesIndentSize to match with attribute indent - // level - int totalIndent = - this.indentLevel - + this.sharedSettings.getFormattingOptions().getSplitAttributesIndentSize(); - xmlBuilder.indent(totalIndent); - } - } - - private void formatAttribute(DOMAttr attr, boolean isSingleAttribute, int prevOffset) - throws BadLocationException { - if (this.sharedSettings.getFormattingOptions().isPreserveAttributeLineBreaks() - && !isSameLine(prevOffset, attr.getStart())) { - xmlBuilder.linefeed(); - xmlBuilder.indent(this.indentLevel + 1); - xmlBuilder.addSingleAttribute(attr, false, false); - } else if (isSingleAttribute) { - xmlBuilder.addSingleAttribute(attr); - } else { - xmlBuilder.addAttribute(attr, this.indentLevel); - } - } - - /** - * Returns true if first offset and second offset belong in the same line of the document - * - *

If current formatting is range formatting, the provided offsets must be ranged offsets - * (offsets relative to the formatting range) - * - * @param first the first offset - * @param second the second offset - * @return true if first offset and second offset belong in the same line of the document - * @throws BadLocationException - */ - private boolean isSameLine(int first, int second) throws BadLocationException { - if (isRangeFormatting()) { - // adjust range offsets so that they are relative to the full document - first = getFullOffsetFromRangeOffset(first); - second = getFullOffsetFromRangeOffset(second); - } - return getLineNumber(first) == getLineNumber(second); - } - - private int getLineNumber(int offset) throws BadLocationException { - return this.textDocument.positionAt(offset).getLine(); - } - - private DOMAttr getLastAttribute(DOMElement element) { - if (!element.hasAttributes()) { - return null; - } - List attributes = element.getAttributeNodes(); - return attributes.get(attributes.size() - 1); - } - - /** - * Returns true if the provided element has one attribute in the fullDomDocument (not the - * rangeDomDocument) - * - * @param element - * @return true if the provided element has one attribute in the fullDomDocument (not the - * rangeDomDocument) - */ - private boolean hasSingleAttributeInFullDoc(DOMElement element) { - DOMElement fullElement = getFullDocElemFromRangeElem(element); - return fullElement.getAttributeNodes().size() == 1; - } - - /** - * Return the option to use to generate empty elements. - * - * @param element the DOM element - * @return the option to use to generate empty elements. - */ - private EmptyElements getEmptyElements(DOMElement element) { - if (this.emptyElements != EmptyElements.Ignore) { - if (element.isClosed() && element.isEmpty()) { - // Element is empty and closed - switch (this.emptyElements) { - case Expand: - case Collapse: { - if (this.sharedSettings.getFormattingOptions().isPreserveEmptyContent()) { - // preserve content - if (element.hasChildNodes()) { - // The element is empty and contains somes spaces which must be preserved - return EmptyElements.Ignore; - } - } - return this.emptyElements; - } - default: - return this.emptyElements; - } - } - } - return EmptyElements.Ignore; - } - - private static boolean formatDTD( - DOMDocumentType doctype, int level, int end, XMLBuilder xmlBuilder) { - DOMNode previous = null; - for (DOMNode node : doctype.getChildren()) { - if (previous != null) { - xmlBuilder.linefeed(); - } - - xmlBuilder.indent(level); - - if (node.isText()) { - xmlBuilder.addContent(((DOMText) node).getData().trim()); - } else if (node.isComment()) { - DOMComment comment = (DOMComment) node; - xmlBuilder.startComment(comment); - xmlBuilder.addContentComment(comment.getData()); - xmlBuilder.endComment(); - } else if (node.isProcessingInstruction()) { - addPIToXMLBuilder(node, xmlBuilder); - } else if (node.isProlog()) { - addPrologToXMLBuilder(node, xmlBuilder); - } else { - boolean setEndBracketOnNewLine = false; - DTDDeclNode decl = (DTDDeclNode) node; - xmlBuilder.addDeclTagStart(decl); - - if (decl.isDTDAttListDecl()) { - DTDAttlistDecl attlist = (DTDAttlistDecl) decl; - List internalDecls = attlist.getInternalChildren(); - - if (internalDecls == null) { - for (DTDDeclParameter param : decl.getParameters()) { - xmlBuilder.addParameter(param.getParameter()); - } - } else { - boolean multipleInternalAttlistDecls = false; - List params = attlist.getParameters(); - DTDDeclParameter param; - for (int i = 0; i < params.size(); i++) { - param = params.get(i); - if (attlist.getNameParameter().equals(param)) { - xmlBuilder.addParameter(param.getParameter()); - if (attlist.getParameters().size() > 1) { // has parameters after elementName - xmlBuilder.linefeed(); - xmlBuilder.indent(level + 1); - setEndBracketOnNewLine = true; - multipleInternalAttlistDecls = true; - } - } else { - if (multipleInternalAttlistDecls && i == 1) { - xmlBuilder.addUnindentedParameter(param.getParameter()); - } else { - xmlBuilder.addParameter(param.getParameter()); - } - } - } - - for (DTDAttlistDecl attlistDecl : internalDecls) { - xmlBuilder.linefeed(); - xmlBuilder.indent(level + 1); - params = attlistDecl.getParameters(); - for (int i = 0; i < params.size(); i++) { - param = params.get(i); - - if (i == 0) { - xmlBuilder.addUnindentedParameter(param.getParameter()); - } else { - xmlBuilder.addParameter(param.getParameter()); - } - } - } - } - } else { - for (DTDDeclParameter param : decl.getParameters()) { - xmlBuilder.addParameter(param.getParameter()); - } - } - if (setEndBracketOnNewLine) { - xmlBuilder.linefeed(); - xmlBuilder.indent(level); - } - if (decl.isClosed()) { - xmlBuilder.closeStartElement(); - } - } - previous = node; - } - return true; - } - - private List getFormatTextEdit() throws BadLocationException { - Position startPosition = this.textDocument.positionAt(this.startOffset); - Position endPosition = this.textDocument.positionAt(this.endOffset); - Range r = new Range(startPosition, endPosition); - List edits = new ArrayList<>(); - - // check if format range reaches the end of the document - if (this.endOffset == this.textDocument.getText().length()) { - - if (this.sharedSettings.getFormattingOptions().isTrimFinalNewLine()) { - this.xmlBuilder.trimFinalNewlines(); - } - - if (this.sharedSettings.getFormattingOptions().isInsertFinalNewLine() - && !this.xmlBuilder.isLastLineEmptyOrWhitespace()) { - this.xmlBuilder.linefeed(); - } - } - - edits.add(new TextEdit(r, this.xmlBuilder.toString())); - return edits; - } - - private static void addPIToXMLBuilder(DOMNode node, XMLBuilder xml) { - DOMProcessingInstruction processingInstruction = (DOMProcessingInstruction) node; - xml.startPrologOrPI(processingInstruction.getTarget()); - - String content = processingInstruction.getData(); - if (content.length() > 0) { - xml.addContentPI(content); - } else { - xml.addContent(" "); - } - - xml.endPrologOrPI(); - } - - private static void addPrologToXMLBuilder(DOMNode node, XMLBuilder xml) { - DOMProcessingInstruction processingInstruction = (DOMProcessingInstruction) node; - xml.startPrologOrPI(processingInstruction.getTarget()); - if (node.hasAttributes()) { - addPrologAttributes(node, xml); - } - xml.endPrologOrPI(); - } - - /** - * Will add all attributes, to the given builder, on a single line - */ - private static void addPrologAttributes(DOMNode node, XMLBuilder xmlBuilder) { - List attrs = node.getAttributeNodes(); - if (attrs == null) { - return; - } - for (DOMAttr attr : attrs) { - xmlBuilder.addPrologAttribute(attr); - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +/** + * Copyright (c) 2022 Red Hat, Inc. and others. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + *

SPDX-License-Identifier: EPL-2.0 + * + *

Contributors: Red Hat Inc. - initial API and implementation + */ +package org.appdevforall.codeonthego.lsp.xml.providers.format; + +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import org.appdevforall.codeonthego.lsp.xml.models.XMLServerSettings; +import org.appdevforall.codeonthego.lsp.xml.utils.XMLBuilder; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences; +import java.util.ArrayList; +import java.util.List; +import org.eclipse.lemminx.commons.BadLocationException; +import org.eclipse.lemminx.commons.TextDocument; +import org.eclipse.lemminx.dom.DOMAttr; +import org.eclipse.lemminx.dom.DOMCDATASection; +import org.eclipse.lemminx.dom.DOMComment; +import org.eclipse.lemminx.dom.DOMDocument; +import org.eclipse.lemminx.dom.DOMDocumentType; +import org.eclipse.lemminx.dom.DOMElement; +import org.eclipse.lemminx.dom.DOMNode; +import org.eclipse.lemminx.dom.DOMParser; +import org.eclipse.lemminx.dom.DOMProcessingInstruction; +import org.eclipse.lemminx.dom.DOMText; +import org.eclipse.lemminx.dom.DTDAttlistDecl; +import org.eclipse.lemminx.dom.DTDDeclNode; +import org.eclipse.lemminx.dom.DTDDeclParameter; +import org.eclipse.lemminx.dom.builder.EmptyElements; + +/** + * Default XML formatter which generates one text edit by rewriting the DOM node which must be + * formatted. + * + * @author Angelo ZERR + */ +public class XMLFormatterDocument { + + private final TextDocument textDocument; + private final Range range; + private final XMLServerSettings sharedSettings = XMLServerSettings.INSTANCE; + private final EmptyElements emptyElements; + + private int startOffset; + private int endOffset; + private DOMDocument fullDomDocument; + private DOMDocument rangeDomDocument; + private XMLBuilder xmlBuilder; + private int indentLevel; + private boolean linefeedOnNextWrite; + private boolean withinDTDContent; + + /** + * XML formatter document. + */ + public XMLFormatterDocument(TextDocument textDocument, Range range) { + this.textDocument = textDocument; + this.range = range; + this.emptyElements = sharedSettings.getFormattingOptions().getEmptyElementsBehavior(); + this.linefeedOnNextWrite = false; + } + + /** + * Returns a List containing a single TextEdit, containing the newly formatted changes of + * this.textDocument + * + * @return List containing a single TextEdit + * @throws BadLocationException + */ + public List format() throws BadLocationException { + this.fullDomDocument = + DOMParser.getInstance().parse(textDocument.getText(), textDocument.getUri(), null, false); + if (isRangeFormatting()) { + setupRangeFormatting(range); + } else { + setupFullFormatting(range); + } + + this.indentLevel = getStartingIndentLevel(); + format(this.rangeDomDocument); + + List textEdits = getFormatTextEdit(); + return textEdits; + } + + private boolean isRangeFormatting() { + return this.range != null; + } + + private void setupRangeFormatting(Range range) throws BadLocationException { + int startOffset = this.textDocument.offsetAt(range.getStart()); + int endOffset = this.textDocument.offsetAt(range.getEnd()); + + Position startPosition = this.textDocument.positionAt(startOffset); + Position endPosition = this.textDocument.positionAt(endOffset); + enlargePositionToGutters(startPosition, endPosition); + + this.startOffset = this.textDocument.offsetAt(startPosition); + this.endOffset = this.textDocument.offsetAt(endPosition); + + String fullText = this.textDocument.getText(); + String rangeText = fullText.substring(this.startOffset, this.endOffset); + + withinDTDContent = this.fullDomDocument.isWithinInternalDTD(startOffset); + String uri = this.textDocument.getUri(); + if (withinDTDContent) { + uri += ".dtd"; + } + this.rangeDomDocument = DOMParser.getInstance().parse(rangeText, uri, null, false); + + if (containsTextWithinStartTag()) { + adjustOffsetToStartTag(); + rangeText = fullText.substring(this.startOffset, this.endOffset); + this.rangeDomDocument = DOMParser.getInstance().parse(rangeText, uri, null, false); + } + + this.xmlBuilder = new XMLBuilder("", textDocument.lineDelimiter(startPosition.getLine())); + } + + private boolean containsTextWithinStartTag() { + + if (this.rangeDomDocument.getChildren().size() < 1) { + return false; + } + + DOMNode firstChild = this.rangeDomDocument.getChild(0); + if (!firstChild.isText()) { + return false; + } + + int tagContentOffset = firstChild.getStart(); + int fullDocOffset = getFullOffsetFromRangeOffset(tagContentOffset); + DOMNode fullNode = this.fullDomDocument.findNodeAt(fullDocOffset); + + if (!fullNode.isElement()) { + return false; + } + return ((DOMElement) fullNode).isInStartTag(fullDocOffset); + } + + private void adjustOffsetToStartTag() throws BadLocationException { + int tagContentOffset = this.rangeDomDocument.getChild(0).getStart(); + int fullDocOffset = getFullOffsetFromRangeOffset(tagContentOffset); + DOMNode fullNode = this.fullDomDocument.findNodeAt(fullDocOffset); + Position nodePosition = this.textDocument.positionAt(fullNode.getStart()); + nodePosition.setColumn(0); + this.startOffset = this.textDocument.offsetAt(nodePosition); + } + + private void setupFullFormatting(Range range) throws BadLocationException { + this.startOffset = 0; + this.endOffset = textDocument.getText().length(); + this.rangeDomDocument = this.fullDomDocument; + + Position startPosition = textDocument.positionAt(startOffset); + this.xmlBuilder = new XMLBuilder("", textDocument.lineDelimiter(startPosition.getLine())); + } + + private void enlargePositionToGutters(Position start, Position end) throws BadLocationException { + start.setColumn(0); + + if (end.getColumn() == 0 && end.getLine() > 0) { + end.setLine(end.getLine() - 1); + } + + end.setColumn(this.textDocument.lineText(end.getLine()).length()); + } + + private int getStartingIndentLevel() throws BadLocationException { + if (withinDTDContent) { + return 1; + } + DOMNode startNode = this.fullDomDocument.findNodeAt(this.startOffset); + if (startNode.isOwnerDocument()) { + return 0; + } + + DOMNode startNodeParent = startNode.getParentNode(); + + if (startNodeParent.isOwnerDocument()) { + return 0; + } + + // the starting indent level is the parent's indent level + 1 + int startNodeIndentLevel = getNodeIndentLevel(startNodeParent) + 1; + return startNodeIndentLevel; + } + + private int getNodeIndentLevel(DOMNode node) throws BadLocationException { + + Position nodePosition = this.textDocument.positionAt(node.getStart()); + String textBeforeNode = + this.textDocument + .lineText(nodePosition.getLine()) + .substring(0, nodePosition.getColumn() + 1); + + int spaceOrTab = getSpaceOrTabStartOfString(textBeforeNode); + + if (EditorPreferences.INSTANCE.getUseSoftTab()) { + return (spaceOrTab / EditorPreferences.INSTANCE.getTabSize()); + } + return spaceOrTab; + } + + private int getSpaceOrTabStartOfString(String string) { + int i = 0; + int spaceOrTab = 0; + while (i < string.length() && (string.charAt(i) == ' ' || string.charAt(i) == '\t')) { + spaceOrTab++; + i++; + } + return spaceOrTab; + } + + private DOMElement getFullDocElemFromRangeElem(DOMElement elemFromRangeDoc) { + int fullOffset = -1; + + if (elemFromRangeDoc.hasStartTag()) { + fullOffset = getFullOffsetFromRangeOffset(elemFromRangeDoc.getStartTagOpenOffset()) + 1; + // +1 because offset must be here: <|root + // for DOMNode.findNodeAt() to find the correct element + } else if (elemFromRangeDoc.hasEndTag()) { + fullOffset = getFullOffsetFromRangeOffset(elemFromRangeDoc.getEndTagOpenOffset()) + 1; + // +1 because offset must be here: <|/root + // for DOMNode.findNodeAt() to find the correct element + } else { + return null; + } + + DOMElement elemFromFullDoc = (DOMElement) this.fullDomDocument.findNodeAt(fullOffset); + return elemFromFullDoc; + } + + private int getFullOffsetFromRangeOffset(int rangeOffset) { + return rangeOffset + this.startOffset; + } + + private boolean startTagExistsInRangeDocument(DOMNode node) { + if (!node.isElement()) { + return false; + } + + return ((DOMElement) node).hasStartTag(); + } + + private boolean startTagExistsInFullDocument(DOMNode node) { + if (!node.isElement()) { + return false; + } + + DOMElement elemFromFullDoc = getFullDocElemFromRangeElem((DOMElement) node); + + if (elemFromFullDoc == null) { + return false; + } + + return elemFromFullDoc.hasStartTag(); + } + + private void format(DOMNode node) throws BadLocationException { + + if (linefeedOnNextWrite && (!node.isText() || !((DOMText) node).isWhitespace())) { + this.xmlBuilder.linefeed(); + linefeedOnNextWrite = false; + } + + if (node.getNodeType() != DOMNode.DOCUMENT_NODE) { + boolean doLineFeed = + !node.getOwnerDocument().isDTD() + && !(node.isComment() && ((DOMComment) node).isCommentSameLineEndTag()) + && (!node.isText() + || (!((DOMText) node).isWhitespace() && ((DOMText) node).hasSiblings())); + + if (this.indentLevel > 0 && doLineFeed) { + // add new line + indent + if (!node.isChildOfOwnerDocument() || node.getPreviousNonTextSibling() != null) { + this.xmlBuilder.linefeed(); + } + + if (!startTagExistsInRangeDocument(node) && startTagExistsInFullDocument(node)) { + DOMNode startNode = getFullDocElemFromRangeElem((DOMElement) node); + int currentIndentLevel = getNodeIndentLevel(startNode); + this.xmlBuilder.indent(currentIndentLevel); + this.indentLevel = currentIndentLevel; + } else { + this.xmlBuilder.indent(this.indentLevel); + } + } + if (node.isElement()) { + // Format Element + formatElement((DOMElement) node); + } else if (node.isCDATA()) { + // Format CDATA + formatCDATA((DOMCDATASection) node); + } else if (node.isComment()) { + // Format comment + formatComment((DOMComment) node); + } else if (node.isProcessingInstruction()) { + // Format processing instruction + formatProcessingInstruction(node); + } else if (node.isProlog()) { + // Format prolog + formatProlog(node); + } else if (node.isText()) { + // Format Text + formatText((DOMText) node); + } else if (node.isDoctype()) { + // Format document type + formatDocumentType((DOMDocumentType) node); + } + } else if (node.hasChildNodes()) { + // Other nodes kind like root + for (DOMNode child : node.getChildren()) { + format(child); + } + } + } + + /** + * Format the given DOM prolog + * + * @param node the DOM prolog to format. + */ + private void formatProlog(DOMNode node) { + addPrologToXMLBuilder(node, this.xmlBuilder); + linefeedOnNextWrite = true; + } + + /** + * Format the given DOM text node. + * + * @param textNode the DOM text node to format. + */ + private void formatText(DOMText textNode) { + String content = textNode.getData(); + if (textNode.equals(this.fullDomDocument.getLastChild())) { + xmlBuilder.addContent(content); + } else { + xmlBuilder.addContent( + content, textNode.isWhitespace(), textNode.hasSiblings(), textNode.getDelimiter()); + } + } + + /** + * Format the given DOM document type. + * + * @param documentType the DOM document type to format. + */ + private void formatDocumentType(DOMDocumentType documentType) { + boolean isDTD = documentType.getOwnerDocument().isDTD(); + if (!isDTD) { + this.xmlBuilder.startDoctype(); + List params = documentType.getParameters(); + + for (DTDDeclParameter param : params) { + if (!documentType.isInternalSubset(param)) { + xmlBuilder.addParameter(param.getParameter()); + } else { + xmlBuilder.startDoctypeInternalSubset(); + xmlBuilder.linefeed(); + // level + 1 since the 'level' value is the doctype tag's level + formatDTD(documentType, this.indentLevel + 1, this.endOffset, this.xmlBuilder); + xmlBuilder.linefeed(); + xmlBuilder.endDoctypeInternalSubset(); + } + } + if (documentType.isClosed()) { + xmlBuilder.endDoctype(); + } + linefeedOnNextWrite = true; + + } else { + formatDTD(documentType, this.indentLevel, this.endOffset, this.xmlBuilder); + } + } + + /** + * Format the given DOM ProcessingIntsruction. + */ + private void formatProcessingInstruction(DOMNode node) { + addPIToXMLBuilder(node, this.xmlBuilder); + if (this.indentLevel == 0) { + this.xmlBuilder.linefeed(); + } + } + + /** + * Format the given DOM Comment + */ + private void formatComment(DOMComment comment) { + this.xmlBuilder.startComment(comment); + this.xmlBuilder.addContentComment(comment.getData()); + if (comment.isClosed()) { + // Generate --> only if comment is closed. + this.xmlBuilder.endComment(); + } + if (this.indentLevel == 0) { + linefeedOnNextWrite = true; + } + } + + /** + * Format the given DOM CDATA + */ + private void formatCDATA(DOMCDATASection cdata) { + this.xmlBuilder.startCDATA(); + this.xmlBuilder.addContentCDATA(cdata.getData()); + if (cdata.isClosed()) { + // Generate ]> only if CDATA is closed. + this.xmlBuilder.endCDATA(); + } + } + + /** + * Format the given DOM element + * + * @param element the DOM element to format. + * @throws BadLocationException + */ + private void formatElement(DOMElement element) throws BadLocationException { + String tag = element.getTagName(); + if (element.hasEndTag() && !element.hasStartTag()) { + // bad element without start tag (ex: <\root>) + xmlBuilder.endElement(tag, element.isEndTagClosed()); + } else { + // generate start element + xmlBuilder.startElement(tag, false); + if (element.hasAttributes()) { + formatAttributes(element); + } + + EmptyElements emptyElements = getEmptyElements(element); + switch (emptyElements) { + case Expand: + // Expand empty element: -> + xmlBuilder.closeStartElement(); + // end tag element is done, only if the element is closed + // the format, doesn't fix the close tag + this.xmlBuilder.endElement(tag, true); + break; + case Collapse: + // Collapse empty element: -> + formatElementStartTagSelfCloseBracket(element); + break; + default: + if (element.isStartTagClosed()) { + formatElementStartTagCloseBracket(element); + } + boolean hasElements = false; + if (element.hasChildNodes()) { + // element has body + + this.indentLevel++; + for (DOMNode child : element.getChildren()) { + hasElements = hasElements || !child.isText(); + format(child); + } + this.indentLevel--; + } + if (element.hasEndTag()) { + if (hasElements) { + this.xmlBuilder.linefeed(); + this.xmlBuilder.indent(this.indentLevel); + } + // end tag element is done, only if the element is closed + // the format, doesn't fix the close tag + if (element.hasEndTag() && element.getEndTagOpenOffset() <= this.endOffset) { + this.xmlBuilder.endElement(tag, element.isEndTagClosed()); + } else { + formatElementStartTagSelfCloseBracket(element); + } + } else if (element.isSelfClosed()) { + formatElementStartTagSelfCloseBracket(element); + } + } + } + } + + /** + * Formats the start tag's closing bracket (>) according to + * {@code XMLFormattingOptions#isPreserveAttrLineBreaks()} + * + *

{@code XMLFormattingOptions#isPreserveAttrLineBreaks()}: If true, must add a newline + + * indent before the closing bracket if the last attribute of the element and the closing bracket + * are in different lines. + * + * @param element + * @throws BadLocationException + */ + private void formatElementStartTagCloseBracket(DOMElement element) throws BadLocationException { + if (this.sharedSettings.getFormattingOptions().isPreserveAttributeLineBreaks() + && element.hasAttributes() + && !isSameLine(getLastAttribute(element).getEnd(), element.getStartTagCloseOffset())) { + xmlBuilder.linefeed(); + this.xmlBuilder.indent(this.indentLevel); + } + xmlBuilder.closeStartElement(); + } + + /** + * Formats the self-closing tag (/>) according to + * {@code XMLFormattingOptions#isPreserveAttrLineBreaks()} + * + *

{@code XMLFormattingOptions#isPreserveAttrLineBreaks()}: If true, must add a newline + + * indent before the self-closing tag if the last attribute of the element and the closing bracket + * are in different lines. + * + * @param element + * @throws BadLocationException + */ + private void formatElementStartTagSelfCloseBracket(DOMElement element) + throws BadLocationException { + if (this.sharedSettings.getFormattingOptions().isPreserveAttributeLineBreaks() + && element.hasAttributes()) { + int elementEndOffset = element.getEnd(); + if (element.isStartTagClosed()) { + elementEndOffset = element.getStartTagCloseOffset(); + } + if (!isSameLine(getLastAttribute(element).getEnd(), elementEndOffset)) { + this.xmlBuilder.linefeed(); + this.xmlBuilder.indent(this.indentLevel); + } + } + + this.xmlBuilder.selfCloseElement(); + } + + private void formatAttributes(DOMElement element) throws BadLocationException { + List attributes = element.getAttributeNodes(); + boolean isSingleAttribute = hasSingleAttributeInFullDoc(element); + int prevOffset = element.getStart(); + for (DOMAttr attr : attributes) { + formatAttribute(attr, isSingleAttribute, prevOffset); + prevOffset = attr.getEnd(); + } + if ((this.sharedSettings.getFormattingOptions().isClosingBracketNewLine() + && this.sharedSettings.getFormattingOptions().isSplitAttributes()) + && !isSingleAttribute) { + xmlBuilder.linefeed(); + // Indent by tag + splitAttributesIndentSize to match with attribute indent + // level + int totalIndent = + this.indentLevel + + this.sharedSettings.getFormattingOptions().getSplitAttributesIndentSize(); + xmlBuilder.indent(totalIndent); + } + } + + private void formatAttribute(DOMAttr attr, boolean isSingleAttribute, int prevOffset) + throws BadLocationException { + if (this.sharedSettings.getFormattingOptions().isPreserveAttributeLineBreaks() + && !isSameLine(prevOffset, attr.getStart())) { + xmlBuilder.linefeed(); + xmlBuilder.indent(this.indentLevel + 1); + xmlBuilder.addSingleAttribute(attr, false, false); + } else if (isSingleAttribute) { + xmlBuilder.addSingleAttribute(attr); + } else { + xmlBuilder.addAttribute(attr, this.indentLevel); + } + } + + /** + * Returns true if first offset and second offset belong in the same line of the document + * + *

If current formatting is range formatting, the provided offsets must be ranged offsets + * (offsets relative to the formatting range) + * + * @param first the first offset + * @param second the second offset + * @return true if first offset and second offset belong in the same line of the document + * @throws BadLocationException + */ + private boolean isSameLine(int first, int second) throws BadLocationException { + if (isRangeFormatting()) { + // adjust range offsets so that they are relative to the full document + first = getFullOffsetFromRangeOffset(first); + second = getFullOffsetFromRangeOffset(second); + } + return getLineNumber(first) == getLineNumber(second); + } + + private int getLineNumber(int offset) throws BadLocationException { + return this.textDocument.positionAt(offset).getLine(); + } + + private DOMAttr getLastAttribute(DOMElement element) { + if (!element.hasAttributes()) { + return null; + } + List attributes = element.getAttributeNodes(); + return attributes.get(attributes.size() - 1); + } + + /** + * Returns true if the provided element has one attribute in the fullDomDocument (not the + * rangeDomDocument) + * + * @param element + * @return true if the provided element has one attribute in the fullDomDocument (not the + * rangeDomDocument) + */ + private boolean hasSingleAttributeInFullDoc(DOMElement element) { + DOMElement fullElement = getFullDocElemFromRangeElem(element); + return fullElement.getAttributeNodes().size() == 1; + } + + /** + * Return the option to use to generate empty elements. + * + * @param element the DOM element + * @return the option to use to generate empty elements. + */ + private EmptyElements getEmptyElements(DOMElement element) { + if (this.emptyElements != EmptyElements.Ignore) { + if (element.isClosed() && element.isEmpty()) { + // Element is empty and closed + switch (this.emptyElements) { + case Expand: + case Collapse: { + if (this.sharedSettings.getFormattingOptions().isPreserveEmptyContent()) { + // preserve content + if (element.hasChildNodes()) { + // The element is empty and contains somes spaces which must be preserved + return EmptyElements.Ignore; + } + } + return this.emptyElements; + } + default: + return this.emptyElements; + } + } + } + return EmptyElements.Ignore; + } + + private static boolean formatDTD( + DOMDocumentType doctype, int level, int end, XMLBuilder xmlBuilder) { + DOMNode previous = null; + for (DOMNode node : doctype.getChildren()) { + if (previous != null) { + xmlBuilder.linefeed(); + } + + xmlBuilder.indent(level); + + if (node.isText()) { + xmlBuilder.addContent(((DOMText) node).getData().trim()); + } else if (node.isComment()) { + DOMComment comment = (DOMComment) node; + xmlBuilder.startComment(comment); + xmlBuilder.addContentComment(comment.getData()); + xmlBuilder.endComment(); + } else if (node.isProcessingInstruction()) { + addPIToXMLBuilder(node, xmlBuilder); + } else if (node.isProlog()) { + addPrologToXMLBuilder(node, xmlBuilder); + } else { + boolean setEndBracketOnNewLine = false; + DTDDeclNode decl = (DTDDeclNode) node; + xmlBuilder.addDeclTagStart(decl); + + if (decl.isDTDAttListDecl()) { + DTDAttlistDecl attlist = (DTDAttlistDecl) decl; + List internalDecls = attlist.getInternalChildren(); + + if (internalDecls == null) { + for (DTDDeclParameter param : decl.getParameters()) { + xmlBuilder.addParameter(param.getParameter()); + } + } else { + boolean multipleInternalAttlistDecls = false; + List params = attlist.getParameters(); + DTDDeclParameter param; + for (int i = 0; i < params.size(); i++) { + param = params.get(i); + if (attlist.getNameParameter().equals(param)) { + xmlBuilder.addParameter(param.getParameter()); + if (attlist.getParameters().size() > 1) { // has parameters after elementName + xmlBuilder.linefeed(); + xmlBuilder.indent(level + 1); + setEndBracketOnNewLine = true; + multipleInternalAttlistDecls = true; + } + } else { + if (multipleInternalAttlistDecls && i == 1) { + xmlBuilder.addUnindentedParameter(param.getParameter()); + } else { + xmlBuilder.addParameter(param.getParameter()); + } + } + } + + for (DTDAttlistDecl attlistDecl : internalDecls) { + xmlBuilder.linefeed(); + xmlBuilder.indent(level + 1); + params = attlistDecl.getParameters(); + for (int i = 0; i < params.size(); i++) { + param = params.get(i); + + if (i == 0) { + xmlBuilder.addUnindentedParameter(param.getParameter()); + } else { + xmlBuilder.addParameter(param.getParameter()); + } + } + } + } + } else { + for (DTDDeclParameter param : decl.getParameters()) { + xmlBuilder.addParameter(param.getParameter()); + } + } + if (setEndBracketOnNewLine) { + xmlBuilder.linefeed(); + xmlBuilder.indent(level); + } + if (decl.isClosed()) { + xmlBuilder.closeStartElement(); + } + } + previous = node; + } + return true; + } + + private List getFormatTextEdit() throws BadLocationException { + Position startPosition = this.textDocument.positionAt(this.startOffset); + Position endPosition = this.textDocument.positionAt(this.endOffset); + Range r = new Range(startPosition, endPosition); + List edits = new ArrayList<>(); + + // check if format range reaches the end of the document + if (this.endOffset == this.textDocument.getText().length()) { + + if (this.sharedSettings.getFormattingOptions().isTrimFinalNewLine()) { + this.xmlBuilder.trimFinalNewlines(); + } + + if (this.sharedSettings.getFormattingOptions().isInsertFinalNewLine() + && !this.xmlBuilder.isLastLineEmptyOrWhitespace()) { + this.xmlBuilder.linefeed(); + } + } + + edits.add(new TextEdit(r, this.xmlBuilder.toString())); + return edits; + } + + private static void addPIToXMLBuilder(DOMNode node, XMLBuilder xml) { + DOMProcessingInstruction processingInstruction = (DOMProcessingInstruction) node; + xml.startPrologOrPI(processingInstruction.getTarget()); + + String content = processingInstruction.getData(); + if (content.length() > 0) { + xml.addContentPI(content); + } else { + xml.addContent(" "); + } + + xml.endPrologOrPI(); + } + + private static void addPrologToXMLBuilder(DOMNode node, XMLBuilder xml) { + DOMProcessingInstruction processingInstruction = (DOMProcessingInstruction) node; + xml.startPrologOrPI(processingInstruction.getTarget()); + if (node.hasAttributes()) { + addPrologAttributes(node, xml); + } + xml.endPrologOrPI(); + } + + /** + * Will add all attributes, to the given builder, on a single line + */ + private static void addPrologAttributes(DOMNode node, XMLBuilder xmlBuilder) { + List attrs = node.getAttributeNodes(); + if (attrs == null) { + return; + } + for (DOMAttr attr : attrs) { + xmlBuilder.addPrologAttribute(attr); + } + } +} diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/XMLFormatterDocumentNew.java b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/XMLFormatterDocumentNew.java similarity index 95% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/XMLFormatterDocumentNew.java rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/XMLFormatterDocumentNew.java index 538f6dd82d..3ed97e4057 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/XMLFormatterDocumentNew.java +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/XMLFormatterDocumentNew.java @@ -1,721 +1,721 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -/******************************************************************************* - * Copyright (c) 2022 Red Hat Inc. and others. - * All rights reserved. This program and the accompanying materials - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v20.html - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat Inc. - initial API and implementation - *******************************************************************************/ -package com.itsaky.androidide.lsp.xml.providers.format; - -import com.itsaky.androidide.lsp.models.TextEdit; -import com.itsaky.androidide.lsp.xml.models.XMLFormattingOptions; -import com.itsaky.androidide.lsp.xml.models.XMLServerSettings; -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; -import com.itsaky.androidide.preferences.internal.EditorPreferences; -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.eclipse.lemminx.commons.BadLocationException; -import org.eclipse.lemminx.commons.TextDocument; -import org.eclipse.lemminx.dom.DOMAttr; -import org.eclipse.lemminx.dom.DOMCDATASection; -import org.eclipse.lemminx.dom.DOMComment; -import org.eclipse.lemminx.dom.DOMDocument; -import org.eclipse.lemminx.dom.DOMDocumentType; -import org.eclipse.lemminx.dom.DOMElement; -import org.eclipse.lemminx.dom.DOMNode; -import org.eclipse.lemminx.dom.DOMProcessingInstruction; -import org.eclipse.lemminx.dom.DOMText; -import org.eclipse.lemminx.utils.StringUtils; -import org.eclipse.lsp4j.jsonrpc.CancelChecker; -import org.w3c.dom.Node; -import org.w3c.dom.Text; - -/** - * Experimental XML formatter which generates several text edit to remove, add, update spaces / - * indent. - * - * @author Angelo ZERR - */ -public class XMLFormatterDocumentNew { - - private static final Logger LOGGER = Logger.getLogger(XMLFormatterDocumentNew.class.getName()); - - private static final String XML_SPACE_ATTR = "xml:space"; - - private static final String XML_SPACE_ATTR_DEFAULT = "default"; - - private static final String XML_SPACE_ATTR_PRESERVE = "preserve"; - - private final DOMDocument xmlDocument; - private final TextDocument textDocument; - private final String lineDelimiter; - private final XMLServerSettings sharedSettings = XMLServerSettings.INSTANCE; - - private final DOMProcessingInstructionFormatter processingInstructionFormatter; - - private final DOMDocTypeFormatter docTypeFormatter; - - private final DOMElementFormatter elementFormatter; - - private final DOMAttributeFormatter attributeFormatter; - - private final DOMTextFormatter textFormatter; - - private final DOMCommentFormatter commentFormatter; - - private final DOMCDATAFormatter cDATAFormatter; - - private int startOffset = -1; - private int endOffset = -1; - - private CancelChecker cancelChecker; - - /** - * XML formatter document. - */ - public XMLFormatterDocumentNew(DOMDocument xmlDocument, Range range) { - this.xmlDocument = xmlDocument; - this.textDocument = xmlDocument.getTextDocument(); - this.lineDelimiter = computeLineDelimiter(textDocument); - if (range != null) { - try { - startOffset = textDocument.offsetAt(range.getStart()); - endOffset = textDocument.offsetAt(range.getEnd()); - } catch (BadLocationException e) { - LOGGER.log(Level.SEVERE, e.getMessage(), e); - } - } - this.docTypeFormatter = new DOMDocTypeFormatter(this); - this.attributeFormatter = new DOMAttributeFormatter(this); - this.elementFormatter = new DOMElementFormatter(this, attributeFormatter); - this.processingInstructionFormatter = - new DOMProcessingInstructionFormatter(this, attributeFormatter); - this.textFormatter = new DOMTextFormatter(this); - this.commentFormatter = new DOMCommentFormatter(this); - this.cDATAFormatter = new DOMCDATAFormatter(this); - } - - private static String computeLineDelimiter(TextDocument textDocument) { - try { - return textDocument.lineDelimiter(0); - } catch (BadLocationException e) { - LOGGER.log(Level.SEVERE, e.getMessage(), e); - } - return System.lineSeparator(); - } - - /** - * Returns a List containing multiple TextEdit, containing the newly formatted changes of an XML - * document. - * - * @return List containing multiple TextEdit of an XML document. - * @throws BadLocationException - */ - public List format() throws BadLocationException { - return format(xmlDocument, startOffset, endOffset); - } - - public List format(DOMDocument document, int start, int end) { - List edits = new ArrayList<>(); - - // get initial document region - DOMNode currentDOMNode = getDOMNodeToFormat(document, start, end); - - if (currentDOMNode != null) { - int startOffset = currentDOMNode.getStart(); - - XMLFormattingConstraints parentConstraints = getNodeConstraints(currentDOMNode); - - // initialize available line width - int lineWidth = getMaxLineWidth(); - - try { - int lineOffset = textDocument.lineOffsetAt(startOffset); - lineWidth = lineWidth - (startOffset - lineOffset); - } catch (BadLocationException e) { - LOGGER.log(Level.SEVERE, e.getMessage(), e); - } - parentConstraints.setAvailableLineWidth(lineWidth); - - // format all siblings (and their children) as long they - // overlap with start/end offset - if (currentDOMNode.isElement()) { - parentConstraints.setFormatElementCategory( - getFormatElementCategory((DOMElement) currentDOMNode, null)); - } else { - parentConstraints.setFormatElementCategory(FormatElementCategory.IgnoreSpace); - } - formatSiblings(edits, currentDOMNode, parentConstraints, start, end); - } - - boolean insertFinalNewline = isInsertFinalNewline(); - if (isTrimFinalNewlines()) { - trimFinalNewlines(insertFinalNewline, edits); - } - if (insertFinalNewline) { - String xml = textDocument.getText(); - int endDocument = xml.length() - 1; - if (endDocument >= 0) { - char c = xml.charAt(endDocument); - if (c != '\n') { - try { - Position pos = textDocument.positionAt(endDocument); - pos.setColumn(pos.getColumn() + 1); - Range range = new Range(pos, pos); - edits.add(new TextEdit(range, lineDelimiter)); - } catch (BadLocationException e) { - LOGGER.log(Level.SEVERE, e.getMessage(), e); - } - } - } - } - return edits; - } - - /** - * Returns the DOM node to format according to the given range and the DOM document otherwise. - * - * @param document the DOM document. - * @param start the start range offset and -1 otherwise. - * @param end the end range offset and -1 otherwise. - * @return the DOM node to format according to the given range and the DOM document otherwise. - */ - private static DOMNode getDOMNodeToFormat(DOMDocument document, int start, int end) { - if (start != -1 && end != -1) { - DOMNode startNode = document.findNodeAt(start); - DOMNode endNode = document.findNodeBefore(end); - - if (endNode.getStart() == start) { - // ex : - //

- // || - //
- return endNode; - } - - if (isCoverNode(startNode, endNode)) { - return startNode; - } else if (isCoverNode(endNode, startNode)) { - return endNode; - } else { - DOMNode startParent = startNode.getParentNode(); - DOMNode endParent = endNode.getParentNode(); - while (startParent != null && endParent != null) { - if (isCoverNode(startParent, endParent)) { - return startParent; - } else if (isCoverNode(endParent, startParent)) { - return endParent; - } - startParent = startParent.getParentNode(); - endParent = endParent.getParentNode(); - } - } - } - return document; - } - - private static boolean isCoverNode(DOMNode startNode, DOMNode endNode) { - return (startNode.getStart() < endNode.getStart() && startNode.getEnd() > endNode.getEnd()) - || startNode == endNode; - } - - /** - * Returns the DOM node constraints of the given DOM node. - * - * @param node the DOM node. - * @return the DOM node constraints of the given DOM node. - */ - private XMLFormattingConstraints getNodeConstraints(DOMNode node) { - XMLFormattingConstraints result = new XMLFormattingConstraints(); - // Compute the indent level according to the parent node. - int indentLevel = 0; - while (node != null) { - node = node.getParentElement(); - if (node != null) { - indentLevel++; - } - } - result.setIndentLevel(indentLevel); - return result; - } - - private void formatSiblings( - List edits, - DOMNode domNode, - XMLFormattingConstraints parentConstraints, - int start, - int end) { - DOMNode currentDOMNode = domNode; - while (currentDOMNode != null) { - if (cancelChecker != null) { - cancelChecker.checkCanceled(); - } - format(currentDOMNode, parentConstraints, start, end, edits); - currentDOMNode = currentDOMNode.getNextSibling(); - } - } - - private void format( - DOMNode child, - XMLFormattingConstraints parentConstraints, - int start, - int end, - List edits) { - - switch (child.getNodeType()) { - case Node.DOCUMENT_TYPE_NODE: - DOMDocumentType docType = (DOMDocumentType) child; - docTypeFormatter.formatDocType(docType, parentConstraints, start, end, edits); - break; - - case Node.DOCUMENT_NODE: - DOMDocument document = (DOMDocument) child; - formatChildren(document, parentConstraints, start, end, edits); - break; - - case DOMNode.PROCESSING_INSTRUCTION_NODE: - DOMProcessingInstruction processingInstruction = (DOMProcessingInstruction) child; - processingInstructionFormatter.formatProcessingInstruction( - processingInstruction, parentConstraints, edits); - break; - - case Node.ELEMENT_NODE: - DOMElement element = (DOMElement) child; - elementFormatter.formatElement(element, parentConstraints, start, end, edits); - break; - - case Node.TEXT_NODE: - DOMText textNode = (DOMText) child; - textFormatter.formatText(textNode, parentConstraints, edits); - break; - - case Node.COMMENT_NODE: - DOMComment commentNode = (DOMComment) child; - commentFormatter.formatComment(commentNode, parentConstraints, edits); - break; - - case Node.CDATA_SECTION_NODE: - DOMCDATASection cDATANode = (DOMCDATASection) child; - cDATAFormatter.formatCDATASection(cDATANode, parentConstraints, edits); - break; - - default: - // unknown, so just leave alone for now but make sure to update - // available line width - int width = updateLineWidthWithLastLine(child, parentConstraints.getAvailableLineWidth()); - parentConstraints.setAvailableLineWidth(width); - } - } - - public void formatChildren( - DOMNode currentDOMNode, - XMLFormattingConstraints parentConstraints, - int start, - int end, - List edits) { - for (DOMNode child : currentDOMNode.getChildren()) { - format(child, parentConstraints, start, end, edits); - } - } - - public void formatAttributeValue(DOMAttr attr, int indentLevel, List edits) { - } - - public void removeLeftSpaces(int leftLimit, int to, List edits) { - replaceLeftSpacesWith(leftLimit, to, "", edits); - } - - public void replaceLeftSpacesWithOneSpace(int leftLimit, int to, List edits) { - replaceLeftSpacesWith(leftLimit, to, " ", edits); - } - - void replaceLeftSpacesWith(int leftLimit, int to, String replacement, List edits) { - int from = adjustOffsetWithLeftWhitespaces(leftLimit, to); - if (from >= 0) { - createTextEditIfNeeded(from, to, replacement, edits); - } - } - - void replaceQuoteWithPreferred(int from, int to, List edits) { - createTextEditIfNeeded(from, to, getQuotationAsString(), edits); - } - - public int adjustOffsetWithLeftWhitespaces(int leftLimit, int to) { - return TextEditUtils.adjustOffsetWithLeftWhitespaces(leftLimit, to, textDocument.getText()); - } - - public int replaceLeftSpacesWithIndentation( - int indentLevel, int leftLimit, int to, boolean addLineSeparator, List edits) { - int from = adjustOffsetWithLeftWhitespaces(leftLimit, to); - if (from >= 0) { - String expectedSpaces = getIndentSpaces(indentLevel, addLineSeparator); - createTextEditIfNeeded(from, to, expectedSpaces, edits); - return expectedSpaces.length(); - } - return 0; - } - - public int replaceLeftSpacesWithIndentationWithMultiNewLines( - int indentLevel, int leftLimit, int offset, int newLineCount, List edits) { - int from = adjustOffsetWithLeftWhitespaces(leftLimit, offset); - if (from >= 0) { - String expectedSpaces = getIndentSpacesWithMultiNewLines(indentLevel, newLineCount); - createTextEditIfNeeded(from, offset, expectedSpaces, edits); - return expectedSpaces.length(); - } - return 0; - } - - public int replaceLeftSpacesWithIndentationWithOffsetSpaces( - int indentSpace, int leftLimit, int to, boolean addLineSeparator, List edits) { - int from = adjustOffsetWithLeftWhitespaces(leftLimit, to); - if (from >= 0) { - String expectedSpaces = getIndentSpacesWithOffsetSpaces(indentSpace, addLineSeparator); - createTextEditIfNeeded(from, to, expectedSpaces, edits); - return expectedSpaces.length(); - } - return 0; - } - - boolean hasLineBreak(int from, int to) { - String text = textDocument.getText(); - for (int i = from; i < to; i++) { - char c = text.charAt(i); - if (isLineSeparator(c)) { - return true; - } - } - return false; - } - - public int getNormalizedLength(int from, int to) { - String text = textDocument.getText(); - int contentOffset = 0; - for (int i = from; i < to; i++) { - if (Character.isWhitespace(text.charAt(i)) && !Character.isWhitespace(text.charAt(i + 1))) { - to -= contentOffset; - contentOffset = 0; - } else if (Character.isWhitespace(text.charAt(i))) { - contentOffset++; - } - } - return to; - } - - public int getOffsetWithPreserveLineBreaks( - int from, int to, int tabSize, boolean isInsertSpaces) { - int initialTo = to; - String text = textDocument.getText(); - for (int i = to; i > from; i--) { - if (text.charAt(i) == '\t') { - to -= tabSize; - } else if (isLineSeparator(text.charAt(i))) { - int prevIndent = 0; - for (int j = i + 1; j < initialTo; j++) { - if (text.charAt(j) == '\t' && !isInsertSpaces) { - prevIndent += tabSize; - } else if (Character.isWhitespace(text.charAt(j))) { - prevIndent++; - } else { - to += (prevIndent - tabSize); - return to; - } - } - } else if (text.charAt(i) == ' ' && StringUtils.isQuote(text.charAt(i - 1))) { - int j = 1; - while (text.charAt(i + j) == ' ') { - to++; - j++; - } - to--; - } else { - to--; - } - } - return to; - } - - // DTD formatting - - // ------- Utilities method - - int updateLineWidthWithLastLine(DOMNode child, int availableLineWidth) { - String text = textDocument.getText(); - int lineWidth = availableLineWidth; - int end = child.getEnd(); - // Check if next char after the end of the DOM node is a new line feed. - if (end < text.length()) { - char c = text.charAt(end); - if (isLineSeparator(c)) { - // ex: \r\n - return getMaxLineWidth(); - } - } - for (int i = end - 1; i > child.getStart(); i--) { - char c = text.charAt(i); - if (isLineSeparator(c)) { - return lineWidth; - } else { - lineWidth--; - } - } - return lineWidth; - } - - private static boolean isLineSeparator(char c) { - return c == '\r' || c == '\n'; - } - - public int getLineBreakOffset(int startAttr, int start) { - String text = textDocument.getText(); - for (int i = startAttr; i < start; i++) { - char c = text.charAt(i); - if (isLineSeparator(c)) { - return i; - } - } - return -1; - } - - void insertLineBreak(int start, int end, List edits) { - createTextEditIfNeeded(start, end, lineDelimiter, edits); - } - - void replaceSpacesWithOneSpace(int spaceStart, int spaceEnd, List edits) { - if (spaceStart >= 0) { - spaceEnd = spaceEnd == -1 ? spaceStart + 1 : spaceEnd + 1; - // Replace several spaces with one space - // a[space][space][space]b - // --> a[space]b - replaceLeftSpacesWithOneSpace(spaceStart, spaceEnd, edits); - } - } - - /** - * Returns the format element category of the given DOM element. - * - * @param element the DOM element. - * @param parentConstraints the parent constraints. - * @return the format element category of the given DOM element. - */ - public FormatElementCategory getFormatElementCategory( - DOMElement element, XMLFormattingConstraints parentConstraints) { - if (!element.isClosed()) { - return parentConstraints.getFormatElementCategory(); - } - - // Get the category from the settings - FormatElementCategory fromSettings = getFormattingSettings().getFormatElementCategory(element); - if (fromSettings != null) { - return fromSettings; - } - - if (XML_SPACE_ATTR_PRESERVE.equals(element.getAttribute(XML_SPACE_ATTR))) { - return FormatElementCategory.PreserveSpace; - } - - if (parentConstraints != null) { - if (parentConstraints.getFormatElementCategory() == FormatElementCategory.PreserveSpace) { - if (!XML_SPACE_ATTR_DEFAULT.equals(element.getAttribute(XML_SPACE_ATTR))) { - return FormatElementCategory.PreserveSpace; - } - } - } - - boolean hasElement = false; - boolean hasText = false; - boolean onlySpaces = true; - for (DOMNode child : element.getChildren()) { - if (child.isElement()) { - hasElement = true; - } else if (child.isText()) { - onlySpaces = ((Text) child).isElementContentWhitespace(); - if (!onlySpaces) { - hasText = true; - } - } - if (hasElement && hasText) { - return FormatElementCategory.MixedContent; - } - } - if (hasElement && onlySpaces) { - return FormatElementCategory.IgnoreSpace; - } - return FormatElementCategory.NormalizeSpace; - } - - void createTextEditIfNeeded(int from, int to, String expectedContent, List edits) { - TextEdit edit = TextEditUtils.createTextEditIfNeeded(from, to, expectedContent, textDocument); - if (edit != null) { - edits.add(edit); - } - } - - public String getIndentSpaces(int level, boolean addLineSeparator) { - StringBuilder spaces = new StringBuilder(); - if (addLineSeparator) { - spaces.append(lineDelimiter); - } - - for (int i = 0; i < level; i++) { - if (isInsertSpaces()) { - for (int j = 0; j < getTabSize(); j++) { - spaces.append(" "); - } - } else { - spaces.append("\t"); - } - } - return spaces.toString(); - } - - /** - * Return the expected indent spaces and new lines with the specified number of new lines. - * - * @param level the indent level. - * @param newLineCount the number of new lines to be added. - * @return the expected indent spaces and new lines with the specified number of new lines. - */ - private String getIndentSpacesWithMultiNewLines(int level, int newLineCount) { - StringBuilder spaces = new StringBuilder(); - while (newLineCount != 0) { - spaces.append(lineDelimiter); - newLineCount--; - } - - for (int i = 0; i < level; i++) { - if (isInsertSpaces()) { - for (int j = 0; j < getTabSize(); j++) { - spaces.append(" "); - } - } else { - spaces.append("\t"); - } - } - return spaces.toString(); - } - - private String getIndentSpacesWithOffsetSpaces(int spaceCount, boolean addLineSeparator) { - StringBuilder spaces = new StringBuilder(); - if (addLineSeparator) { - spaces.append(lineDelimiter); - } - int spaceOffset = spaceCount % getTabSize(); - - for (int i = 0; i < spaceCount / getTabSize(); i++) { - if (isInsertSpaces()) { - for (int j = 0; j < getTabSize(); j++) { - spaces.append(" "); - } - } else { - spaces.append("\t"); - } - } - - for (int i = 0; i < spaceOffset; i++) { - spaces.append(" "); - } - - return spaces.toString(); - } - - private void trimFinalNewlines(boolean insertFinalNewline, List edits) { - String xml = textDocument.getText(); - int end = xml.length() - 1; - int i = end; - while (i >= 0 && isLineSeparator(xml.charAt(i))) { - i--; - } - if (end > i) { - if (insertFinalNewline) { - // re-adjust offset to keep insert final new line - i++; - if (xml.charAt(end - 1) == '\r') { - i++; - } - } - if (end > i) { - try { - Position endPos = textDocument.positionAt(end + 1); - Position startPos = textDocument.positionAt(i + 1); - Range range = new Range(startPos, endPos); - edits.add(new TextEdit(range, "")); - } catch (BadLocationException e) { - LOGGER.log(Level.SEVERE, e.getMessage(), e); - } - } - } - } - - int getMaxLineWidth() { - return getFormattingSettings().getMaxLineWidth(); - } - - private int getTabSize() { - return EditorPreferences.INSTANCE.getTabSize(); - } - - private boolean isInsertSpaces() { - return EditorPreferences.INSTANCE.getUseSoftTab(); - } - - private boolean isTrimFinalNewlines() { - return getFormattingSettings().isTrimFinalNewLine(); - } - - private boolean isInsertFinalNewline() { - return getFormattingSettings().isInsertFinalNewLine(); - } - - private String getQuotationAsString() { - return "\""; - } - - private XMLFormattingOptions getFormattingSettings() { - return getSharedSettings().getFormattingOptions(); - } - - XMLServerSettings getSharedSettings() { - return sharedSettings; - } - - String getLineDelimiter() { - return lineDelimiter; - } - - String getText() { - return textDocument.getText(); - } - - public int getLineAtOffset(int offset) { - try { - return textDocument.lineOffsetAt(offset); - } catch (BadLocationException e) { - return -1; - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +/******************************************************************************* + * Copyright (c) 2022 Red Hat Inc. and others. + * All rights reserved. This program and the accompanying materials + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat Inc. - initial API and implementation + *******************************************************************************/ +package org.appdevforall.codeonthego.lsp.xml.providers.format; + +import org.appdevforall.codeonthego.lsp.models.TextEdit; +import org.appdevforall.codeonthego.lsp.xml.models.XMLFormattingOptions; +import org.appdevforall.codeonthego.lsp.xml.models.XMLServerSettings; +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.eclipse.lemminx.commons.BadLocationException; +import org.eclipse.lemminx.commons.TextDocument; +import org.eclipse.lemminx.dom.DOMAttr; +import org.eclipse.lemminx.dom.DOMCDATASection; +import org.eclipse.lemminx.dom.DOMComment; +import org.eclipse.lemminx.dom.DOMDocument; +import org.eclipse.lemminx.dom.DOMDocumentType; +import org.eclipse.lemminx.dom.DOMElement; +import org.eclipse.lemminx.dom.DOMNode; +import org.eclipse.lemminx.dom.DOMProcessingInstruction; +import org.eclipse.lemminx.dom.DOMText; +import org.eclipse.lemminx.utils.StringUtils; +import org.eclipse.lsp4j.jsonrpc.CancelChecker; +import org.w3c.dom.Node; +import org.w3c.dom.Text; + +/** + * Experimental XML formatter which generates several text edit to remove, add, update spaces / + * indent. + * + * @author Angelo ZERR + */ +public class XMLFormatterDocumentNew { + + private static final Logger LOGGER = Logger.getLogger(XMLFormatterDocumentNew.class.getName()); + + private static final String XML_SPACE_ATTR = "xml:space"; + + private static final String XML_SPACE_ATTR_DEFAULT = "default"; + + private static final String XML_SPACE_ATTR_PRESERVE = "preserve"; + + private final DOMDocument xmlDocument; + private final TextDocument textDocument; + private final String lineDelimiter; + private final XMLServerSettings sharedSettings = XMLServerSettings.INSTANCE; + + private final DOMProcessingInstructionFormatter processingInstructionFormatter; + + private final DOMDocTypeFormatter docTypeFormatter; + + private final DOMElementFormatter elementFormatter; + + private final DOMAttributeFormatter attributeFormatter; + + private final DOMTextFormatter textFormatter; + + private final DOMCommentFormatter commentFormatter; + + private final DOMCDATAFormatter cDATAFormatter; + + private int startOffset = -1; + private int endOffset = -1; + + private CancelChecker cancelChecker; + + /** + * XML formatter document. + */ + public XMLFormatterDocumentNew(DOMDocument xmlDocument, Range range) { + this.xmlDocument = xmlDocument; + this.textDocument = xmlDocument.getTextDocument(); + this.lineDelimiter = computeLineDelimiter(textDocument); + if (range != null) { + try { + startOffset = textDocument.offsetAt(range.getStart()); + endOffset = textDocument.offsetAt(range.getEnd()); + } catch (BadLocationException e) { + LOGGER.log(Level.SEVERE, e.getMessage(), e); + } + } + this.docTypeFormatter = new DOMDocTypeFormatter(this); + this.attributeFormatter = new DOMAttributeFormatter(this); + this.elementFormatter = new DOMElementFormatter(this, attributeFormatter); + this.processingInstructionFormatter = + new DOMProcessingInstructionFormatter(this, attributeFormatter); + this.textFormatter = new DOMTextFormatter(this); + this.commentFormatter = new DOMCommentFormatter(this); + this.cDATAFormatter = new DOMCDATAFormatter(this); + } + + private static String computeLineDelimiter(TextDocument textDocument) { + try { + return textDocument.lineDelimiter(0); + } catch (BadLocationException e) { + LOGGER.log(Level.SEVERE, e.getMessage(), e); + } + return System.lineSeparator(); + } + + /** + * Returns a List containing multiple TextEdit, containing the newly formatted changes of an XML + * document. + * + * @return List containing multiple TextEdit of an XML document. + * @throws BadLocationException + */ + public List format() throws BadLocationException { + return format(xmlDocument, startOffset, endOffset); + } + + public List format(DOMDocument document, int start, int end) { + List edits = new ArrayList<>(); + + // get initial document region + DOMNode currentDOMNode = getDOMNodeToFormat(document, start, end); + + if (currentDOMNode != null) { + int startOffset = currentDOMNode.getStart(); + + XMLFormattingConstraints parentConstraints = getNodeConstraints(currentDOMNode); + + // initialize available line width + int lineWidth = getMaxLineWidth(); + + try { + int lineOffset = textDocument.lineOffsetAt(startOffset); + lineWidth = lineWidth - (startOffset - lineOffset); + } catch (BadLocationException e) { + LOGGER.log(Level.SEVERE, e.getMessage(), e); + } + parentConstraints.setAvailableLineWidth(lineWidth); + + // format all siblings (and their children) as long they + // overlap with start/end offset + if (currentDOMNode.isElement()) { + parentConstraints.setFormatElementCategory( + getFormatElementCategory((DOMElement) currentDOMNode, null)); + } else { + parentConstraints.setFormatElementCategory(FormatElementCategory.IgnoreSpace); + } + formatSiblings(edits, currentDOMNode, parentConstraints, start, end); + } + + boolean insertFinalNewline = isInsertFinalNewline(); + if (isTrimFinalNewlines()) { + trimFinalNewlines(insertFinalNewline, edits); + } + if (insertFinalNewline) { + String xml = textDocument.getText(); + int endDocument = xml.length() - 1; + if (endDocument >= 0) { + char c = xml.charAt(endDocument); + if (c != '\n') { + try { + Position pos = textDocument.positionAt(endDocument); + pos.setColumn(pos.getColumn() + 1); + Range range = new Range(pos, pos); + edits.add(new TextEdit(range, lineDelimiter)); + } catch (BadLocationException e) { + LOGGER.log(Level.SEVERE, e.getMessage(), e); + } + } + } + } + return edits; + } + + /** + * Returns the DOM node to format according to the given range and the DOM document otherwise. + * + * @param document the DOM document. + * @param start the start range offset and -1 otherwise. + * @param end the end range offset and -1 otherwise. + * @return the DOM node to format according to the given range and the DOM document otherwise. + */ + private static DOMNode getDOMNodeToFormat(DOMDocument document, int start, int end) { + if (start != -1 && end != -1) { + DOMNode startNode = document.findNodeAt(start); + DOMNode endNode = document.findNodeBefore(end); + + if (endNode.getStart() == start) { + // ex : + //
+ // || + //
+ return endNode; + } + + if (isCoverNode(startNode, endNode)) { + return startNode; + } else if (isCoverNode(endNode, startNode)) { + return endNode; + } else { + DOMNode startParent = startNode.getParentNode(); + DOMNode endParent = endNode.getParentNode(); + while (startParent != null && endParent != null) { + if (isCoverNode(startParent, endParent)) { + return startParent; + } else if (isCoverNode(endParent, startParent)) { + return endParent; + } + startParent = startParent.getParentNode(); + endParent = endParent.getParentNode(); + } + } + } + return document; + } + + private static boolean isCoverNode(DOMNode startNode, DOMNode endNode) { + return (startNode.getStart() < endNode.getStart() && startNode.getEnd() > endNode.getEnd()) + || startNode == endNode; + } + + /** + * Returns the DOM node constraints of the given DOM node. + * + * @param node the DOM node. + * @return the DOM node constraints of the given DOM node. + */ + private XMLFormattingConstraints getNodeConstraints(DOMNode node) { + XMLFormattingConstraints result = new XMLFormattingConstraints(); + // Compute the indent level according to the parent node. + int indentLevel = 0; + while (node != null) { + node = node.getParentElement(); + if (node != null) { + indentLevel++; + } + } + result.setIndentLevel(indentLevel); + return result; + } + + private void formatSiblings( + List edits, + DOMNode domNode, + XMLFormattingConstraints parentConstraints, + int start, + int end) { + DOMNode currentDOMNode = domNode; + while (currentDOMNode != null) { + if (cancelChecker != null) { + cancelChecker.checkCanceled(); + } + format(currentDOMNode, parentConstraints, start, end, edits); + currentDOMNode = currentDOMNode.getNextSibling(); + } + } + + private void format( + DOMNode child, + XMLFormattingConstraints parentConstraints, + int start, + int end, + List edits) { + + switch (child.getNodeType()) { + case Node.DOCUMENT_TYPE_NODE: + DOMDocumentType docType = (DOMDocumentType) child; + docTypeFormatter.formatDocType(docType, parentConstraints, start, end, edits); + break; + + case Node.DOCUMENT_NODE: + DOMDocument document = (DOMDocument) child; + formatChildren(document, parentConstraints, start, end, edits); + break; + + case DOMNode.PROCESSING_INSTRUCTION_NODE: + DOMProcessingInstruction processingInstruction = (DOMProcessingInstruction) child; + processingInstructionFormatter.formatProcessingInstruction( + processingInstruction, parentConstraints, edits); + break; + + case Node.ELEMENT_NODE: + DOMElement element = (DOMElement) child; + elementFormatter.formatElement(element, parentConstraints, start, end, edits); + break; + + case Node.TEXT_NODE: + DOMText textNode = (DOMText) child; + textFormatter.formatText(textNode, parentConstraints, edits); + break; + + case Node.COMMENT_NODE: + DOMComment commentNode = (DOMComment) child; + commentFormatter.formatComment(commentNode, parentConstraints, edits); + break; + + case Node.CDATA_SECTION_NODE: + DOMCDATASection cDATANode = (DOMCDATASection) child; + cDATAFormatter.formatCDATASection(cDATANode, parentConstraints, edits); + break; + + default: + // unknown, so just leave alone for now but make sure to update + // available line width + int width = updateLineWidthWithLastLine(child, parentConstraints.getAvailableLineWidth()); + parentConstraints.setAvailableLineWidth(width); + } + } + + public void formatChildren( + DOMNode currentDOMNode, + XMLFormattingConstraints parentConstraints, + int start, + int end, + List edits) { + for (DOMNode child : currentDOMNode.getChildren()) { + format(child, parentConstraints, start, end, edits); + } + } + + public void formatAttributeValue(DOMAttr attr, int indentLevel, List edits) { + } + + public void removeLeftSpaces(int leftLimit, int to, List edits) { + replaceLeftSpacesWith(leftLimit, to, "", edits); + } + + public void replaceLeftSpacesWithOneSpace(int leftLimit, int to, List edits) { + replaceLeftSpacesWith(leftLimit, to, " ", edits); + } + + void replaceLeftSpacesWith(int leftLimit, int to, String replacement, List edits) { + int from = adjustOffsetWithLeftWhitespaces(leftLimit, to); + if (from >= 0) { + createTextEditIfNeeded(from, to, replacement, edits); + } + } + + void replaceQuoteWithPreferred(int from, int to, List edits) { + createTextEditIfNeeded(from, to, getQuotationAsString(), edits); + } + + public int adjustOffsetWithLeftWhitespaces(int leftLimit, int to) { + return TextEditUtils.adjustOffsetWithLeftWhitespaces(leftLimit, to, textDocument.getText()); + } + + public int replaceLeftSpacesWithIndentation( + int indentLevel, int leftLimit, int to, boolean addLineSeparator, List edits) { + int from = adjustOffsetWithLeftWhitespaces(leftLimit, to); + if (from >= 0) { + String expectedSpaces = getIndentSpaces(indentLevel, addLineSeparator); + createTextEditIfNeeded(from, to, expectedSpaces, edits); + return expectedSpaces.length(); + } + return 0; + } + + public int replaceLeftSpacesWithIndentationWithMultiNewLines( + int indentLevel, int leftLimit, int offset, int newLineCount, List edits) { + int from = adjustOffsetWithLeftWhitespaces(leftLimit, offset); + if (from >= 0) { + String expectedSpaces = getIndentSpacesWithMultiNewLines(indentLevel, newLineCount); + createTextEditIfNeeded(from, offset, expectedSpaces, edits); + return expectedSpaces.length(); + } + return 0; + } + + public int replaceLeftSpacesWithIndentationWithOffsetSpaces( + int indentSpace, int leftLimit, int to, boolean addLineSeparator, List edits) { + int from = adjustOffsetWithLeftWhitespaces(leftLimit, to); + if (from >= 0) { + String expectedSpaces = getIndentSpacesWithOffsetSpaces(indentSpace, addLineSeparator); + createTextEditIfNeeded(from, to, expectedSpaces, edits); + return expectedSpaces.length(); + } + return 0; + } + + boolean hasLineBreak(int from, int to) { + String text = textDocument.getText(); + for (int i = from; i < to; i++) { + char c = text.charAt(i); + if (isLineSeparator(c)) { + return true; + } + } + return false; + } + + public int getNormalizedLength(int from, int to) { + String text = textDocument.getText(); + int contentOffset = 0; + for (int i = from; i < to; i++) { + if (Character.isWhitespace(text.charAt(i)) && !Character.isWhitespace(text.charAt(i + 1))) { + to -= contentOffset; + contentOffset = 0; + } else if (Character.isWhitespace(text.charAt(i))) { + contentOffset++; + } + } + return to; + } + + public int getOffsetWithPreserveLineBreaks( + int from, int to, int tabSize, boolean isInsertSpaces) { + int initialTo = to; + String text = textDocument.getText(); + for (int i = to; i > from; i--) { + if (text.charAt(i) == '\t') { + to -= tabSize; + } else if (isLineSeparator(text.charAt(i))) { + int prevIndent = 0; + for (int j = i + 1; j < initialTo; j++) { + if (text.charAt(j) == '\t' && !isInsertSpaces) { + prevIndent += tabSize; + } else if (Character.isWhitespace(text.charAt(j))) { + prevIndent++; + } else { + to += (prevIndent - tabSize); + return to; + } + } + } else if (text.charAt(i) == ' ' && StringUtils.isQuote(text.charAt(i - 1))) { + int j = 1; + while (text.charAt(i + j) == ' ') { + to++; + j++; + } + to--; + } else { + to--; + } + } + return to; + } + + // DTD formatting + + // ------- Utilities method + + int updateLineWidthWithLastLine(DOMNode child, int availableLineWidth) { + String text = textDocument.getText(); + int lineWidth = availableLineWidth; + int end = child.getEnd(); + // Check if next char after the end of the DOM node is a new line feed. + if (end < text.length()) { + char c = text.charAt(end); + if (isLineSeparator(c)) { + // ex: \r\n + return getMaxLineWidth(); + } + } + for (int i = end - 1; i > child.getStart(); i--) { + char c = text.charAt(i); + if (isLineSeparator(c)) { + return lineWidth; + } else { + lineWidth--; + } + } + return lineWidth; + } + + private static boolean isLineSeparator(char c) { + return c == '\r' || c == '\n'; + } + + public int getLineBreakOffset(int startAttr, int start) { + String text = textDocument.getText(); + for (int i = startAttr; i < start; i++) { + char c = text.charAt(i); + if (isLineSeparator(c)) { + return i; + } + } + return -1; + } + + void insertLineBreak(int start, int end, List edits) { + createTextEditIfNeeded(start, end, lineDelimiter, edits); + } + + void replaceSpacesWithOneSpace(int spaceStart, int spaceEnd, List edits) { + if (spaceStart >= 0) { + spaceEnd = spaceEnd == -1 ? spaceStart + 1 : spaceEnd + 1; + // Replace several spaces with one space + // a[space][space][space]b + // --> a[space]b + replaceLeftSpacesWithOneSpace(spaceStart, spaceEnd, edits); + } + } + + /** + * Returns the format element category of the given DOM element. + * + * @param element the DOM element. + * @param parentConstraints the parent constraints. + * @return the format element category of the given DOM element. + */ + public FormatElementCategory getFormatElementCategory( + DOMElement element, XMLFormattingConstraints parentConstraints) { + if (!element.isClosed()) { + return parentConstraints.getFormatElementCategory(); + } + + // Get the category from the settings + FormatElementCategory fromSettings = getFormattingSettings().getFormatElementCategory(element); + if (fromSettings != null) { + return fromSettings; + } + + if (XML_SPACE_ATTR_PRESERVE.equals(element.getAttribute(XML_SPACE_ATTR))) { + return FormatElementCategory.PreserveSpace; + } + + if (parentConstraints != null) { + if (parentConstraints.getFormatElementCategory() == FormatElementCategory.PreserveSpace) { + if (!XML_SPACE_ATTR_DEFAULT.equals(element.getAttribute(XML_SPACE_ATTR))) { + return FormatElementCategory.PreserveSpace; + } + } + } + + boolean hasElement = false; + boolean hasText = false; + boolean onlySpaces = true; + for (DOMNode child : element.getChildren()) { + if (child.isElement()) { + hasElement = true; + } else if (child.isText()) { + onlySpaces = ((Text) child).isElementContentWhitespace(); + if (!onlySpaces) { + hasText = true; + } + } + if (hasElement && hasText) { + return FormatElementCategory.MixedContent; + } + } + if (hasElement && onlySpaces) { + return FormatElementCategory.IgnoreSpace; + } + return FormatElementCategory.NormalizeSpace; + } + + void createTextEditIfNeeded(int from, int to, String expectedContent, List edits) { + TextEdit edit = TextEditUtils.createTextEditIfNeeded(from, to, expectedContent, textDocument); + if (edit != null) { + edits.add(edit); + } + } + + public String getIndentSpaces(int level, boolean addLineSeparator) { + StringBuilder spaces = new StringBuilder(); + if (addLineSeparator) { + spaces.append(lineDelimiter); + } + + for (int i = 0; i < level; i++) { + if (isInsertSpaces()) { + for (int j = 0; j < getTabSize(); j++) { + spaces.append(" "); + } + } else { + spaces.append("\t"); + } + } + return spaces.toString(); + } + + /** + * Return the expected indent spaces and new lines with the specified number of new lines. + * + * @param level the indent level. + * @param newLineCount the number of new lines to be added. + * @return the expected indent spaces and new lines with the specified number of new lines. + */ + private String getIndentSpacesWithMultiNewLines(int level, int newLineCount) { + StringBuilder spaces = new StringBuilder(); + while (newLineCount != 0) { + spaces.append(lineDelimiter); + newLineCount--; + } + + for (int i = 0; i < level; i++) { + if (isInsertSpaces()) { + for (int j = 0; j < getTabSize(); j++) { + spaces.append(" "); + } + } else { + spaces.append("\t"); + } + } + return spaces.toString(); + } + + private String getIndentSpacesWithOffsetSpaces(int spaceCount, boolean addLineSeparator) { + StringBuilder spaces = new StringBuilder(); + if (addLineSeparator) { + spaces.append(lineDelimiter); + } + int spaceOffset = spaceCount % getTabSize(); + + for (int i = 0; i < spaceCount / getTabSize(); i++) { + if (isInsertSpaces()) { + for (int j = 0; j < getTabSize(); j++) { + spaces.append(" "); + } + } else { + spaces.append("\t"); + } + } + + for (int i = 0; i < spaceOffset; i++) { + spaces.append(" "); + } + + return spaces.toString(); + } + + private void trimFinalNewlines(boolean insertFinalNewline, List edits) { + String xml = textDocument.getText(); + int end = xml.length() - 1; + int i = end; + while (i >= 0 && isLineSeparator(xml.charAt(i))) { + i--; + } + if (end > i) { + if (insertFinalNewline) { + // re-adjust offset to keep insert final new line + i++; + if (xml.charAt(end - 1) == '\r') { + i++; + } + } + if (end > i) { + try { + Position endPos = textDocument.positionAt(end + 1); + Position startPos = textDocument.positionAt(i + 1); + Range range = new Range(startPos, endPos); + edits.add(new TextEdit(range, "")); + } catch (BadLocationException e) { + LOGGER.log(Level.SEVERE, e.getMessage(), e); + } + } + } + } + + int getMaxLineWidth() { + return getFormattingSettings().getMaxLineWidth(); + } + + private int getTabSize() { + return EditorPreferences.INSTANCE.getTabSize(); + } + + private boolean isInsertSpaces() { + return EditorPreferences.INSTANCE.getUseSoftTab(); + } + + private boolean isTrimFinalNewlines() { + return getFormattingSettings().isTrimFinalNewLine(); + } + + private boolean isInsertFinalNewline() { + return getFormattingSettings().isInsertFinalNewLine(); + } + + private String getQuotationAsString() { + return "\""; + } + + private XMLFormattingOptions getFormattingSettings() { + return getSharedSettings().getFormattingOptions(); + } + + XMLServerSettings getSharedSettings() { + return sharedSettings; + } + + String getLineDelimiter() { + return lineDelimiter; + } + + String getText() { + return textDocument.getText(); + } + + public int getLineAtOffset(int offset) { + try { + return textDocument.lineOffsetAt(offset); + } catch (BadLocationException e) { + return -1; + } + } +} diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/XMLFormattingConstraints.java b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/XMLFormattingConstraints.java similarity index 94% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/XMLFormattingConstraints.java rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/XMLFormattingConstraints.java index 49fac0aa60..db5069b3f7 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/format/XMLFormattingConstraints.java +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/format/XMLFormattingConstraints.java @@ -1,77 +1,77 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -/******************************************************************************* - * Copyright (c) 2022 Red Hat Inc. and others. - * All rights reserved. This program and the accompanying materials - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v20.html - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat Inc. - initial API and implementation - *******************************************************************************/ -package com.itsaky.androidide.lsp.xml.providers.format; - -/** - * XML formatting constraints. - * - * @author Angelo ZERR - */ -public class XMLFormattingConstraints { - - private FormatElementCategory formatElementCategory; - - private int availableLineWidth = 0; - private int indentLevel = 0; - - /** - * Initializes the values in this formatting constraint with values from constraints - * - * @param constraints cannot be null - */ - public void copyConstraints(XMLFormattingConstraints constraints) { - setFormatElementCategory(constraints.getFormatElementCategory()); - setAvailableLineWidth(constraints.getAvailableLineWidth()); - setIndentLevel(constraints.getIndentLevel()); - } - - public FormatElementCategory getFormatElementCategory() { - return formatElementCategory; - } - - public void setFormatElementCategory(FormatElementCategory formatElementCategory) { - this.formatElementCategory = formatElementCategory; - } - - public int getAvailableLineWidth() { - return availableLineWidth; - } - - public void setAvailableLineWidth(int availableLineWidth) { - this.availableLineWidth = availableLineWidth; - } - - public int getIndentLevel() { - return indentLevel; - } - - public void setIndentLevel(int indentLevel) { - this.indentLevel = indentLevel; - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +/******************************************************************************* + * Copyright (c) 2022 Red Hat Inc. and others. + * All rights reserved. This program and the accompanying materials + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat Inc. - initial API and implementation + *******************************************************************************/ +package org.appdevforall.codeonthego.lsp.xml.providers.format; + +/** + * XML formatting constraints. + * + * @author Angelo ZERR + */ +public class XMLFormattingConstraints { + + private FormatElementCategory formatElementCategory; + + private int availableLineWidth = 0; + private int indentLevel = 0; + + /** + * Initializes the values in this formatting constraint with values from constraints + * + * @param constraints cannot be null + */ + public void copyConstraints(XMLFormattingConstraints constraints) { + setFormatElementCategory(constraints.getFormatElementCategory()); + setAvailableLineWidth(constraints.getAvailableLineWidth()); + setIndentLevel(constraints.getIndentLevel()); + } + + public FormatElementCategory getFormatElementCategory() { + return formatElementCategory; + } + + public void setFormatElementCategory(FormatElementCategory formatElementCategory) { + this.formatElementCategory = formatElementCategory; + } + + public int getAvailableLineWidth() { + return availableLineWidth; + } + + public void setAvailableLineWidth(int availableLineWidth) { + this.availableLineWidth = availableLineWidth; + } + + public int getIndentLevel() { + return indentLevel; + } + + public void setIndentLevel(int indentLevel) { + this.indentLevel = indentLevel; + } +} diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/snippet/XmlSnippetRepository.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/snippet/XmlSnippetRepository.kt similarity index 80% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/snippet/XmlSnippetRepository.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/snippet/XmlSnippetRepository.kt index bbe78a2da8..a11a16d52e 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/snippet/XmlSnippetRepository.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/snippet/XmlSnippetRepository.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.snippet +package org.appdevforall.codeonthego.lsp.xml.providers.snippet -import com.itsaky.androidide.lsp.snippets.ISnippet -import com.itsaky.androidide.lsp.snippets.SnippetLanguage -import com.itsaky.androidide.lsp.snippets.SnippetRegistry +import org.appdevforall.codeonthego.lsp.snippets.ISnippet +import org.appdevforall.codeonthego.lsp.snippets.SnippetLanguage +import org.appdevforall.codeonthego.lsp.snippets.SnippetRegistry object XmlSnippetRepository { val snippets: Map> diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/snippet/XmlSnippetScope.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/snippet/XmlSnippetScope.kt similarity index 91% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/snippet/XmlSnippetScope.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/snippet/XmlSnippetScope.kt index 0928747fb9..d6087626c9 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/providers/snippet/XmlSnippetScope.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/providers/snippet/XmlSnippetScope.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.snippet +package org.appdevforall.codeonthego.lsp.xml.providers.snippet -import com.itsaky.androidide.lsp.snippets.ISnippetScope +import org.appdevforall.codeonthego.lsp.snippets.ISnippetScope val XML_SNIPPET_SCOPES = listOf( diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/utils/StringUtils.java b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/utils/StringUtils.java similarity index 99% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/utils/StringUtils.java rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/utils/StringUtils.java index a71a7a8577..bea89bf566 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/utils/StringUtils.java +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/utils/StringUtils.java @@ -8,7 +8,7 @@ *

Contributors: Nikolas Komonen , Red Hat Inc. - initial API and * implementation */ -package com.itsaky.androidide.lsp.xml.utils; +package org.appdevforall.codeonthego.lsp.xml.utils; import java.util.Arrays; import java.util.Collection; diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/utils/XMLBuilder.java b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/utils/XMLBuilder.java similarity index 93% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/utils/XMLBuilder.java rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/utils/XMLBuilder.java index 8f6e335489..ca34496253 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/utils/XMLBuilder.java +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/utils/XMLBuilder.java @@ -25,9 +25,9 @@ *

Contributors: Angelo Zerr - initial API and implementation */ -package com.itsaky.androidide.lsp.xml.utils; +package org.appdevforall.codeonthego.lsp.xml.utils; -import com.itsaky.androidide.lsp.xml.models.XMLServerSettings; +import org.appdevforall.codeonthego.lsp.xml.models.XMLServerSettings; import org.eclipse.lemminx.dom.builder.BaseXmlFormattingOptions; import org.eclipse.lemminx.dom.builder.XmlBuilder; diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/utils/XmlUtils.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/utils/XmlUtils.kt similarity index 88% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/utils/XmlUtils.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/utils/XmlUtils.kt index 3daea605ad..5e7ed01bad 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/utils/XmlUtils.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/utils/XmlUtils.kt @@ -1,132 +1,132 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.xml.utils - -import com.itsaky.androidide.lexers.xml.XMLLexer -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType.ATTRIBUTE -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType.ATTRIBUTE_VALUE -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType.TAG -import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType.UNKNOWN -import org.antlr.v4.runtime.CharStreams -import org.antlr.v4.runtime.Token -import org.eclipse.lemminx.dom.DOMDocument -import org.eclipse.lemminx.dom.DOMElement -import org.eclipse.lemminx.dom.DOMNode -import org.slf4j.LoggerFactory - -/** @author Akash Yadav */ -object XmlUtils { - - private val log = LoggerFactory.getLogger(XmlUtils::class.java) - - fun isTag(node: DOMNode, index: Int): Boolean { - var name = node.nodeName - if (name.isNullOrBlank()) { - name = "" - } - return node.start < index && index <= node.start + name.length + 1 - } - - fun isEndTag(node: DOMNode?, index: Int): Boolean { - if (node !is DOMElement) { - return false - } - val endOpenOffset = node.endTagOpenOffset - return if (endOpenOffset == -1) { - false - } else index >= endOpenOffset - } - - fun isInAttributeValue(contents: String?, index: Int): Boolean { - val lexer = XMLLexer(CharStreams.fromString(contents)) - var token: Token - while (lexer.nextToken().also { token = it } != null) { - val start = token.startIndex - val end = token.stopIndex - if (token.type == Token.EOF) { - break - } - - if (index in start..end) { - return token.type == XMLLexer.STRING - } - if (end > index) { - break - } - } - return false - } - - fun getPrefix(parsed: DOMDocument, index: Int, type: NodeType?): String? { - val text = parsed.text - return when (type) { - TAG -> { - val nodeAt = parsed.findNodeAt(index) ?: run { - log.warn("Unable to find node at index {}", index) - return null - } - text.substring(nodeAt.start, index) - } - ATTRIBUTE -> { - val attr = parsed.findAttrAt(index) ?: run { - log.warn("Unable to find attribute at index {}", index) - return null - } - - text.substring(attr.start, index) - } - ATTRIBUTE_VALUE -> { - val attrAt = parsed.findAttrAt(index) ?: run { - log.warn("Unable to find attribute at index {}", index) - return null - } - - var prefix = text.substring(attrAt.nodeAttrValue.start + 1, index) - if (prefix.contains("|")) { - prefix = prefix.substring(prefix.lastIndexOf('|') + 1) - } - prefix - } - else -> "" - } - } - - fun getNodeType(parsed: DOMDocument, cursor: Int): NodeType { - val nodeAt = parsed.findNodeAt(cursor) ?: run { - log.warn("Unable to find node at index {}", cursor) - return UNKNOWN - } - - - if (isTag(nodeAt, cursor) || isEndTag(nodeAt, cursor)) { - return TAG - } - - return if (isInAttributeValue(parsed.textDocument.text, cursor)) { - ATTRIBUTE_VALUE - } else { - ATTRIBUTE - } - } - - enum class NodeType { - UNKNOWN, - TAG, - ATTRIBUTE, - ATTRIBUTE_VALUE - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.xml.utils + +import com.itsaky.androidide.lexers.xml.XMLLexer +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType.ATTRIBUTE +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType.ATTRIBUTE_VALUE +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType.TAG +import org.appdevforall.codeonthego.lsp.xml.utils.XmlUtils.NodeType.UNKNOWN +import org.antlr.v4.runtime.CharStreams +import org.antlr.v4.runtime.Token +import org.eclipse.lemminx.dom.DOMDocument +import org.eclipse.lemminx.dom.DOMElement +import org.eclipse.lemminx.dom.DOMNode +import org.slf4j.LoggerFactory + +/** @author Akash Yadav */ +object XmlUtils { + + private val log = LoggerFactory.getLogger(XmlUtils::class.java) + + fun isTag(node: DOMNode, index: Int): Boolean { + var name = node.nodeName + if (name.isNullOrBlank()) { + name = "" + } + return node.start < index && index <= node.start + name.length + 1 + } + + fun isEndTag(node: DOMNode?, index: Int): Boolean { + if (node !is DOMElement) { + return false + } + val endOpenOffset = node.endTagOpenOffset + return if (endOpenOffset == -1) { + false + } else index >= endOpenOffset + } + + fun isInAttributeValue(contents: String?, index: Int): Boolean { + val lexer = XMLLexer(CharStreams.fromString(contents)) + var token: Token + while (lexer.nextToken().also { token = it } != null) { + val start = token.startIndex + val end = token.stopIndex + if (token.type == Token.EOF) { + break + } + + if (index in start..end) { + return token.type == XMLLexer.STRING + } + if (end > index) { + break + } + } + return false + } + + fun getPrefix(parsed: DOMDocument, index: Int, type: NodeType?): String? { + val text = parsed.text + return when (type) { + TAG -> { + val nodeAt = parsed.findNodeAt(index) ?: run { + log.warn("Unable to find node at index {}", index) + return null + } + text.substring(nodeAt.start, index) + } + ATTRIBUTE -> { + val attr = parsed.findAttrAt(index) ?: run { + log.warn("Unable to find attribute at index {}", index) + return null + } + + text.substring(attr.start, index) + } + ATTRIBUTE_VALUE -> { + val attrAt = parsed.findAttrAt(index) ?: run { + log.warn("Unable to find attribute at index {}", index) + return null + } + + var prefix = text.substring(attrAt.nodeAttrValue.start + 1, index) + if (prefix.contains("|")) { + prefix = prefix.substring(prefix.lastIndexOf('|') + 1) + } + prefix + } + else -> "" + } + } + + fun getNodeType(parsed: DOMDocument, cursor: Int): NodeType { + val nodeAt = parsed.findNodeAt(cursor) ?: run { + log.warn("Unable to find node at index {}", cursor) + return UNKNOWN + } + + + if (isTag(nodeAt, cursor) || isEndTag(nodeAt, cursor)) { + return TAG + } + + return if (isInAttributeValue(parsed.textDocument.text, cursor)) { + ATTRIBUTE_VALUE + } else { + ATTRIBUTE + } + } + + enum class NodeType { + UNKNOWN, + TAG, + ATTRIBUTE, + ATTRIBUTE_VALUE + } +} diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/utils/inheritingAttrs.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/utils/inheritingAttrs.kt similarity index 96% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/utils/inheritingAttrs.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/utils/inheritingAttrs.kt index 3b0c6a1f45..a9808b98f7 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/utils/inheritingAttrs.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/utils/inheritingAttrs.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.utils +package org.appdevforall.codeonthego.lsp.xml.utils const val TRANSITION = "Transition" const val TRANSITION_FADE = "Fade" diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/utils/tagTransforms.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/utils/tagTransforms.kt similarity index 96% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/utils/tagTransforms.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/utils/tagTransforms.kt index da07e60c30..f88d35cbb4 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/utils/tagTransforms.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/utils/tagTransforms.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.utils +package org.appdevforall.codeonthego.lsp.xml.utils -import com.itsaky.androidide.lsp.xml.providers.completion.transformToEntryName +import org.appdevforall.codeonthego.lsp.xml.providers.completion.transformToEntryName /** Transforms tag names to styleable entry names. */ interface ITagTransformer { diff --git a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/utils/xmlCompletionUtils.kt b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/utils/xmlCompletionUtils.kt similarity index 94% rename from lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/utils/xmlCompletionUtils.kt rename to lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/utils/xmlCompletionUtils.kt index cc0c919eaf..86416c5f84 100644 --- a/lsp/xml/src/main/java/com/itsaky/androidide/lsp/xml/utils/xmlCompletionUtils.kt +++ b/lsp/xml/src/main/java/org/appdevforall/codeonthego/lsp/xml/utils/xmlCompletionUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.utils +package org.appdevforall.codeonthego.lsp.xml.utils import com.android.SdkConstants diff --git a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/CompletionHelper.kt b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/CompletionHelper.kt similarity index 89% rename from lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/CompletionHelper.kt rename to lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/CompletionHelper.kt index 09ab9b9736..a4bf269151 100644 --- a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/CompletionHelper.kt +++ b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/CompletionHelper.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml +package org.appdevforall.codeonthego.lsp.xml -import com.itsaky.androidide.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionItem /** * Helps with providing completions. diff --git a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/CompletionHelperImpl.kt b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/CompletionHelperImpl.kt similarity index 87% rename from lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/CompletionHelperImpl.kt rename to lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/CompletionHelperImpl.kt index f0d556051d..01434364ed 100644 --- a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/CompletionHelperImpl.kt +++ b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/CompletionHelperImpl.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml +package org.appdevforall.codeonthego.lsp.xml -import com.itsaky.androidide.lsp.models.CompletionItem -import com.itsaky.androidide.lsp.models.CompletionParams -import com.itsaky.androidide.progress.ICancelChecker +import org.appdevforall.codeonthego.lsp.models.CompletionItem +import org.appdevforall.codeonthego.lsp.models.CompletionParams +import org.appdevforall.codeonthego.progress.ICancelChecker /** @author Akash Yadav */ class CompletionHelperImpl : CompletionHelper { diff --git a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/XMLLSPTest.kt b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/XMLLSPTest.kt similarity index 82% rename from lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/XMLLSPTest.kt rename to lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/XMLLSPTest.kt index ac55ad7f89..5917773045 100644 --- a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/XMLLSPTest.kt +++ b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/XMLLSPTest.kt @@ -14,16 +14,16 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml +package org.appdevforall.codeonthego.lsp.xml -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lsp.api.ILanguageServerRegistry -import com.itsaky.androidide.lsp.api.LSPTest -import com.itsaky.androidide.projects.api.ModuleProject -import com.itsaky.androidide.projects.util.findAppModule -import com.itsaky.androidide.xml.resources.ResourceTableRegistry -import com.itsaky.androidide.xml.versions.ApiVersions -import com.itsaky.androidide.xml.widgets.WidgetTable +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lsp.api.ILanguageServerRegistry +import org.appdevforall.codeonthego.lsp.api.LSPTest +import org.appdevforall.codeonthego.projects.api.ModuleProject +import org.appdevforall.codeonthego.projects.util.findAppModule +import org.appdevforall.codeonthego.xml.resources.ResourceTableRegistry +import org.appdevforall.codeonthego.xml.versions.ApiVersions +import org.appdevforall.codeonthego.xml.widgets.WidgetTable import org.junit.Before import org.junit.Ignore diff --git a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/AttributeValueCompletionTest.kt b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/AttributeValueCompletionTest.kt similarity index 96% rename from lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/AttributeValueCompletionTest.kt rename to lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/AttributeValueCompletionTest.kt index 3c19baeb9e..c474a9dda1 100644 --- a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/AttributeValueCompletionTest.kt +++ b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/AttributeValueCompletionTest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion +package org.appdevforall.codeonthego.lsp.xml.providers.completion import com.android.aaptcompiler.AaptResourceType.BOOL import com.android.aaptcompiler.AaptResourceType.DIMEN @@ -23,10 +23,10 @@ import com.android.aaptcompiler.AaptResourceType.INTEGER import com.android.aaptcompiler.AaptResourceType.MENU import com.android.aaptcompiler.AaptResourceType.STRING import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.xml.CompletionHelper -import com.itsaky.androidide.lsp.xml.CompletionHelperImpl -import com.itsaky.androidide.lsp.xml.XMLLSPTest -import com.itsaky.androidide.lsp.xml.utils.dimensionUnits +import org.appdevforall.codeonthego.lsp.xml.CompletionHelper +import org.appdevforall.codeonthego.lsp.xml.CompletionHelperImpl +import org.appdevforall.codeonthego.lsp.xml.XMLLSPTest +import org.appdevforall.codeonthego.lsp.xml.utils.dimensionUnits import org.junit.Before import org.junit.Test import org.junit.runner.RunWith diff --git a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/CommonAttrCompletionProviderTest.kt b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/CommonAttrCompletionProviderTest.kt similarity index 90% rename from lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/CommonAttrCompletionProviderTest.kt rename to lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/CommonAttrCompletionProviderTest.kt index 0e4d4bd7d0..4fc05809be 100644 --- a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/CommonAttrCompletionProviderTest.kt +++ b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/CommonAttrCompletionProviderTest.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion +package org.appdevforall.codeonthego.lsp.xml.providers.completion import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.xml.CompletionHelper -import com.itsaky.androidide.lsp.xml.CompletionHelperImpl -import com.itsaky.androidide.lsp.xml.XMLLSPTest +import org.appdevforall.codeonthego.lsp.xml.CompletionHelper +import org.appdevforall.codeonthego.lsp.xml.CompletionHelperImpl +import org.appdevforall.codeonthego.lsp.xml.XMLLSPTest import org.junit.Before import org.junit.Test import org.junit.runner.RunWith diff --git a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/CommonAttrValueCompletionTest.kt b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/CommonAttrValueCompletionTest.kt similarity index 89% rename from lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/CommonAttrValueCompletionTest.kt rename to lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/CommonAttrValueCompletionTest.kt index 8d67719d76..9198423375 100644 --- a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/CommonAttrValueCompletionTest.kt +++ b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/CommonAttrValueCompletionTest.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion +package org.appdevforall.codeonthego.lsp.xml.providers.completion import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.xml.CompletionHelper -import com.itsaky.androidide.lsp.xml.CompletionHelperImpl -import com.itsaky.androidide.lsp.xml.XMLLSPTest +import org.appdevforall.codeonthego.lsp.xml.CompletionHelper +import org.appdevforall.codeonthego.lsp.xml.CompletionHelperImpl +import org.appdevforall.codeonthego.lsp.xml.XMLLSPTest import org.junit.Before import org.junit.Test import org.junit.runner.RunWith diff --git a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/LayoutAttributeCompletionProviderTest.kt b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/LayoutAttributeCompletionProviderTest.kt similarity index 97% rename from lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/LayoutAttributeCompletionProviderTest.kt rename to lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/LayoutAttributeCompletionProviderTest.kt index d8025b227f..94c40aa6ea 100644 --- a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/LayoutAttributeCompletionProviderTest.kt +++ b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/LayoutAttributeCompletionProviderTest.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion +package org.appdevforall.codeonthego.lsp.xml.providers.completion import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.xml.CompletionHelper -import com.itsaky.androidide.lsp.xml.CompletionHelperImpl -import com.itsaky.androidide.lsp.xml.XMLLSPTest +import org.appdevforall.codeonthego.lsp.xml.CompletionHelper +import org.appdevforall.codeonthego.lsp.xml.CompletionHelperImpl +import org.appdevforall.codeonthego.lsp.xml.XMLLSPTest import org.junit.Before import org.junit.Test import org.junit.runner.RunWith diff --git a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/ManifestAttrCompletionProviderTest.kt b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/ManifestAttrCompletionProviderTest.kt similarity index 89% rename from lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/ManifestAttrCompletionProviderTest.kt rename to lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/ManifestAttrCompletionProviderTest.kt index 2123ffc62c..c11b03b9b2 100644 --- a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/ManifestAttrCompletionProviderTest.kt +++ b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/ManifestAttrCompletionProviderTest.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion +package org.appdevforall.codeonthego.lsp.xml.providers.completion import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.xml.CompletionHelper -import com.itsaky.androidide.lsp.xml.CompletionHelperImpl -import com.itsaky.androidide.lsp.xml.XMLLSPTest +import org.appdevforall.codeonthego.lsp.xml.CompletionHelper +import org.appdevforall.codeonthego.lsp.xml.CompletionHelperImpl +import org.appdevforall.codeonthego.lsp.xml.XMLLSPTest import org.junit.Before import org.junit.Test import org.junit.runner.RunWith diff --git a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/ManifestAttrValueCompletionProviderTest.kt b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/ManifestAttrValueCompletionProviderTest.kt similarity index 95% rename from lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/ManifestAttrValueCompletionProviderTest.kt rename to lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/ManifestAttrValueCompletionProviderTest.kt index cad93f931d..2464b2ddd6 100644 --- a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/ManifestAttrValueCompletionProviderTest.kt +++ b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/ManifestAttrValueCompletionProviderTest.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion +package org.appdevforall.codeonthego.lsp.xml.providers.completion import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.xml.CompletionHelper -import com.itsaky.androidide.lsp.xml.CompletionHelperImpl -import com.itsaky.androidide.lsp.xml.XMLLSPTest +import org.appdevforall.codeonthego.lsp.xml.CompletionHelper +import org.appdevforall.codeonthego.lsp.xml.CompletionHelperImpl +import org.appdevforall.codeonthego.lsp.xml.XMLLSPTest import org.junit.Before import org.junit.Test import org.junit.runner.RunWith diff --git a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/ManifestTagCompletionProviderTest.kt b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/ManifestTagCompletionProviderTest.kt similarity index 88% rename from lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/ManifestTagCompletionProviderTest.kt rename to lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/ManifestTagCompletionProviderTest.kt index d9e2c09585..7651a3c6f2 100644 --- a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/ManifestTagCompletionProviderTest.kt +++ b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/ManifestTagCompletionProviderTest.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.providers.completion +package org.appdevforall.codeonthego.lsp.xml.providers.completion import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.xml.CompletionHelper -import com.itsaky.androidide.lsp.xml.CompletionHelperImpl -import com.itsaky.androidide.lsp.xml.XMLLSPTest +import org.appdevforall.codeonthego.lsp.xml.CompletionHelper +import org.appdevforall.codeonthego.lsp.xml.CompletionHelperImpl +import org.appdevforall.codeonthego.lsp.xml.XMLLSPTest import org.junit.Before import org.junit.Test import org.junit.runner.RunWith diff --git a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/XMLCompletionProviderTest.kt b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/XMLCompletionProviderTest.kt similarity index 88% rename from lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/XMLCompletionProviderTest.kt rename to lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/XMLCompletionProviderTest.kt index 22c1d2191d..d8c1953f12 100644 --- a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/providers/completion/XMLCompletionProviderTest.kt +++ b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/providers/completion/XMLCompletionProviderTest.kt @@ -1,93 +1,93 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.lsp.xml.providers.completion - -import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lsp.xml.CompletionHelper -import com.itsaky.androidide.lsp.xml.CompletionHelperImpl -import com.itsaky.androidide.lsp.xml.XMLLSPTest -import org.junit.Before -import org.junit.Test -import org.junit.runner.RunWith -import org.robolectric.RobolectricTestRunner - -/** @author Akash Yadav */ -@RunWith(RobolectricTestRunner::class) -class XMLCompletionProviderTest : CompletionHelper by CompletionHelperImpl() { - - @Before - fun setup() { - XMLLSPTest.initProjectIfNeeded() - } - - @Test - fun `test simple tag completion`() { - XMLLSPTest.apply { - openFile("../res/layout/TagCompletion") - - val (isIncomplete, items) = complete() - - assertThat(isIncomplete).isTrue() - assertThat(items).isNotEmpty() - - assertThat(items).containsAtLeast("ImageView", "ImageButton") - } - } - - @Test - fun `test empty tag completion`() { - XMLLSPTest.apply { - openFile("../res/layout/EmptyTagNameCompletion") - - val (isIncomplete, items) = complete() - - assertThat(isIncomplete).isTrue() - assertThat(items).isNotEmpty() - - assertThat(items).containsAtLeast("ImageView", "ImageButton") - } - } - - @Test - fun `test simple attribute value completion`() { - XMLLSPTest.apply { - openFile("../res/layout/AttributeValueCompletion") - - val (isIncomplete, items) = complete() - - assertThat(isIncomplete).isFalse() - assertThat(items).isNotEmpty() - - assertThat(items).containsAtLeast("center", "fitCenter", "fitXY", "matrix") - } - } - - @Test - fun `test simple attribute completion`() { - XMLLSPTest.apply { - openFile("../res/layout/AttributeCompletion") - - val (isIncomplete, items) = complete() - - assertThat(isIncomplete).isFalse() - assertThat(items).isNotEmpty() - - assertThat(items).containsAtLeast("android:text", "android:textColor", "android:textAlignment", "android:textAllCaps") - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.lsp.xml.providers.completion + +import com.google.common.truth.Truth.assertThat +import org.appdevforall.codeonthego.lsp.xml.CompletionHelper +import org.appdevforall.codeonthego.lsp.xml.CompletionHelperImpl +import org.appdevforall.codeonthego.lsp.xml.XMLLSPTest +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner + +/** @author Akash Yadav */ +@RunWith(RobolectricTestRunner::class) +class XMLCompletionProviderTest : CompletionHelper by CompletionHelperImpl() { + + @Before + fun setup() { + XMLLSPTest.initProjectIfNeeded() + } + + @Test + fun `test simple tag completion`() { + XMLLSPTest.apply { + openFile("../res/layout/TagCompletion") + + val (isIncomplete, items) = complete() + + assertThat(isIncomplete).isTrue() + assertThat(items).isNotEmpty() + + assertThat(items).containsAtLeast("ImageView", "ImageButton") + } + } + + @Test + fun `test empty tag completion`() { + XMLLSPTest.apply { + openFile("../res/layout/EmptyTagNameCompletion") + + val (isIncomplete, items) = complete() + + assertThat(isIncomplete).isTrue() + assertThat(items).isNotEmpty() + + assertThat(items).containsAtLeast("ImageView", "ImageButton") + } + } + + @Test + fun `test simple attribute value completion`() { + XMLLSPTest.apply { + openFile("../res/layout/AttributeValueCompletion") + + val (isIncomplete, items) = complete() + + assertThat(isIncomplete).isFalse() + assertThat(items).isNotEmpty() + + assertThat(items).containsAtLeast("center", "fitCenter", "fitXY", "matrix") + } + } + + @Test + fun `test simple attribute completion`() { + XMLLSPTest.apply { + openFile("../res/layout/AttributeCompletion") + + val (isIncomplete, items) = complete() + + assertThat(isIncomplete).isFalse() + assertThat(items).isNotEmpty() + + assertThat(items).containsAtLeast("android:text", "android:textColor", "android:textAlignment", "android:textAllCaps") + } + } +} diff --git a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/utils/TagTransformsTest.kt b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/utils/TagTransformsTest.kt similarity index 98% rename from lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/utils/TagTransformsTest.kt rename to lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/utils/TagTransformsTest.kt index 41f58ef49e..52080e9dc6 100644 --- a/lsp/xml/src/test/java/com/itsaky/androidide/lsp/xml/utils/TagTransformsTest.kt +++ b/lsp/xml/src/test/java/org/appdevforall/codeonthego/lsp/xml/utils/TagTransformsTest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.xml.utils +package org.appdevforall.codeonthego.lsp.xml.utils import com.google.common.truth.Truth.assertThat import org.junit.Test diff --git a/markdown-preview-plugin/build.gradle.kts b/markdown-preview-plugin/build.gradle.kts index c9fc0538d2..d243e91a89 100644 --- a/markdown-preview-plugin/build.gradle.kts +++ b/markdown-preview-plugin/build.gradle.kts @@ -1,7 +1,7 @@ plugins { id("com.android.application") version "8.8.2" id("org.jetbrains.kotlin.android") version "2.1.21" - id("com.itsaky.androidide.plugins.build") + id("org.appdevforall.codeonthego.plugins.build") } pluginBuilder { diff --git a/markdown-preview-plugin/src/main/kotlin/com/codeonthego/markdownpreviewer/MarkdownPreviewerPlugin.kt b/markdown-preview-plugin/src/main/kotlin/com/codeonthego/markdownpreviewer/MarkdownPreviewerPlugin.kt index 936f44cf6e..9f1ea733f9 100644 --- a/markdown-preview-plugin/src/main/kotlin/com/codeonthego/markdownpreviewer/MarkdownPreviewerPlugin.kt +++ b/markdown-preview-plugin/src/main/kotlin/com/codeonthego/markdownpreviewer/MarkdownPreviewerPlugin.kt @@ -1,16 +1,16 @@ package com.codeonthego.markdownpreviewer import androidx.fragment.app.Fragment -import com.itsaky.androidide.plugins.IPlugin -import com.itsaky.androidide.plugins.PluginContext -import com.itsaky.androidide.plugins.extensions.UIExtension -import com.itsaky.androidide.plugins.extensions.EditorTabExtension -import com.itsaky.androidide.plugins.extensions.MenuItem -import com.itsaky.androidide.plugins.extensions.TabItem -import com.itsaky.androidide.plugins.extensions.EditorTabItem -import com.itsaky.androidide.plugins.extensions.NavigationItem -import com.itsaky.androidide.plugins.extensions.ContextMenuContext -import com.itsaky.androidide.plugins.services.IdeEditorTabService +import org.appdevforall.codeonthego.plugins.IPlugin +import org.appdevforall.codeonthego.plugins.PluginContext +import org.appdevforall.codeonthego.plugins.extensions.UIExtension +import org.appdevforall.codeonthego.plugins.extensions.EditorTabExtension +import org.appdevforall.codeonthego.plugins.extensions.MenuItem +import org.appdevforall.codeonthego.plugins.extensions.TabItem +import org.appdevforall.codeonthego.plugins.extensions.EditorTabItem +import org.appdevforall.codeonthego.plugins.extensions.NavigationItem +import org.appdevforall.codeonthego.plugins.extensions.ContextMenuContext +import org.appdevforall.codeonthego.plugins.services.IdeEditorTabService import com.codeonthego.markdownpreviewer.fragments.MarkdownPreviewFragment import java.io.File diff --git a/markdown-preview-plugin/src/main/kotlin/com/codeonthego/markdownpreviewer/fragments/MarkdownPreviewFragment.kt b/markdown-preview-plugin/src/main/kotlin/com/codeonthego/markdownpreviewer/fragments/MarkdownPreviewFragment.kt index 937298ca9d..9b22281af2 100644 --- a/markdown-preview-plugin/src/main/kotlin/com/codeonthego/markdownpreviewer/fragments/MarkdownPreviewFragment.kt +++ b/markdown-preview-plugin/src/main/kotlin/com/codeonthego/markdownpreviewer/fragments/MarkdownPreviewFragment.kt @@ -24,9 +24,9 @@ import androidx.lifecycle.lifecycleScope import com.codeonthego.markdownpreviewer.MarkdownPreviewerPlugin import com.codeonthego.markdownpreviewer.PreviewState import com.codeonthego.markdownpreviewer.R -import com.itsaky.androidide.plugins.base.PluginFragmentHelper -import com.itsaky.androidide.plugins.services.IdeProjectService -import com.itsaky.androidide.plugins.services.IdeFileService +import org.appdevforall.codeonthego.plugins.base.PluginFragmentHelper +import org.appdevforall.codeonthego.plugins.services.IdeProjectService +import org.appdevforall.codeonthego.plugins.services.IdeFileService import io.noties.markwon.Markwon import io.noties.markwon.ext.tables.TablePlugin import io.noties.markwon.ext.strikethrough.StrikethroughPlugin diff --git a/plugin-api/build.gradle.kts b/plugin-api/build.gradle.kts index a37d2888f6..e96ac2cb0c 100644 --- a/plugin-api/build.gradle.kts +++ b/plugin-api/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } android { - namespace = "com.itsaky.androidide.plugins.api" + namespace = "org.appdevforall.codeonthego.plugins.api" compileSdk = 36 defaultConfig { @@ -32,7 +32,7 @@ kotlin { apiValidation { ignoredClasses.add("com.itsaky.androidide.plugins.api.BuildConfig") - nonPublicMarkers.add("com.itsaky.androidide.plugins.base.InternalPluginApi") + nonPublicMarkers.add("org.appdevforall.codeonthego.plugins.base.InternalPluginApi") } dependencies { diff --git a/plugin-api/plugin-builder/build.gradle.kts b/plugin-api/plugin-builder/build.gradle.kts index d87081d08d..d380371c0a 100644 --- a/plugin-api/plugin-builder/build.gradle.kts +++ b/plugin-api/plugin-builder/build.gradle.kts @@ -3,7 +3,7 @@ plugins { `maven-publish` } -group = "com.itsaky.androidide.plugins" +group = "org.appdevforall.codeonthego.plugins" version = "1.0.0" dependencies { @@ -27,8 +27,8 @@ tasks.withType().configureEach { gradlePlugin { plugins { create("pluginBuilder") { - id = "com.itsaky.androidide.plugins.build" - implementationClass = "com.itsaky.androidide.plugins.build.PluginBuilder" + id = "org.appdevforall.codeonthego.plugins.build" + implementationClass = "org.appdevforall.codeonthego.plugins.build.PluginBuilder" displayName = "Code on the Go Plugin Builder" description = "Gradle plugin for building Code on the Go plugins" } diff --git a/plugin-api/plugin-builder/src/main/kotlin/com/itsaky/androidide/plugins/build/GenerateCgpBuildProperties.kt b/plugin-api/plugin-builder/src/main/kotlin/org/appdevforall/codeonthego/plugins/build/GenerateCgpBuildProperties.kt similarity index 98% rename from plugin-api/plugin-builder/src/main/kotlin/com/itsaky/androidide/plugins/build/GenerateCgpBuildProperties.kt rename to plugin-api/plugin-builder/src/main/kotlin/org/appdevforall/codeonthego/plugins/build/GenerateCgpBuildProperties.kt index 93b1b2849b..9c5176447d 100644 --- a/plugin-api/plugin-builder/src/main/kotlin/com/itsaky/androidide/plugins/build/GenerateCgpBuildProperties.kt +++ b/plugin-api/plugin-builder/src/main/kotlin/org/appdevforall/codeonthego/plugins/build/GenerateCgpBuildProperties.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.build +package org.appdevforall.codeonthego.plugins.build import org.gradle.api.DefaultTask import org.gradle.api.file.DirectoryProperty diff --git a/plugin-api/plugin-builder/src/main/kotlin/com/itsaky/androidide/plugins/build/PluginBuilder.kt b/plugin-api/plugin-builder/src/main/kotlin/org/appdevforall/codeonthego/plugins/build/PluginBuilder.kt similarity index 99% rename from plugin-api/plugin-builder/src/main/kotlin/com/itsaky/androidide/plugins/build/PluginBuilder.kt rename to plugin-api/plugin-builder/src/main/kotlin/org/appdevforall/codeonthego/plugins/build/PluginBuilder.kt index b2c31689dc..2a712993a1 100644 --- a/plugin-api/plugin-builder/src/main/kotlin/com/itsaky/androidide/plugins/build/PluginBuilder.kt +++ b/plugin-api/plugin-builder/src/main/kotlin/org/appdevforall/codeonthego/plugins/build/PluginBuilder.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.build +package org.appdevforall.codeonthego.plugins.build import com.android.build.api.dsl.ApplicationExtension import com.android.build.api.variant.ApplicationAndroidComponentsExtension diff --git a/plugin-api/plugin-builder/src/main/kotlin/com/itsaky/androidide/plugins/build/PluginBuilderExtension.kt b/plugin-api/plugin-builder/src/main/kotlin/org/appdevforall/codeonthego/plugins/build/PluginBuilderExtension.kt similarity index 95% rename from plugin-api/plugin-builder/src/main/kotlin/com/itsaky/androidide/plugins/build/PluginBuilderExtension.kt rename to plugin-api/plugin-builder/src/main/kotlin/org/appdevforall/codeonthego/plugins/build/PluginBuilderExtension.kt index 67826f652e..0f1a32edc0 100644 --- a/plugin-api/plugin-builder/src/main/kotlin/com/itsaky/androidide/plugins/build/PluginBuilderExtension.kt +++ b/plugin-api/plugin-builder/src/main/kotlin/org/appdevforall/codeonthego/plugins/build/PluginBuilderExtension.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.build +package org.appdevforall.codeonthego.plugins.build import org.gradle.api.provider.Property diff --git a/plugin-api/plugin-builder/src/main/kotlin/com/itsaky/androidide/plugins/build/PluginProvenance.kt b/plugin-api/plugin-builder/src/main/kotlin/org/appdevforall/codeonthego/plugins/build/PluginProvenance.kt similarity index 99% rename from plugin-api/plugin-builder/src/main/kotlin/com/itsaky/androidide/plugins/build/PluginProvenance.kt rename to plugin-api/plugin-builder/src/main/kotlin/org/appdevforall/codeonthego/plugins/build/PluginProvenance.kt index e5e6dfa6c4..5b4dd47e62 100644 --- a/plugin-api/plugin-builder/src/main/kotlin/com/itsaky/androidide/plugins/build/PluginProvenance.kt +++ b/plugin-api/plugin-builder/src/main/kotlin/org/appdevforall/codeonthego/plugins/build/PluginProvenance.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.build +package org.appdevforall.codeonthego.plugins.build import java.io.File import java.time.Instant diff --git a/plugin-api/plugin-builder/src/main/kotlin/com/itsaky/androidide/plugins/build/ProvenanceResolver.kt b/plugin-api/plugin-builder/src/main/kotlin/org/appdevforall/codeonthego/plugins/build/ProvenanceResolver.kt similarity index 98% rename from plugin-api/plugin-builder/src/main/kotlin/com/itsaky/androidide/plugins/build/ProvenanceResolver.kt rename to plugin-api/plugin-builder/src/main/kotlin/org/appdevforall/codeonthego/plugins/build/ProvenanceResolver.kt index c860d98406..6770fe72bd 100644 --- a/plugin-api/plugin-builder/src/main/kotlin/com/itsaky/androidide/plugins/build/ProvenanceResolver.kt +++ b/plugin-api/plugin-builder/src/main/kotlin/org/appdevforall/codeonthego/plugins/build/ProvenanceResolver.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.build +package org.appdevforall.codeonthego.plugins.build import java.io.File diff --git a/plugin-api/plugin-builder/src/test/kotlin/com/itsaky/androidide/plugins/build/CgpBuildPropertiesTest.kt b/plugin-api/plugin-builder/src/test/kotlin/org/appdevforall/codeonthego/plugins/build/CgpBuildPropertiesTest.kt similarity index 98% rename from plugin-api/plugin-builder/src/test/kotlin/com/itsaky/androidide/plugins/build/CgpBuildPropertiesTest.kt rename to plugin-api/plugin-builder/src/test/kotlin/org/appdevforall/codeonthego/plugins/build/CgpBuildPropertiesTest.kt index 1b2aa82171..524d244547 100644 --- a/plugin-api/plugin-builder/src/test/kotlin/com/itsaky/androidide/plugins/build/CgpBuildPropertiesTest.kt +++ b/plugin-api/plugin-builder/src/test/kotlin/org/appdevforall/codeonthego/plugins/build/CgpBuildPropertiesTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.build +package org.appdevforall.codeonthego.plugins.build import com.google.common.truth.Truth.assertThat import org.junit.jupiter.api.Test diff --git a/plugin-api/plugin-builder/src/test/kotlin/com/itsaky/androidide/plugins/build/GitDirectoryReaderTest.kt b/plugin-api/plugin-builder/src/test/kotlin/org/appdevforall/codeonthego/plugins/build/GitDirectoryReaderTest.kt similarity index 98% rename from plugin-api/plugin-builder/src/test/kotlin/com/itsaky/androidide/plugins/build/GitDirectoryReaderTest.kt rename to plugin-api/plugin-builder/src/test/kotlin/org/appdevforall/codeonthego/plugins/build/GitDirectoryReaderTest.kt index 3a42311f37..b68df462c5 100644 --- a/plugin-api/plugin-builder/src/test/kotlin/com/itsaky/androidide/plugins/build/GitDirectoryReaderTest.kt +++ b/plugin-api/plugin-builder/src/test/kotlin/org/appdevforall/codeonthego/plugins/build/GitDirectoryReaderTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.build +package org.appdevforall.codeonthego.plugins.build import com.google.common.truth.Truth.assertThat import org.junit.jupiter.api.Test diff --git a/plugin-api/plugin-builder/src/test/kotlin/com/itsaky/androidide/plugins/build/PluginProvenanceTest.kt b/plugin-api/plugin-builder/src/test/kotlin/org/appdevforall/codeonthego/plugins/build/PluginProvenanceTest.kt similarity index 99% rename from plugin-api/plugin-builder/src/test/kotlin/com/itsaky/androidide/plugins/build/PluginProvenanceTest.kt rename to plugin-api/plugin-builder/src/test/kotlin/org/appdevforall/codeonthego/plugins/build/PluginProvenanceTest.kt index cea0c5c139..1ed7ae424e 100644 --- a/plugin-api/plugin-builder/src/test/kotlin/com/itsaky/androidide/plugins/build/PluginProvenanceTest.kt +++ b/plugin-api/plugin-builder/src/test/kotlin/org/appdevforall/codeonthego/plugins/build/PluginProvenanceTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.build +package org.appdevforall.codeonthego.plugins.build import com.google.common.truth.Truth.assertThat import org.junit.jupiter.api.Test diff --git a/plugin-api/plugin-builder/src/test/kotlin/com/itsaky/androidide/plugins/build/ProvenanceResolverTest.kt b/plugin-api/plugin-builder/src/test/kotlin/org/appdevforall/codeonthego/plugins/build/ProvenanceResolverTest.kt similarity index 99% rename from plugin-api/plugin-builder/src/test/kotlin/com/itsaky/androidide/plugins/build/ProvenanceResolverTest.kt rename to plugin-api/plugin-builder/src/test/kotlin/org/appdevforall/codeonthego/plugins/build/ProvenanceResolverTest.kt index 7b31e90ccf..57002f4547 100644 --- a/plugin-api/plugin-builder/src/test/kotlin/com/itsaky/androidide/plugins/build/ProvenanceResolverTest.kt +++ b/plugin-api/plugin-builder/src/test/kotlin/org/appdevforall/codeonthego/plugins/build/ProvenanceResolverTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.build +package org.appdevforall.codeonthego.plugins.build import com.google.common.truth.Truth.assertThat import org.junit.jupiter.api.Test diff --git a/plugin-api/src/main/java/com/itsaky/androidide/plugins/services/CapabilityStatus.java b/plugin-api/src/main/java/org/appdevforall/codeonthego/plugins/services/CapabilityStatus.java similarity index 94% rename from plugin-api/src/main/java/com/itsaky/androidide/plugins/services/CapabilityStatus.java rename to plugin-api/src/main/java/org/appdevforall/codeonthego/plugins/services/CapabilityStatus.java index cfac616484..0b035deebd 100644 --- a/plugin-api/src/main/java/com/itsaky/androidide/plugins/services/CapabilityStatus.java +++ b/plugin-api/src/main/java/org/appdevforall/codeonthego/plugins/services/CapabilityStatus.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.services; +package org.appdevforall.codeonthego.plugins.services; /** * Whether something the agent depends on can be used right now: a {@link LlmInferenceService.StatusReportingBackend}, a {@link ToolSourceRegistry.StatusReportingToolSource} or one of its {@link ToolSourceRegistry.ToolGroup}s. diff --git a/plugin-api/src/main/java/com/itsaky/androidide/plugins/services/LlmInferenceService.java b/plugin-api/src/main/java/org/appdevforall/codeonthego/plugins/services/LlmInferenceService.java similarity index 99% rename from plugin-api/src/main/java/com/itsaky/androidide/plugins/services/LlmInferenceService.java rename to plugin-api/src/main/java/org/appdevforall/codeonthego/plugins/services/LlmInferenceService.java index 99ead62390..1272be4747 100644 --- a/plugin-api/src/main/java/com/itsaky/androidide/plugins/services/LlmInferenceService.java +++ b/plugin-api/src/main/java/org/appdevforall/codeonthego/plugins/services/LlmInferenceService.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.services; +package org.appdevforall.codeonthego.plugins.services; import androidx.annotation.NonNull; import androidx.annotation.Nullable; diff --git a/plugin-api/src/main/java/com/itsaky/androidide/plugins/services/ToolSourceRegistry.java b/plugin-api/src/main/java/org/appdevforall/codeonthego/plugins/services/ToolSourceRegistry.java similarity index 99% rename from plugin-api/src/main/java/com/itsaky/androidide/plugins/services/ToolSourceRegistry.java rename to plugin-api/src/main/java/org/appdevforall/codeonthego/plugins/services/ToolSourceRegistry.java index 60c6db1768..a75261b9df 100644 --- a/plugin-api/src/main/java/com/itsaky/androidide/plugins/services/ToolSourceRegistry.java +++ b/plugin-api/src/main/java/org/appdevforall/codeonthego/plugins/services/ToolSourceRegistry.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.services; +package org.appdevforall.codeonthego.plugins.services; import androidx.annotation.NonNull; import androidx.annotation.Nullable; diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/IPlugin.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/IPlugin.kt similarity index 97% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/IPlugin.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/IPlugin.kt index c54581cc1f..b49d9d6e9c 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/IPlugin.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/IPlugin.kt @@ -1,5 +1,5 @@ -package com.itsaky.androidide.plugins +package org.appdevforall.codeonthego.plugins import android.os.Parcelable import kotlinx.parcelize.Parcelize diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/PluginContext.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/PluginContext.kt similarity index 99% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/PluginContext.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/PluginContext.kt index efc44ea7d3..29ae6fbb9e 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/PluginContext.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/PluginContext.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.plugins +package org.appdevforall.codeonthego.plugins import android.content.Context import android.content.SharedPreferences diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/LlmBackendRegistration.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/LlmBackendRegistration.kt similarity index 94% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/LlmBackendRegistration.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/LlmBackendRegistration.kt index b069aeea8e..635e6bfaf7 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/LlmBackendRegistration.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/LlmBackendRegistration.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.plugins.ai +package org.appdevforall.codeonthego.plugins.ai import android.content.SharedPreferences -import com.itsaky.androidide.plugins.PluginContext -import com.itsaky.androidide.plugins.PluginLifecycleListener -import com.itsaky.androidide.plugins.services.LlmInferenceService -import com.itsaky.androidide.plugins.services.SharedServices +import org.appdevforall.codeonthego.plugins.PluginContext +import org.appdevforall.codeonthego.plugins.PluginLifecycleListener +import org.appdevforall.codeonthego.plugins.services.LlmInferenceService +import org.appdevforall.codeonthego.plugins.services.SharedServices /** * Keeps one backend plugin's [LlmInferenceService.LlmBackend] registered with the router, and tells @@ -38,7 +38,7 @@ class LlmBackendRegistration( ) { companion object { /** The plugin that publishes [LlmInferenceService]. */ - const val AI_CORE_PLUGIN_ID = "com.itsaky.androidide.plugins.aicore" + const val AI_CORE_PLUGIN_ID = "org.appdevforall.codeonthego.plugins.aicore" } private val lock = Any() diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigDocument.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigDocument.kt similarity index 98% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigDocument.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigDocument.kt index 508055fef0..6b0c26f39b 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigDocument.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigDocument.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.ai.prompt +package org.appdevforall.codeonthego.plugins.ai.prompt import org.snakeyaml.engine.v2.api.Load import org.snakeyaml.engine.v2.api.LoadSettings diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigException.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigException.kt similarity index 80% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigException.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigException.kt index e701cb861d..d0d2cc382c 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigException.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigException.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.ai.prompt +package org.appdevforall.codeonthego.plugins.ai.prompt /** Why a prompt config was refused, naming the file and the key, e.g. `rules.yml: rules[0].items`. */ class PromptConfigException( diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigLoader.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigLoader.kt similarity index 98% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigLoader.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigLoader.kt index d229391978..e77de60662 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigLoader.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigLoader.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.ai.prompt +package org.appdevforall.codeonthego.plugins.ai.prompt import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.Dispatchers diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigObject.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigObject.kt similarity index 98% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigObject.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigObject.kt index d8f38fd764..3ec481b2b1 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigObject.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigObject.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.ai.prompt +package org.appdevforall.codeonthego.plugins.ai.prompt /** * One YAML mapping of a prompt config, read key by key; [read] then refuses any key nothing asked diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigSource.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigSource.kt similarity index 95% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigSource.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigSource.kt index c1144206a2..68023f68fa 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigSource.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigSource.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.ai.prompt +package org.appdevforall.codeonthego.plugins.ai.prompt import android.content.res.AssetManager diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigStore.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigStore.kt similarity index 98% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigStore.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigStore.kt index 27e10433f6..e5bf3b6e75 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigStore.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigStore.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.ai.prompt +package org.appdevforall.codeonthego.plugins.ai.prompt import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptTemplateEngine.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptTemplateEngine.kt similarity index 99% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptTemplateEngine.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptTemplateEngine.kt index b4dc3bf7dc..fcd0b56d4c 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptTemplateEngine.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptTemplateEngine.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.ai.prompt +package org.appdevforall.codeonthego.plugins.ai.prompt /** * Renders a prompt template: `{{NAME}}` values, `{{#NAME}}...{{/NAME}}` and `{{^NAME}}...{{/NAME}}` diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptText.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptText.kt similarity index 88% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptText.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptText.kt index a6b93b45ff..e4b984e275 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptText.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptText.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.ai.prompt +package org.appdevforall.codeonthego.plugins.ai.prompt /** * Prompt wording from config: itself a template, so [PromptTemplateEngine] renders it where it is diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/ui/PaneStyling.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/ui/PaneStyling.kt similarity index 98% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/ui/PaneStyling.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/ui/PaneStyling.kt index 6cd59a375b..88ba875e48 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/ui/PaneStyling.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/ui/PaneStyling.kt @@ -1,6 +1,6 @@ @file:JvmName("PaneStyling") -package com.itsaky.androidide.plugins.ai.ui +package org.appdevforall.codeonthego.plugins.ai.ui import android.content.res.ColorStateList import android.graphics.Color diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/ui/SecretRevealController.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/ui/SecretRevealController.kt similarity index 98% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/ui/SecretRevealController.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/ui/SecretRevealController.kt index 26deea136b..e92faf82bc 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/ai/ui/SecretRevealController.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/ai/ui/SecretRevealController.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.ai.ui +package org.appdevforall.codeonthego.plugins.ai.ui import android.text.method.HideReturnsTransformationMethod import android.text.method.PasswordTransformationMethod diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/base/InternalPluginApi.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/base/InternalPluginApi.kt similarity index 84% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/base/InternalPluginApi.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/base/InternalPluginApi.kt index 71ed0e7b82..b49259c1f2 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/base/InternalPluginApi.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/base/InternalPluginApi.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.base +package org.appdevforall.codeonthego.plugins.base @RequiresOptIn( level = RequiresOptIn.Level.ERROR, diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/base/PluginFragment.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/base/PluginFragment.kt similarity index 97% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/base/PluginFragment.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/base/PluginFragment.kt index 2873504902..696b08c215 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/base/PluginFragment.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/base/PluginFragment.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.plugins.base +package org.appdevforall.codeonthego.plugins.base import android.content.Context import android.content.res.Resources import android.view.LayoutInflater -import com.itsaky.androidide.plugins.ServiceRegistry +import org.appdevforall.codeonthego.plugins.ServiceRegistry import java.lang.ref.WeakReference /** diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/base/PluginWindows.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/base/PluginWindows.kt similarity index 99% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/base/PluginWindows.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/base/PluginWindows.kt index 5ba7ad0531..e65429e222 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/base/PluginWindows.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/base/PluginWindows.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.base +package org.appdevforall.codeonthego.plugins.base import android.app.Activity import android.app.Dialog diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/base/SafePluginLayoutInflater.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/base/SafePluginLayoutInflater.kt similarity index 98% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/base/SafePluginLayoutInflater.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/base/SafePluginLayoutInflater.kt index d8e7dce821..d6cad18c28 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/base/SafePluginLayoutInflater.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/base/SafePluginLayoutInflater.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.base +package org.appdevforall.codeonthego.plugins.base import android.content.Context import android.util.AttributeSet diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/BuildActionExtension.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/BuildActionExtension.kt similarity index 96% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/BuildActionExtension.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/BuildActionExtension.kt index e4350a5978..034c7c3860 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/BuildActionExtension.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/BuildActionExtension.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.plugins.extensions +package org.appdevforall.codeonthego.plugins.extensions -import com.itsaky.androidide.plugins.IPlugin +import org.appdevforall.codeonthego.plugins.IPlugin interface BuildActionExtension : IPlugin { fun getBuildActions(): List diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/DocumentationExtension.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/DocumentationExtension.kt similarity index 97% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/DocumentationExtension.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/DocumentationExtension.kt index 8115845fb2..f18bfba500 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/DocumentationExtension.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/DocumentationExtension.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.plugins.extensions +package org.appdevforall.codeonthego.plugins.extensions -import com.itsaky.androidide.plugins.IPlugin +import org.appdevforall.codeonthego.plugins.IPlugin /** * Interface for plugins that provide documentation and tooltips. diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/EditorDecorationProvider.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/EditorDecorationProvider.kt similarity index 94% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/EditorDecorationProvider.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/EditorDecorationProvider.kt index ee1099c151..016fbda67e 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/EditorDecorationProvider.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/EditorDecorationProvider.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.plugins.extensions +package org.appdevforall.codeonthego.plugins.extensions -import com.itsaky.androidide.plugins.IPlugin +import org.appdevforall.codeonthego.plugins.IPlugin /** * Additive editor decoration extension: contributes foreground-color spans for regions of editor diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/EditorExtension.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/EditorExtension.kt similarity index 95% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/EditorExtension.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/EditorExtension.kt index ef4c3420a2..3b859af1f2 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/EditorExtension.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/EditorExtension.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.plugins.extensions +package org.appdevforall.codeonthego.plugins.extensions -import com.itsaky.androidide.plugins.IPlugin +import org.appdevforall.codeonthego.plugins.IPlugin interface EditorExtension : IPlugin { fun provideCompletionItems(context: CompletionContext): List diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/EditorTabExtension.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/EditorTabExtension.kt similarity index 95% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/EditorTabExtension.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/EditorTabExtension.kt index 43d73feabb..d8f2a61023 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/EditorTabExtension.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/EditorTabExtension.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.plugins.extensions +package org.appdevforall.codeonthego.plugins.extensions import androidx.fragment.app.Fragment -import com.itsaky.androidide.plugins.IPlugin +import org.appdevforall.codeonthego.plugins.IPlugin /** * Interface for plugins that want to contribute tabs to the main editor tab bar. diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/FileOpenExtension.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/FileOpenExtension.kt similarity index 84% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/FileOpenExtension.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/FileOpenExtension.kt index e6fc2d4ee2..de573e4f50 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/FileOpenExtension.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/FileOpenExtension.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.plugins.extensions +package org.appdevforall.codeonthego.plugins.extensions -import com.itsaky.androidide.plugins.IPlugin +import org.appdevforall.codeonthego.plugins.IPlugin import java.io.File interface FileOpenExtension : IPlugin { diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/LanguageExtension.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/LanguageExtension.kt similarity index 83% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/LanguageExtension.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/LanguageExtension.kt index 5eb4893b9d..f49361f58d 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/LanguageExtension.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/LanguageExtension.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.plugins.extensions +package org.appdevforall.codeonthego.plugins.extensions -import com.itsaky.androidide.plugins.IPlugin +import org.appdevforall.codeonthego.plugins.IPlugin interface LanguageExtension : IPlugin { fun getLanguages(): List diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/ProjectExtension.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/ProjectExtension.kt similarity index 94% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/ProjectExtension.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/ProjectExtension.kt index c2c92b8628..bf2db1e2e0 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/ProjectExtension.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/ProjectExtension.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.plugins.extensions +package org.appdevforall.codeonthego.plugins.extensions -import com.itsaky.androidide.plugins.IPlugin +import org.appdevforall.codeonthego.plugins.IPlugin import java.io.File interface ProjectExtension : IPlugin { diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/ProjectSearchExtension.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/ProjectSearchExtension.kt similarity index 96% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/ProjectSearchExtension.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/ProjectSearchExtension.kt index cb10d351f2..8063e38e0a 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/ProjectSearchExtension.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/ProjectSearchExtension.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.plugins.extensions +package org.appdevforall.codeonthego.plugins.extensions -import com.itsaky.androidide.plugins.IPlugin +import org.appdevforall.codeonthego.plugins.IPlugin import java.io.File import java.util.concurrent.CompletableFuture diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/SettingsExtension.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/SettingsExtension.kt similarity index 94% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/SettingsExtension.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/SettingsExtension.kt index c2fcdace7c..0b05814070 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/SettingsExtension.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/SettingsExtension.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.plugins.extensions +package org.appdevforall.codeonthego.plugins.extensions -import com.itsaky.androidide.plugins.IPlugin +import org.appdevforall.codeonthego.plugins.IPlugin /** * Interface for plugins that contribute rows to the IDE Preferences screen. diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/SnippetExtension.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/SnippetExtension.kt similarity index 69% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/SnippetExtension.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/SnippetExtension.kt index 64d498f1c9..ac2855de7c 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/SnippetExtension.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/SnippetExtension.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.plugins.extensions +package org.appdevforall.codeonthego.plugins.extensions -import com.itsaky.androidide.plugins.IPlugin +import org.appdevforall.codeonthego.plugins.IPlugin interface SnippetExtension : IPlugin { fun getSnippetContributions(): List diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/UIExtension.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/UIExtension.kt similarity index 97% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/UIExtension.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/UIExtension.kt index b0a2137c06..e8623ab64b 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/extensions/UIExtension.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/extensions/UIExtension.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.plugins.extensions +package org.appdevforall.codeonthego.plugins.extensions import androidx.fragment.app.Fragment -import com.itsaky.androidide.plugins.IPlugin +import org.appdevforall.codeonthego.plugins.IPlugin /** * Interface for plugins that extend the IDE's user interface. @@ -168,7 +168,7 @@ data class ToolbarAction( * The host re-invokes this each time the toolbar is (re)built, so a plugin can * change the icon in response to its own state. Ask the host to rebuild the * toolbar after a state change via - * [com.itsaky.androidide.plugins.services.IdeUIService.refreshToolbarActions]. + * [org.appdevforall.codeonthego.plugins.services.IdeUIService.refreshToolbarActions]. * If the returned resource is an animated drawable (e.g. `AnimatedVectorDrawable`), * the host starts it automatically; author it to loop for a continuous animation. * Returning null (or a failure) falls back to the static [icon]. diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/security/KeystoreSecretStore.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/security/KeystoreSecretStore.kt similarity index 99% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/security/KeystoreSecretStore.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/security/KeystoreSecretStore.kt index e6cc909513..df43d2ea63 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/security/KeystoreSecretStore.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/security/KeystoreSecretStore.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.security +package org.appdevforall.codeonthego.plugins.security import android.content.SharedPreferences import android.security.keystore.KeyPermanentlyInvalidatedException diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/security/SecretKeySource.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/security/SecretKeySource.kt similarity index 98% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/security/SecretKeySource.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/security/SecretKeySource.kt index 5e24788159..f4ed62dbe9 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/security/SecretKeySource.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/security/SecretKeySource.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.security +package org.appdevforall.codeonthego.plugins.security import android.security.keystore.KeyGenParameterSpec import android.security.keystore.KeyProperties diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeArchiveService.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeArchiveService.kt similarity index 97% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeArchiveService.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeArchiveService.kt index 05b6553a2b..4fefc05d49 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeArchiveService.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeArchiveService.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.services +package org.appdevforall.codeonthego.plugins.services import java.io.File import java.io.InputStream diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeCommandService.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeCommandService.kt similarity index 63% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeCommandService.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeCommandService.kt index ed4fb6a04f..715e5c8d19 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeCommandService.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeCommandService.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.plugins.services +package org.appdevforall.codeonthego.plugins.services -import com.itsaky.androidide.plugins.extensions.CommandOutput -import com.itsaky.androidide.plugins.extensions.CommandResult -import com.itsaky.androidide.plugins.extensions.CommandSpec +import org.appdevforall.codeonthego.plugins.extensions.CommandOutput +import org.appdevforall.codeonthego.plugins.extensions.CommandResult +import org.appdevforall.codeonthego.plugins.extensions.CommandSpec import kotlinx.coroutines.flow.Flow interface IdeCommandService { diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeEditorTabService.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeEditorTabService.kt similarity index 94% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeEditorTabService.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeEditorTabService.kt index 824ef78ba3..3c4d71aac7 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeEditorTabService.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeEditorTabService.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.services +package org.appdevforall.codeonthego.plugins.services /** * Service for managing plugin editor tabs integration. diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeEnvironmentService.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeEnvironmentService.kt similarity index 91% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeEnvironmentService.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeEnvironmentService.kt index e53bc1e737..4cbf47ddb1 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeEnvironmentService.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeEnvironmentService.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.services +package org.appdevforall.codeonthego.plugins.services import java.io.File import java.io.IOException @@ -8,7 +8,7 @@ import java.io.IOException * * Reading these paths is unrestricted. Writing to them through * [IdeFileService] or [IdeArchiveService] requires the plugin to declare the - * [com.itsaky.androidide.plugins.PluginPermission.IDE_ENVIRONMENT_WRITE] + * [org.appdevforall.codeonthego.plugins.PluginPermission.IDE_ENVIRONMENT_WRITE] * permission in its manifest. */ interface IdeEnvironmentService { diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeFeatureFlagService.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeFeatureFlagService.kt similarity index 59% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeFeatureFlagService.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeFeatureFlagService.kt index 8cc98a6cea..cdcd17a5de 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeFeatureFlagService.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeFeatureFlagService.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.services +package org.appdevforall.codeonthego.plugins.services interface IdeFeatureFlagService { diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeLogService.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeLogService.kt similarity index 98% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeLogService.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeLogService.kt index 2e2f619bc9..5e41093da6 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeLogService.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeLogService.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.services +package org.appdevforall.codeonthego.plugins.services /** * Read-only access to the IDE's App Logs and IDE Logs: the same retained history the editor's diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeServices.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeServices.kt similarity index 96% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeServices.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeServices.kt index 82d08ddbc9..2b482a9ff3 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeServices.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeServices.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.plugins.services +package org.appdevforall.codeonthego.plugins.services import android.app.Activity -import com.itsaky.androidide.plugins.extensions.IProject +import org.appdevforall.codeonthego.plugins.extensions.IProject import java.io.File import java.io.InputStream import java.util.concurrent.CompletableFuture @@ -334,8 +334,8 @@ interface IdeUIService { /** * Asks the IDE to rebuild the editor toolbar, re-evaluating each plugin - * [com.itsaky.androidide.plugins.extensions.ToolbarAction]'s dynamic providers - * ([com.itsaky.androidide.plugins.extensions.ToolbarAction.iconProvider], + * [org.appdevforall.codeonthego.plugins.extensions.ToolbarAction]'s dynamic providers + * ([org.appdevforall.codeonthego.plugins.extensions.ToolbarAction.iconProvider], * `isEnabledProvider`, `isVisibleProvider`). Call this after changing plugin state * that those providers depend on - e.g. to swap a toolbar icon between * idle/active/processing states. @@ -347,10 +347,10 @@ interface IdeUIService { fun refreshToolbarActions() {} companion object { - const val ACTION_OPEN_PLUGIN_SCREEN = "com.itsaky.androidide.plugins.OPEN_PLUGIN_SCREEN" - const val EXTRA_PLUGIN_ID = "com.itsaky.androidide.plugins.extra.PLUGIN_ID" - const val EXTRA_FRAGMENT_CLASS_NAME = "com.itsaky.androidide.plugins.extra.FRAGMENT_CLASS_NAME" - const val EXTRA_TITLE = "com.itsaky.androidide.plugins.extra.TITLE" + const val ACTION_OPEN_PLUGIN_SCREEN = "org.appdevforall.codeonthego.plugins.OPEN_PLUGIN_SCREEN" + const val EXTRA_PLUGIN_ID = "org.appdevforall.codeonthego.plugins.extra.PLUGIN_ID" + const val EXTRA_FRAGMENT_CLASS_NAME = "org.appdevforall.codeonthego.plugins.extra.FRAGMENT_CLASS_NAME" + const val EXTRA_TITLE = "org.appdevforall.codeonthego.plugins.extra.TITLE" } } @@ -538,7 +538,7 @@ interface IdeFileService { /** * Deletes a file or directory. Directories are removed recursively. * Required for plugins that need to clean up installed assets in - * [com.itsaky.androidide.plugins.IPlugin.deactivate]. + * [org.appdevforall.codeonthego.plugins.IPlugin.deactivate]. * @param file The file or directory to delete * @return true if the deletion was successful, false otherwise */ diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeSidebarService.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeSidebarService.kt similarity index 81% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeSidebarService.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeSidebarService.kt index 9bb39c4feb..0d048f5c68 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeSidebarService.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeSidebarService.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.plugins.services +package org.appdevforall.codeonthego.plugins.services interface IdeSidebarService { diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeSnippetService.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeSnippetService.kt similarity index 58% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeSnippetService.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeSnippetService.kt index aaf0ba2edb..5b1f4f133a 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeSnippetService.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeSnippetService.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.services +package org.appdevforall.codeonthego.plugins.services interface IdeSnippetService { fun refreshSnippets(pluginId: String) diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeTemplateService.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeTemplateService.kt similarity index 74% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeTemplateService.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeTemplateService.kt index 82bb621fb0..b9d4514609 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeTemplateService.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeTemplateService.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.plugins.services +package org.appdevforall.codeonthego.plugins.services -import com.itsaky.androidide.plugins.templates.CgtTemplateBuilder +import org.appdevforall.codeonthego.plugins.templates.CgtTemplateBuilder import java.io.File interface IdeTemplateService { diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeThemeService.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeThemeService.kt similarity index 83% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeThemeService.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeThemeService.kt index 0ab8cb2571..07d4dede45 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeThemeService.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeThemeService.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.services +package org.appdevforall.codeonthego.plugins.services interface IdeThemeService { diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeTooltipService.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeTooltipService.kt similarity index 94% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeTooltipService.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeTooltipService.kt index afdca13ee5..0bc3198503 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeTooltipService.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/IdeTooltipService.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.services +package org.appdevforall.codeonthego.plugins.services import android.view.View diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/SharedServices.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/SharedServices.kt similarity index 95% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/SharedServices.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/SharedServices.kt index f447ee3245..d7ac167fc2 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/SharedServices.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/services/SharedServices.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.services +package org.appdevforall.codeonthego.plugins.services import java.util.concurrent.ConcurrentHashMap diff --git a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/templates/CgtTemplateBuilder.kt b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/templates/CgtTemplateBuilder.kt similarity index 98% rename from plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/templates/CgtTemplateBuilder.kt rename to plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/templates/CgtTemplateBuilder.kt index 50c2a25198..11869ac4cd 100644 --- a/plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/templates/CgtTemplateBuilder.kt +++ b/plugin-api/src/main/kotlin/org/appdevforall/codeonthego/plugins/templates/CgtTemplateBuilder.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.plugins.templates +package org.appdevforall.codeonthego.plugins.templates -import com.itsaky.androidide.plugins.PluginContext +import org.appdevforall.codeonthego.plugins.PluginContext import java.io.File import java.io.InputStream import java.util.zip.ZipEntry diff --git a/plugin-api/src/test/java/com/itsaky/androidide/plugins/services/LlmInferenceServiceTest.java b/plugin-api/src/test/java/org/appdevforall/codeonthego/plugins/services/LlmInferenceServiceTest.java similarity index 99% rename from plugin-api/src/test/java/com/itsaky/androidide/plugins/services/LlmInferenceServiceTest.java rename to plugin-api/src/test/java/org/appdevforall/codeonthego/plugins/services/LlmInferenceServiceTest.java index cecf32bdc5..f6b3ad0a51 100644 --- a/plugin-api/src/test/java/com/itsaky/androidide/plugins/services/LlmInferenceServiceTest.java +++ b/plugin-api/src/test/java/org/appdevforall/codeonthego/plugins/services/LlmInferenceServiceTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.services; +package org.appdevforall.codeonthego.plugins.services; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; diff --git a/plugin-api/src/test/java/com/itsaky/androidide/plugins/services/ToolSourceRegistryTest.java b/plugin-api/src/test/java/org/appdevforall/codeonthego/plugins/services/ToolSourceRegistryTest.java similarity index 98% rename from plugin-api/src/test/java/com/itsaky/androidide/plugins/services/ToolSourceRegistryTest.java rename to plugin-api/src/test/java/org/appdevforall/codeonthego/plugins/services/ToolSourceRegistryTest.java index b49f3ad0c6..ab3096201b 100644 --- a/plugin-api/src/test/java/com/itsaky/androidide/plugins/services/ToolSourceRegistryTest.java +++ b/plugin-api/src/test/java/org/appdevforall/codeonthego/plugins/services/ToolSourceRegistryTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.services; +package org.appdevforall.codeonthego.plugins.services; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/PluginContextTest.kt b/plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/PluginContextTest.kt similarity index 99% rename from plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/PluginContextTest.kt rename to plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/PluginContextTest.kt index 9bef521e22..5fffe15484 100644 --- a/plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/PluginContextTest.kt +++ b/plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/PluginContextTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins +package org.appdevforall.codeonthego.plugins import android.content.SharedPreferences import org.junit.Assert.assertEquals diff --git a/plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/ai/LlmBackendRegistrationTest.kt b/plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/ai/LlmBackendRegistrationTest.kt similarity index 93% rename from plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/ai/LlmBackendRegistrationTest.kt rename to plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/ai/LlmBackendRegistrationTest.kt index 40619249ce..46654867ed 100644 --- a/plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/ai/LlmBackendRegistrationTest.kt +++ b/plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/ai/LlmBackendRegistrationTest.kt @@ -1,13 +1,13 @@ -package com.itsaky.androidide.plugins.ai +package org.appdevforall.codeonthego.plugins.ai import android.content.Context import android.content.SharedPreferences import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.plugins.PluginContext -import com.itsaky.androidide.plugins.PluginLifecycleListener -import com.itsaky.androidide.plugins.PluginLogger -import com.itsaky.androidide.plugins.services.LlmInferenceService -import com.itsaky.androidide.plugins.services.SharedServices +import org.appdevforall.codeonthego.plugins.PluginContext +import org.appdevforall.codeonthego.plugins.PluginLifecycleListener +import org.appdevforall.codeonthego.plugins.PluginLogger +import org.appdevforall.codeonthego.plugins.services.LlmInferenceService +import org.appdevforall.codeonthego.plugins.services.SharedServices import org.junit.After import org.junit.Before import org.junit.Test diff --git a/plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigFixture.kt b/plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigFixture.kt similarity index 98% rename from plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigFixture.kt rename to plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigFixture.kt index 9500aa6da6..c7d3342152 100644 --- a/plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigFixture.kt +++ b/plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigFixture.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.ai.prompt +package org.appdevforall.codeonthego.plugins.ai.prompt import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.runBlocking diff --git a/plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigLoaderTest.kt b/plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigLoaderTest.kt similarity index 93% rename from plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigLoaderTest.kt rename to plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigLoaderTest.kt index fae91b0714..1a5b74834e 100644 --- a/plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigLoaderTest.kt +++ b/plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigLoaderTest.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.plugins.ai.prompt +package org.appdevforall.codeonthego.plugins.ai.prompt -import com.itsaky.androidide.plugins.ai.prompt.PromptConfigFixture.files -import com.itsaky.androidide.plugins.ai.prompt.PromptConfigFixture.load -import com.itsaky.androidide.plugins.ai.prompt.PromptConfigFixture.loadWith -import com.itsaky.androidide.plugins.ai.prompt.PromptConfigFixture.parser +import org.appdevforall.codeonthego.plugins.ai.prompt.PromptConfigFixture.files +import org.appdevforall.codeonthego.plugins.ai.prompt.PromptConfigFixture.load +import org.appdevforall.codeonthego.plugins.ai.prompt.PromptConfigFixture.loadWith +import org.appdevforall.codeonthego.plugins.ai.prompt.PromptConfigFixture.parser import kotlinx.coroutines.runBlocking import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse diff --git a/plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigObjectTest.kt b/plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigObjectTest.kt similarity index 96% rename from plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigObjectTest.kt rename to plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigObjectTest.kt index f8f7b1cc3c..bf17c4e91c 100644 --- a/plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigObjectTest.kt +++ b/plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigObjectTest.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.plugins.ai.prompt +package org.appdevforall.codeonthego.plugins.ai.prompt -import com.itsaky.androidide.plugins.ai.prompt.PromptConfigFixture.load -import com.itsaky.androidide.plugins.ai.prompt.PromptConfigFixture.loadWith +import org.appdevforall.codeonthego.plugins.ai.prompt.PromptConfigFixture.load +import org.appdevforall.codeonthego.plugins.ai.prompt.PromptConfigFixture.loadWith import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue import org.junit.Test diff --git a/plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigStoreTest.kt b/plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigStoreTest.kt similarity index 96% rename from plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigStoreTest.kt rename to plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigStoreTest.kt index 2a4e7663b7..8a322c395b 100644 --- a/plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptConfigStoreTest.kt +++ b/plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptConfigStoreTest.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.plugins.ai.prompt +package org.appdevforall.codeonthego.plugins.ai.prompt -import com.itsaky.androidide.plugins.ai.prompt.PromptConfigFixture.files -import com.itsaky.androidide.plugins.ai.prompt.PromptConfigFixture.parser +import org.appdevforall.codeonthego.plugins.ai.prompt.PromptConfigFixture.files +import org.appdevforall.codeonthego.plugins.ai.prompt.PromptConfigFixture.parser import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Deferred diff --git a/plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptTemplateEngineTest.kt b/plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptTemplateEngineTest.kt similarity index 99% rename from plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptTemplateEngineTest.kt rename to plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptTemplateEngineTest.kt index 50a62f6ae8..c5de4a4ded 100644 --- a/plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/ai/prompt/PromptTemplateEngineTest.kt +++ b/plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/ai/prompt/PromptTemplateEngineTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.ai.prompt +package org.appdevforall.codeonthego.plugins.ai.prompt import org.junit.Assert.assertEquals import org.junit.Assert.assertThrows diff --git a/plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/security/KeystoreSecretStoreTest.kt b/plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/security/KeystoreSecretStoreTest.kt similarity index 99% rename from plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/security/KeystoreSecretStoreTest.kt rename to plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/security/KeystoreSecretStoreTest.kt index 9cc1cab1bd..7df16d7d9e 100644 --- a/plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/security/KeystoreSecretStoreTest.kt +++ b/plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/security/KeystoreSecretStoreTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.security +package org.appdevforall.codeonthego.plugins.security import android.content.Context import android.content.SharedPreferences diff --git a/plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/services/LogQueryTest.kt b/plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/services/LogQueryTest.kt similarity index 92% rename from plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/services/LogQueryTest.kt rename to plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/services/LogQueryTest.kt index 901c3b6cba..24d857d960 100644 --- a/plugin-api/src/test/kotlin/com/itsaky/androidide/plugins/services/LogQueryTest.kt +++ b/plugin-api/src/test/kotlin/org/appdevforall/codeonthego/plugins/services/LogQueryTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.services +package org.appdevforall.codeonthego.plugins.services import com.google.common.truth.Truth.assertThat import org.junit.Test diff --git a/plugin-manager/build.gradle.kts b/plugin-manager/build.gradle.kts index e75526fe2d..e3f6566d75 100644 --- a/plugin-manager/build.gradle.kts +++ b/plugin-manager/build.gradle.kts @@ -15,7 +15,7 @@ android { kotlin { compilerOptions { - optIn.add("com.itsaky.androidide.plugins.base.InternalPluginApi") + optIn.add("org.appdevforall.codeonthego.plugins.base.InternalPluginApi") } } diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeFeatureFlagServiceImpl.kt b/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeFeatureFlagServiceImpl.kt deleted file mode 100644 index fa254aa13c..0000000000 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeFeatureFlagServiceImpl.kt +++ /dev/null @@ -1,9 +0,0 @@ -package com.itsaky.androidide.plugins.manager.services - -import com.itsaky.androidide.plugins.services.IdeFeatureFlagService -import com.itsaky.androidide.utils.FeatureFlags - -class IdeFeatureFlagServiceImpl : IdeFeatureFlagService { - - override fun isExperimentsEnabled(): Boolean = FeatureFlags.isExperimentsEnabled -} diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/PluginTooltipNaming.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/PluginTooltipNaming.kt similarity index 80% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/PluginTooltipNaming.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/PluginTooltipNaming.kt index 44226f8edf..a683306e4a 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/PluginTooltipNaming.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/PluginTooltipNaming.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.manager +package org.appdevforall.codeonthego.plugins.manager const val PLUGIN_CATEGORY_PREFIX: String = "plugin_" diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/build/PluginBuildActionManager.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/build/PluginBuildActionManager.kt similarity index 89% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/build/PluginBuildActionManager.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/build/PluginBuildActionManager.kt index e952903d6e..93ca456a6d 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/build/PluginBuildActionManager.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/build/PluginBuildActionManager.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.plugins.manager.build - -import com.itsaky.androidide.plugins.extensions.BuildActionCategory -import com.itsaky.androidide.plugins.extensions.BuildActionExtension -import com.itsaky.androidide.plugins.extensions.CommandResult -import com.itsaky.androidide.plugins.extensions.CommandSpec -import com.itsaky.androidide.plugins.extensions.PluginBuildAction -import com.itsaky.androidide.plugins.extensions.ToolbarActionIds -import com.itsaky.androidide.plugins.manager.loaders.ManifestBuildAction -import com.itsaky.androidide.plugins.manager.loaders.PluginManifest -import com.itsaky.androidide.plugins.services.CommandExecution -import com.itsaky.androidide.plugins.services.IdeCommandService +package org.appdevforall.codeonthego.plugins.manager.build + +import org.appdevforall.codeonthego.plugins.extensions.BuildActionCategory +import org.appdevforall.codeonthego.plugins.extensions.BuildActionExtension +import org.appdevforall.codeonthego.plugins.extensions.CommandResult +import org.appdevforall.codeonthego.plugins.extensions.CommandSpec +import org.appdevforall.codeonthego.plugins.extensions.PluginBuildAction +import org.appdevforall.codeonthego.plugins.extensions.ToolbarActionIds +import org.appdevforall.codeonthego.plugins.manager.loaders.ManifestBuildAction +import org.appdevforall.codeonthego.plugins.manager.loaders.PluginManifest +import org.appdevforall.codeonthego.plugins.services.CommandExecution +import org.appdevforall.codeonthego.plugins.services.IdeCommandService import android.util.Log import java.util.concurrent.ConcurrentHashMap diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/context/PluginContextImpl.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/context/PluginContextImpl.kt similarity index 98% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/context/PluginContextImpl.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/context/PluginContextImpl.kt index de3a94e82c..16daef684c 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/context/PluginContextImpl.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/context/PluginContextImpl.kt @@ -1,13 +1,13 @@ -package com.itsaky.androidide.plugins.manager.context +package org.appdevforall.codeonthego.plugins.manager.context import android.content.Context import android.content.SharedPreferences import android.content.res.AssetManager import android.util.Log -import com.itsaky.androidide.plugins.* -import com.itsaky.androidide.plugins.manager.security.PluginSecurityManager +import org.appdevforall.codeonthego.plugins.* +import org.appdevforall.codeonthego.plugins.manager.security.PluginSecurityManager import java.io.File import java.io.InputStream import java.util.concurrent.ConcurrentHashMap diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/core/PluginCrashTracker.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/core/PluginCrashTracker.kt similarity index 97% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/core/PluginCrashTracker.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/core/PluginCrashTracker.kt index f5f7b618e9..74d83aa66b 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/core/PluginCrashTracker.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/core/PluginCrashTracker.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.plugins.manager.core +package org.appdevforall.codeonthego.plugins.manager.core -import com.itsaky.androidide.plugins.PluginLogger +import org.appdevforall.codeonthego.plugins.PluginLogger import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/core/PluginManager.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/core/PluginManager.kt similarity index 90% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/core/PluginManager.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/core/PluginManager.kt index 46264abdf4..b2f86e841e 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/core/PluginManager.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/core/PluginManager.kt @@ -1,83 +1,83 @@ -package com.itsaky.androidide.plugins.manager.core +package org.appdevforall.codeonthego.plugins.manager.core import android.app.Activity import android.content.Context -import com.itsaky.androidide.actions.SidebarSlotManager -import com.itsaky.androidide.plugins.IPlugin -import com.itsaky.androidide.plugins.PluginContext -import com.itsaky.androidide.plugins.PluginInfo -import com.itsaky.androidide.plugins.PluginLogger -import com.itsaky.androidide.plugins.PluginMetadata -import com.itsaky.androidide.plugins.PluginPermission -import com.itsaky.androidide.plugins.ServiceRegistry -import com.itsaky.androidide.plugins.base.PluginFragmentHelper -import com.itsaky.androidide.plugins.extensions.BuildActionExtension -import com.itsaky.androidide.plugins.extensions.DocumentationExtension -import com.itsaky.androidide.plugins.extensions.EditorDecorationProvider -import com.itsaky.androidide.plugins.extensions.FileOpenExtension -import com.itsaky.androidide.plugins.extensions.FileTabMenuItem -import com.itsaky.androidide.plugins.extensions.LanguageDefinition -import com.itsaky.androidide.plugins.extensions.LanguageExtension -import com.itsaky.androidide.plugins.extensions.PluginSettingsEntry -import com.itsaky.androidide.plugins.extensions.SettingsExtension -import com.itsaky.androidide.plugins.extensions.SnippetExtension -import com.itsaky.androidide.plugins.extensions.UIExtension -import com.itsaky.androidide.plugins.manager.build.PluginBuildActionManager -import com.itsaky.androidide.plugins.manager.context.PluginContextImpl -import com.itsaky.androidide.plugins.manager.context.PluginLifecycleDispatcher -import com.itsaky.androidide.plugins.manager.context.PluginLoggerImpl -import com.itsaky.androidide.plugins.manager.context.PluginRegistry -import com.itsaky.androidide.plugins.manager.context.ResourceManagerImpl -import com.itsaky.androidide.plugins.manager.context.ServiceRegistryImpl -import com.itsaky.androidide.plugins.manager.context.SharedServiceRegistry -import com.itsaky.androidide.plugins.manager.documentation.PluginDocumentationManager -import com.itsaky.androidide.plugins.manager.fragment.PluginFragmentFactory -import com.itsaky.androidide.plugins.manager.language.PluginLanguageContribution -import com.itsaky.androidide.plugins.manager.loaders.PluginLoader -import com.itsaky.androidide.plugins.manager.loaders.PluginManifest -import com.itsaky.androidide.plugins.manager.loaders.PluginResourceContext -import com.itsaky.androidide.plugins.manager.loaders.toPluginMetadata -import com.itsaky.androidide.plugins.manager.project.PluginProjectManager -import com.itsaky.androidide.plugins.manager.security.PluginSecurityManager -import com.itsaky.androidide.plugins.manager.services.CogoProjectProvider -import com.itsaky.androidide.plugins.manager.services.IdeArchiveServiceImpl -import com.itsaky.androidide.plugins.manager.services.IdeBuildServiceImpl -import com.itsaky.androidide.plugins.manager.services.IdeCommandServiceImpl -import com.itsaky.androidide.plugins.manager.services.IdeEditorServiceImpl -import com.itsaky.androidide.plugins.manager.services.IdeEditorTabServiceImpl -import com.itsaky.androidide.plugins.manager.services.IdeEnvironmentServiceImpl -import com.itsaky.androidide.plugins.manager.services.IdeFeatureFlagServiceImpl -import com.itsaky.androidide.plugins.manager.services.IdeFileServiceImpl -import com.itsaky.androidide.plugins.manager.services.IdeLogServiceImpl -import com.itsaky.androidide.plugins.manager.services.IdeProjectManipulationServiceImpl -import com.itsaky.androidide.plugins.manager.services.IdeProjectServiceImpl -import com.itsaky.androidide.plugins.manager.services.IdeSidebarServiceImpl -import com.itsaky.androidide.plugins.manager.services.IdeSnippetServiceImpl -import com.itsaky.androidide.plugins.manager.services.IdeTemplateServiceImpl -import com.itsaky.androidide.plugins.manager.services.IdeThemeServiceImpl -import com.itsaky.androidide.plugins.manager.services.IdeTooltipServiceImpl -import com.itsaky.androidide.plugins.manager.services.IdeUIServiceImpl -import com.itsaky.androidide.plugins.manager.snippets.PluginSnippetManager -import com.itsaky.androidide.plugins.manager.ui.PluginEditorTabManager -import com.itsaky.androidide.plugins.services.IdeArchiveService -import com.itsaky.androidide.plugins.services.IdeBuildService -import com.itsaky.androidide.plugins.services.IdeCommandService -import com.itsaky.androidide.plugins.services.IdeEditorService -import com.itsaky.androidide.plugins.services.IdeEditorTabService -import com.itsaky.androidide.plugins.services.IdeEnvironmentService -import com.itsaky.androidide.plugins.services.IdeFeatureFlagService -import com.itsaky.androidide.plugins.services.IdeFileService -import com.itsaky.androidide.plugins.services.IdeLogService -import com.itsaky.androidide.plugins.services.IdeProjectManipulationService -import com.itsaky.androidide.plugins.services.IdeProjectService -import com.itsaky.androidide.plugins.services.IdeSidebarService -import com.itsaky.androidide.plugins.services.IdeSnippetService -import com.itsaky.androidide.plugins.services.IdeTemplateService -import com.itsaky.androidide.plugins.services.IdeThemeService -import com.itsaky.androidide.plugins.services.IdeTooltipService -import com.itsaky.androidide.plugins.services.IdeUIService +import org.appdevforall.codeonthego.actions.SidebarSlotManager +import org.appdevforall.codeonthego.plugins.IPlugin +import org.appdevforall.codeonthego.plugins.PluginContext +import org.appdevforall.codeonthego.plugins.PluginInfo +import org.appdevforall.codeonthego.plugins.PluginLogger +import org.appdevforall.codeonthego.plugins.PluginMetadata +import org.appdevforall.codeonthego.plugins.PluginPermission +import org.appdevforall.codeonthego.plugins.ServiceRegistry +import org.appdevforall.codeonthego.plugins.base.PluginFragmentHelper +import org.appdevforall.codeonthego.plugins.extensions.BuildActionExtension +import org.appdevforall.codeonthego.plugins.extensions.DocumentationExtension +import org.appdevforall.codeonthego.plugins.extensions.EditorDecorationProvider +import org.appdevforall.codeonthego.plugins.extensions.FileOpenExtension +import org.appdevforall.codeonthego.plugins.extensions.FileTabMenuItem +import org.appdevforall.codeonthego.plugins.extensions.LanguageDefinition +import org.appdevforall.codeonthego.plugins.extensions.LanguageExtension +import org.appdevforall.codeonthego.plugins.extensions.PluginSettingsEntry +import org.appdevforall.codeonthego.plugins.extensions.SettingsExtension +import org.appdevforall.codeonthego.plugins.extensions.SnippetExtension +import org.appdevforall.codeonthego.plugins.extensions.UIExtension +import org.appdevforall.codeonthego.plugins.manager.build.PluginBuildActionManager +import org.appdevforall.codeonthego.plugins.manager.context.PluginContextImpl +import org.appdevforall.codeonthego.plugins.manager.context.PluginLifecycleDispatcher +import org.appdevforall.codeonthego.plugins.manager.context.PluginLoggerImpl +import org.appdevforall.codeonthego.plugins.manager.context.PluginRegistry +import org.appdevforall.codeonthego.plugins.manager.context.ResourceManagerImpl +import org.appdevforall.codeonthego.plugins.manager.context.ServiceRegistryImpl +import org.appdevforall.codeonthego.plugins.manager.context.SharedServiceRegistry +import org.appdevforall.codeonthego.plugins.manager.documentation.PluginDocumentationManager +import org.appdevforall.codeonthego.plugins.manager.fragment.PluginFragmentFactory +import org.appdevforall.codeonthego.plugins.manager.language.PluginLanguageContribution +import org.appdevforall.codeonthego.plugins.manager.loaders.PluginLoader +import org.appdevforall.codeonthego.plugins.manager.loaders.PluginManifest +import org.appdevforall.codeonthego.plugins.manager.loaders.PluginResourceContext +import org.appdevforall.codeonthego.plugins.manager.loaders.toPluginMetadata +import org.appdevforall.codeonthego.plugins.manager.project.PluginProjectManager +import org.appdevforall.codeonthego.plugins.manager.security.PluginSecurityManager +import org.appdevforall.codeonthego.plugins.manager.services.CogoProjectProvider +import org.appdevforall.codeonthego.plugins.manager.services.IdeArchiveServiceImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeBuildServiceImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeCommandServiceImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeEditorServiceImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeEditorTabServiceImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeEnvironmentServiceImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeFeatureFlagServiceImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeFileServiceImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeLogServiceImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeProjectManipulationServiceImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeProjectServiceImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeSidebarServiceImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeSnippetServiceImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeTemplateServiceImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeThemeServiceImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeTooltipServiceImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeUIServiceImpl +import org.appdevforall.codeonthego.plugins.manager.snippets.PluginSnippetManager +import org.appdevforall.codeonthego.plugins.manager.ui.PluginEditorTabManager +import org.appdevforall.codeonthego.plugins.services.IdeArchiveService +import org.appdevforall.codeonthego.plugins.services.IdeBuildService +import org.appdevforall.codeonthego.plugins.services.IdeCommandService +import org.appdevforall.codeonthego.plugins.services.IdeEditorService +import org.appdevforall.codeonthego.plugins.services.IdeEditorTabService +import org.appdevforall.codeonthego.plugins.services.IdeEnvironmentService +import org.appdevforall.codeonthego.plugins.services.IdeFeatureFlagService +import org.appdevforall.codeonthego.plugins.services.IdeFileService +import org.appdevforall.codeonthego.plugins.services.IdeLogService +import org.appdevforall.codeonthego.plugins.services.IdeProjectManipulationService +import org.appdevforall.codeonthego.plugins.services.IdeProjectService +import org.appdevforall.codeonthego.plugins.services.IdeSidebarService +import org.appdevforall.codeonthego.plugins.services.IdeSnippetService +import org.appdevforall.codeonthego.plugins.services.IdeTemplateService +import org.appdevforall.codeonthego.plugins.services.IdeThemeService +import org.appdevforall.codeonthego.plugins.services.IdeTooltipService +import org.appdevforall.codeonthego.plugins.services.IdeUIService import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -231,7 +231,7 @@ class PluginManager private constructor( override fun replaceRange( file: File, - range: com.itsaky.androidide.plugins.services.SelectionRange, + range: org.appdevforall.codeonthego.plugins.services.SelectionRange, newText: String, ): Boolean = current()?.replaceRange(file, range, newText) ?: false @@ -967,11 +967,11 @@ class PluginManager private constructor( /** * Get all enabled plugins that implement UI extensions */ - fun getEnabledUIExtensions(): List = + fun getEnabledUIExtensions(): List = loadedPlugins.values .filter { it.isEnabled } .map { it.plugin } - .filterIsInstance() + .filterIsInstance() fun getEnabledFileOpenExtensions(): List = loadedPlugins.values @@ -1924,7 +1924,7 @@ class PluginManager private constructor( val plugin = loadedPlugins[pluginId]?.plugin if (plugin is UIExtension) { - val registryClass = Class.forName("com.itsaky.androidide.actions.ActionsRegistry") + val registryClass = Class.forName("org.appdevforall.codeonthego.actions.ActionsRegistry") val getInstanceMethod = registryClass.getMethod("getInstance") val registry = getInstanceMethod.invoke(null) diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/core/PluginSettingsEntries.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/core/PluginSettingsEntries.kt similarity index 87% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/core/PluginSettingsEntries.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/core/PluginSettingsEntries.kt index 2c13b41833..cb0dd9ef7e 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/core/PluginSettingsEntries.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/core/PluginSettingsEntries.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.plugins.manager.core +package org.appdevforall.codeonthego.plugins.manager.core -import com.itsaky.androidide.plugins.extensions.PluginSettingsEntry -import com.itsaky.androidide.plugins.extensions.SettingsExtension +import org.appdevforall.codeonthego.plugins.extensions.PluginSettingsEntry +import org.appdevforall.codeonthego.plugins.extensions.SettingsExtension /** * Collects the preference rows contributed by [extensions], each paired with its owning plugin id. diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/documentation/ExtensionToContentTypeResolver.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/documentation/ExtensionToContentTypeResolver.kt similarity index 95% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/documentation/ExtensionToContentTypeResolver.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/documentation/ExtensionToContentTypeResolver.kt index 709d66e727..c59104500b 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/documentation/ExtensionToContentTypeResolver.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/documentation/ExtensionToContentTypeResolver.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.manager.documentation +package org.appdevforall.codeonthego.plugins.manager.documentation import android.database.sqlite.SQLiteDatabase import android.webkit.MimeTypeMap diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/documentation/PluginDocumentationManager.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/documentation/PluginDocumentationManager.kt similarity index 98% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/documentation/PluginDocumentationManager.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/documentation/PluginDocumentationManager.kt index b60f15ed32..7797512e98 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/documentation/PluginDocumentationManager.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/documentation/PluginDocumentationManager.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.manager.documentation +package org.appdevforall.codeonthego.plugins.manager.documentation import android.content.ContentValues import android.content.Context @@ -6,13 +6,13 @@ import android.content.SharedPreferences import android.content.res.AssetManager import android.database.sqlite.SQLiteDatabase import android.util.Log -import com.itsaky.androidide.plugins.extensions.DocumentationExtension -import com.itsaky.androidide.plugins.extensions.PluginTooltipEntry -import com.itsaky.androidide.plugins.manager.pluginCategory +import org.appdevforall.codeonthego.plugins.extensions.DocumentationExtension +import org.appdevforall.codeonthego.plugins.extensions.PluginTooltipEntry +import org.appdevforall.codeonthego.plugins.manager.pluginCategory import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.BrotliDictionaryCodec -import com.itsaky.androidide.utils.expectsCompressionDictionary -import com.itsaky.androidide.utils.loadCompressionDictionary +import org.appdevforall.codeonthego.utils.BrotliDictionaryCodec +import org.appdevforall.codeonthego.utils.expectsCompressionDictionary +import org.appdevforall.codeonthego.utils.loadCompressionDictionary import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import java.io.File diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/documentation/Tier3AssetWalker.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/documentation/Tier3AssetWalker.kt similarity index 97% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/documentation/Tier3AssetWalker.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/documentation/Tier3AssetWalker.kt index ef46ffd59c..e7658a83b7 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/documentation/Tier3AssetWalker.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/documentation/Tier3AssetWalker.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.manager.documentation +package org.appdevforall.codeonthego.plugins.manager.documentation import android.content.res.AssetManager import android.util.Log diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/fragment/PluginFragmentFactory.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/fragment/PluginFragmentFactory.kt similarity index 98% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/fragment/PluginFragmentFactory.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/fragment/PluginFragmentFactory.kt index adf0782195..f604ef98b9 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/fragment/PluginFragmentFactory.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/fragment/PluginFragmentFactory.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.manager.fragment +package org.appdevforall.codeonthego.plugins.manager.fragment import android.util.Log import androidx.fragment.app.Fragment diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/language/PluginLanguageContribution.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/language/PluginLanguageContribution.kt similarity index 61% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/language/PluginLanguageContribution.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/language/PluginLanguageContribution.kt index 491b8186e3..c33e83dc51 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/language/PluginLanguageContribution.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/language/PluginLanguageContribution.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.plugins.manager.language +package org.appdevforall.codeonthego.plugins.manager.language import android.content.res.AssetManager -import com.itsaky.androidide.plugins.extensions.LanguageDefinition +import org.appdevforall.codeonthego.plugins.extensions.LanguageDefinition import java.io.File data class PluginLanguageContribution( diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/loaders/PluginLoader.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/loaders/PluginLoader.kt similarity index 99% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/loaders/PluginLoader.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/loaders/PluginLoader.kt index 7db58f76cf..5a04277287 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/loaders/PluginLoader.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/loaders/PluginLoader.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.manager.loaders +package org.appdevforall.codeonthego.plugins.manager.loaders import android.content.Context import android.content.pm.ApplicationInfo diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/loaders/PluginManifest.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/loaders/PluginManifest.kt similarity index 97% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/loaders/PluginManifest.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/loaders/PluginManifest.kt index 0c01444301..59dab5b67e 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/loaders/PluginManifest.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/loaders/PluginManifest.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.plugins.manager.loaders +package org.appdevforall.codeonthego.plugins.manager.loaders import android.util.Log import com.google.gson.Gson import com.google.gson.annotations.SerializedName -import com.itsaky.androidide.plugins.PluginMetadata +import org.appdevforall.codeonthego.plugins.PluginMetadata import java.io.File import java.io.InputStreamReader import java.util.jar.JarFile diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/loaders/PluginResourceContext.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/loaders/PluginResourceContext.kt similarity index 98% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/loaders/PluginResourceContext.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/loaders/PluginResourceContext.kt index 87906740e0..98d0f41c94 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/loaders/PluginResourceContext.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/loaders/PluginResourceContext.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.manager.loaders +package org.appdevforall.codeonthego.plugins.manager.loaders import android.content.Context import android.content.pm.ApplicationInfo @@ -16,8 +16,8 @@ import android.util.Log import android.view.ContextThemeWrapper import android.view.LayoutInflater import android.view.View -import com.itsaky.androidide.plugins.base.PluginFragmentHelper -import com.itsaky.androidide.plugins.manager.core.PluginManager +import org.appdevforall.codeonthego.plugins.base.PluginFragmentHelper +import org.appdevforall.codeonthego.plugins.manager.core.PluginManager import java.io.File import java.io.FileNotFoundException import java.io.IOException diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/project/PluginProjectManager.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/project/PluginProjectManager.kt similarity index 96% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/project/PluginProjectManager.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/project/PluginProjectManager.kt index 3176ac508c..4c60790782 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/project/PluginProjectManager.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/project/PluginProjectManager.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.plugins.manager.project +package org.appdevforall.codeonthego.plugins.manager.project -import com.itsaky.androidide.utils.Environment +import org.appdevforall.codeonthego.utils.Environment import org.slf4j.LoggerFactory import java.io.File diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/security/PluginSecurityManager.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/security/PluginSecurityManager.kt similarity index 95% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/security/PluginSecurityManager.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/security/PluginSecurityManager.kt index 509145a607..127c2f1ec1 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/security/PluginSecurityManager.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/security/PluginSecurityManager.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.plugins.manager.security +package org.appdevforall.codeonthego.plugins.manager.security -import com.itsaky.androidide.plugins.PluginPermission -import com.itsaky.androidide.plugins.manager.loaders.PluginManifest +import org.appdevforall.codeonthego.plugins.PluginPermission +import org.appdevforall.codeonthego.plugins.manager.loaders.PluginManifest import java.io.File import java.security.MessageDigest diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/CogoProjectProvider.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/CogoProjectProvider.kt similarity index 92% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/CogoProjectProvider.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/CogoProjectProvider.kt index a48dfb8cf2..be440a14e7 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/CogoProjectProvider.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/CogoProjectProvider.kt @@ -1,13 +1,13 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services -import com.itsaky.androidide.plugins.extensions.IProject -import com.itsaky.androidide.plugins.extensions.IModule -import com.itsaky.androidide.plugins.extensions.ProjectType -import com.itsaky.androidide.plugins.extensions.ModuleType -import com.itsaky.androidide.plugins.extensions.SourceSet -import com.itsaky.androidide.preferences.internal.GeneralPreferences +import org.appdevforall.codeonthego.plugins.extensions.IProject +import org.appdevforall.codeonthego.plugins.extensions.IModule +import org.appdevforall.codeonthego.plugins.extensions.ProjectType +import org.appdevforall.codeonthego.plugins.extensions.ModuleType +import org.appdevforall.codeonthego.plugins.extensions.SourceSet +import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences import java.io.File /** diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeArchiveServiceImpl.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeArchiveServiceImpl.kt similarity index 97% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeArchiveServiceImpl.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeArchiveServiceImpl.kt index b369d569d3..2e0fac72b2 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeArchiveServiceImpl.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeArchiveServiceImpl.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services -import com.itsaky.androidide.plugins.PluginPermission -import com.itsaky.androidide.plugins.services.ArchiveFormat -import com.itsaky.androidide.plugins.services.ExtractResult -import com.itsaky.androidide.plugins.services.IdeArchiveService +import org.appdevforall.codeonthego.plugins.PluginPermission +import org.appdevforall.codeonthego.plugins.services.ArchiveFormat +import org.appdevforall.codeonthego.plugins.services.ExtractResult +import org.appdevforall.codeonthego.plugins.services.IdeArchiveService import org.apache.commons.compress.archivers.ArchiveEntry import org.apache.commons.compress.archivers.tar.TarArchiveEntry import org.apache.commons.compress.archivers.tar.TarArchiveInputStream diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeBuildServiceImpl.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeBuildServiceImpl.kt similarity index 91% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeBuildServiceImpl.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeBuildServiceImpl.kt index 8f0b618fd1..7bd2e92b39 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeBuildServiceImpl.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeBuildServiceImpl.kt @@ -1,12 +1,12 @@ -package com.itsaky.androidide.plugins.manager.services - -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.plugins.services.BuildAndLaunchCallback -import com.itsaky.androidide.plugins.services.BuildStatusListener -import com.itsaky.androidide.plugins.services.GradleSyncCallback -import com.itsaky.androidide.plugins.services.IdeBuildService -import com.itsaky.androidide.projects.builder.BuildService +package org.appdevforall.codeonthego.plugins.manager.services + +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.plugins.services.BuildAndLaunchCallback +import org.appdevforall.codeonthego.plugins.services.BuildStatusListener +import org.appdevforall.codeonthego.plugins.services.GradleSyncCallback +import org.appdevforall.codeonthego.plugins.services.IdeBuildService +import org.appdevforall.codeonthego.projects.builder.BuildService import org.slf4j.LoggerFactory import java.util.concurrent.CompletableFuture import java.util.concurrent.CopyOnWriteArraySet diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeCommandServiceImpl.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeCommandServiceImpl.kt similarity index 93% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeCommandServiceImpl.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeCommandServiceImpl.kt index a334b1b2a4..1284036e03 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeCommandServiceImpl.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeCommandServiceImpl.kt @@ -1,12 +1,12 @@ -package com.itsaky.androidide.plugins.manager.services - -import com.itsaky.androidide.plugins.PluginPermission -import com.itsaky.androidide.plugins.extensions.CommandOutput -import com.itsaky.androidide.plugins.extensions.CommandResult -import com.itsaky.androidide.plugins.extensions.CommandSpec -import com.itsaky.androidide.plugins.services.CommandExecution -import com.itsaky.androidide.plugins.services.IdeCommandService -import com.itsaky.androidide.utils.TermuxProcessEnvironment +package org.appdevforall.codeonthego.plugins.manager.services + +import org.appdevforall.codeonthego.plugins.PluginPermission +import org.appdevforall.codeonthego.plugins.extensions.CommandOutput +import org.appdevforall.codeonthego.plugins.extensions.CommandResult +import org.appdevforall.codeonthego.plugins.extensions.CommandSpec +import org.appdevforall.codeonthego.plugins.services.CommandExecution +import org.appdevforall.codeonthego.plugins.services.IdeCommandService +import org.appdevforall.codeonthego.utils.TermuxProcessEnvironment import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeEditorServiceImpl.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeEditorServiceImpl.kt similarity index 96% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeEditorServiceImpl.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeEditorServiceImpl.kt index 7de586be3e..c5ff26e8f8 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeEditorServiceImpl.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeEditorServiceImpl.kt @@ -1,14 +1,14 @@ -package com.itsaky.androidide.plugins.manager.services - -import com.itsaky.androidide.plugins.PluginPermission -import com.itsaky.androidide.plugins.services.CursorPosition -import com.itsaky.androidide.plugins.services.EditorContentChangeListener -import com.itsaky.androidide.plugins.services.FileChangeListener -import com.itsaky.androidide.plugins.services.IdeEditorService -import com.itsaky.androidide.plugins.services.SelectionRange -import com.itsaky.androidide.utils.Environment +package org.appdevforall.codeonthego.plugins.manager.services + +import org.appdevforall.codeonthego.plugins.PluginPermission +import org.appdevforall.codeonthego.plugins.services.CursorPosition +import org.appdevforall.codeonthego.plugins.services.EditorContentChangeListener +import org.appdevforall.codeonthego.plugins.services.FileChangeListener +import org.appdevforall.codeonthego.plugins.services.IdeEditorService +import org.appdevforall.codeonthego.plugins.services.SelectionRange +import org.appdevforall.codeonthego.utils.Environment import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.slf4j.LoggerFactory diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeEditorTabServiceImpl.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeEditorTabServiceImpl.kt similarity index 94% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeEditorTabServiceImpl.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeEditorTabServiceImpl.kt index 2d625e7250..89fb6fd449 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeEditorTabServiceImpl.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeEditorTabServiceImpl.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services import android.util.Log -import com.itsaky.androidide.plugins.manager.core.PluginManager -import com.itsaky.androidide.plugins.manager.ui.PluginEditorTabManager -import com.itsaky.androidide.plugins.services.IdeEditorTabService +import org.appdevforall.codeonthego.plugins.manager.core.PluginManager +import org.appdevforall.codeonthego.plugins.manager.ui.PluginEditorTabManager +import org.appdevforall.codeonthego.plugins.services.IdeEditorTabService /** * Implementation of IdeEditorTabService that provides plugin access to the editor tab system. diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeEnvironmentServiceImpl.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeEnvironmentServiceImpl.kt similarity index 81% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeEnvironmentServiceImpl.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeEnvironmentServiceImpl.kt index c9b3cfd38f..6c6038026d 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeEnvironmentServiceImpl.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeEnvironmentServiceImpl.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services -import com.itsaky.androidide.plugins.services.IdeEnvironmentService -import com.itsaky.androidide.utils.Environment +import org.appdevforall.codeonthego.plugins.services.IdeEnvironmentService +import org.appdevforall.codeonthego.utils.Environment import java.io.File import java.io.IOException diff --git a/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeFeatureFlagServiceImpl.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeFeatureFlagServiceImpl.kt new file mode 100644 index 0000000000..32ccc46fa1 --- /dev/null +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeFeatureFlagServiceImpl.kt @@ -0,0 +1,9 @@ +package org.appdevforall.codeonthego.plugins.manager.services + +import org.appdevforall.codeonthego.plugins.services.IdeFeatureFlagService +import org.appdevforall.codeonthego.utils.FeatureFlags + +class IdeFeatureFlagServiceImpl : IdeFeatureFlagService { + + override fun isExperimentsEnabled(): Boolean = FeatureFlags.isExperimentsEnabled +} diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeFileServiceImpl.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeFileServiceImpl.kt similarity index 95% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeFileServiceImpl.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeFileServiceImpl.kt index 03928b1876..70751bd2aa 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeFileServiceImpl.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeFileServiceImpl.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services -import com.itsaky.androidide.eventbus.events.filetree.PluginFilesChangedEvent -import com.itsaky.androidide.plugins.PluginPermission -import com.itsaky.androidide.plugins.services.IdeFileService +import org.appdevforall.codeonthego.eventbus.events.filetree.PluginFilesChangedEvent +import org.appdevforall.codeonthego.plugins.PluginPermission +import org.appdevforall.codeonthego.plugins.services.IdeFileService import org.greenrobot.eventbus.EventBus import java.io.BufferedInputStream import java.io.File diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeLogServiceImpl.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeLogServiceImpl.kt similarity index 81% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeLogServiceImpl.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeLogServiceImpl.kt index 1e45efbf64..c6639d6c2d 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeLogServiceImpl.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeLogServiceImpl.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services -import com.itsaky.androidide.plugins.services.IdeLogService -import com.itsaky.androidide.plugins.services.LogQuery -import com.itsaky.androidide.plugins.services.LogReadResult -import com.itsaky.androidide.plugins.services.LogSource +import org.appdevforall.codeonthego.plugins.services.IdeLogService +import org.appdevforall.codeonthego.plugins.services.LogQuery +import org.appdevforall.codeonthego.plugins.services.LogReadResult +import org.appdevforall.codeonthego.plugins.services.LogSource import org.slf4j.LoggerFactory /** diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeProjectManipulationServiceImpl.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeProjectManipulationServiceImpl.kt similarity index 93% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeProjectManipulationServiceImpl.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeProjectManipulationServiceImpl.kt index 973dbe7e37..70ba6aa57d 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeProjectManipulationServiceImpl.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeProjectManipulationServiceImpl.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services -import com.itsaky.androidide.plugins.services.IdeProjectManipulationService +import org.appdevforall.codeonthego.plugins.services.IdeProjectManipulationService /** * Implementation of IdeProjectManipulationService that provides access to Code On the Go's diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeProjectServiceImpl.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeProjectServiceImpl.kt similarity index 93% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeProjectServiceImpl.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeProjectServiceImpl.kt index 0e804a00a6..ab331553ac 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeProjectServiceImpl.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeProjectServiceImpl.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.plugins.manager.services - -import com.itsaky.androidide.plugins.PluginPermission -import com.itsaky.androidide.plugins.extensions.IProject -import com.itsaky.androidide.plugins.manager.core.PluginManager -import com.itsaky.androidide.plugins.services.IdeProjectService -import com.itsaky.androidide.plugins.services.ModuleContext -import com.itsaky.androidide.preferences.internal.GeneralPreferences -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.utils.Environment +package org.appdevforall.codeonthego.plugins.manager.services + +import org.appdevforall.codeonthego.plugins.PluginPermission +import org.appdevforall.codeonthego.plugins.extensions.IProject +import org.appdevforall.codeonthego.plugins.manager.core.PluginManager +import org.appdevforall.codeonthego.plugins.services.IdeProjectService +import org.appdevforall.codeonthego.plugins.services.ModuleContext +import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.utils.Environment import org.slf4j.LoggerFactory import java.io.File diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeSidebarServiceImpl.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeSidebarServiceImpl.kt similarity index 69% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeSidebarServiceImpl.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeSidebarServiceImpl.kt index d3e7186925..47c0102414 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeSidebarServiceImpl.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeSidebarServiceImpl.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services -import com.itsaky.androidide.actions.SidebarSlotManager -import com.itsaky.androidide.plugins.services.IdeSidebarService +import org.appdevforall.codeonthego.actions.SidebarSlotManager +import org.appdevforall.codeonthego.plugins.services.IdeSidebarService class IdeSidebarServiceImpl( private val pluginId: String, diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeSnippetServiceImpl.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeSnippetServiceImpl.kt similarity index 77% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeSnippetServiceImpl.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeSnippetServiceImpl.kt index 6d1ad658d0..a8e6142c21 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeSnippetServiceImpl.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeSnippetServiceImpl.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services -import com.itsaky.androidide.plugins.services.IdeSnippetService +import org.appdevforall.codeonthego.plugins.services.IdeSnippetService import org.slf4j.LoggerFactory class IdeSnippetServiceImpl : IdeSnippetService { diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeTemplateServiceImpl.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeTemplateServiceImpl.kt similarity index 91% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeTemplateServiceImpl.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeTemplateServiceImpl.kt index 202f8a6cea..4c7c5fa653 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeTemplateServiceImpl.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeTemplateServiceImpl.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services -import com.itsaky.androidide.plugins.PluginPermission -import com.itsaky.androidide.plugins.services.IdeTemplateService -import com.itsaky.androidide.plugins.templates.CgtTemplateBuilder -import com.itsaky.androidide.utils.Environment +import org.appdevforall.codeonthego.plugins.PluginPermission +import org.appdevforall.codeonthego.plugins.services.IdeTemplateService +import org.appdevforall.codeonthego.plugins.templates.CgtTemplateBuilder +import org.appdevforall.codeonthego.utils.Environment import org.slf4j.LoggerFactory import java.io.File diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeThemeServiceImpl.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeThemeServiceImpl.kt similarity index 84% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeThemeServiceImpl.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeThemeServiceImpl.kt index 29d8b91189..e00eab3a8c 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeThemeServiceImpl.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeThemeServiceImpl.kt @@ -1,12 +1,12 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services import android.content.ComponentCallbacks import android.content.Context import android.content.res.Configuration import androidx.appcompat.app.AppCompatDelegate -import com.itsaky.androidide.plugins.services.IdeThemeService -import com.itsaky.androidide.plugins.services.ThemeChangeListener -import com.itsaky.androidide.utils.isSystemInDarkMode +import org.appdevforall.codeonthego.plugins.services.IdeThemeService +import org.appdevforall.codeonthego.plugins.services.ThemeChangeListener +import org.appdevforall.codeonthego.utils.isSystemInDarkMode class IdeThemeServiceImpl( private val context: Context diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeTooltipServiceImpl.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeTooltipServiceImpl.kt similarity index 84% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeTooltipServiceImpl.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeTooltipServiceImpl.kt index 4719f9b615..64a44a3f99 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeTooltipServiceImpl.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeTooltipServiceImpl.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services import android.content.Context import android.view.View -import com.itsaky.androidide.idetooltips.TooltipManager -import com.itsaky.androidide.plugins.manager.core.PluginManager -import com.itsaky.androidide.plugins.manager.pluginCategory -import com.itsaky.androidide.plugins.services.IdeTooltipService +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.plugins.manager.core.PluginManager +import org.appdevforall.codeonthego.plugins.manager.pluginCategory +import org.appdevforall.codeonthego.plugins.services.IdeTooltipService /** * Implementation of the tooltip service for plugins. diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeUIServiceImpl.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeUIServiceImpl.kt similarity index 85% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeUIServiceImpl.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeUIServiceImpl.kt index a5d2d85a19..19b8aa8a6a 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeUIServiceImpl.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeUIServiceImpl.kt @@ -1,12 +1,12 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services import android.app.Activity import android.content.Intent -import com.itsaky.androidide.plugins.manager.core.PluginManager -import com.itsaky.androidide.plugins.manager.ui.PluginToolbarHost -import com.itsaky.androidide.plugins.services.IdeUIService +import org.appdevforall.codeonthego.plugins.manager.core.PluginManager +import org.appdevforall.codeonthego.plugins.manager.ui.PluginToolbarHost +import org.appdevforall.codeonthego.plugins.services.IdeUIService /** * Implementation of IdeUIService that provides access to Code On the Go's UI context diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/ModuleContextResolver.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/ModuleContextResolver.kt similarity index 92% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/ModuleContextResolver.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/ModuleContextResolver.kt index 6c4cfd8ec6..60aeda2711 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/ModuleContextResolver.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/ModuleContextResolver.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services -import com.itsaky.androidide.plugins.services.ModuleContext -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.api.AndroidModule +import org.appdevforall.codeonthego.plugins.services.ModuleContext +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.api.AndroidModule import org.json.JSONObject import java.io.File import java.io.StringReader diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/PluginPathAllowlist.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/PluginPathAllowlist.kt similarity index 90% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/PluginPathAllowlist.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/PluginPathAllowlist.kt index eaa4a7be88..5144deef01 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/PluginPathAllowlist.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/services/PluginPathAllowlist.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services -import com.itsaky.androidide.plugins.PluginPermission -import com.itsaky.androidide.utils.Environment +import org.appdevforall.codeonthego.plugins.PluginPermission +import org.appdevforall.codeonthego.utils.Environment import java.io.File internal object PluginPathAllowlist { diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/snippets/PluginSnippetManager.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/snippets/PluginSnippetManager.kt similarity index 90% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/snippets/PluginSnippetManager.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/snippets/PluginSnippetManager.kt index 94ded703d3..785e6591ea 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/snippets/PluginSnippetManager.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/snippets/PluginSnippetManager.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.plugins.manager.snippets +package org.appdevforall.codeonthego.plugins.manager.snippets -import com.itsaky.androidide.plugins.extensions.SnippetContribution -import com.itsaky.androidide.plugins.extensions.SnippetExtension +import org.appdevforall.codeonthego.plugins.extensions.SnippetContribution +import org.appdevforall.codeonthego.plugins.extensions.SnippetExtension import org.slf4j.LoggerFactory class PluginSnippetManager private constructor() { diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/ui/PluginDrawableResolver.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/ui/PluginDrawableResolver.kt similarity index 90% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/ui/PluginDrawableResolver.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/ui/PluginDrawableResolver.kt index 8eaca68cd6..138c203206 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/ui/PluginDrawableResolver.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/ui/PluginDrawableResolver.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.plugins.manager.ui +package org.appdevforall.codeonthego.plugins.manager.ui import android.content.Context import android.content.res.Resources import android.graphics.drawable.Drawable import android.util.Log import androidx.core.content.ContextCompat -import com.itsaky.androidide.plugins.base.PluginFragmentHelper +import org.appdevforall.codeonthego.plugins.base.PluginFragmentHelper object PluginDrawableResolver { diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/ui/PluginEditorTabManager.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/ui/PluginEditorTabManager.kt similarity index 95% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/ui/PluginEditorTabManager.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/ui/PluginEditorTabManager.kt index 4fe6a7fae6..0055b94317 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/ui/PluginEditorTabManager.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/ui/PluginEditorTabManager.kt @@ -1,13 +1,13 @@ -package com.itsaky.androidide.plugins.manager.ui +package org.appdevforall.codeonthego.plugins.manager.ui import android.util.Log import androidx.fragment.app.Fragment -import com.itsaky.androidide.plugins.IPlugin -import com.itsaky.androidide.plugins.extensions.EditorTabExtension -import com.itsaky.androidide.plugins.extensions.EditorTabItem -import com.itsaky.androidide.plugins.manager.core.PluginManager -import com.itsaky.androidide.plugins.manager.fragment.PluginFragmentFactory -import com.itsaky.androidide.eventbus.events.plugin.PluginCrashedEvent +import org.appdevforall.codeonthego.plugins.IPlugin +import org.appdevforall.codeonthego.plugins.extensions.EditorTabExtension +import org.appdevforall.codeonthego.plugins.extensions.EditorTabItem +import org.appdevforall.codeonthego.plugins.manager.core.PluginManager +import org.appdevforall.codeonthego.plugins.manager.fragment.PluginFragmentFactory +import org.appdevforall.codeonthego.eventbus.events.plugin.PluginCrashedEvent import org.greenrobot.eventbus.EventBus import org.slf4j.LoggerFactory diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/ui/PluginToolbarHost.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/ui/PluginToolbarHost.kt similarity index 91% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/ui/PluginToolbarHost.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/ui/PluginToolbarHost.kt index 81c7593073..e5e520b593 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/ui/PluginToolbarHost.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/ui/PluginToolbarHost.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.manager.ui +package org.appdevforall.codeonthego.plugins.manager.ui /** * Implemented by the editor Activity so lower modules (e.g. the plugin services in diff --git a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/ui/PluginUiActionManager.kt b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/ui/PluginUiActionManager.kt similarity index 90% rename from plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/ui/PluginUiActionManager.kt rename to plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/ui/PluginUiActionManager.kt index eb47155c14..ca64c27fa9 100644 --- a/plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/ui/PluginUiActionManager.kt +++ b/plugin-manager/src/main/kotlin/org/appdevforall/codeonthego/plugins/manager/ui/PluginUiActionManager.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.plugins.manager.ui +package org.appdevforall.codeonthego.plugins.manager.ui import android.util.Log -import com.itsaky.androidide.plugins.manager.core.PluginManager +import org.appdevforall.codeonthego.plugins.manager.core.PluginManager /** * Collects the editor-toolbar action ids that enabled `UIExtension` plugins want hidden diff --git a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/E2EIntegrationTest.kt b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/E2EIntegrationTest.kt similarity index 85% rename from plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/E2EIntegrationTest.kt rename to plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/E2EIntegrationTest.kt index eaca5ab1f8..2766a1d5b6 100644 --- a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/E2EIntegrationTest.kt +++ b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/E2EIntegrationTest.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.plugins.manager +package org.appdevforall.codeonthego.plugins.manager -import com.itsaky.androidide.plugins.PluginPermission -import com.itsaky.androidide.plugins.manager.context.ServiceRegistryImpl -import com.itsaky.androidide.plugins.manager.services.IdeFileServiceImpl -import com.itsaky.androidide.plugins.services.IdeFileService +import org.appdevforall.codeonthego.plugins.PluginPermission +import org.appdevforall.codeonthego.plugins.manager.context.ServiceRegistryImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeFileServiceImpl +import org.appdevforall.codeonthego.plugins.services.IdeFileService import org.junit.After import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse diff --git a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/core/PluginManagerIntegrationTest.kt b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/core/PluginManagerIntegrationTest.kt similarity index 86% rename from plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/core/PluginManagerIntegrationTest.kt rename to plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/core/PluginManagerIntegrationTest.kt index 67f50c90ec..e1a40d0902 100644 --- a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/core/PluginManagerIntegrationTest.kt +++ b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/core/PluginManagerIntegrationTest.kt @@ -1,13 +1,13 @@ -package com.itsaky.androidide.plugins.manager.core - -import com.itsaky.androidide.plugins.PluginPermission -import com.itsaky.androidide.plugins.ServiceRegistry -import com.itsaky.androidide.plugins.extensions.IProject -import com.itsaky.androidide.plugins.manager.context.ServiceRegistryImpl -import com.itsaky.androidide.plugins.manager.services.IdeFileServiceImpl -import com.itsaky.androidide.plugins.manager.services.IdeProjectServiceImpl -import com.itsaky.androidide.plugins.services.IdeFileService -import com.itsaky.androidide.plugins.services.IdeProjectService +package org.appdevforall.codeonthego.plugins.manager.core + +import org.appdevforall.codeonthego.plugins.PluginPermission +import org.appdevforall.codeonthego.plugins.ServiceRegistry +import org.appdevforall.codeonthego.plugins.extensions.IProject +import org.appdevforall.codeonthego.plugins.manager.context.ServiceRegistryImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeFileServiceImpl +import org.appdevforall.codeonthego.plugins.manager.services.IdeProjectServiceImpl +import org.appdevforall.codeonthego.plugins.services.IdeFileService +import org.appdevforall.codeonthego.plugins.services.IdeProjectService import org.junit.After import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse diff --git a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/core/PluginSettingsEntriesTest.kt b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/core/PluginSettingsEntriesTest.kt similarity index 92% rename from plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/core/PluginSettingsEntriesTest.kt rename to plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/core/PluginSettingsEntriesTest.kt index 7ef8e080d6..61e64e9328 100644 --- a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/core/PluginSettingsEntriesTest.kt +++ b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/core/PluginSettingsEntriesTest.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.plugins.manager.core +package org.appdevforall.codeonthego.plugins.manager.core import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.plugins.PluginContext -import com.itsaky.androidide.plugins.extensions.PluginSettingsEntry -import com.itsaky.androidide.plugins.extensions.SettingsExtension +import org.appdevforall.codeonthego.plugins.PluginContext +import org.appdevforall.codeonthego.plugins.extensions.PluginSettingsEntry +import org.appdevforall.codeonthego.plugins.extensions.SettingsExtension import org.junit.Test /** diff --git a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/loaders/PluginProvenanceMappingTest.kt b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/loaders/PluginProvenanceMappingTest.kt similarity index 98% rename from plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/loaders/PluginProvenanceMappingTest.kt rename to plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/loaders/PluginProvenanceMappingTest.kt index e8f0435c4d..3cbbc0b3b8 100644 --- a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/loaders/PluginProvenanceMappingTest.kt +++ b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/loaders/PluginProvenanceMappingTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.plugins.manager.loaders +package org.appdevforall.codeonthego.plugins.manager.loaders import com.google.common.truth.Truth.assertThat import org.junit.Test diff --git a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/services/IdeBuildServiceImplExecuteTasksTest.kt b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeBuildServiceImplExecuteTasksTest.kt similarity index 81% rename from plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/services/IdeBuildServiceImplExecuteTasksTest.kt rename to plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeBuildServiceImplExecuteTasksTest.kt index 9e7aa57c1f..439fe64be2 100644 --- a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/services/IdeBuildServiceImplExecuteTasksTest.kt +++ b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeBuildServiceImplExecuteTasksTest.kt @@ -1,14 +1,14 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.projects.builder.BuildService -import com.itsaky.androidide.tooling.api.messages.InitializeProjectParams -import com.itsaky.androidide.tooling.api.messages.TaskExecutionMessage -import com.itsaky.androidide.tooling.api.messages.result.BuildCancellationRequestResult -import com.itsaky.androidide.tooling.api.messages.result.InitializeResult -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult -import com.itsaky.androidide.tooling.api.models.ToolingServerMetadata +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.projects.builder.BuildService +import org.appdevforall.codeonthego.tooling.api.messages.InitializeProjectParams +import org.appdevforall.codeonthego.tooling.api.messages.TaskExecutionMessage +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildCancellationRequestResult +import org.appdevforall.codeonthego.tooling.api.messages.result.InitializeResult +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult +import org.appdevforall.codeonthego.tooling.api.models.ToolingServerMetadata import org.junit.After import org.junit.Test import java.util.concurrent.CompletableFuture diff --git a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/services/IdeEditorServiceImplSaveFileTest.kt b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeEditorServiceImplSaveFileTest.kt similarity index 95% rename from plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/services/IdeEditorServiceImplSaveFileTest.kt rename to plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeEditorServiceImplSaveFileTest.kt index 2632cc6642..0e1a9fd43f 100644 --- a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/services/IdeEditorServiceImplSaveFileTest.kt +++ b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeEditorServiceImplSaveFileTest.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services -import com.itsaky.androidide.plugins.PluginPermission +import org.appdevforall.codeonthego.plugins.PluginPermission import kotlinx.coroutines.runBlocking import org.junit.After import org.junit.Assert.assertEquals diff --git a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/services/IdeFileServiceImplTest.kt b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeFileServiceImplTest.kt similarity index 97% rename from plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/services/IdeFileServiceImplTest.kt rename to plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeFileServiceImplTest.kt index a87086cac0..24338b4784 100644 --- a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/services/IdeFileServiceImplTest.kt +++ b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeFileServiceImplTest.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services -import com.itsaky.androidide.plugins.PluginPermission +import org.appdevforall.codeonthego.plugins.PluginPermission import org.junit.After import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse diff --git a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/services/IdeLogServiceImplTest.kt b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeLogServiceImplTest.kt similarity index 79% rename from plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/services/IdeLogServiceImplTest.kt rename to plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeLogServiceImplTest.kt index 8b6346b9fa..764d1ffbf7 100644 --- a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/services/IdeLogServiceImplTest.kt +++ b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeLogServiceImplTest.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.plugins.services.LogEntry -import com.itsaky.androidide.plugins.services.LogLevel -import com.itsaky.androidide.plugins.services.LogQuery -import com.itsaky.androidide.plugins.services.LogReadResult -import com.itsaky.androidide.plugins.services.LogSource +import org.appdevforall.codeonthego.plugins.services.LogEntry +import org.appdevforall.codeonthego.plugins.services.LogLevel +import org.appdevforall.codeonthego.plugins.services.LogQuery +import org.appdevforall.codeonthego.plugins.services.LogReadResult +import org.appdevforall.codeonthego.plugins.services.LogSource import org.junit.Test class IdeLogServiceImplTest { diff --git a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/services/IdeProjectServiceImplModuleContextTest.kt b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeProjectServiceImplModuleContextTest.kt similarity index 86% rename from plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/services/IdeProjectServiceImplModuleContextTest.kt rename to plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeProjectServiceImplModuleContextTest.kt index 446eac793f..8bc21c4009 100644 --- a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/services/IdeProjectServiceImplModuleContextTest.kt +++ b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeProjectServiceImplModuleContextTest.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services -import com.itsaky.androidide.plugins.PluginPermission -import com.itsaky.androidide.plugins.extensions.IProject +import org.appdevforall.codeonthego.plugins.PluginPermission +import org.appdevforall.codeonthego.plugins.extensions.IProject import org.junit.Assert.assertThrows import org.junit.Test import java.io.File diff --git a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/services/IdeSidebarServiceImplTest.kt b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeSidebarServiceImplTest.kt similarity index 83% rename from plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/services/IdeSidebarServiceImplTest.kt rename to plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeSidebarServiceImplTest.kt index 9ad883ea8d..d1046c854a 100644 --- a/plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/services/IdeSidebarServiceImplTest.kt +++ b/plugin-manager/src/test/kotlin/org/appdevforall/codeonthego/plugins/manager/services/IdeSidebarServiceImplTest.kt @@ -1,7 +1,7 @@ -package com.itsaky.androidide.plugins.manager.services +package org.appdevforall.codeonthego.plugins.manager.services import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.actions.SidebarSlotManager +import org.appdevforall.codeonthego.actions.SidebarSlotManager import org.junit.After import org.junit.Test diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/BaseIDEPreferences.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/BaseIDEPreferences.kt similarity index 96% rename from preferences/src/main/java/com/itsaky/androidide/preferences/BaseIDEPreferences.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/BaseIDEPreferences.kt index d515b6e537..5668f44d81 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/BaseIDEPreferences.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/BaseIDEPreferences.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import android.content.Context import androidx.preference.Preference diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/BasePreference.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/BasePreference.kt similarity index 93% rename from preferences/src/main/java/com/itsaky/androidide/preferences/BasePreference.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/BasePreference.kt index c5a6c38a0f..3c694ad678 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/BasePreference.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/BasePreference.kt @@ -15,14 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences + +import com.itsaky.androidide.preferences.R import android.content.Context import android.graphics.PorterDuff.Mode.SRC_ATOP import android.graphics.PorterDuffColorFilter import androidx.core.content.ContextCompat import androidx.preference.Preference -import com.itsaky.androidide.utils.resolveAttr +import org.appdevforall.codeonthego.utils.resolveAttr /** * Base class for preferences. diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/ChoiceBasedDialogPreference.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/ChoiceBasedDialogPreference.kt similarity index 98% rename from preferences/src/main/java/com/itsaky/androidide/preferences/ChoiceBasedDialogPreference.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/ChoiceBasedDialogPreference.kt index 873fb3c184..c129ff0a64 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/ChoiceBasedDialogPreference.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/ChoiceBasedDialogPreference.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import androidx.annotation.CallSuper import androidx.appcompat.app.AlertDialog diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/DialogPreference.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/DialogPreference.kt similarity index 92% rename from preferences/src/main/java/com/itsaky/androidide/preferences/DialogPreference.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/DialogPreference.kt index 19fd5712d9..30ceaf67c5 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/DialogPreference.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/DialogPreference.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import android.content.Context import android.view.View import androidx.appcompat.app.AlertDialog import androidx.preference.Preference import com.google.android.material.dialog.MaterialAlertDialogBuilder -import com.itsaky.androidide.utils.DialogUtils -import com.itsaky.androidide.utils.applyLongPressRecursively -import com.itsaky.androidide.utils.showIdeCategoryTooltipIfPresent +import org.appdevforall.codeonthego.utils.DialogUtils +import org.appdevforall.codeonthego.utils.applyLongPressRecursively +import org.appdevforall.codeonthego.utils.showIdeCategoryTooltipIfPresent /** * A preference which shows a dialog when clicked. diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/EditTextPreference.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/EditTextPreference.kt similarity index 97% rename from preferences/src/main/java/com/itsaky/androidide/preferences/EditTextPreference.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/EditTextPreference.kt index 11437f2ac9..6bd0e8ccb8 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/EditTextPreference.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/EditTextPreference.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import android.view.LayoutInflater import androidx.preference.Preference diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/IDEPreferences.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/IDEPreferences.kt similarity index 92% rename from preferences/src/main/java/com/itsaky/androidide/preferences/IDEPreferences.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/IDEPreferences.kt index e1cdf832b1..9aabb29b45 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/IDEPreferences.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/IDEPreferences.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import android.os.Parcel import android.os.Parcelable -import com.itsaky.androidide.idetooltips.TooltipTag +import org.appdevforall.codeonthego.idetooltips.TooltipTag /** * The preferences for the IDE. diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/IPreference.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/IPreference.kt similarity index 96% rename from preferences/src/main/java/com/itsaky/androidide/preferences/IPreference.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/IPreference.kt index 9b397ee82d..2d816cb3ac 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/IPreference.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/IPreference.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import android.content.Context import android.os.Parcelable diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/IPreferenceGroup.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/IPreferenceGroup.kt similarity index 97% rename from preferences/src/main/java/com/itsaky/androidide/preferences/IPreferenceGroup.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/IPreferenceGroup.kt index 92b365fc59..0f9bc3fb19 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/IPreferenceGroup.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/IPreferenceGroup.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import android.content.Context import androidx.preference.Preference diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/IPreferenceInflater.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/IPreferenceInflater.kt similarity index 95% rename from preferences/src/main/java/com/itsaky/androidide/preferences/IPreferenceInflater.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/IPreferenceInflater.kt index abacd83887..4973516816 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/IPreferenceInflater.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/IPreferenceInflater.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import androidx.preference.Preference diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/IPreferenceScreen.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/IPreferenceScreen.kt similarity index 96% rename from preferences/src/main/java/com/itsaky/androidide/preferences/IPreferenceScreen.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/IPreferenceScreen.kt index 35c88970d2..a8daf33570 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/IPreferenceScreen.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/IPreferenceScreen.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import android.content.Context import androidx.preference.Preference diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/MultiChoicePreference.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/MultiChoicePreference.kt similarity index 97% rename from preferences/src/main/java/com/itsaky/androidide/preferences/MultiChoicePreference.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/MultiChoicePreference.kt index ba3e66178b..c159de6e20 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/MultiChoicePreference.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/MultiChoicePreference.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import androidx.preference.Preference import com.google.android.material.dialog.MaterialAlertDialogBuilder diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/NumberInputEditTextPreference.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/NumberInputEditTextPreference.kt similarity index 98% rename from preferences/src/main/java/com/itsaky/androidide/preferences/NumberInputEditTextPreference.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/NumberInputEditTextPreference.kt index a8b04280d7..4d069ad930 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/NumberInputEditTextPreference.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/NumberInputEditTextPreference.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import android.text.method.DigitsKeyListener import android.view.LayoutInflater diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/PreferenceChoices.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/PreferenceChoices.kt similarity index 97% rename from preferences/src/main/java/com/itsaky/androidide/preferences/PreferenceChoices.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/PreferenceChoices.kt index 06987e6eb8..474f4283d6 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/PreferenceChoices.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/PreferenceChoices.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import androidx.preference.Preference diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/PreferenceValueType.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/PreferenceValueType.kt similarity index 95% rename from preferences/src/main/java/com/itsaky/androidide/preferences/PreferenceValueType.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/PreferenceValueType.kt index d5228bdb4a..d8675c7329 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/PreferenceValueType.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/PreferenceValueType.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences /** * The type of value a preference holds. diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/SimpleClickablePreference.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/SimpleClickablePreference.kt similarity index 96% rename from preferences/src/main/java/com/itsaky/androidide/preferences/SimpleClickablePreference.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/SimpleClickablePreference.kt index a0f84754e3..1135524aed 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/SimpleClickablePreference.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/SimpleClickablePreference.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import androidx.preference.Preference import kotlinx.parcelize.IgnoredOnParcel diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/SimplePreference.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/SimplePreference.kt similarity index 95% rename from preferences/src/main/java/com/itsaky/androidide/preferences/SimplePreference.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/SimplePreference.kt index cbbe43c01c..21b29f85b8 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/SimplePreference.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/SimplePreference.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import android.content.Context import androidx.preference.Preference diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/SingleChoicePreference.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/SingleChoicePreference.kt similarity index 98% rename from preferences/src/main/java/com/itsaky/androidide/preferences/SingleChoicePreference.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/SingleChoicePreference.kt index ab58ae53cb..e0c0876524 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/SingleChoicePreference.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/SingleChoicePreference.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import androidx.preference.Preference import com.google.android.material.dialog.MaterialAlertDialogBuilder diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/SwitchPreference.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/SwitchPreference.kt similarity index 96% rename from preferences/src/main/java/com/itsaky/androidide/preferences/SwitchPreference.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/SwitchPreference.kt index 6b5d977bfb..4d29e5861e 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/SwitchPreference.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/SwitchPreference.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences +package org.appdevforall.codeonthego.preferences import android.content.Context import androidx.preference.Preference diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/internal/BuildPreferences.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/BuildPreferences.kt similarity index 98% rename from preferences/src/main/java/com/itsaky/androidide/preferences/internal/BuildPreferences.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/BuildPreferences.kt index 34155df4eb..3e8fa20a5d 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/internal/BuildPreferences.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/BuildPreferences.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences.internal +package org.appdevforall.codeonthego.preferences.internal import org.adfa.constants.GRADLE_DISTRIBUTIONS_DIR import org.adfa.constants.GRADLE_DISTRIBUTION_NAME diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/internal/DevOpsPreferences.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/DevOpsPreferences.kt similarity index 96% rename from preferences/src/main/java/com/itsaky/androidide/preferences/internal/DevOpsPreferences.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/DevOpsPreferences.kt index d92b3f81d8..ccab865cb0 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/internal/DevOpsPreferences.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/DevOpsPreferences.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences.internal +package org.appdevforall.codeonthego.preferences.internal /** * @author Akash Yadav diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/internal/EditorPreferences.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/EditorPreferences.kt similarity index 99% rename from preferences/src/main/java/com/itsaky/androidide/preferences/internal/EditorPreferences.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/EditorPreferences.kt index a47c94f055..153f605985 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/internal/EditorPreferences.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/EditorPreferences.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences.internal +package org.appdevforall.codeonthego.preferences.internal /** * Preferences for the code editor. diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/internal/GeneralPreferences.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/GeneralPreferences.kt similarity index 95% rename from preferences/src/main/java/com/itsaky/androidide/preferences/internal/GeneralPreferences.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/GeneralPreferences.kt index 2b7e15fc90..c41ce1bd96 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/internal/GeneralPreferences.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/GeneralPreferences.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences.internal +package org.appdevforall.codeonthego.preferences.internal import androidx.appcompat.app.AppCompatDelegate -import com.itsaky.androidide.resources.localization.LocaleProvider +import org.appdevforall.codeonthego.resources.localization.LocaleProvider /** * @author Akash Yadav diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/internal/GitPreferences.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/GitPreferences.kt similarity index 92% rename from preferences/src/main/java/com/itsaky/androidide/preferences/internal/GitPreferences.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/GitPreferences.kt index 89121b3d76..dceec98317 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/internal/GitPreferences.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/GitPreferences.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.preferences.internal +package org.appdevforall.codeonthego.preferences.internal /** * Preferences for Git configuration. diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/internal/JavaPreferences.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/JavaPreferences.kt similarity index 94% rename from preferences/src/main/java/com/itsaky/androidide/preferences/internal/JavaPreferences.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/JavaPreferences.kt index 5de61f6f79..508ab1e96d 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/internal/JavaPreferences.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/JavaPreferences.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences.internal +package org.appdevforall.codeonthego.preferences.internal /** * @author Akash Yadav diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/internal/StatPreferences.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/StatPreferences.kt similarity index 93% rename from preferences/src/main/java/com/itsaky/androidide/preferences/internal/StatPreferences.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/StatPreferences.kt index af4566f9ab..6798529d9f 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/internal/StatPreferences.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/StatPreferences.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences.internal +package org.appdevforall.codeonthego.preferences.internal import android.content.Context import android.content.SharedPreferences -import com.itsaky.androidide.app.BaseApplication +import org.appdevforall.codeonthego.app.BaseApplication enum class TelemetryConsent { UNSET, diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/internal/XmlPreferences.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/XmlPreferences.kt similarity index 98% rename from preferences/src/main/java/com/itsaky/androidide/preferences/internal/XmlPreferences.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/XmlPreferences.kt index 33bc27374f..e41b82b8db 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/internal/XmlPreferences.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/XmlPreferences.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences.internal +package org.appdevforall.codeonthego.preferences.internal /** * @author Akash Yadav diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/internal/preferences.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/preferences.kt similarity index 82% rename from preferences/src/main/java/com/itsaky/androidide/preferences/internal/preferences.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/preferences.kt index 852106d11c..180caf1a9e 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/internal/preferences.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/internal/preferences.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences.internal +package org.appdevforall.codeonthego.preferences.internal -import com.itsaky.androidide.app.BaseApplication -import com.itsaky.androidide.managers.PreferenceManager +import org.appdevforall.codeonthego.app.BaseApplication +import org.appdevforall.codeonthego.managers.PreferenceManager /** * The global preference manager instance. diff --git a/preferences/src/main/java/com/itsaky/androidide/preferences/utils/editorUtil.kt b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/utils/editorUtil.kt similarity index 92% rename from preferences/src/main/java/com/itsaky/androidide/preferences/utils/editorUtil.kt rename to preferences/src/main/java/org/appdevforall/codeonthego/preferences/utils/editorUtil.kt index 474daf62ee..381478883e 100644 --- a/preferences/src/main/java/com/itsaky/androidide/preferences/utils/editorUtil.kt +++ b/preferences/src/main/java/org/appdevforall/codeonthego/preferences/utils/editorUtil.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.preferences.utils +package org.appdevforall.codeonthego.preferences.utils -import com.itsaky.androidide.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences /** @author Akash Yadav */ diff --git a/profiler/src/main/java/org/appdevforall/cotg/profiler/ui/theme/ProfilerTheme.kt b/profiler/src/main/java/org/appdevforall/cotg/profiler/ui/theme/ProfilerTheme.kt index 32c74150f4..5a6d168fa2 100644 --- a/profiler/src/main/java/org/appdevforall/cotg/profiler/ui/theme/ProfilerTheme.kt +++ b/profiler/src/main/java/org/appdevforall/cotg/profiler/ui/theme/ProfilerTheme.kt @@ -1,7 +1,7 @@ package org.appdevforall.cotg.profiler.ui.theme import androidx.compose.runtime.Composable -import com.itsaky.androidide.common.compose.IdeTheme +import org.appdevforall.codeonthego.common.compose.IdeTheme /** * Profiler content themed from the IDE's XML theme. diff --git a/quickbuild/core/src/main/AndroidManifest.xml b/quickbuild/core/src/main/AndroidManifest.xml index edc60f1208..4176f0dbe8 100644 --- a/quickbuild/core/src/main/AndroidManifest.xml +++ b/quickbuild/core/src/main/AndroidManifest.xml @@ -9,7 +9,7 @@ android:name="org.appdevforall.cotg.quickbuild.service.deploy.QuickBuildHostService" android:exported="true"> - + diff --git a/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/domain/reload/ComponentInfo.kt b/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/domain/reload/ComponentInfo.kt index 082649c319..392f48cdc2 100644 --- a/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/domain/reload/ComponentInfo.kt +++ b/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/domain/reload/ComponentInfo.kt @@ -57,8 +57,8 @@ val RESTART_SENSITIVE_KINDS: Set = */ val COGO_INJECTED_COMPONENTS: Set = setOf( - "com.itsaky.androidide.logsender.LogSenderService", - "com.itsaky.androidide.logsender.utils.LogSenderInstaller", + "org.appdevforall.codeonthego.logsender.LogSenderService", + "org.appdevforall.codeonthego.logsender.utils.LogSenderInstaller", ) /** diff --git a/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/domain/reload/RealIdInstall.kt b/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/domain/reload/RealIdInstall.kt index 13e4518511..85e9df19f4 100644 --- a/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/domain/reload/RealIdInstall.kt +++ b/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/domain/reload/RealIdInstall.kt @@ -19,7 +19,7 @@ object RealIdInstall { * plugin writes into the manifest (`QuickBuildPlugin.APP_COMPONENT_FACTORY`). */ const val QUICK_BUILD_APP_COMPONENT_FACTORY = - "com.itsaky.androidide.quickbuild.runtime.QuickBuildAppComponentFactory" + "org.appdevforall.codeonthego.quickbuild.runtime.QuickBuildAppComponentFactory" /** * True when the package installed under the real id is a Quick Build proxy app. diff --git a/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/service/deploy/DeployChannel.kt b/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/service/deploy/DeployChannel.kt index 9532bd4bd4..f8f3248ed0 100644 --- a/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/service/deploy/DeployChannel.kt +++ b/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/service/deploy/DeployChannel.kt @@ -131,7 +131,7 @@ sealed interface DeployResult { /** * The on-device [DeploySender]: passes payload files as read-only fds over the oneway - * [com.itsaky.androidide.quickbuild.IQuickBuildTarget.onPayload] and awaits the matching + * [org.appdevforall.codeonthego.quickbuild.IQuickBuildTarget.onPayload] and awaits the matching * report. * * Every wait is bounded, so a hung proxy app surfaces as [DeployResult.TimedOut] instead diff --git a/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/service/deploy/ProxyAppConnections.kt b/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/service/deploy/ProxyAppConnections.kt index d4957cfa18..c3d2c50640 100644 --- a/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/service/deploy/ProxyAppConnections.kt +++ b/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/service/deploy/ProxyAppConnections.kt @@ -1,7 +1,7 @@ package org.appdevforall.cotg.quickbuild.service.deploy import android.os.IBinder -import com.itsaky.androidide.quickbuild.IQuickBuildTarget +import org.appdevforall.codeonthego.quickbuild.IQuickBuildTarget import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharedFlow diff --git a/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/service/deploy/ProxyAppPriorityHold.kt b/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/service/deploy/ProxyAppPriorityHold.kt index b0d8b095ba..e6ab46eae6 100644 --- a/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/service/deploy/ProxyAppPriorityHold.kt +++ b/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/service/deploy/ProxyAppPriorityHold.kt @@ -95,7 +95,7 @@ class BoundServicePriorityHold internal constructor( * app bakes in. Must match `QuickBuildKeepAliveService` and the Gradle plugin's * `UNPROXIABLE_BY_NAME` entry that keeps the manifest transform from renaming it. */ - const val KEEP_ALIVE_SERVICE = "com.itsaky.androidide.quickbuild.runtime.QuickBuildKeepAliveService" + const val KEEP_ALIVE_SERVICE = "org.appdevforall.codeonthego.quickbuild.runtime.QuickBuildKeepAliveService" /** * Builds a hold that binds from [context]. diff --git a/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/service/deploy/QuickBuildHostService.kt b/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/service/deploy/QuickBuildHostService.kt index 92e5c0967c..16d2b617bc 100644 --- a/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/service/deploy/QuickBuildHostService.kt +++ b/quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/service/deploy/QuickBuildHostService.kt @@ -4,8 +4,8 @@ import android.app.Service import android.content.Intent import android.os.Binder import android.os.IBinder -import com.itsaky.androidide.quickbuild.IQuickBuildHost -import com.itsaky.androidide.quickbuild.IQuickBuildTarget +import org.appdevforall.codeonthego.quickbuild.IQuickBuildHost +import org.appdevforall.codeonthego.quickbuild.IQuickBuildTarget import org.slf4j.LoggerFactory /** @@ -169,6 +169,6 @@ class QuickBuildHostService : Service() { private val log = LoggerFactory.getLogger("QB-HostService") /** Matches the manifest intent-filter and the runtime's bind intent. */ - const val ACTION_QUICK_BUILD = "com.itsaky.androidide.QUICK_BUILD_ACTION" + const val ACTION_QUICK_BUILD = "org.appdevforall.codeonthego.QUICK_BUILD_ACTION" } } diff --git a/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/domain/reload/DeployPolicyTest.kt b/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/domain/reload/DeployPolicyTest.kt index ec57da0217..223dc72f84 100644 --- a/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/domain/reload/DeployPolicyTest.kt +++ b/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/domain/reload/DeployPolicyTest.kt @@ -46,13 +46,13 @@ class DeployPolicyTest { private val logSenderService = ComponentInfo( ComponentKind.SERVICE, - "com.itsaky.androidide.logsender.LogSenderService", + "org.appdevforall.codeonthego.logsender.LogSenderService", proxyClass = "com.example.quickbuild.proxies.Proxy1Service", ) private val logSenderInstaller = ComponentInfo( ComponentKind.PROVIDER, - "com.itsaky.androidide.logsender.utils.LogSenderInstaller", + "org.appdevforall.codeonthego.logsender.utils.LogSenderInstaller", proxyClass = "com.example.quickbuild.proxies.Proxy1Provider", ) @@ -185,19 +185,19 @@ class DeployPolicyTest { // A user class that happens to sit in logsender's package is still the user's code and // still ships in the payload. A prefix match would silently stop restarting for it. val neighbour = - ComponentInfo(ComponentKind.SERVICE, "com.itsaky.androidide.logsender.MyOwnService") + ComponentInfo(ComponentKind.SERVICE, "org.appdevforall.codeonthego.logsender.MyOwnService") val nestedNeighbour = - ComponentInfo(ComponentKind.PROVIDER, "com.itsaky.androidide.logsender.utils.MyOwnProvider") + ComponentInfo(ComponentKind.PROVIDER, "org.appdevforall.codeonthego.logsender.utils.MyOwnProvider") assertThat(policy(logSenderService, neighbour).decide(null)) .isEqualTo( - DeployDecision.Restart(ComponentKind.SERVICE, "com.itsaky.androidide.logsender.MyOwnService"), + DeployDecision.Restart(ComponentKind.SERVICE, "org.appdevforall.codeonthego.logsender.MyOwnService"), ) assertThat(policy(logSenderInstaller, nestedNeighbour).decide(null)) .isEqualTo( DeployDecision.Restart( ComponentKind.PROVIDER, - "com.itsaky.androidide.logsender.utils.MyOwnProvider", + "org.appdevforall.codeonthego.logsender.utils.MyOwnProvider", ), ) } @@ -208,8 +208,8 @@ class DeployPolicyTest { // set silently restores restart-on-every-save. assertThat(COGO_INJECTED_COMPONENTS) .containsExactly( - "com.itsaky.androidide.logsender.LogSenderService", - "com.itsaky.androidide.logsender.utils.LogSenderInstaller", + "org.appdevforall.codeonthego.logsender.LogSenderService", + "org.appdevforall.codeonthego.logsender.utils.LogSenderInstaller", ) } diff --git a/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/deploy/DeployChannelDeployTest.kt b/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/deploy/DeployChannelDeployTest.kt index 2a117f38a2..9e0b98d77b 100644 --- a/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/deploy/DeployChannelDeployTest.kt +++ b/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/deploy/DeployChannelDeployTest.kt @@ -6,7 +6,7 @@ import android.os.IBinder import android.os.ParcelFileDescriptor import android.os.RemoteException import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.quickbuild.IQuickBuildTarget +import org.appdevforall.codeonthego.quickbuild.IQuickBuildTarget import kotlinx.coroutines.async import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest diff --git a/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/deploy/DeployChannelWaitsTest.kt b/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/deploy/DeployChannelWaitsTest.kt index 3bbc052999..1440534db0 100644 --- a/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/deploy/DeployChannelWaitsTest.kt +++ b/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/deploy/DeployChannelWaitsTest.kt @@ -5,7 +5,7 @@ package org.appdevforall.cotg.quickbuild.service.deploy import android.os.IBinder import android.os.ParcelFileDescriptor import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.quickbuild.IQuickBuildTarget +import org.appdevforall.codeonthego.quickbuild.IQuickBuildTarget import kotlinx.coroutines.async import kotlinx.coroutines.test.advanceTimeBy import kotlinx.coroutines.test.runCurrent diff --git a/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/deploy/ProxyAppConnectionsFreezerHoldTest.kt b/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/deploy/ProxyAppConnectionsFreezerHoldTest.kt index 39045f2604..dfef1b949c 100644 --- a/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/deploy/ProxyAppConnectionsFreezerHoldTest.kt +++ b/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/deploy/ProxyAppConnectionsFreezerHoldTest.kt @@ -3,7 +3,7 @@ package org.appdevforall.cotg.quickbuild.service.deploy import android.os.IBinder import android.os.ParcelFileDescriptor import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.quickbuild.IQuickBuildTarget +import org.appdevforall.codeonthego.quickbuild.IQuickBuildTarget import org.junit.jupiter.api.Test /** diff --git a/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/deploy/QuickBuildHostBinderTest.kt b/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/deploy/QuickBuildHostBinderTest.kt index f2cc662232..043241b619 100644 --- a/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/deploy/QuickBuildHostBinderTest.kt +++ b/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/deploy/QuickBuildHostBinderTest.kt @@ -4,7 +4,7 @@ import android.os.IBinder import android.os.ParcelFileDescriptor import android.os.RemoteException import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.quickbuild.IQuickBuildTarget +import org.appdevforall.codeonthego.quickbuild.IQuickBuildTarget import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.launch import kotlinx.coroutines.test.UnconfinedTestDispatcher diff --git a/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/session/QuickBuildSessionManagerTest.kt b/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/session/QuickBuildSessionManagerTest.kt index ae7120ce84..1d962cb981 100644 --- a/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/session/QuickBuildSessionManagerTest.kt +++ b/quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/session/QuickBuildSessionManagerTest.kt @@ -2447,7 +2447,7 @@ class QuickBuildSessionManagerTest { private fun connectedAt(generation: Long): ConnectedTarget = ConnectedTarget( target = - object : com.itsaky.androidide.quickbuild.IQuickBuildTarget { + object : org.appdevforall.codeonthego.quickbuild.IQuickBuildTarget { override fun onBuildStatus(statusJson: String?) = Unit override fun onPayload( @@ -4256,9 +4256,9 @@ class QuickBuildSessionManagerTest { private val syncService = ComponentInfo(ComponentKind.SERVICE, "com.example.SyncService") private val logSenderService = - ComponentInfo(ComponentKind.SERVICE, "com.itsaky.androidide.logsender.LogSenderService") + ComponentInfo(ComponentKind.SERVICE, "org.appdevforall.codeonthego.logsender.LogSenderService") private val logSenderInstaller = - ComponentInfo(ComponentKind.PROVIDER, "com.itsaky.androidide.logsender.utils.LogSenderInstaller") + ComponentInfo(ComponentKind.PROVIDER, "org.appdevforall.codeonthego.logsender.utils.LogSenderInstaller") @Test fun `a hot swap warns nothing when the only components are the ones CoGo injected`() = diff --git a/quickbuild/docs/debugging.md b/quickbuild/docs/debugging.md index e04f432353..68918f1427 100644 --- a/quickbuild/docs/debugging.md +++ b/quickbuild/docs/debugging.md @@ -45,7 +45,7 @@ answers. 6. **Is the app on screen actually the proxy app?** A Standard Run install occupies the same package slot, so both look identical from the launcher. Three markers: - the installed package declares `android:appComponentFactory` = - `com.itsaky.androidide.quickbuild.runtime.QuickBuildAppComponentFactory` + `org.appdevforall.codeonthego.quickbuild.runtime.QuickBuildAppComponentFactory` ([`RealIdInstall.kt`](../core/src/main/java/org/appdevforall/cotg/quickbuild/domain/reload/RealIdInstall.kt)); - it logs under the tag `QB-Runtime`; - it has a `files/quickbuild/payload/` directory once a deploy has landed. @@ -298,16 +298,16 @@ worst open one of the user's own projects ```bash adb shell am start-activity \ - -a com.itsaky.androidide.quickbuild.action.BENCH_OPEN_PROJECT \ + -a org.appdevforall.codeonthego.quickbuild.action.BENCH_OPEN_PROJECT \ -n com.itsaky.androidide/.quickbuild.QuickBuildBenchActivity \ - --es com.itsaky.androidide.quickbuild.extra.PROJECT_PATH \ + --es org.appdevforall.codeonthego.quickbuild.extra.PROJECT_PATH \ /storage/emulated/0/CodeOnTheGoProjects/ ``` - **Idempotent.** Re-sending for the already-open, already-initialized project just taps Quick Build again, so a session can be retried (after an install-confirm timeout, say) without a force-stop and full re-open. -- **Optional `--es com.itsaky.androidide.quickbuild.extra.MODE `**, either `quickbuild` +- **Optional `--es org.appdevforall.codeonthego.quickbuild.extra.MODE `**, either `quickbuild` (the default) or `standard`. `standard` fires the normal Run button instead, which is how a standard build is measured on the same warm daemon. An unknown value rejects the intent outright. diff --git a/quickbuild/docs/live-reload-alternatives.md b/quickbuild/docs/live-reload-alternatives.md index 80fefa084f..d9e3b48026 100644 --- a/quickbuild/docs/live-reload-alternatives.md +++ b/quickbuild/docs/live-reload-alternatives.md @@ -45,8 +45,8 @@ and never restarts. | Class | Kind | |---|---| -| `com.itsaky.androidide.logsender.LogSenderService` | service | -| `com.itsaky.androidide.logsender.utils.LogSenderInstaller` | provider | +| `org.appdevforall.codeonthego.logsender.LogSenderService` | service | +| `org.appdevforall.codeonthego.logsender.utils.LogSenderInstaller` | provider | Without this, **every** app restarts on **every** save: `LogSenderPlugin` adds the logsender AAR to every debuggable variant, so its service and installer provider land in every app CoGo diff --git a/quickbuild/runtime/build.gradle.kts b/quickbuild/runtime/build.gradle.kts index c952973813..65d2150c88 100644 --- a/quickbuild/runtime/build.gradle.kts +++ b/quickbuild/runtime/build.gradle.kts @@ -68,23 +68,23 @@ tasks.register("jacocoTestReport") { fileTree( layout.buildDirectory.dir("intermediates/javac/v8Debug/compileV8DebugJavaWithJavac/classes"), ) { - exclude("com/itsaky/androidide/quickbuild/IQuickBuild*") + exclude("org/appdevforall/codeonthego/quickbuild/IQuickBuild*") // Binder host service: payload fds, Handler/Looper, activity relaunch orchestration. - exclude("com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntime*") + exclude("org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntime*") // ServiceConnection bind/reconnect to CoGo; binder death + rebind only happen on-device. - exclude("com/itsaky/androidide/quickbuild/runtime/QuickBuildClient*") + exclude("org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildClient*") // Framework-instantiated AppComponentFactory (Activity/Service/Provider hooks). - exclude("com/itsaky/androidide/quickbuild/runtime/QuickBuildAppComponentFactory*") + exclude("org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildAppComponentFactory*") // InMemoryDexClassLoader (ART-only) + /proc + android.os.Process boot path; not // splittable without moving prod code around - the generation-gate logic it defers // to (Generations, PayloadPersistence, PersistedSelection) is JVM-tested. - exclude("com/itsaky/androidide/quickbuild/runtime/PayloadStore*") + exclude("org/appdevforall/codeonthego/quickbuild/runtime/PayloadStore*") // API 30+ ResourcesLoader/ResourcesProvider attach; framework Resources objects only. - exclude("com/itsaky/androidide/quickbuild/runtime/ResourceStore*") + exclude("org/appdevforall/codeonthego/quickbuild/runtime/ResourceStore*") // Overlay banner View/TextView UI (UI is DoD-exempt; OverlayState text model is JVM-tested). - exclude("com/itsaky/androidide/quickbuild/runtime/StatusOverlay*") + exclude("org/appdevforall/codeonthego/quickbuild/runtime/StatusOverlay*") // Application.ActivityLifecycleCallbacks census over real Activity instances. - exclude("com/itsaky/androidide/quickbuild/runtime/ActivityTracker*") + exclude("org/appdevforall/codeonthego/quickbuild/runtime/ActivityTracker*") }, ) sourceDirectories.setFrom(files("src/main/java")) diff --git a/quickbuild/runtime/src/main/AndroidManifest.xml b/quickbuild/runtime/src/main/AndroidManifest.xml index 16e18325ee..83971d8aec 100644 --- a/quickbuild/runtime/src/main/AndroidManifest.xml +++ b/quickbuild/runtime/src/main/AndroidManifest.xml @@ -28,7 +28,7 @@ manifest transform leaves this name intact. --> diff --git a/quickbuild/runtime/src/main/aidl/com/itsaky/androidide/quickbuild/IQuickBuildHost.aidl b/quickbuild/runtime/src/main/aidl/org/appdevforall/codeonthego/quickbuild/IQuickBuildHost.aidl similarity index 88% rename from quickbuild/runtime/src/main/aidl/com/itsaky/androidide/quickbuild/IQuickBuildHost.aidl rename to quickbuild/runtime/src/main/aidl/org/appdevforall/codeonthego/quickbuild/IQuickBuildHost.aidl index e8d1bc08af..f41cdb61f0 100644 --- a/quickbuild/runtime/src/main/aidl/com/itsaky/androidide/quickbuild/IQuickBuildHost.aidl +++ b/quickbuild/runtime/src/main/aidl/org/appdevforall/codeonthego/quickbuild/IQuickBuildHost.aidl @@ -1,6 +1,6 @@ -package com.itsaky.androidide.quickbuild; +package org.appdevforall.codeonthego.quickbuild; -import com.itsaky.androidide.quickbuild.IQuickBuildTarget; +import org.appdevforall.codeonthego.quickbuild.IQuickBuildTarget; /** * CoGo side of the deploy channel (bound service, LogSender bind pattern). The proxy app diff --git a/quickbuild/runtime/src/main/aidl/com/itsaky/androidide/quickbuild/IQuickBuildTarget.aidl b/quickbuild/runtime/src/main/aidl/org/appdevforall/codeonthego/quickbuild/IQuickBuildTarget.aidl similarity index 97% rename from quickbuild/runtime/src/main/aidl/com/itsaky/androidide/quickbuild/IQuickBuildTarget.aidl rename to quickbuild/runtime/src/main/aidl/org/appdevforall/codeonthego/quickbuild/IQuickBuildTarget.aidl index 6f469c7405..5ca07faf89 100644 --- a/quickbuild/runtime/src/main/aidl/com/itsaky/androidide/quickbuild/IQuickBuildTarget.aidl +++ b/quickbuild/runtime/src/main/aidl/org/appdevforall/codeonthego/quickbuild/IQuickBuildTarget.aidl @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild; +package org.appdevforall.codeonthego.quickbuild; /** * Proxy app side of the deploy channel. CoGo calls this after a successful diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/ActivityTracker.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/ActivityTracker.java similarity index 99% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/ActivityTracker.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/ActivityTracker.java index d72100a28d..fbaba9b0d7 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/ActivityTracker.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/ActivityTracker.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import android.app.Activity; import android.app.Application; diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/AssetExtractor.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/AssetExtractor.java similarity index 99% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/AssetExtractor.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/AssetExtractor.java index 5f6dea3b21..138c53a66c 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/AssetExtractor.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/AssetExtractor.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import java.io.File; import java.io.FileInputStream; diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/BaselineGeneration.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/BaselineGeneration.java similarity index 97% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/BaselineGeneration.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/BaselineGeneration.java index 52c4b3caec..42fce05508 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/BaselineGeneration.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/BaselineGeneration.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import java.io.InputStream; diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/BootProbation.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/BootProbation.java similarity index 98% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/BootProbation.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/BootProbation.java index 662a40b714..3e36990beb 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/BootProbation.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/BootProbation.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; /** * Which generation a crash right now should be quarantined against, so a fresh process stops booting it. diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/BuildStatus.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/BuildStatus.java similarity index 98% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/BuildStatus.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/BuildStatus.java index d4530573fa..5cf13a59ab 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/BuildStatus.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/BuildStatus.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import java.util.Map; diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/CrashSummary.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/CrashSummary.java similarity index 99% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/CrashSummary.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/CrashSummary.java index 9ffb598e85..ef67f8910d 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/CrashSummary.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/CrashSummary.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; /** * Turns a payload crash into the text CoGo is told about it, and owns the height its banner may reach. diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/DeployMetadata.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/DeployMetadata.java similarity index 97% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/DeployMetadata.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/DeployMetadata.java index bf9d5933da..6a9a7ab3c8 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/DeployMetadata.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/DeployMetadata.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import java.util.Map; diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/DirectoryAssetsProvider.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/DirectoryAssetsProvider.java similarity index 98% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/DirectoryAssetsProvider.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/DirectoryAssetsProvider.java index 5e914cb280..b5fca962dc 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/DirectoryAssetsProvider.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/DirectoryAssetsProvider.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import android.annotation.TargetApi; import android.content.res.AssetFileDescriptor; diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/FirstFrameGate.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/FirstFrameGate.java similarity index 98% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/FirstFrameGate.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/FirstFrameGate.java index 3e6cce839b..7d33517362 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/FirstFrameGate.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/FirstFrameGate.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; /** * Holds a hot swap's pending generation until the activity that took the screen has actually drawn it. diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/Generations.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/Generations.java similarity index 98% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/Generations.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/Generations.java index 7722e84db0..965b173f3e 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/Generations.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/Generations.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; /** * Holds the generation acceptance rule, so it is stated once and JVM-testable. diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/LegacyResourceSwap.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/LegacyResourceSwap.java similarity index 99% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/LegacyResourceSwap.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/LegacyResourceSwap.java index a68b267f19..bc7885437f 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/LegacyResourceSwap.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/LegacyResourceSwap.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import android.content.res.AssetManager; import android.content.res.Resources; diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/LoaderRouter.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/LoaderRouter.java similarity index 96% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/LoaderRouter.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/LoaderRouter.java index 87ab1fdbe3..52b5186799 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/LoaderRouter.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/LoaderRouter.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; /** * Holds the classloader routing decision every {@link QuickBuildAppComponentFactory} override makes. diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/MiniJson.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/MiniJson.java similarity index 99% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/MiniJson.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/MiniJson.java index bd4e7b8179..c1e0b286e5 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/MiniJson.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/MiniJson.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import java.util.ArrayList; import java.util.LinkedHashMap; diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/OverlayState.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/OverlayState.java similarity index 99% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/OverlayState.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/OverlayState.java index 9f341a447a..6076722f8b 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/OverlayState.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/OverlayState.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; /** * Immutable description of what the status overlay currently shows. diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/PayloadPersistence.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadPersistence.java similarity index 99% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/PayloadPersistence.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadPersistence.java index 70e4b30d01..3d026445a2 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/PayloadPersistence.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadPersistence.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import java.io.ByteArrayInputStream; import java.io.File; diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/PayloadStore.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadStore.java similarity index 99% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/PayloadStore.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadStore.java index cc9ef75173..731ae338c5 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/PayloadStore.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadStore.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import android.content.Context; import android.os.Build; diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/PersistedSelection.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/PersistedSelection.java similarity index 96% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/PersistedSelection.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/PersistedSelection.java index 5816a5308f..f10e735b4b 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/PersistedSelection.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/PersistedSelection.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; /** * The boot-time decision of whether a persisted payload supersedes the baked baseline. diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildAppComponentFactory.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildAppComponentFactory.java similarity index 99% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildAppComponentFactory.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildAppComponentFactory.java index 46faecda21..3339838d4d 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildAppComponentFactory.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildAppComponentFactory.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import android.app.Activity; import android.app.AppComponentFactory; diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildClassLoaders.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildClassLoaders.java similarity index 97% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildClassLoaders.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildClassLoaders.java index 9ec030c219..faf9066afb 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildClassLoaders.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildClassLoaders.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; /** * Supplies the classloader that generated proxy activities return from their {@code getClassLoader()} override. diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildClient.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildClient.java similarity index 98% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildClient.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildClient.java index b38d6d68e3..b4c09a276f 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildClient.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildClient.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import android.content.ComponentName; import android.content.Context; @@ -9,8 +9,8 @@ import android.os.Looper; import android.os.ParcelFileDescriptor; import android.os.RemoteException; -import com.itsaky.androidide.quickbuild.IQuickBuildHost; -import com.itsaky.androidide.quickbuild.IQuickBuildTarget; +import org.appdevforall.codeonthego.quickbuild.IQuickBuildHost; +import org.appdevforall.codeonthego.quickbuild.IQuickBuildTarget; /** * The proxy app's end of the deploy channel to CoGo. @@ -22,7 +22,7 @@ final class QuickBuildClient implements ServiceConnection { /** Intent action of CoGo's deploy service. */ - static final String SERVICE_ACTION = "com.itsaky.androidide.QUICK_BUILD_ACTION"; + static final String SERVICE_ACTION = "org.appdevforall.codeonthego.QUICK_BUILD_ACTION"; /** CoGo's package name (same constant the LogSender uses). */ static final String IDE_PACKAGE = "com.itsaky.androidide"; diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildKeepAliveService.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildKeepAliveService.java similarity index 97% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildKeepAliveService.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildKeepAliveService.java index 94096edf7c..c34665e615 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildKeepAliveService.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildKeepAliveService.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import android.app.Service; import android.content.Intent; diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntime.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntime.java similarity index 99% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntime.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntime.java index 1dfb9289db..aee85a519e 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntime.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntime.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import android.app.Activity; import android.app.Application; diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/ResourceStore.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/ResourceStore.java similarity index 99% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/ResourceStore.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/ResourceStore.java index 51f9284b36..c9b3a0efc1 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/ResourceStore.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/ResourceStore.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import android.annotation.TargetApi; import android.content.Context; diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/ResourceSwapStrategy.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/ResourceSwapStrategy.java similarity index 95% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/ResourceSwapStrategy.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/ResourceSwapStrategy.java index e48cf69a4b..bfbea61dc4 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/ResourceSwapStrategy.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/ResourceSwapStrategy.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; /** * How a resource-table payload is applied on this device, chosen once per process from the SDK level. diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/RestartHandoff.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/RestartHandoff.java similarity index 99% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/RestartHandoff.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/RestartHandoff.java index 517b7ce271..6fa241624f 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/RestartHandoff.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/RestartHandoff.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; /** * The wait a restart deploy makes between asking Android to background the app and killing the process. diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/RuntimeLog.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/RuntimeLog.java similarity index 98% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/RuntimeLog.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/RuntimeLog.java index c479948440..37cf798936 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/RuntimeLog.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/RuntimeLog.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import android.util.Log; diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/StatusOverlay.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/StatusOverlay.java similarity index 98% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/StatusOverlay.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/StatusOverlay.java index da490ff867..2d4343bb32 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/StatusOverlay.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/StatusOverlay.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import android.app.Activity; import android.graphics.Color; @@ -18,7 +18,7 @@ final class StatusOverlay { /** View tag identifying the banner so re-renders update instead of stacking views. */ - private static final String VIEW_TAG = "com.itsaky.androidide.quickbuild.runtime.banner"; + private static final String VIEW_TAG = "org.appdevforall.codeonthego.quickbuild.runtime.banner"; private static final int COLOR_BUILD_FAILED = 0xCCBF360C; private static final int COLOR_CRASHED = 0xCCB71C1C; diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/Streams.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/Streams.java similarity index 99% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/Streams.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/Streams.java index 477d296a57..5051ee1605 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/Streams.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/Streams.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/SwapAckGate.java b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/SwapAckGate.java similarity index 98% rename from quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/SwapAckGate.java rename to quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/SwapAckGate.java index c3904987c3..0f5a4c2640 100644 --- a/quickbuild/runtime/src/main/java/com/itsaky/androidide/quickbuild/runtime/SwapAckGate.java +++ b/quickbuild/runtime/src/main/java/org/appdevforall/codeonthego/quickbuild/runtime/SwapAckGate.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; /** * Holds a backgrounded deploy's ack until every resource swap it posted has committed. diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/AssetExtractorFailurePathTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/AssetExtractorFailurePathTest.java similarity index 98% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/AssetExtractorFailurePathTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/AssetExtractorFailurePathTest.java index 7532b47005..e759b1628b 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/AssetExtractorFailurePathTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/AssetExtractorFailurePathTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/AssetExtractorTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/AssetExtractorTest.java similarity index 99% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/AssetExtractorTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/AssetExtractorTest.java index 732087f8a5..d0eba1d0f9 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/AssetExtractorTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/AssetExtractorTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertWithMessage; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/BaselineGenerationTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/BaselineGenerationTest.java similarity index 97% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/BaselineGenerationTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/BaselineGenerationTest.java index c941b88c94..9a6e131712 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/BaselineGenerationTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/BaselineGenerationTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/BootProbationTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/BootProbationTest.java similarity index 99% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/BootProbationTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/BootProbationTest.java index 6d6c057897..7f3a17babd 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/BootProbationTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/BootProbationTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/BuildStatusTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/BuildStatusTest.java similarity index 98% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/BuildStatusTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/BuildStatusTest.java index a15fe7b1f1..b6e4a4c497 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/BuildStatusTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/BuildStatusTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/CrashSummaryTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/CrashSummaryTest.java similarity index 99% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/CrashSummaryTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/CrashSummaryTest.java index 952945a8a8..a81bb46568 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/CrashSummaryTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/CrashSummaryTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/DeployMetadataTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/DeployMetadataTest.java similarity index 97% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/DeployMetadataTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/DeployMetadataTest.java index c82bbb0227..1e674c70f1 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/DeployMetadataTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/DeployMetadataTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/DirectoryAssetsProviderTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/DirectoryAssetsProviderTest.java similarity index 98% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/DirectoryAssetsProviderTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/DirectoryAssetsProviderTest.java index 08683234b6..b0c49322a7 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/DirectoryAssetsProviderTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/DirectoryAssetsProviderTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/FirstFrameGateTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/FirstFrameGateTest.java similarity index 98% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/FirstFrameGateTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/FirstFrameGateTest.java index 2a00e66663..9d1e2754d4 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/FirstFrameGateTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/FirstFrameGateTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/GenerationsTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/GenerationsTest.java similarity index 98% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/GenerationsTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/GenerationsTest.java index 98c1f18038..7078a6c112 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/GenerationsTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/GenerationsTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/LegacyResourceSwapAddAssetPathTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/LegacyResourceSwapAddAssetPathTest.java similarity index 94% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/LegacyResourceSwapAddAssetPathTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/LegacyResourceSwapAddAssetPathTest.java index 8ac1637a73..2a36b18694 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/LegacyResourceSwapAddAssetPathTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/LegacyResourceSwapAddAssetPathTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/LegacyResourceSwapSweepTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/LegacyResourceSwapSweepTest.java similarity index 98% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/LegacyResourceSwapSweepTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/LegacyResourceSwapSweepTest.java index f997c7cbbb..0b2da141c3 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/LegacyResourceSwapSweepTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/LegacyResourceSwapSweepTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assumptions.assumeFalse; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/LegacyResourceSwapTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/LegacyResourceSwapTest.java similarity index 98% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/LegacyResourceSwapTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/LegacyResourceSwapTest.java index 8c8dff5602..6d32f54572 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/LegacyResourceSwapTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/LegacyResourceSwapTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/LoaderRouterTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/LoaderRouterTest.java similarity index 97% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/LoaderRouterTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/LoaderRouterTest.java index 40602e4013..4ede3b691d 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/LoaderRouterTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/LoaderRouterTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/ManifestAppComponentFactoryTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/ManifestAppComponentFactoryTest.java similarity index 97% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/ManifestAppComponentFactoryTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/ManifestAppComponentFactoryTest.java index 21742ef956..f43e6db13e 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/ManifestAppComponentFactoryTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/ManifestAppComponentFactoryTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/MiniJsonHardeningTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/MiniJsonHardeningTest.java similarity index 98% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/MiniJsonHardeningTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/MiniJsonHardeningTest.java index a53e7a9666..45b6f8a856 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/MiniJsonHardeningTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/MiniJsonHardeningTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/MiniJsonSeparatorAndLiteralTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/MiniJsonSeparatorAndLiteralTest.java similarity index 97% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/MiniJsonSeparatorAndLiteralTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/MiniJsonSeparatorAndLiteralTest.java index 40ed10cc19..b7e2ea8eb4 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/MiniJsonSeparatorAndLiteralTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/MiniJsonSeparatorAndLiteralTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/MiniJsonTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/MiniJsonTest.java similarity index 98% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/MiniJsonTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/MiniJsonTest.java index e26d2a5427..3d09b0d986 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/MiniJsonTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/MiniJsonTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/OfflineNetworkGuardTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/OfflineNetworkGuardTest.java similarity index 97% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/OfflineNetworkGuardTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/OfflineNetworkGuardTest.java index 1240c764db..0e02899db8 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/OfflineNetworkGuardTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/OfflineNetworkGuardTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertWithMessage; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/OverlayStateTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/OverlayStateTest.java similarity index 98% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/OverlayStateTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/OverlayStateTest.java index 8a192d97aa..cb496b8ef7 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/OverlayStateTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/OverlayStateTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/OverlayStateTextEdgeTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/OverlayStateTextEdgeTest.java similarity index 97% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/OverlayStateTextEdgeTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/OverlayStateTextEdgeTest.java index 90f8e6dc96..394d02bfe2 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/OverlayStateTextEdgeTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/OverlayStateTextEdgeTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/PayloadPersistenceAtomicSetTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadPersistenceAtomicSetTest.java similarity index 99% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/PayloadPersistenceAtomicSetTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadPersistenceAtomicSetTest.java index 574326d960..1003ddfe72 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/PayloadPersistenceAtomicSetTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadPersistenceAtomicSetTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertWithMessage; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/PayloadPersistenceAtomicWriteTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadPersistenceAtomicWriteTest.java similarity index 98% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/PayloadPersistenceAtomicWriteTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadPersistenceAtomicWriteTest.java index daec4f9b5b..c1101281d6 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/PayloadPersistenceAtomicWriteTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadPersistenceAtomicWriteTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/PayloadPersistenceCorruptMetaTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadPersistenceCorruptMetaTest.java similarity index 99% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/PayloadPersistenceCorruptMetaTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadPersistenceCorruptMetaTest.java index e5668e2579..9a8e1e9986 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/PayloadPersistenceCorruptMetaTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadPersistenceCorruptMetaTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/PayloadPersistenceQuarantineTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadPersistenceQuarantineTest.java similarity index 99% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/PayloadPersistenceQuarantineTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadPersistenceQuarantineTest.java index ff26e3317e..098ae97828 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/PayloadPersistenceQuarantineTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadPersistenceQuarantineTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/PayloadPersistenceTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadPersistenceTest.java similarity index 99% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/PayloadPersistenceTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadPersistenceTest.java index 311ba5a63c..925b91d1c0 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/PayloadPersistenceTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/PayloadPersistenceTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertWithMessage; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/PersistedSelectionTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/PersistedSelectionTest.java similarity index 98% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/PersistedSelectionTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/PersistedSelectionTest.java index 3e761013fd..5051efaed4 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/PersistedSelectionTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/PersistedSelectionTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildAppComponentFactoryRethrowTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildAppComponentFactoryRethrowTest.java similarity index 98% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildAppComponentFactoryRethrowTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildAppComponentFactoryRethrowTest.java index 926bd41ad0..5810b04317 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildAppComponentFactoryRethrowTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildAppComponentFactoryRethrowTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildClassLoadersForActivityTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildClassLoadersForActivityTest.java similarity index 96% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildClassLoadersForActivityTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildClassLoadersForActivityTest.java index 9ec6fcddd0..2b27572485 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildClassLoadersForActivityTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildClassLoadersForActivityTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildClassLoadersTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildClassLoadersTest.java similarity index 93% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildClassLoadersTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildClassLoadersTest.java index 039c592efd..459ff501f5 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildClassLoadersTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildClassLoadersTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntimeApplyFailureReportTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntimeApplyFailureReportTest.java similarity index 98% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntimeApplyFailureReportTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntimeApplyFailureReportTest.java index 3b2e1179c0..bdf6478503 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntimeApplyFailureReportTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntimeApplyFailureReportTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntimeBootRestoreDispatchTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntimeBootRestoreDispatchTest.java similarity index 96% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntimeBootRestoreDispatchTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntimeBootRestoreDispatchTest.java index c3084ba61d..b8a278626d 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntimeBootRestoreDispatchTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntimeBootRestoreDispatchTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntimeFailReloadDispatchTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntimeFailReloadDispatchTest.java similarity index 96% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntimeFailReloadDispatchTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntimeFailReloadDispatchTest.java index 4621883105..ceb54108ec 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntimeFailReloadDispatchTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntimeFailReloadDispatchTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntimeFrameCompletionTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntimeFrameCompletionTest.java similarity index 98% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntimeFrameCompletionTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntimeFrameCompletionTest.java index e3cd1422ae..821fefab2b 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntimeFrameCompletionTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntimeFrameCompletionTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntimeResumeCompletionTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntimeResumeCompletionTest.java similarity index 97% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntimeResumeCompletionTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntimeResumeCompletionTest.java index 1b1c565a26..a06485c1a4 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/QuickBuildRuntimeResumeCompletionTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/QuickBuildRuntimeResumeCompletionTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/ResourceStoreAbandonedSwapTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/ResourceStoreAbandonedSwapTest.java similarity index 98% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/ResourceStoreAbandonedSwapTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/ResourceStoreAbandonedSwapTest.java index 0786164393..fcbc6c4cce 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/ResourceStoreAbandonedSwapTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/ResourceStoreAbandonedSwapTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/ResourceStoreLegacyAssetsTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/ResourceStoreLegacyAssetsTest.java similarity index 97% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/ResourceStoreLegacyAssetsTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/ResourceStoreLegacyAssetsTest.java index 91ab0eb5c0..1d9ab8ac38 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/ResourceStoreLegacyAssetsTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/ResourceStoreLegacyAssetsTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/ResourceStoreLegacyWriteSweepTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/ResourceStoreLegacyWriteSweepTest.java similarity index 97% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/ResourceStoreLegacyWriteSweepTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/ResourceStoreLegacyWriteSweepTest.java index 376d21ec44..0a4e7fe0c2 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/ResourceStoreLegacyWriteSweepTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/ResourceStoreLegacyWriteSweepTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/ResourceSwapStrategyTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/ResourceSwapStrategyTest.java similarity index 94% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/ResourceSwapStrategyTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/ResourceSwapStrategyTest.java index 21801b9572..4e161d3667 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/ResourceSwapStrategyTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/ResourceSwapStrategyTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/RestartHandoffTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/RestartHandoffTest.java similarity index 99% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/RestartHandoffTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/RestartHandoffTest.java index e1e072da23..2b10948ad7 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/RestartHandoffTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/RestartHandoffTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/RuntimeLogTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/RuntimeLogTest.java similarity index 96% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/RuntimeLogTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/RuntimeLogTest.java index 09ece2fc95..65199eef17 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/RuntimeLogTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/RuntimeLogTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/StatusOverlayInsetActionTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/StatusOverlayInsetActionTest.java similarity index 96% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/StatusOverlayInsetActionTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/StatusOverlayInsetActionTest.java index 3630c3fb02..3de384df8f 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/StatusOverlayInsetActionTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/StatusOverlayInsetActionTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/StreamsCloseQuietlyTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/StreamsCloseQuietlyTest.java similarity index 92% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/StreamsCloseQuietlyTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/StreamsCloseQuietlyTest.java index 0d2b2fdcdf..27f4991e28 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/StreamsCloseQuietlyTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/StreamsCloseQuietlyTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/StreamsTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/StreamsTest.java similarity index 99% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/StreamsTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/StreamsTest.java index b212349122..8f5ba08d17 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/StreamsTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/StreamsTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/SwapAckGateTest.java b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/SwapAckGateTest.java similarity index 98% rename from quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/SwapAckGateTest.java rename to quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/SwapAckGateTest.java index e2e48f4bd6..c4702a95ff 100644 --- a/quickbuild/runtime/src/test/java/com/itsaky/androidide/quickbuild/runtime/SwapAckGateTest.java +++ b/quickbuild/runtime/src/test/java/org/appdevforall/codeonthego/quickbuild/runtime/SwapAckGateTest.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.quickbuild.runtime; +package org.appdevforall.codeonthego.quickbuild.runtime; import static com.google.common.truth.Truth.assertThat; diff --git a/resources/src/main/java/com/itsaky/androidide/resources/ITooltipView.java b/resources/src/main/java/org/appdevforall/codeonthego/resources/ITooltipView.java similarity index 91% rename from resources/src/main/java/com/itsaky/androidide/resources/ITooltipView.java rename to resources/src/main/java/org/appdevforall/codeonthego/resources/ITooltipView.java index 030eff4e93..8c4fb5bdd2 100644 --- a/resources/src/main/java/com/itsaky/androidide/resources/ITooltipView.java +++ b/resources/src/main/java/org/appdevforall/codeonthego/resources/ITooltipView.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.resources; +package org.appdevforall.codeonthego.resources; /** * An interface for views that support a custom long-press action for showing tooltips. diff --git a/resources/src/main/java/com/itsaky/androidide/resources/TooltipMaterialCheckBox.java b/resources/src/main/java/org/appdevforall/codeonthego/resources/TooltipMaterialCheckBox.java similarity index 96% rename from resources/src/main/java/com/itsaky/androidide/resources/TooltipMaterialCheckBox.java rename to resources/src/main/java/org/appdevforall/codeonthego/resources/TooltipMaterialCheckBox.java index e291a9fc8e..d86816bc2a 100644 --- a/resources/src/main/java/com/itsaky/androidide/resources/TooltipMaterialCheckBox.java +++ b/resources/src/main/java/org/appdevforall/codeonthego/resources/TooltipMaterialCheckBox.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.resources; +package org.appdevforall.codeonthego.resources; import android.content.Context; import android.util.AttributeSet; diff --git a/resources/src/main/java/com/itsaky/androidide/resources/TooltipTextInputLayout.java b/resources/src/main/java/org/appdevforall/codeonthego/resources/TooltipTextInputLayout.java similarity index 98% rename from resources/src/main/java/com/itsaky/androidide/resources/TooltipTextInputLayout.java rename to resources/src/main/java/org/appdevforall/codeonthego/resources/TooltipTextInputLayout.java index 23d3f392f9..f6a51f0255 100644 --- a/resources/src/main/java/com/itsaky/androidide/resources/TooltipTextInputLayout.java +++ b/resources/src/main/java/org/appdevforall/codeonthego/resources/TooltipTextInputLayout.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.resources; +package org.appdevforall.codeonthego.resources; import android.content.Context; import android.util.AttributeSet; diff --git a/resources/src/main/java/com/itsaky/androidide/resources/localization/LocaleProvider.java b/resources/src/main/java/org/appdevforall/codeonthego/resources/localization/LocaleProvider.java similarity index 98% rename from resources/src/main/java/com/itsaky/androidide/resources/localization/LocaleProvider.java rename to resources/src/main/java/org/appdevforall/codeonthego/resources/localization/LocaleProvider.java index 3f49346b8e..8580240871 100644 --- a/resources/src/main/java/com/itsaky/androidide/resources/localization/LocaleProvider.java +++ b/resources/src/main/java/org/appdevforall/codeonthego/resources/localization/LocaleProvider.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.resources.localization; +package org.appdevforall.codeonthego.resources.localization; import androidx.annotation.Nullable; import java.util.Collections; diff --git a/resources/src/main/res/layout/layout_spinner.xml b/resources/src/main/res/layout/layout_spinner.xml index 879cebe8b3..1b7d046486 100644 --- a/resources/src/main/res/layout/layout_spinner.xml +++ b/resources/src/main/res/layout/layout_spinner.xml @@ -15,7 +15,7 @@ ~ along with AndroidIDE. If not, see . --> - - \ No newline at end of file + \ No newline at end of file diff --git a/scripts/run_instrumentation_tests.sh b/scripts/run_instrumentation_tests.sh index 09708a1110..ce37143ab9 100644 --- a/scripts/run_instrumentation_tests.sh +++ b/scripts/run_instrumentation_tests.sh @@ -31,7 +31,7 @@ DEVICE=true # The task for installing the tools in the emulator INSTALLER_TEST_TASK_NAME=":app:connectedArm64-v8aDebugAndroidTest" # Fully qualified name of the class which install installs the build tools -INSTALLER_TEST_CLASS_NAME="com.itsaky.androidide.BuildToolsInstallerTest" +INSTALLER_TEST_CLASS_NAME="org.appdevforall.codeonthego.BuildToolsInstallerTest" # Common Gradle invocation arguments GRADLE_INVOCATION_ARGS="--scan --continue --no-configuration-cache --stacktrace" diff --git a/shared/src/main/java/com/itsaky/androidide/models/Locations.kt b/shared/src/main/java/org/appdevforall/codeonthego/models/Locations.kt similarity index 99% rename from shared/src/main/java/com/itsaky/androidide/models/Locations.kt rename to shared/src/main/java/org/appdevforall/codeonthego/models/Locations.kt index 5d12d32f05..fff95925b8 100644 --- a/shared/src/main/java/com/itsaky/androidide/models/Locations.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/models/Locations.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models import com.google.gson.annotations.SerializedName import java.nio.file.Path diff --git a/shared/src/main/java/com/itsaky/androidide/models/LogLine.kt b/shared/src/main/java/org/appdevforall/codeonthego/models/LogLine.kt similarity index 94% rename from shared/src/main/java/com/itsaky/androidide/models/LogLine.kt rename to shared/src/main/java/org/appdevforall/codeonthego/models/LogLine.kt index 613f210b6e..cec50d9b02 100644 --- a/shared/src/main/java/com/itsaky/androidide/models/LogLine.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/models/LogLine.kt @@ -14,12 +14,12 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.models +package org.appdevforall.codeonthego.models -import com.itsaky.androidide.utils.DefaultRecyclable -import com.itsaky.androidide.utils.ILogger -import com.itsaky.androidide.utils.LogTagUtils -import com.itsaky.androidide.utils.newRecyclableObjectPool +import org.appdevforall.codeonthego.utils.DefaultRecyclable +import org.appdevforall.codeonthego.utils.ILogger +import org.appdevforall.codeonthego.utils.LogTagUtils +import org.appdevforall.codeonthego.utils.newRecyclableObjectPool class LogLine private constructor() : DefaultRecyclable() { diff --git a/shared/src/main/java/com/itsaky/androidide/progress/ICancelChecker.kt b/shared/src/main/java/org/appdevforall/codeonthego/progress/ICancelChecker.kt similarity index 98% rename from shared/src/main/java/com/itsaky/androidide/progress/ICancelChecker.kt rename to shared/src/main/java/org/appdevforall/codeonthego/progress/ICancelChecker.kt index 80b2a78cfd..483df16476 100644 --- a/shared/src/main/java/com/itsaky/androidide/progress/ICancelChecker.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/progress/ICancelChecker.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.progress +package org.appdevforall.codeonthego.progress import java.util.concurrent.CancellationException import java.util.concurrent.CopyOnWriteArrayList diff --git a/shared/src/main/java/com/itsaky/androidide/progress/ProgressManager.kt b/shared/src/main/java/org/appdevforall/codeonthego/progress/ProgressManager.kt similarity index 96% rename from shared/src/main/java/com/itsaky/androidide/progress/ProgressManager.kt rename to shared/src/main/java/org/appdevforall/codeonthego/progress/ProgressManager.kt index 3ed8e58068..02b03ea82f 100644 --- a/shared/src/main/java/com/itsaky/androidide/progress/ProgressManager.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/progress/ProgressManager.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.progress +package org.appdevforall.codeonthego.progress -import com.itsaky.androidide.progress.ICancelChecker.Default +import org.appdevforall.codeonthego.progress.ICancelChecker.Default import java.util.WeakHashMap import java.util.concurrent.CancellationException diff --git a/shared/src/main/java/com/itsaky/androidide/utils/AndroidPluginVersion.kt b/shared/src/main/java/org/appdevforall/codeonthego/utils/AndroidPluginVersion.kt similarity index 99% rename from shared/src/main/java/com/itsaky/androidide/utils/AndroidPluginVersion.kt rename to shared/src/main/java/org/appdevforall/codeonthego/utils/AndroidPluginVersion.kt index ebeb1827ea..9d7da1a17f 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/AndroidPluginVersion.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/AndroidPluginVersion.kt @@ -31,7 +31,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import com.itsaky.androidide.buildinfo.BuildInfo import java.util.Objects diff --git a/shared/src/main/java/com/itsaky/androidide/utils/Cache.java b/shared/src/main/java/org/appdevforall/codeonthego/utils/Cache.java similarity index 96% rename from shared/src/main/java/com/itsaky/androidide/utils/Cache.java rename to shared/src/main/java/org/appdevforall/codeonthego/utils/Cache.java index 335049345c..0fd18b8862 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/Cache.java +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/Cache.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; import java.lang.reflect.Method; import java.nio.file.Path; @@ -73,7 +73,7 @@ private static Instant getLastModified(Path file) { private static void initProjectManagerInstance() { if (FileManager_INSTANCE == null) { try { - final var klass = Class.forName("com.itsaky.androidide.projects.FileManager"); + final var klass = Class.forName("org.appdevforall.codeonthego.projects.FileManager"); final var field = klass.getDeclaredField("INSTANCE"); if (!field.isAccessible()) { field.setAccessible(true); diff --git a/shared/src/main/java/com/itsaky/androidide/utils/ClassTrie.kt b/shared/src/main/java/org/appdevforall/codeonthego/utils/ClassTrie.kt similarity index 99% rename from shared/src/main/java/com/itsaky/androidide/utils/ClassTrie.kt rename to shared/src/main/java/org/appdevforall/codeonthego/utils/ClassTrie.kt index d42853f52c..6bf910e110 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/ClassTrie.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/ClassTrie.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import java.util.concurrent.ConcurrentHashMap import java.util.function.Predicate diff --git a/shared/src/main/java/com/itsaky/androidide/utils/DefaultRecyclable.kt b/shared/src/main/java/org/appdevforall/codeonthego/utils/DefaultRecyclable.kt similarity index 96% rename from shared/src/main/java/com/itsaky/androidide/utils/DefaultRecyclable.kt rename to shared/src/main/java/org/appdevforall/codeonthego/utils/DefaultRecyclable.kt index 9ae6bf67a9..86f620e157 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/DefaultRecyclable.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/DefaultRecyclable.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import java.util.concurrent.atomic.AtomicBoolean diff --git a/shared/src/main/java/com/itsaky/androidide/utils/DocumentUtils.java b/shared/src/main/java/org/appdevforall/codeonthego/utils/DocumentUtils.java similarity index 97% rename from shared/src/main/java/com/itsaky/androidide/utils/DocumentUtils.java rename to shared/src/main/java/org/appdevforall/codeonthego/utils/DocumentUtils.java index 04162b096f..7697018f7e 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/DocumentUtils.java +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/DocumentUtils.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; import java.io.IOException; import java.nio.file.Files; diff --git a/shared/src/main/java/com/itsaky/androidide/utils/Either.kt b/shared/src/main/java/org/appdevforall/codeonthego/utils/Either.kt similarity index 92% rename from shared/src/main/java/com/itsaky/androidide/utils/Either.kt rename to shared/src/main/java/org/appdevforall/codeonthego/utils/Either.kt index 84480b2795..55013d9077 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/Either.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/Either.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils data class Either( private val _left: L? = null, diff --git a/shared/src/main/java/com/itsaky/androidide/utils/FileProvider.kt b/shared/src/main/java/org/appdevforall/codeonthego/utils/FileProvider.kt similarity index 95% rename from shared/src/main/java/com/itsaky/androidide/utils/FileProvider.kt rename to shared/src/main/java/org/appdevforall/codeonthego/utils/FileProvider.kt index 838328c48d..9b0bb06f5d 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/FileProvider.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/FileProvider.kt @@ -1,112 +1,112 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.utils - -import java.io.File -import java.nio.file.Path -import java.nio.file.Paths -import kotlin.io.path.absolute -import kotlin.io.path.exists -import kotlin.io.path.readText - -const val PROJECT_ROOT_FILE = ".androidide_root" - -/** - * Provides paths to various directories and files. - * - * @author Akash Yadav - */ -class FileProvider { - - companion object { - - private val projectRoot by lazy { - currentDir().findProjectRoot()?.absolute()?.normalize() - } - - @JvmField - val extension = run { - val file = File(".").canonicalFile - when (file.name) { - "xml" -> "xml" // Testing in ':lsp:xml' module - else -> "java" // Testing in ':lsp:java' or ':lsp:testing' module - } - } - - @JvmStatic - fun currentDir(): Path = Paths.get(System.getProperty("user.dir")!!) - - @JvmStatic - fun implModule(): Path = projectRoot().resolve("subprojects/tooling-api-impl") - - @JvmStatic - fun projectRoot(): Path = - checkNotNull(projectRoot) { - "Unable to file project root. Check if '${PROJECT_ROOT_FILE}' file exists in the project root directory." - } - - @JvmStatic - private fun testingDir() = projectRoot().resolve("testing") - - @JvmStatic - private fun testResourcesDir(): Path = testingDir().resolve("resources") - - @JvmStatic - fun testHomeDir(): Path = testResourcesDir().resolve("test-home") - - @JvmStatic - fun testProjectRoot(): Path = testResourcesDir().resolve("test-project") - - @JvmStatic - fun sampleProjectRoot(): Path = testResourcesDir().resolve("sample-project") - - /** - * Get the path to the 'resources' directory. - * - * @return The the resources directory. - */ - @JvmStatic - fun resources(): Path { - return testProjectRoot().resolve("app/src/main/resources") - } - - /** - * Get the path to the file in resources. - * - * @param name The name of the file. Nested file paths can be separated using '/'. - * @return The path to the file. - */ - @JvmStatic - fun sourceFile(name: String): Path { - return resources().resolve("${name}_template.$extension").normalize() - } - - @JvmStatic - fun contents(file: Path): StringBuilder = StringBuilder(file.readText()) - } -} - -private fun Path.findProjectRoot(): Path? { - // Walk UP from `this` looking for the marker in each ancestor. The previous - // implementation walked the whole subtree at every level, which is both wildly - // expensive and racy against concurrent Gradle tasks that mutate `build/` - // (e.g. NoSuchFileException on transient kotlin-classes during parallel tasks). - if (resolve(PROJECT_ROOT_FILE).exists()) { - return this - } - return parent?.findProjectRoot() -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.utils + +import java.io.File +import java.nio.file.Path +import java.nio.file.Paths +import kotlin.io.path.absolute +import kotlin.io.path.exists +import kotlin.io.path.readText + +const val PROJECT_ROOT_FILE = ".androidide_root" + +/** + * Provides paths to various directories and files. + * + * @author Akash Yadav + */ +class FileProvider { + + companion object { + + private val projectRoot by lazy { + currentDir().findProjectRoot()?.absolute()?.normalize() + } + + @JvmField + val extension = run { + val file = File(".").canonicalFile + when (file.name) { + "xml" -> "xml" // Testing in ':lsp:xml' module + else -> "java" // Testing in ':lsp:java' or ':lsp:testing' module + } + } + + @JvmStatic + fun currentDir(): Path = Paths.get(System.getProperty("user.dir")!!) + + @JvmStatic + fun implModule(): Path = projectRoot().resolve("subprojects/tooling-api-impl") + + @JvmStatic + fun projectRoot(): Path = + checkNotNull(projectRoot) { + "Unable to file project root. Check if '${PROJECT_ROOT_FILE}' file exists in the project root directory." + } + + @JvmStatic + private fun testingDir() = projectRoot().resolve("testing") + + @JvmStatic + private fun testResourcesDir(): Path = testingDir().resolve("resources") + + @JvmStatic + fun testHomeDir(): Path = testResourcesDir().resolve("test-home") + + @JvmStatic + fun testProjectRoot(): Path = testResourcesDir().resolve("test-project") + + @JvmStatic + fun sampleProjectRoot(): Path = testResourcesDir().resolve("sample-project") + + /** + * Get the path to the 'resources' directory. + * + * @return The the resources directory. + */ + @JvmStatic + fun resources(): Path { + return testProjectRoot().resolve("app/src/main/resources") + } + + /** + * Get the path to the file in resources. + * + * @param name The name of the file. Nested file paths can be separated using '/'. + * @return The path to the file. + */ + @JvmStatic + fun sourceFile(name: String): Path { + return resources().resolve("${name}_template.$extension").normalize() + } + + @JvmStatic + fun contents(file: Path): StringBuilder = StringBuilder(file.readText()) + } +} + +private fun Path.findProjectRoot(): Path? { + // Walk UP from `this` looking for the marker in each ancestor. The previous + // implementation walked the whole subtree at every level, which is both wildly + // expensive and racy against concurrent Gradle tasks that mutate `build/` + // (e.g. NoSuchFileException on transient kotlin-classes during parallel tasks). + if (resolve(PROJECT_ROOT_FILE).exists()) { + return this + } + return parent?.findProjectRoot() +} diff --git a/shared/src/main/java/com/itsaky/androidide/utils/HashUtils.kt b/shared/src/main/java/org/appdevforall/codeonthego/utils/HashUtils.kt similarity index 95% rename from shared/src/main/java/com/itsaky/androidide/utils/HashUtils.kt rename to shared/src/main/java/org/appdevforall/codeonthego/utils/HashUtils.kt index 331f1fd442..9117c859fd 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/HashUtils.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/HashUtils.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import java.io.File import java.math.BigInteger diff --git a/shared/src/main/java/com/itsaky/androidide/utils/InputStreamLineReader.java b/shared/src/main/java/org/appdevforall/codeonthego/utils/InputStreamLineReader.java similarity index 97% rename from shared/src/main/java/com/itsaky/androidide/utils/InputStreamLineReader.java rename to shared/src/main/java/org/appdevforall/codeonthego/utils/InputStreamLineReader.java index e464fd4e7f..a15b26b8e4 100755 --- a/shared/src/main/java/com/itsaky/androidide/utils/InputStreamLineReader.java +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/InputStreamLineReader.java @@ -17,7 +17,7 @@ * along with AndroidIDE. If not, see . * **************************************************************************************/ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; import java.io.BufferedReader; import java.io.InputStream; diff --git a/shared/src/main/java/com/itsaky/androidide/utils/IntPair.java b/shared/src/main/java/org/appdevforall/codeonthego/utils/IntPair.java similarity index 97% rename from shared/src/main/java/com/itsaky/androidide/utils/IntPair.java rename to shared/src/main/java/org/appdevforall/codeonthego/utils/IntPair.java index 0a28ec37c9..9330e4f8f6 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/IntPair.java +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/IntPair.java @@ -22,7 +22,7 @@ * additional information or have any questions */ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; /** * Pack two int into a long Also unpack it This is convenient while passing data diff --git a/shared/src/main/java/com/itsaky/androidide/utils/ReaderInputStream.java b/shared/src/main/java/org/appdevforall/codeonthego/utils/ReaderInputStream.java similarity index 99% rename from shared/src/main/java/com/itsaky/androidide/utils/ReaderInputStream.java rename to shared/src/main/java/org/appdevforall/codeonthego/utils/ReaderInputStream.java index 81a1eee71a..701aaf0418 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/ReaderInputStream.java +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/ReaderInputStream.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; import java.io.IOException; import java.io.InputStream; diff --git a/shared/src/main/java/com/itsaky/androidide/utils/RecyclableObjectPool.kt b/shared/src/main/java/org/appdevforall/codeonthego/utils/RecyclableObjectPool.kt similarity index 99% rename from shared/src/main/java/com/itsaky/androidide/utils/RecyclableObjectPool.kt rename to shared/src/main/java/org/appdevforall/codeonthego/utils/RecyclableObjectPool.kt index 20c8d8aefc..99ad8568f2 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/RecyclableObjectPool.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/RecyclableObjectPool.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import org.slf4j.LoggerFactory import java.util.concurrent.ArrayBlockingQueue diff --git a/shared/src/main/java/com/itsaky/androidide/utils/ServiceLoader.java b/shared/src/main/java/org/appdevforall/codeonthego/utils/ServiceLoader.java similarity index 99% rename from shared/src/main/java/com/itsaky/androidide/utils/ServiceLoader.java rename to shared/src/main/java/org/appdevforall/codeonthego/utils/ServiceLoader.java index cd0a161aa4..1e59e5689b 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/ServiceLoader.java +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/ServiceLoader.java @@ -41,7 +41,7 @@ * questions. */ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; import androidx.annotation.NonNull; import java.io.BufferedReader; diff --git a/shared/src/main/java/com/itsaky/androidide/utils/ServiceNotFoundException.java b/shared/src/main/java/org/appdevforall/codeonthego/utils/ServiceNotFoundException.java similarity index 95% rename from shared/src/main/java/com/itsaky/androidide/utils/ServiceNotFoundException.java rename to shared/src/main/java/org/appdevforall/codeonthego/utils/ServiceNotFoundException.java index ada3f6a7b2..37321d95c4 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/ServiceNotFoundException.java +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/ServiceNotFoundException.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; /** * Exception thrown when a service cannot be loaded by {@link ServiceLoader}. diff --git a/shared/src/main/java/com/itsaky/androidide/utils/SharedEnvironment.kt b/shared/src/main/java/org/appdevforall/codeonthego/utils/SharedEnvironment.kt similarity index 97% rename from shared/src/main/java/com/itsaky/androidide/utils/SharedEnvironment.kt rename to shared/src/main/java/org/appdevforall/codeonthego/utils/SharedEnvironment.kt index 729376f1f1..a6871b6cb7 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/SharedEnvironment.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/SharedEnvironment.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils /** * Shared properties. diff --git a/shared/src/main/java/com/itsaky/androidide/utils/SourceClassTrie.kt b/shared/src/main/java/org/appdevforall/codeonthego/utils/SourceClassTrie.kt similarity index 97% rename from shared/src/main/java/com/itsaky/androidide/utils/SourceClassTrie.kt rename to shared/src/main/java/org/appdevforall/codeonthego/utils/SourceClassTrie.kt index e7569b197e..bf9c6e29e3 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/SourceClassTrie.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/SourceClassTrie.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import java.nio.file.Files import java.nio.file.Path @@ -33,7 +33,7 @@ open class SourceClassTrie(root: SourcePackageNode = SourcePackageNode()) : Clas companion object { @JvmStatic private val pkgNameMethod by lazy { - Class.forName("com.itsaky.androidide.projects.util.StringSearch") + Class.forName("org.appdevforall.codeonthego.projects.util.StringSearch") .getDeclaredMethod("packageName", Path::class.java) } diff --git a/shared/src/main/java/com/itsaky/androidide/utils/StackFrameLocator.kt b/shared/src/main/java/org/appdevforall/codeonthego/utils/StackFrameLocator.kt similarity index 96% rename from shared/src/main/java/com/itsaky/androidide/utils/StackFrameLocator.kt rename to shared/src/main/java/org/appdevforall/codeonthego/utils/StackFrameLocator.kt index dc59db1325..486ac62705 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/StackFrameLocator.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/StackFrameLocator.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import java.io.File diff --git a/shared/src/main/java/com/itsaky/androidide/utils/StopWatch.kt b/shared/src/main/java/org/appdevforall/codeonthego/utils/StopWatch.kt similarity index 94% rename from shared/src/main/java/com/itsaky/androidide/utils/StopWatch.kt rename to shared/src/main/java/org/appdevforall/codeonthego/utils/StopWatch.kt index a5f1a9557e..ae4bd18f87 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/StopWatch.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/StopWatch.kt @@ -1,80 +1,80 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.utils - -import org.slf4j.LoggerFactory -import java.io.PrintStream - -/** - * A stop watch helps to log duration between the time when the instance of the stopwatch instance - * was created and the time when [StopWatch.log] or [StopWatch.lap] method is called. - * - * @param label The label for the log message. - * @author Akash Yadav - */ -class StopWatch -@JvmOverloads -constructor( - val label: String, - val start: Long = System.currentTimeMillis(), - var lastLap: Long = start -) { - - companion object { - - private val log = LoggerFactory.getLogger(StopWatch::class.java) - } - - fun log() { - log.debug("{} completed in {}ms", label, System.currentTimeMillis() - start) - } - - fun lap(message: String) { - log.debug("{} in {}ms", message, System.currentTimeMillis() - start) - lastLap = System.currentTimeMillis() - } - - fun lapFromLast(message: String) { - log.debug("{} in {}ms", message, System.currentTimeMillis() - lastLap) - lastLap = System.currentTimeMillis() - } - - fun writeTo(stream: PrintStream) { - stream.println("$label completed in ${System.currentTimeMillis() - start}ms") - } -} - -/** - * Run the given action with a stopwatch to log the time the action took to execute. - * - * @see StopWatch - */ -inline fun withStopWatch( - label: String, - start: Long = System.currentTimeMillis(), - lastLap: Long = start, - action: (StopWatch) -> R -): R { - return StopWatch(label, start, lastLap).run { - try { - action(this) - } finally { - log() - } - } +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.utils + +import org.slf4j.LoggerFactory +import java.io.PrintStream + +/** + * A stop watch helps to log duration between the time when the instance of the stopwatch instance + * was created and the time when [StopWatch.log] or [StopWatch.lap] method is called. + * + * @param label The label for the log message. + * @author Akash Yadav + */ +class StopWatch +@JvmOverloads +constructor( + val label: String, + val start: Long = System.currentTimeMillis(), + var lastLap: Long = start +) { + + companion object { + + private val log = LoggerFactory.getLogger(StopWatch::class.java) + } + + fun log() { + log.debug("{} completed in {}ms", label, System.currentTimeMillis() - start) + } + + fun lap(message: String) { + log.debug("{} in {}ms", message, System.currentTimeMillis() - start) + lastLap = System.currentTimeMillis() + } + + fun lapFromLast(message: String) { + log.debug("{} in {}ms", message, System.currentTimeMillis() - lastLap) + lastLap = System.currentTimeMillis() + } + + fun writeTo(stream: PrintStream) { + stream.println("$label completed in ${System.currentTimeMillis() - start}ms") + } +} + +/** + * Run the given action with a stopwatch to log the time the action took to execute. + * + * @see StopWatch + */ +inline fun withStopWatch( + label: String, + start: Long = System.currentTimeMillis(), + lastLap: Long = start, + action: (StopWatch) -> R +): R { + return StopWatch(label, start, lastLap).run { + try { + action(this) + } finally { + log() + } + } } \ No newline at end of file diff --git a/shared/src/main/java/com/itsaky/androidide/utils/StringUtil.java b/shared/src/main/java/org/appdevforall/codeonthego/utils/StringUtil.java similarity index 95% rename from shared/src/main/java/com/itsaky/androidide/utils/StringUtil.java rename to shared/src/main/java/org/appdevforall/codeonthego/utils/StringUtil.java index eff93356e7..709af33877 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/StringUtil.java +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/StringUtil.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; diff --git a/shared/src/main/java/com/itsaky/androidide/utils/UniqueNameBuilder.java b/shared/src/main/java/org/appdevforall/codeonthego/utils/UniqueNameBuilder.java similarity index 99% rename from shared/src/main/java/com/itsaky/androidide/utils/UniqueNameBuilder.java rename to shared/src/main/java/org/appdevforall/codeonthego/utils/UniqueNameBuilder.java index 7199397ead..6cc63d9770 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/UniqueNameBuilder.java +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/UniqueNameBuilder.java @@ -1,5 +1,5 @@ // Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package com.itsaky.androidide.utils; +package org.appdevforall.codeonthego.utils; import java.util.HashMap; import java.util.Iterator; diff --git a/shared/src/main/java/com/itsaky/androidide/utils/VMUtils.kt b/shared/src/main/java/org/appdevforall/codeonthego/utils/VMUtils.kt similarity index 97% rename from shared/src/main/java/com/itsaky/androidide/utils/VMUtils.kt rename to shared/src/main/java/org/appdevforall/codeonthego/utils/VMUtils.kt index dbde87acda..ddc2d8dd2b 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/VMUtils.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/VMUtils.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils /** * Utilities related to VM. diff --git a/shared/src/main/java/com/itsaky/androidide/utils/miscUtils.kt b/shared/src/main/java/org/appdevforall/codeonthego/utils/miscUtils.kt similarity index 94% rename from shared/src/main/java/com/itsaky/androidide/utils/miscUtils.kt rename to shared/src/main/java/org/appdevforall/codeonthego/utils/miscUtils.kt index ab54698cc8..d458959a1f 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/miscUtils.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/miscUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils @Suppress("UNCHECKED_CAST") fun uncheckedCast(obj: Any): T { diff --git a/shared/src/main/java/com/itsaky/androidide/utils/recyclableObjectPoolExtensions.kt b/shared/src/main/java/org/appdevforall/codeonthego/utils/recyclableObjectPoolExtensions.kt similarity index 97% rename from shared/src/main/java/com/itsaky/androidide/utils/recyclableObjectPoolExtensions.kt rename to shared/src/main/java/org/appdevforall/codeonthego/utils/recyclableObjectPoolExtensions.kt index a964614b7f..f021d6c250 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/recyclableObjectPoolExtensions.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/recyclableObjectPoolExtensions.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils /** * Create a new [RecyclableObjectPool] with the given [capacity] and the object [factory]. diff --git a/shared/src/main/java/com/itsaky/androidide/utils/stringExt.kt b/shared/src/main/java/org/appdevforall/codeonthego/utils/stringExt.kt similarity index 95% rename from shared/src/main/java/com/itsaky/androidide/utils/stringExt.kt rename to shared/src/main/java/org/appdevforall/codeonthego/utils/stringExt.kt index d90da12359..b812747a9f 100644 --- a/shared/src/main/java/com/itsaky/androidide/utils/stringExt.kt +++ b/shared/src/main/java/org/appdevforall/codeonthego/utils/stringExt.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import java.util.Locale diff --git a/shared/src/test/java/com/itsaky/androidide/progress/ICancelCheckerTest.kt b/shared/src/test/java/org/appdevforall/codeonthego/progress/ICancelCheckerTest.kt similarity index 98% rename from shared/src/test/java/com/itsaky/androidide/progress/ICancelCheckerTest.kt rename to shared/src/test/java/org/appdevforall/codeonthego/progress/ICancelCheckerTest.kt index ee761e63d8..184a85b478 100644 --- a/shared/src/test/java/com/itsaky/androidide/progress/ICancelCheckerTest.kt +++ b/shared/src/test/java/org/appdevforall/codeonthego/progress/ICancelCheckerTest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.progress +package org.appdevforall.codeonthego.progress import com.google.common.truth.Truth.assertThat import org.junit.Test diff --git a/shared/src/test/java/com/itsaky/androidide/progress/ProgressManagerTest.kt b/shared/src/test/java/org/appdevforall/codeonthego/progress/ProgressManagerTest.kt similarity index 97% rename from shared/src/test/java/com/itsaky/androidide/progress/ProgressManagerTest.kt rename to shared/src/test/java/org/appdevforall/codeonthego/progress/ProgressManagerTest.kt index 941ed02564..244f0bc82a 100644 --- a/shared/src/test/java/com/itsaky/androidide/progress/ProgressManagerTest.kt +++ b/shared/src/test/java/org/appdevforall/codeonthego/progress/ProgressManagerTest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.progress +package org.appdevforall.codeonthego.progress import com.google.common.truth.Truth.assertThat import org.junit.Test diff --git a/shared/src/test/java/com/itsaky/androidide/utils/FileProviderTest.kt b/shared/src/test/java/org/appdevforall/codeonthego/utils/FileProviderTest.kt similarity index 97% rename from shared/src/test/java/com/itsaky/androidide/utils/FileProviderTest.kt rename to shared/src/test/java/org/appdevforall/codeonthego/utils/FileProviderTest.kt index 650ced6d80..39f3757879 100644 --- a/shared/src/test/java/com/itsaky/androidide/utils/FileProviderTest.kt +++ b/shared/src/test/java/org/appdevforall/codeonthego/utils/FileProviderTest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import com.google.common.truth.Truth.assertThat import org.junit.Test diff --git a/shared/src/test/java/com/itsaky/androidide/utils/StackFrameLocatorTest.kt b/shared/src/test/java/org/appdevforall/codeonthego/utils/StackFrameLocatorTest.kt similarity index 98% rename from shared/src/test/java/com/itsaky/androidide/utils/StackFrameLocatorTest.kt rename to shared/src/test/java/org/appdevforall/codeonthego/utils/StackFrameLocatorTest.kt index 2961c81682..199c28423a 100644 --- a/shared/src/test/java/com/itsaky/androidide/utils/StackFrameLocatorTest.kt +++ b/shared/src/test/java/org/appdevforall/codeonthego/utils/StackFrameLocatorTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.utils +package org.appdevforall.codeonthego.utils import com.google.common.truth.Truth.assertThat import org.junit.Test diff --git a/subprojects/aaptcompiler/src/main/java/com/itsaky/androidide/aapt/Resources.kt b/subprojects/aaptcompiler/src/main/java/org/appdevforall/codeonthego/aapt/Resources.kt similarity index 93% rename from subprojects/aaptcompiler/src/main/java/com/itsaky/androidide/aapt/Resources.kt rename to subprojects/aaptcompiler/src/main/java/org/appdevforall/codeonthego/aapt/Resources.kt index e7d599967c..854f0cc697 100644 --- a/subprojects/aaptcompiler/src/main/java/com/itsaky/androidide/aapt/Resources.kt +++ b/subprojects/aaptcompiler/src/main/java/org/appdevforall/codeonthego/aapt/Resources.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.aapt +package org.appdevforall.codeonthego.aapt import com.android.aaptcompiler.ResourceEntry import com.android.aaptcompiler.ResourceGroup diff --git a/subprojects/aaptcompiler/src/main/java/com/itsaky/androidide/aapt/logging/IDELogger.kt b/subprojects/aaptcompiler/src/main/java/org/appdevforall/codeonthego/aapt/logging/IDELogger.kt similarity index 97% rename from subprojects/aaptcompiler/src/main/java/com/itsaky/androidide/aapt/logging/IDELogger.kt rename to subprojects/aaptcompiler/src/main/java/org/appdevforall/codeonthego/aapt/logging/IDELogger.kt index 12e57a87ad..894c3b2ae7 100644 --- a/subprojects/aaptcompiler/src/main/java/com/itsaky/androidide/aapt/logging/IDELogger.kt +++ b/subprojects/aaptcompiler/src/main/java/org/appdevforall/codeonthego/aapt/logging/IDELogger.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.aapt.logging +package org.appdevforall.codeonthego.aapt.logging import com.android.utils.StdLogger import com.android.utils.StdLogger.Level.VERBOSE diff --git a/subprojects/aaptcompiler/src/test/java/com/itsaky/androidide/aaptcompiler/CompilerTest.kt b/subprojects/aaptcompiler/src/test/java/org/appdevforall/codeonthego/aaptcompiler/CompilerTest.kt similarity index 95% rename from subprojects/aaptcompiler/src/test/java/com/itsaky/androidide/aaptcompiler/CompilerTest.kt rename to subprojects/aaptcompiler/src/test/java/org/appdevforall/codeonthego/aaptcompiler/CompilerTest.kt index b6346a1f5f..2b67563f7a 100644 --- a/subprojects/aaptcompiler/src/test/java/com/itsaky/androidide/aaptcompiler/CompilerTest.kt +++ b/subprojects/aaptcompiler/src/test/java/org/appdevforall/codeonthego/aaptcompiler/CompilerTest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.aaptcompiler +package org.appdevforall.codeonthego.aaptcompiler import com.android.aaptcompiler.BlameLogger import com.android.aaptcompiler.ResourceCompilerOptions @@ -26,7 +26,7 @@ import com.android.aaptcompiler.compileResource import com.android.aaptcompiler.extractPathData import com.android.utils.StdLogger import com.android.utils.StdLogger.Level.VERBOSE -import com.itsaky.androidide.utils.FileProvider +import org.appdevforall.codeonthego.utils.FileProvider import java.nio.file.Paths import kotlin.io.path.absolute import org.junit.Test diff --git a/subprojects/aaptcompiler/src/test/resources/layout/activity_editor.xml b/subprojects/aaptcompiler/src/test/resources/layout/activity_editor.xml index d2831ce2c1..01ec389448 100755 --- a/subprojects/aaptcompiler/src/test/resources/layout/activity_editor.xml +++ b/subprojects/aaptcompiler/src/test/resources/layout/activity_editor.xml @@ -1,5 +1,5 @@ - - - - + diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultAndroidArtifact.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultAndroidArtifact.kt similarity index 97% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultAndroidArtifact.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultAndroidArtifact.kt index 69d67fe8a8..b337460e2b 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultAndroidArtifact.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultAndroidArtifact.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.builder.model +package org.appdevforall.codeonthego.builder.model import com.android.builder.model.v2.ide.AndroidArtifact import com.android.builder.model.v2.ide.BytecodeTransformation diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultAndroidGradlePluginProjectFlags.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultAndroidGradlePluginProjectFlags.kt similarity index 94% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultAndroidGradlePluginProjectFlags.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultAndroidGradlePluginProjectFlags.kt index 75c66d1dac..3cf3bddb46 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultAndroidGradlePluginProjectFlags.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultAndroidGradlePluginProjectFlags.kt @@ -1,35 +1,35 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.builder.model - -import com.android.builder.model.v2.ide.AndroidGradlePluginProjectFlags -import com.android.builder.model.v2.ide.AndroidGradlePluginProjectFlags.BooleanFlag -import java.io.Serializable - -/** @author Akash Yadav */ -class DefaultAndroidGradlePluginProjectFlags(val booleanFlagMap: Map) : - AndroidGradlePluginProjectFlags, Serializable { - private val serialVersionUID = 1L - - companion object { - private val flagByName = BooleanFlag.values().associateBy { it.name } - } - - override fun getFlagValue(flagName: String): Boolean? { - return flagByName[flagName]?.let { booleanFlagMap[it] } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.builder.model + +import com.android.builder.model.v2.ide.AndroidGradlePluginProjectFlags +import com.android.builder.model.v2.ide.AndroidGradlePluginProjectFlags.BooleanFlag +import java.io.Serializable + +/** @author Akash Yadav */ +class DefaultAndroidGradlePluginProjectFlags(val booleanFlagMap: Map) : + AndroidGradlePluginProjectFlags, Serializable { + private val serialVersionUID = 1L + + companion object { + private val flagByName = BooleanFlag.values().associateBy { it.name } + } + + override fun getFlagValue(flagName: String): Boolean? { + return flagByName[flagName]?.let { booleanFlagMap[it] } + } +} diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultAndroidLibraryData.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultAndroidLibraryData.kt similarity index 94% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultAndroidLibraryData.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultAndroidLibraryData.kt index c2e6f29610..37844f8d12 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultAndroidLibraryData.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultAndroidLibraryData.kt @@ -1,41 +1,41 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.builder.model - -import com.android.builder.model.v2.ide.AndroidLibraryData -import java.io.File -import java.io.Serializable - -/** @author Akash Yadav */ -data class DefaultAndroidLibraryData( - override val aidlFolder: File, - override val assetsFolder: File, - override val compileJarFiles: List, - override val externalAnnotations: File, - override val jniFolder: File, - override val manifest: File, - override val proguardRules: File, - override val publicResources: File, - override val renderscriptFolder: File, - override val resFolder: File, - override val resStaticLibrary: File, - override val runtimeJarFiles: List, - override val symbolFile: File -) : AndroidLibraryData, Serializable { - private val serialVersionUID = 1L -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.builder.model + +import com.android.builder.model.v2.ide.AndroidLibraryData +import java.io.File +import java.io.Serializable + +/** @author Akash Yadav */ +data class DefaultAndroidLibraryData( + override val aidlFolder: File, + override val assetsFolder: File, + override val compileJarFiles: List, + override val externalAnnotations: File, + override val jniFolder: File, + override val manifest: File, + override val proguardRules: File, + override val publicResources: File, + override val renderscriptFolder: File, + override val resFolder: File, + override val resStaticLibrary: File, + override val runtimeJarFiles: List, + override val symbolFile: File +) : AndroidLibraryData, Serializable { + private val serialVersionUID = 1L +} diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultApiVersion.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultApiVersion.kt similarity index 93% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultApiVersion.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultApiVersion.kt index 12593f63fd..2ffefbac26 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultApiVersion.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultApiVersion.kt @@ -1,29 +1,29 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.builder.model - -import com.android.builder.model.v2.ide.ApiVersion -import java.io.Serializable - -/** @author Akash Yadav */ -class DefaultApiVersion : ApiVersion, Serializable { - private val serialVersionUID = 1L - - override var apiLevel: Int = -1 - override var codename: String? = null -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.builder.model + +import com.android.builder.model.v2.ide.ApiVersion +import java.io.Serializable + +/** @author Akash Yadav */ +class DefaultApiVersion : ApiVersion, Serializable { + private val serialVersionUID = 1L + + override var apiLevel: Int = -1 + override var codename: String? = null +} diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultArtifactDependencies.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultArtifactDependencies.kt similarity index 94% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultArtifactDependencies.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultArtifactDependencies.kt index 1d56e7b4ca..941a43abc2 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultArtifactDependencies.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultArtifactDependencies.kt @@ -1,28 +1,28 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.builder.model - -import com.android.builder.model.v2.ide.ArtifactDependencies -import java.io.Serializable - -/** @author Akash Yadav */ -class DefaultArtifactDependencies : ArtifactDependencies, Serializable { - private val serialVersionUID = 1L - override var compileDependencies: List = emptyList() - override var runtimeDependencies: List = emptyList() - override var unresolvedDependencies: List = emptyList() -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.builder.model + +import com.android.builder.model.v2.ide.ArtifactDependencies +import java.io.Serializable + +/** @author Akash Yadav */ +class DefaultArtifactDependencies : ArtifactDependencies, Serializable { + private val serialVersionUID = 1L + override var compileDependencies: List = emptyList() + override var runtimeDependencies: List = emptyList() + override var unresolvedDependencies: List = emptyList() +} diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultBundleInfo.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultBundleInfo.kt similarity index 93% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultBundleInfo.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultBundleInfo.kt index f1b7e5b52b..1b31f35881 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultBundleInfo.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultBundleInfo.kt @@ -1,31 +1,31 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.builder.model - -import com.android.builder.model.v2.ide.BundleInfo -import java.io.File -import java.io.Serializable - -/** @author Akash Yadav */ -class DefaultBundleInfo : BundleInfo, Serializable { - private val serialVersionUID = 1L - override var apkFromBundleTaskName: String = "" - override var apkFromBundleTaskOutputListingFile: File = File(".") - override var bundleTaskName: String = "" - override var bundleTaskOutputListingFile: File = File(".") -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.builder.model + +import com.android.builder.model.v2.ide.BundleInfo +import java.io.File +import java.io.Serializable + +/** @author Akash Yadav */ +class DefaultBundleInfo : BundleInfo, Serializable { + private val serialVersionUID = 1L + override var apkFromBundleTaskName: String = "" + override var apkFromBundleTaskOutputListingFile: File = File(".") + override var bundleTaskName: String = "" + override var bundleTaskOutputListingFile: File = File(".") +} diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultCustomSourceDirectory.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultCustomSourceDirectory.kt similarity index 93% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultCustomSourceDirectory.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultCustomSourceDirectory.kt index 2ca3edd073..8820b9a5a2 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultCustomSourceDirectory.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultCustomSourceDirectory.kt @@ -1,30 +1,30 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.builder.model - -import com.android.builder.model.v2.CustomSourceDirectory -import java.io.File -import java.io.Serializable - -/** @author Akash Yadav */ -data class DefaultCustomSourceDirectory( - override val directory: File, - override val sourceTypeName: String -) : CustomSourceDirectory, Serializable { - private val serialVersionUID = 1L -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.builder.model + +import com.android.builder.model.v2.CustomSourceDirectory +import java.io.File +import java.io.Serializable + +/** @author Akash Yadav */ +data class DefaultCustomSourceDirectory( + override val directory: File, + override val sourceTypeName: String +) : CustomSourceDirectory, Serializable { + private val serialVersionUID = 1L +} diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultGraphItem.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultGraphItem.kt similarity index 93% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultGraphItem.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultGraphItem.kt index 117d0a4500..8f2552acf4 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultGraphItem.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultGraphItem.kt @@ -1,28 +1,28 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.builder.model - -import com.android.builder.model.v2.ide.GraphItem -import java.io.Serializable - -/** @author Akash Yadav */ -class DefaultGraphItem : GraphItem, Serializable { - private val serialVersionUID = 1L - override var dependencies: List = mutableListOf() - override var key: String = "" - override var requestedCoordinates: String? = "" -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.builder.model + +import com.android.builder.model.v2.ide.GraphItem +import java.io.Serializable + +/** @author Akash Yadav */ +class DefaultGraphItem : GraphItem, Serializable { + private val serialVersionUID = 1L + override var dependencies: List = mutableListOf() + override var key: String = "" + override var requestedCoordinates: String? = "" +} diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultJavaArtifact.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultJavaArtifact.kt similarity index 95% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultJavaArtifact.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultJavaArtifact.kt index 58f5895170..2396fe9435 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultJavaArtifact.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultJavaArtifact.kt @@ -1,39 +1,39 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.builder.model - -import com.android.builder.model.v2.ide.BytecodeTransformation -import com.android.builder.model.v2.ide.JavaArtifact -import java.io.File -import java.io.Serializable - -/** @author Akash Yadav */ -class DefaultJavaArtifact : JavaArtifact, Serializable { - - private val serialVersionUID = 1L - override var modelSyncFiles: Collection = emptyList() - - override var assembleTaskName: String = "" - override var classesFolders: Set = emptySet() - override var compileTaskName: String = "" - override var generatedSourceFolders: Collection = emptyList() - override var ideSetupTaskNames: Set = emptySet() - override var mockablePlatformJar: File? = null - override var runtimeResourceFolder: File? = null - override val generatedClassPaths: Map = emptyMap() - override val bytecodeTransformations: Collection = emptyList() -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.builder.model + +import com.android.builder.model.v2.ide.BytecodeTransformation +import com.android.builder.model.v2.ide.JavaArtifact +import java.io.File +import java.io.Serializable + +/** @author Akash Yadav */ +class DefaultJavaArtifact : JavaArtifact, Serializable { + + private val serialVersionUID = 1L + override var modelSyncFiles: Collection = emptyList() + + override var assembleTaskName: String = "" + override var classesFolders: Set = emptySet() + override var compileTaskName: String = "" + override var generatedSourceFolders: Collection = emptyList() + override var ideSetupTaskNames: Set = emptySet() + override var mockablePlatformJar: File? = null + override var runtimeResourceFolder: File? = null + override val generatedClassPaths: Map = emptyMap() + override val bytecodeTransformations: Collection = emptyList() +} diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultJavaCompileOptions.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultJavaCompileOptions.kt similarity index 94% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultJavaCompileOptions.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultJavaCompileOptions.kt index 6d90bc074e..5722586638 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultJavaCompileOptions.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultJavaCompileOptions.kt @@ -1,42 +1,42 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.builder.model - -import com.android.builder.model.v2.ide.JavaCompileOptions -import java.io.Serializable - -/** @author Akash Yadav */ -class DefaultJavaCompileOptions : IJavaCompilerSettings(), JavaCompileOptions, Serializable { - override var encoding: String = "" - override var isCoreLibraryDesugaringEnabled: Boolean = false - - override var sourceCompatibility: String = "" - set(value) { - field = value - javaSourceVersion = value - } - - override var targetCompatibility: String = "" - set(value) { - field = value - javaBytecodeVersion = value - } - - override var javaSourceVersion: String = sourceCompatibility - override var javaBytecodeVersion: String = targetCompatibility -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.builder.model + +import com.android.builder.model.v2.ide.JavaCompileOptions +import java.io.Serializable + +/** @author Akash Yadav */ +class DefaultJavaCompileOptions : IJavaCompilerSettings(), JavaCompileOptions, Serializable { + override var encoding: String = "" + override var isCoreLibraryDesugaringEnabled: Boolean = false + + override var sourceCompatibility: String = "" + set(value) { + field = value + javaSourceVersion = value + } + + override var targetCompatibility: String = "" + set(value) { + field = value + javaBytecodeVersion = value + } + + override var javaSourceVersion: String = sourceCompatibility + override var javaBytecodeVersion: String = targetCompatibility +} diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultLibrary.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultLibrary.kt similarity index 97% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultLibrary.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultLibrary.kt index c131ca1725..43cdf6c572 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultLibrary.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultLibrary.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.builder.model +package org.appdevforall.codeonthego.builder.model import com.android.builder.model.v2.ide.Library import com.android.builder.model.v2.ide.LibraryType diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultLibraryInfo.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultLibraryInfo.kt similarity index 93% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultLibraryInfo.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultLibraryInfo.kt index 99030ee9d7..a1c4298f15 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultLibraryInfo.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultLibraryInfo.kt @@ -1,35 +1,35 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.builder.model - -import com.android.builder.model.v2.ide.LibraryInfo -import java.io.Serializable - -/** @author Akash Yadav */ -data class DefaultLibraryInfo( - override val attributes: Map, - override val buildType: String?, - override val capabilities: List, - override val isTestFixtures: Boolean, - override val productFlavors: Map, - override val group: String, - override val name: String, - override val version: String -) : LibraryInfo, Serializable { - private val serialVersionUID = 1L -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.builder.model + +import com.android.builder.model.v2.ide.LibraryInfo +import java.io.Serializable + +/** @author Akash Yadav */ +data class DefaultLibraryInfo( + override val attributes: Map, + override val buildType: String?, + override val capabilities: List, + override val isTestFixtures: Boolean, + override val productFlavors: Map, + override val group: String, + override val name: String, + override val version: String +) : LibraryInfo, Serializable { + private val serialVersionUID = 1L +} diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultProjectInfo.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultProjectInfo.kt similarity index 93% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultProjectInfo.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultProjectInfo.kt index 0d67c2d2a6..7a5e3d6840 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultProjectInfo.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultProjectInfo.kt @@ -1,34 +1,34 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.builder.model - -import com.android.builder.model.v2.ide.ProjectInfo -import java.io.Serializable - -/** @author Akash Yadav */ -data class DefaultProjectInfo( - override val attributes: Map, - override val buildType: String?, - override val capabilities: List, - override val isTestFixtures: Boolean, - override val productFlavors: Map, - override val buildId: String, - override val projectPath: String -) : ProjectInfo, Serializable { - private val serialVersionUID = 1L -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.builder.model + +import com.android.builder.model.v2.ide.ProjectInfo +import java.io.Serializable + +/** @author Akash Yadav */ +data class DefaultProjectInfo( + override val attributes: Map, + override val buildType: String?, + override val capabilities: List, + override val isTestFixtures: Boolean, + override val productFlavors: Map, + override val buildId: String, + override val projectPath: String +) : ProjectInfo, Serializable { + private val serialVersionUID = 1L +} diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultProjectSyncIssues.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultProjectSyncIssues.kt similarity index 93% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultProjectSyncIssues.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultProjectSyncIssues.kt index 8ba431ac72..3c8e867640 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultProjectSyncIssues.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultProjectSyncIssues.kt @@ -1,26 +1,26 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.builder.model - -import com.android.builder.model.v2.models.ProjectSyncIssues -import java.io.Serializable - -/** @author Akash Yadav */ -data class DefaultProjectSyncIssues(override val syncIssues: Collection) : - ProjectSyncIssues, Serializable { - private val serialVersionUID = 1L -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.builder.model + +import com.android.builder.model.v2.models.ProjectSyncIssues +import java.io.Serializable + +/** @author Akash Yadav */ +data class DefaultProjectSyncIssues(override val syncIssues: Collection) : + ProjectSyncIssues, Serializable { + private val serialVersionUID = 1L +} diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultSourceProvider.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultSourceProvider.kt similarity index 97% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultSourceProvider.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultSourceProvider.kt index 8499d6ad02..c601f6bd7c 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultSourceProvider.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultSourceProvider.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.builder.model +package org.appdevforall.codeonthego.builder.model import com.android.builder.model.v2.ide.SourceProvider import java.io.File diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultSourceSetContainer.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultSourceSetContainer.kt similarity index 95% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultSourceSetContainer.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultSourceSetContainer.kt index 59c2291367..eeaf0b4db0 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultSourceSetContainer.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultSourceSetContainer.kt @@ -1,35 +1,35 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.builder.model - -import com.android.builder.model.v2.ide.SourceProvider -import com.android.builder.model.v2.ide.SourceSetContainer -import java.io.Serializable - -/** @author Akash Yadav */ -class DefaultSourceSetContainer : SourceSetContainer, Serializable { - - private val serialVersionUID = 1L - @Deprecated("Contained in deviceTestSourceProviders") - override var androidTestSourceProvider: DefaultSourceProvider? = null - override var sourceProvider: DefaultSourceProvider = DefaultSourceProvider() - override var testFixturesSourceProvider: DefaultSourceProvider? = null - @Deprecated("Contained in hostTestSourceProviders") - override var unitTestSourceProvider: DefaultSourceProvider? = null - override val deviceTestSourceProviders: Map = emptyMap() - override val hostTestSourceProviders: Map = emptyMap() -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.builder.model + +import com.android.builder.model.v2.ide.SourceProvider +import com.android.builder.model.v2.ide.SourceSetContainer +import java.io.Serializable + +/** @author Akash Yadav */ +class DefaultSourceSetContainer : SourceSetContainer, Serializable { + + private val serialVersionUID = 1L + @Deprecated("Contained in deviceTestSourceProviders") + override var androidTestSourceProvider: DefaultSourceProvider? = null + override var sourceProvider: DefaultSourceProvider = DefaultSourceProvider() + override var testFixturesSourceProvider: DefaultSourceProvider? = null + @Deprecated("Contained in hostTestSourceProviders") + override var unitTestSourceProvider: DefaultSourceProvider? = null + override val deviceTestSourceProviders: Map = emptyMap() + override val hostTestSourceProviders: Map = emptyMap() +} diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultSyncIssue.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultSyncIssue.kt similarity index 93% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultSyncIssue.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultSyncIssue.kt index 5e9f314f69..610ce5e660 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultSyncIssue.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultSyncIssue.kt @@ -1,32 +1,32 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.builder.model - -import java.io.Serializable - -/** @author Akash Yadav */ -data class DefaultSyncIssue( - override val data: String?, - override val message: String, - override val multiLineMessage: List?, - override val severity: Int, - override val type: Int -) : IDESyncIssue, Serializable { - - private val serialVersionUID = 1L -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.builder.model + +import java.io.Serializable + +/** @author Akash Yadav */ +data class DefaultSyncIssue( + override val data: String?, + override val message: String, + override val multiLineMessage: List?, + override val severity: Int, + override val type: Int +) : IDESyncIssue, Serializable { + + private val serialVersionUID = 1L +} diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultTestInfo.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultTestInfo.kt similarity index 93% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultTestInfo.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultTestInfo.kt index 7eb416a8b4..b765856604 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultTestInfo.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultTestInfo.kt @@ -1,32 +1,32 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.builder.model - -import com.android.builder.model.v2.ide.TestInfo -import com.android.builder.model.v2.ide.TestInfo.Execution -import java.io.File -import java.io.Serializable - -/** @author Akash Yadav */ -class DefaultTestInfo : TestInfo, Serializable { - private val serialVersionUID = 1L - override var additionalRuntimeApks: Collection = emptyList() - override var animationsDisabled: Boolean = false - override var execution: Execution? = null - override var instrumentedTestTaskName: String = "" -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.builder.model + +import com.android.builder.model.v2.ide.TestInfo +import com.android.builder.model.v2.ide.TestInfo.Execution +import java.io.File +import java.io.Serializable + +/** @author Akash Yadav */ +class DefaultTestInfo : TestInfo, Serializable { + private val serialVersionUID = 1L + override var additionalRuntimeApks: Collection = emptyList() + override var animationsDisabled: Boolean = false + override var execution: Execution? = null + override var instrumentedTestTaskName: String = "" +} diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultTestedTargetVariant.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultTestedTargetVariant.kt similarity index 93% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultTestedTargetVariant.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultTestedTargetVariant.kt index 74201c4e63..818b625fb4 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultTestedTargetVariant.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultTestedTargetVariant.kt @@ -1,28 +1,28 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.builder.model - -import com.android.builder.model.v2.ide.TestedTargetVariant -import java.io.Serializable - -/** @author Akash Yadav */ -class DefaultTestedTargetVariant : TestedTargetVariant, Serializable { - private val serialVersionUID = 1L - override var targetProjectPath: String = "" - override var targetVariant: String = "" -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.builder.model + +import com.android.builder.model.v2.ide.TestedTargetVariant +import java.io.Serializable + +/** @author Akash Yadav */ +class DefaultTestedTargetVariant : TestedTargetVariant, Serializable { + private val serialVersionUID = 1L + override var targetProjectPath: String = "" + override var targetVariant: String = "" +} diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultUnresolvedDependency.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultUnresolvedDependency.kt similarity index 93% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultUnresolvedDependency.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultUnresolvedDependency.kt index 31321c7681..d67e4fe8e7 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultUnresolvedDependency.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultUnresolvedDependency.kt @@ -1,27 +1,27 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.builder.model - -import com.android.builder.model.v2.ide.UnresolvedDependency -import java.io.Serializable - -/** @author Akash Yadav */ -data class DefaultUnresolvedDependency(override val cause: String?, override val name: String) : - UnresolvedDependency, Serializable { - private val serialVersionUID = 1L -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.builder.model + +import com.android.builder.model.v2.ide.UnresolvedDependency +import java.io.Serializable + +/** @author Akash Yadav */ +data class DefaultUnresolvedDependency(override val cause: String?, override val name: String) : + UnresolvedDependency, Serializable { + private val serialVersionUID = 1L +} diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultVariant.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultVariant.kt similarity index 97% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultVariant.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultVariant.kt index f2266f5627..78d4fd6d07 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultVariant.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultVariant.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.builder.model +package org.appdevforall.codeonthego.builder.model import com.android.builder.model.v2.ide.AndroidArtifact import com.android.builder.model.v2.ide.JavaArtifact diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultVariantDependencies.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultVariantDependencies.kt similarity index 97% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultVariantDependencies.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultVariantDependencies.kt index 1845f9e13c..1b85281f44 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultVariantDependencies.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultVariantDependencies.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.builder.model +package org.appdevforall.codeonthego.builder.model import com.android.builder.model.v2.ide.ArtifactDependencies import com.android.builder.model.v2.models.TestSuiteDependencies diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultViewBindingOptions.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultViewBindingOptions.kt similarity index 93% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultViewBindingOptions.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultViewBindingOptions.kt index d29cf4a3cd..ea5610bb84 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/DefaultViewBindingOptions.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/DefaultViewBindingOptions.kt @@ -1,27 +1,27 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.builder.model - -import com.android.builder.model.v2.ide.ViewBindingOptions -import java.io.Serializable - -/** @author Akash Yadav */ -class DefaultViewBindingOptions : ViewBindingOptions, Serializable { - private val serialVersionUID = 1L - override var isEnabled: Boolean = false -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.builder.model + +import com.android.builder.model.v2.ide.ViewBindingOptions +import java.io.Serializable + +/** @author Akash Yadav */ +class DefaultViewBindingOptions : ViewBindingOptions, Serializable { + private val serialVersionUID = 1L + override var isEnabled: Boolean = false +} diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/IDESyncIssue.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/IDESyncIssue.kt similarity index 97% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/IDESyncIssue.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/IDESyncIssue.kt index c7b0e2136a..d55f1cd16f 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/IDESyncIssue.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/IDESyncIssue.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.builder.model +package org.appdevforall.codeonthego.builder.model import com.android.build.gradle.options.StringOption import com.android.build.gradle.options.StringOption.AAPT2_FROM_MAVEN_OVERRIDE diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/IJavaCompilerSettings.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/IJavaCompilerSettings.kt similarity index 95% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/IJavaCompilerSettings.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/IJavaCompilerSettings.kt index 1eb97e643a..f2fc8b1bc6 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/IJavaCompilerSettings.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/IJavaCompilerSettings.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.builder.model +package org.appdevforall.codeonthego.builder.model /** * Java compilation settings for both, Android and Java modules. diff --git a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/modelConstants.kt b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/modelConstants.kt similarity index 85% rename from subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/modelConstants.kt rename to subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/modelConstants.kt index 1f4761a802..7b97a18808 100644 --- a/subprojects/builder-model-impl/src/main/java/com/itsaky/androidide/builder/model/modelConstants.kt +++ b/subprojects/builder-model-impl/src/main/java/org/appdevforall/codeonthego/builder/model/modelConstants.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.builder.model +package org.appdevforall.codeonthego.builder.model /** @author Akash Yadav */ -const val UNKNOWN_PACKAGE = "com.itsaky.androidide.unknown_package" +const val UNKNOWN_PACKAGE = "org.appdevforall.codeonthego.unknown_package" diff --git a/subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/Flashbar.kt b/subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/Flashbar.kt similarity index 97% rename from subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/Flashbar.kt rename to subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/Flashbar.kt index 7c8ca2c7ea..665bdc61b1 100644 --- a/subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/Flashbar.kt +++ b/subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/Flashbar.kt @@ -15,7 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.flashbar +package org.appdevforall.codeonthego.flashbar + +import com.itsaky.androidide.flashbar.R import android.app.Activity import android.graphics.Bitmap @@ -34,13 +36,13 @@ import androidx.core.content.ContextCompat import androidx.core.view.ViewCompat import androidx.core.view.WindowInsetsCompat import androidx.core.view.updatePadding -import com.itsaky.androidide.flashbar.Flashbar.Gravity.BOTTOM -import com.itsaky.androidide.flashbar.Flashbar.Gravity.TOP -import com.itsaky.androidide.flashbar.Flashbar.ProgressPosition.LEFT -import com.itsaky.androidide.flashbar.Flashbar.ProgressPosition.RIGHT -import com.itsaky.androidide.flashbar.anim.FlashAnim -import com.itsaky.androidide.flashbar.anim.FlashAnimBarBuilder -import com.itsaky.androidide.flashbar.anim.FlashAnimIconBuilder +import org.appdevforall.codeonthego.flashbar.Flashbar.Gravity.BOTTOM +import org.appdevforall.codeonthego.flashbar.Flashbar.Gravity.TOP +import org.appdevforall.codeonthego.flashbar.Flashbar.ProgressPosition.LEFT +import org.appdevforall.codeonthego.flashbar.Flashbar.ProgressPosition.RIGHT +import org.appdevforall.codeonthego.flashbar.anim.FlashAnim +import org.appdevforall.codeonthego.flashbar.anim.FlashAnimBarBuilder +import org.appdevforall.codeonthego.flashbar.anim.FlashAnimIconBuilder private const val DEFAULT_SHADOW_STRENGTH = 4 private const val DEFAUT_ICON_SCALE = 1.0f diff --git a/subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/FlashbarContainerView.kt b/subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/FlashbarContainerView.kt similarity index 89% rename from subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/FlashbarContainerView.kt rename to subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/FlashbarContainerView.kt index 670da8328b..1ebfd0b510 100644 --- a/subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/FlashbarContainerView.kt +++ b/subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/FlashbarContainerView.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.flashbar +package org.appdevforall.codeonthego.flashbar import android.app.Activity import android.content.ComponentCallbacks @@ -31,24 +31,24 @@ import android.view.ViewGroup.LayoutParams.MATCH_PARENT import android.widget.FrameLayout import android.widget.RelativeLayout import androidx.core.view.ViewCompat -import com.itsaky.androidide.flashbar.Flashbar.Companion.DURATION_INDEFINITE -import com.itsaky.androidide.flashbar.Flashbar.DismissEvent -import com.itsaky.androidide.flashbar.Flashbar.DismissEvent.* -import com.itsaky.androidide.flashbar.Flashbar.Vibration.DISMISS -import com.itsaky.androidide.flashbar.SwipeDismissTouchListener.DismissCallbacks -import com.itsaky.androidide.flashbar.anim.FlashAnim -import com.itsaky.androidide.flashbar.Flashbar.OnBarDismissListener -import com.itsaky.androidide.flashbar.Flashbar.OnBarShowListener -import com.itsaky.androidide.flashbar.Flashbar.OnTapListener -import com.itsaky.androidide.flashbar.Flashbar.Vibration -import com.itsaky.androidide.flashbar.Flashbar.Vibration.SHOW -import com.itsaky.androidide.flashbar.anim.FlashAnimBarBuilder -import com.itsaky.androidide.flashbar.anim.FlashAnimIconBuilder -import com.itsaky.androidide.flashbar.util.NavigationBarPosition.* -import com.itsaky.androidide.flashbar.util.afterMeasured -import com.itsaky.androidide.flashbar.util.getNavigationBarPosition -import com.itsaky.androidide.flashbar.util.getNavigationBarSizeInPx -import com.itsaky.androidide.flashbar.util.getRootView +import org.appdevforall.codeonthego.flashbar.Flashbar.Companion.DURATION_INDEFINITE +import org.appdevforall.codeonthego.flashbar.Flashbar.DismissEvent +import org.appdevforall.codeonthego.flashbar.Flashbar.DismissEvent.* +import org.appdevforall.codeonthego.flashbar.Flashbar.Vibration.DISMISS +import org.appdevforall.codeonthego.flashbar.SwipeDismissTouchListener.DismissCallbacks +import org.appdevforall.codeonthego.flashbar.anim.FlashAnim +import org.appdevforall.codeonthego.flashbar.Flashbar.OnBarDismissListener +import org.appdevforall.codeonthego.flashbar.Flashbar.OnBarShowListener +import org.appdevforall.codeonthego.flashbar.Flashbar.OnTapListener +import org.appdevforall.codeonthego.flashbar.Flashbar.Vibration +import org.appdevforall.codeonthego.flashbar.Flashbar.Vibration.SHOW +import org.appdevforall.codeonthego.flashbar.anim.FlashAnimBarBuilder +import org.appdevforall.codeonthego.flashbar.anim.FlashAnimIconBuilder +import org.appdevforall.codeonthego.flashbar.util.NavigationBarPosition.* +import org.appdevforall.codeonthego.flashbar.util.afterMeasured +import org.appdevforall.codeonthego.flashbar.util.getNavigationBarPosition +import org.appdevforall.codeonthego.flashbar.util.getNavigationBarSizeInPx +import org.appdevforall.codeonthego.flashbar.util.getRootView /** * Container withView matching the height and width of the parent to hold a FlashbarView. diff --git a/subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/FlashbarView.kt b/subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/FlashbarView.kt similarity index 94% rename from subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/FlashbarView.kt rename to subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/FlashbarView.kt index 2054fe4c64..16b40a2f2d 100644 --- a/subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/FlashbarView.kt +++ b/subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/FlashbarView.kt @@ -15,7 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.flashbar +package org.appdevforall.codeonthego.flashbar + +import com.itsaky.androidide.flashbar.R +import com.itsaky.androidide.flashbar.databinding.FlashBarViewBinding import android.annotation.SuppressLint import android.app.Activity @@ -45,18 +48,17 @@ import androidx.core.view.marginTop import androidx.core.view.updateLayoutParams import com.google.android.material.button.MaterialButton import com.google.android.material.progressindicator.CircularProgressIndicator -import com.itsaky.androidide.flashbar.Flashbar.Gravity -import com.itsaky.androidide.flashbar.Flashbar.Gravity.BOTTOM -import com.itsaky.androidide.flashbar.Flashbar.Gravity.TOP -import com.itsaky.androidide.flashbar.Flashbar.OnActionTapListener -import com.itsaky.androidide.flashbar.Flashbar.OnTapListener -import com.itsaky.androidide.flashbar.Flashbar.ProgressPosition -import com.itsaky.androidide.flashbar.Flashbar.ProgressPosition.LEFT -import com.itsaky.androidide.flashbar.Flashbar.ProgressPosition.RIGHT -import com.itsaky.androidide.flashbar.SwipeDismissTouchListener.DismissCallbacks -import com.itsaky.androidide.flashbar.anim.FlashAnimIconBuilder -import com.itsaky.androidide.flashbar.databinding.FlashBarViewBinding -import com.itsaky.androidide.flashbar.util.getStatusBarHeightInPx +import org.appdevforall.codeonthego.flashbar.Flashbar.Gravity +import org.appdevforall.codeonthego.flashbar.Flashbar.Gravity.BOTTOM +import org.appdevforall.codeonthego.flashbar.Flashbar.Gravity.TOP +import org.appdevforall.codeonthego.flashbar.Flashbar.OnActionTapListener +import org.appdevforall.codeonthego.flashbar.Flashbar.OnTapListener +import org.appdevforall.codeonthego.flashbar.Flashbar.ProgressPosition +import org.appdevforall.codeonthego.flashbar.Flashbar.ProgressPosition.LEFT +import org.appdevforall.codeonthego.flashbar.Flashbar.ProgressPosition.RIGHT +import org.appdevforall.codeonthego.flashbar.SwipeDismissTouchListener.DismissCallbacks +import org.appdevforall.codeonthego.flashbar.anim.FlashAnimIconBuilder +import org.appdevforall.codeonthego.flashbar.util.getStatusBarHeightInPx /** * The actual Flashbar withView representation that can consist of the title, message, button, icon, diff --git a/subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/SwipeDismissTouchListener.kt b/subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/SwipeDismissTouchListener.kt similarity index 99% rename from subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/SwipeDismissTouchListener.kt rename to subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/SwipeDismissTouchListener.kt index 61130d315d..76e687b0de 100644 --- a/subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/SwipeDismissTouchListener.kt +++ b/subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/SwipeDismissTouchListener.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.flashbar +package org.appdevforall.codeonthego.flashbar import android.animation.Animator import android.animation.AnimatorListenerAdapter diff --git a/subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/anim/BaseFlashAnimBuilder.kt b/subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/anim/BaseFlashAnimBuilder.kt similarity index 97% rename from subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/anim/BaseFlashAnimBuilder.kt rename to subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/anim/BaseFlashAnimBuilder.kt index a4ffa6423c..3bd6b2f00c 100644 --- a/subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/anim/BaseFlashAnimBuilder.kt +++ b/subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/anim/BaseFlashAnimBuilder.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.flashbar.anim +package org.appdevforall.codeonthego.flashbar.anim import android.content.Context import android.view.View diff --git a/subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/anim/FlashAnim.kt b/subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/anim/FlashAnim.kt similarity index 96% rename from subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/anim/FlashAnim.kt rename to subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/anim/FlashAnim.kt index 337bac8b57..2de4c5f33d 100644 --- a/subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/anim/FlashAnim.kt +++ b/subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/anim/FlashAnim.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.flashbar.anim +package org.appdevforall.codeonthego.flashbar.anim import android.animation.Animator import android.animation.AnimatorSet diff --git a/subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/anim/FlashAnimBarBuilder.kt b/subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/anim/FlashAnimBarBuilder.kt similarity index 88% rename from subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/anim/FlashAnimBarBuilder.kt rename to subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/anim/FlashAnimBarBuilder.kt index 7b8a716246..d3ea4bcb1e 100644 --- a/subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/anim/FlashAnimBarBuilder.kt +++ b/subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/anim/FlashAnimBarBuilder.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.flashbar.anim +package org.appdevforall.codeonthego.flashbar.anim import android.animation.Animator import android.animation.AnimatorSet @@ -9,13 +9,13 @@ import android.view.animation.AnticipateInterpolator import android.view.animation.Interpolator import android.view.animation.OvershootInterpolator import androidx.annotation.InterpolatorRes -import com.itsaky.androidide.flashbar.Flashbar -import com.itsaky.androidide.flashbar.Flashbar.Gravity.BOTTOM -import com.itsaky.androidide.flashbar.Flashbar.Gravity.TOP -import com.itsaky.androidide.flashbar.anim.FlashAnimBarBuilder.Direction.LEFT -import com.itsaky.androidide.flashbar.anim.FlashAnimBarBuilder.Direction.RIGHT -import com.itsaky.androidide.flashbar.anim.FlashAnimBarBuilder.Type.ENTER -import com.itsaky.androidide.flashbar.anim.FlashAnimBarBuilder.Type.EXIT +import org.appdevforall.codeonthego.flashbar.Flashbar +import org.appdevforall.codeonthego.flashbar.Flashbar.Gravity.BOTTOM +import org.appdevforall.codeonthego.flashbar.Flashbar.Gravity.TOP +import org.appdevforall.codeonthego.flashbar.anim.FlashAnimBarBuilder.Direction.LEFT +import org.appdevforall.codeonthego.flashbar.anim.FlashAnimBarBuilder.Direction.RIGHT +import org.appdevforall.codeonthego.flashbar.anim.FlashAnimBarBuilder.Type.ENTER +import org.appdevforall.codeonthego.flashbar.anim.FlashAnimBarBuilder.Type.EXIT class FlashAnimBarBuilder(context: Context) : BaseFlashAnimBuilder(context) { diff --git a/subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/anim/FlashAnimIconBuilder.kt b/subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/anim/FlashAnimIconBuilder.kt similarity index 98% rename from subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/anim/FlashAnimIconBuilder.kt rename to subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/anim/FlashAnimIconBuilder.kt index df325d0704..5bd2667c10 100644 --- a/subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/anim/FlashAnimIconBuilder.kt +++ b/subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/anim/FlashAnimIconBuilder.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.flashbar.anim +package org.appdevforall.codeonthego.flashbar.anim import android.animation.Animator import android.animation.AnimatorSet diff --git a/subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/util/CommonUtils.kt b/subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/util/CommonUtils.kt similarity index 89% rename from subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/util/CommonUtils.kt rename to subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/util/CommonUtils.kt index 004d9a55a7..c789ed1616 100644 --- a/subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/util/CommonUtils.kt +++ b/subprojects/flashbar/src/main/java/org/appdevforall/codeonthego/flashbar/util/CommonUtils.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.flashbar.util +package org.appdevforall.codeonthego.flashbar.util import android.app.Activity import android.content.Context @@ -15,10 +15,10 @@ import android.view.ViewGroup import android.view.ViewTreeObserver import android.view.Window import android.view.WindowManager -import com.itsaky.androidide.flashbar.util.NavigationBarPosition.BOTTOM -import com.itsaky.androidide.flashbar.util.NavigationBarPosition.LEFT -import com.itsaky.androidide.flashbar.util.NavigationBarPosition.RIGHT -import com.itsaky.androidide.flashbar.util.NavigationBarPosition.TOP +import org.appdevforall.codeonthego.flashbar.util.NavigationBarPosition.BOTTOM +import org.appdevforall.codeonthego.flashbar.util.NavigationBarPosition.LEFT +import org.appdevforall.codeonthego.flashbar.util.NavigationBarPosition.RIGHT +import org.appdevforall.codeonthego.flashbar.util.NavigationBarPosition.TOP import kotlin.math.roundToInt internal fun Activity.getStatusBarHeightInPx(): Int { diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/CancelAbort.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/CancelAbort.java similarity index 96% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/CancelAbort.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/CancelAbort.java index bdccfed743..3e79272a93 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/CancelAbort.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/CancelAbort.java @@ -34,7 +34,7 @@ * under the License. */ -package com.itsaky.androidide.javac.services; +package org.appdevforall.codeonthego.javac.services; import openjdk.tools.javac.util.Abort; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/CancelService.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/CancelService.java similarity index 97% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/CancelService.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/CancelService.java index dc37f8acea..47d2111e38 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/CancelService.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/CancelService.java @@ -34,7 +34,7 @@ * under the License. */ -package com.itsaky.androidide.javac.services; +package org.appdevforall.codeonthego.javac.services; import openjdk.tools.javac.util.Context; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBAttr.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBAttr.java similarity index 98% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBAttr.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBAttr.java index bd39311821..03fd4360bf 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBAttr.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBAttr.java @@ -33,7 +33,7 @@ * specific language governing permissions and limitations * under the License. */ -package com.itsaky.androidide.javac.services; +package org.appdevforall.codeonthego.javac.services; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBClassFinder.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBClassFinder.java similarity index 99% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBClassFinder.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBClassFinder.java index d9fa7d4e76..ba315b0abc 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBClassFinder.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBClassFinder.java @@ -33,7 +33,7 @@ * specific language governing permissions and limitations * under the License. */ -package com.itsaky.androidide.javac.services; +package org.appdevforall.codeonthego.javac.services; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBClassReader.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBClassReader.java similarity index 99% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBClassReader.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBClassReader.java index 60703a2eb3..b662b5d94a 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBClassReader.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBClassReader.java @@ -33,7 +33,7 @@ * specific language governing permissions and limitations * under the License. */ -package com.itsaky.androidide.javac.services; +package org.appdevforall.codeonthego.javac.services; import static openjdk.tools.javac.jvm.ClassFile.Version.V45_3; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBClassWriter.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBClassWriter.java similarity index 97% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBClassWriter.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBClassWriter.java index d42c1149d9..43471e3e37 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBClassWriter.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBClassWriter.java @@ -33,7 +33,7 @@ * specific language governing permissions and limitations * under the License. */ -package com.itsaky.androidide.javac.services; +package org.appdevforall.codeonthego.javac.services; import openjdk.tools.javac.code.Types; import openjdk.tools.javac.jvm.ClassWriter; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBEnter.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBEnter.java similarity index 98% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBEnter.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBEnter.java index 1d04649fca..3b8e61813b 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBEnter.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBEnter.java @@ -33,7 +33,7 @@ * specific language governing permissions and limitations * under the License. */ -package com.itsaky.androidide.javac.services; +package org.appdevforall.codeonthego.javac.services; import openjdk.tools.javac.code.Symbol.TypeSymbol; import openjdk.tools.javac.code.Symtab; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBJavaCompiler.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBJavaCompiler.java similarity index 98% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBJavaCompiler.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBJavaCompiler.java index 72107cb28f..c80d3736f0 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBJavaCompiler.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBJavaCompiler.java @@ -33,7 +33,7 @@ * specific language governing permissions and limitations * under the License. */ -package com.itsaky.androidide.javac.services; +package org.appdevforall.codeonthego.javac.services; import java.util.Collection; import java.util.Collections; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBJavacTrees.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBJavacTrees.java similarity index 98% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBJavacTrees.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBJavacTrees.java index 556fb630e4..d77506c9c2 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBJavacTrees.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBJavacTrees.java @@ -33,7 +33,7 @@ * specific language governing permissions and limitations * under the License. */ -package com.itsaky.androidide.javac.services; +package org.appdevforall.codeonthego.javac.services; import java.util.HashMap; import java.util.Map; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBLog.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBLog.java similarity index 98% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBLog.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBLog.java index 246b906a29..48b43b5579 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBLog.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBLog.java @@ -33,7 +33,7 @@ * specific language governing permissions and limitations * under the License. */ -package com.itsaky.androidide.javac.services; +package org.appdevforall.codeonthego.javac.services; import java.io.PrintWriter; import java.net.URI; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBMemberEnter.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBMemberEnter.java similarity index 98% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBMemberEnter.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBMemberEnter.java index d222832f7d..2b26cb901e 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBMemberEnter.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBMemberEnter.java @@ -33,7 +33,7 @@ * specific language governing permissions and limitations * under the License. */ -package com.itsaky.androidide.javac.services; +package org.appdevforall.codeonthego.javac.services; import openjdk.source.util.TreePath; import openjdk.tools.javac.api.JavacTrees; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBNames.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBNames.java similarity index 98% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBNames.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBNames.java index 5d18993f8a..e3e1c0c054 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBNames.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBNames.java @@ -33,7 +33,7 @@ * specific language governing permissions and limitations * under the License. */ -package com.itsaky.androidide.javac.services; +package org.appdevforall.codeonthego.javac.services; import openjdk.tools.javac.util.Context; import openjdk.tools.javac.util.Name; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBParserFactory.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBParserFactory.java similarity index 99% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBParserFactory.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBParserFactory.java index e61f4f2997..bcd2df5c4f 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBParserFactory.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBParserFactory.java @@ -33,7 +33,7 @@ * specific language governing permissions and limitations * under the License. */ -package com.itsaky.androidide.javac.services; +package org.appdevforall.codeonthego.javac.services; import openjdk.tools.javac.parser.JavacParser; import openjdk.tools.javac.parser.Lexer; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBResolve.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBResolve.java similarity index 98% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBResolve.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBResolve.java index 92e1fcd39d..1dc8e7fa37 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBResolve.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBResolve.java @@ -33,7 +33,7 @@ * specific language governing permissions and limitations * under the License. */ -package com.itsaky.androidide.javac.services; +package org.appdevforall.codeonthego.javac.services; import openjdk.tools.javac.code.Symbol; import openjdk.tools.javac.code.Symbol.TypeSymbol; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBTreeMaker.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBTreeMaker.java similarity index 98% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBTreeMaker.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBTreeMaker.java index a01ef556df..496b3d44ff 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/NBTreeMaker.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/NBTreeMaker.java @@ -33,7 +33,7 @@ * specific language governing permissions and limitations * under the License. */ -package com.itsaky.androidide.javac.services; +package org.appdevforall.codeonthego.javac.services; import openjdk.tools.javac.code.Symtab; import openjdk.tools.javac.code.Types; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/CancelServiceImpl.kt b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/CancelServiceImpl.kt similarity index 87% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/CancelServiceImpl.kt rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/CancelServiceImpl.kt index 366f6c0ec4..90b7a2b4cd 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/CancelServiceImpl.kt +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/CancelServiceImpl.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.compiler +package org.appdevforall.codeonthego.javac.services.compiler -import com.itsaky.androidide.javac.services.CancelService -import com.itsaky.androidide.utils.ILogger +import org.appdevforall.codeonthego.javac.services.CancelService +import org.appdevforall.codeonthego.utils.ILogger import java.util.concurrent.atomic.AtomicBoolean /** diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/JavacFlowListener.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/JavacFlowListener.java similarity index 94% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/JavacFlowListener.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/JavacFlowListener.java index eecfd1faec..ea01972c09 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/JavacFlowListener.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/JavacFlowListener.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.compiler; +package org.appdevforall.codeonthego.javac.services.compiler; import androidx.annotation.NonNull; import jdkx.tools.JavaFileObject; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/ReusableBorrow.kt b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/ReusableBorrow.kt similarity index 95% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/ReusableBorrow.kt rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/ReusableBorrow.kt index 62e454e516..587490bdab 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/ReusableBorrow.kt +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/ReusableBorrow.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.compiler +package org.appdevforall.codeonthego.javac.services.compiler import openjdk.tools.javac.api.JavacTaskImpl diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/ReusableCompiler.kt b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/ReusableCompiler.kt similarity index 97% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/ReusableCompiler.kt rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/ReusableCompiler.kt index c7a1a6e109..70f27e1497 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/ReusableCompiler.kt +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/ReusableCompiler.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ // Forked from JavacTaskImpl -package com.itsaky.androidide.javac.services.compiler +package org.appdevforall.codeonthego.javac.services.compiler -import com.itsaky.androidide.javac.services.CancelService +import org.appdevforall.codeonthego.javac.services.CancelService import jdkx.tools.DiagnosticListener import jdkx.tools.JavaFileManager import jdkx.tools.JavaFileObject diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/ReusableContext.kt b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/ReusableContext.kt similarity index 82% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/ReusableContext.kt rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/ReusableContext.kt index 68c039ea2c..af65f0a873 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/ReusableContext.kt +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/ReusableContext.kt @@ -15,21 +15,21 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.compiler +package org.appdevforall.codeonthego.javac.services.compiler -import com.itsaky.androidide.javac.services.CancelService -import com.itsaky.androidide.javac.services.NBAttr -import com.itsaky.androidide.javac.services.NBClassFinder -import com.itsaky.androidide.javac.services.NBClassReader -import com.itsaky.androidide.javac.services.NBEnter -import com.itsaky.androidide.javac.services.NBJavacTrees -import com.itsaky.androidide.javac.services.NBMemberEnter -import com.itsaky.androidide.javac.services.NBParserFactory -import com.itsaky.androidide.javac.services.NBResolve -import com.itsaky.androidide.javac.services.NBTreeMaker -import com.itsaky.androidide.javac.services.fs.CacheFSInfoSingleton -import com.itsaky.androidide.javac.services.fs.JarPackageProviderImpl -import com.itsaky.androidide.utils.VMUtils +import org.appdevforall.codeonthego.javac.services.CancelService +import org.appdevforall.codeonthego.javac.services.NBAttr +import org.appdevforall.codeonthego.javac.services.NBClassFinder +import org.appdevforall.codeonthego.javac.services.NBClassReader +import org.appdevforall.codeonthego.javac.services.NBEnter +import org.appdevforall.codeonthego.javac.services.NBJavacTrees +import org.appdevforall.codeonthego.javac.services.NBMemberEnter +import org.appdevforall.codeonthego.javac.services.NBParserFactory +import org.appdevforall.codeonthego.javac.services.NBResolve +import org.appdevforall.codeonthego.javac.services.NBTreeMaker +import org.appdevforall.codeonthego.javac.services.fs.CacheFSInfoSingleton +import org.appdevforall.codeonthego.javac.services.fs.JarPackageProviderImpl +import org.appdevforall.codeonthego.utils.VMUtils import com.itsaky.androidide.zipfs2.JarPackageProvider import jdkx.tools.DiagnosticListener import jdkx.tools.JavaFileManager diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/ReusableJavaCompiler.kt b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/ReusableJavaCompiler.kt similarity index 90% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/ReusableJavaCompiler.kt rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/ReusableJavaCompiler.kt index f5e1c44d4b..5ec23d2324 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/ReusableJavaCompiler.kt +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/ReusableJavaCompiler.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.compiler +package org.appdevforall.codeonthego.javac.services.compiler -import com.itsaky.androidide.javac.services.NBJavaCompiler +import org.appdevforall.codeonthego.javac.services.NBJavaCompiler import openjdk.tools.javac.main.JavaCompiler import openjdk.tools.javac.util.Context diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/ReusableLog.kt b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/ReusableLog.kt similarity index 95% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/ReusableLog.kt rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/ReusableLog.kt index 6bf08fba11..6ac186cbbd 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/compiler/ReusableLog.kt +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/compiler/ReusableLog.kt @@ -14,9 +14,9 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.compiler +package org.appdevforall.codeonthego.javac.services.compiler -import com.itsaky.androidide.javac.services.NBLog +import org.appdevforall.codeonthego.javac.services.NBLog import jdkx.tools.Diagnostic import jdkx.tools.DiagnosticListener import jdkx.tools.JavaFileObject diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/fs/AndroidFsProviderImpl.kt b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/fs/AndroidFsProviderImpl.kt similarity index 95% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/fs/AndroidFsProviderImpl.kt rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/fs/AndroidFsProviderImpl.kt index 360d933927..9b944e6fdf 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/fs/AndroidFsProviderImpl.kt +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/fs/AndroidFsProviderImpl.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.fs +package org.appdevforall.codeonthego.javac.services.fs import com.itsaky.androidide.zipfs2.AndroidFsProvider import java.nio.file.spi.FileSystemProvider diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/fs/CacheFSInfoSingleton.kt b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/fs/CacheFSInfoSingleton.kt similarity index 94% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/fs/CacheFSInfoSingleton.kt rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/fs/CacheFSInfoSingleton.kt index aa7f660b32..8305706f3b 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/fs/CacheFSInfoSingleton.kt +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/fs/CacheFSInfoSingleton.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.fs +package org.appdevforall.codeonthego.javac.services.fs -import com.itsaky.androidide.utils.VMUtils +import org.appdevforall.codeonthego.utils.VMUtils import openjdk.tools.javac.file.CacheFSInfo import org.slf4j.LoggerFactory import java.nio.file.Path diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/fs/CachedJarFileSystem.kt b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/fs/CachedJarFileSystem.kt similarity index 97% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/fs/CachedJarFileSystem.kt rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/fs/CachedJarFileSystem.kt index e11f4b3187..5e8dfc31be 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/fs/CachedJarFileSystem.kt +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/fs/CachedJarFileSystem.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.fs +package org.appdevforall.codeonthego.javac.services.fs import com.itsaky.androidide.zipfs2.ZipFileSystem import com.itsaky.androidide.zipfs2.ZipFileSystemProvider diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/fs/CachingJarFileSystemProvider.kt b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/fs/CachingJarFileSystemProvider.kt similarity index 98% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/fs/CachingJarFileSystemProvider.kt rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/fs/CachingJarFileSystemProvider.kt index 8edfaf87a0..c5eefca725 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/fs/CachingJarFileSystemProvider.kt +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/fs/CachingJarFileSystemProvider.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.fs +package org.appdevforall.codeonthego.javac.services.fs import com.itsaky.androidide.zipfs2.JarFileSystemProvider import com.itsaky.androidide.zipfs2.ZipFileSystem diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/fs/JarPackageProviderImpl.kt b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/fs/JarPackageProviderImpl.kt similarity index 95% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/fs/JarPackageProviderImpl.kt rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/fs/JarPackageProviderImpl.kt index 0606a5b523..87bcc5f169 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/fs/JarPackageProviderImpl.kt +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/fs/JarPackageProviderImpl.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.fs +package org.appdevforall.codeonthego.javac.services.fs import com.itsaky.androidide.zipfs2.JarPackageProvider import openjdk.tools.javac.file.RelativePath.RelativeDirectory diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/partial/CompilationInfo.kt b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/partial/CompilationInfo.kt similarity index 95% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/partial/CompilationInfo.kt rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/partial/CompilationInfo.kt index 95be6cf3bd..76cde0ad1a 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/partial/CompilationInfo.kt +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/partial/CompilationInfo.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.partial +package org.appdevforall.codeonthego.javac.services.partial import jdkx.tools.DiagnosticListener import jdkx.tools.JavaFileObject diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/partial/DiagnosticListenerImpl.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/partial/DiagnosticListenerImpl.java similarity index 99% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/partial/DiagnosticListenerImpl.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/partial/DiagnosticListenerImpl.java index 293359eeb9..11cb0069b3 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/partial/DiagnosticListenerImpl.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/partial/DiagnosticListenerImpl.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.partial; +package org.appdevforall.codeonthego.javac.services.partial; import androidx.annotation.Nullable; import java.util.ArrayList; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/partial/PartialReparser.kt b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/partial/PartialReparser.kt similarity index 94% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/partial/PartialReparser.kt rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/partial/PartialReparser.kt index b2210e33cb..9b2c2e9dd5 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/partial/PartialReparser.kt +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/partial/PartialReparser.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.partial +package org.appdevforall.codeonthego.javac.services.partial import openjdk.source.util.TreePath diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/partial/PartialReparserImpl.kt b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/partial/PartialReparserImpl.kt similarity index 92% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/partial/PartialReparserImpl.kt rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/partial/PartialReparserImpl.kt index b64a12cbf5..be66f91923 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/partial/PartialReparserImpl.kt +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/partial/PartialReparserImpl.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.partial +package org.appdevforall.codeonthego.javac.services.partial -import com.itsaky.androidide.javac.services.compiler.JavacFlowListener -import com.itsaky.androidide.javac.services.util.ReparserUtils -import com.itsaky.androidide.javac.services.visitors.FindAnonymousVisitor -import com.itsaky.androidide.javac.services.visitors.TranslateMethodPositionsVisitor +import org.appdevforall.codeonthego.javac.services.compiler.JavacFlowListener +import org.appdevforall.codeonthego.javac.services.util.ReparserUtils +import org.appdevforall.codeonthego.javac.services.visitors.FindAnonymousVisitor +import org.appdevforall.codeonthego.javac.services.visitors.TranslateMethodPositionsVisitor import openjdk.source.tree.BlockTree import openjdk.source.tree.ClassTree import openjdk.source.tree.CompilationUnitTree @@ -116,7 +116,7 @@ class PartialReparserImpl : PartialReparser { val context = task.context try { - val l = com.itsaky.androidide.javac.services.NBLog.instance(context) + val l = org.appdevforall.codeonthego.javac.services.NBLog.instance(context) l.startPartialReparse(fo) val prevLogged = l.useSource(fo) val block: JCBlock? @@ -246,20 +246,20 @@ class PartialReparserImpl : PartialReparser { endPositions: EndPosTable?, ): JavacParser { val factory = - com.itsaky.androidide.javac.services.NBParserFactory.instance(context) - as com.itsaky.androidide.javac.services.NBParserFactory + org.appdevforall.codeonthego.javac.services.NBParserFactory.instance(context) + as org.appdevforall.codeonthego.javac.services.NBParserFactory val scannerFactory = ScannerFactory.instance(context) - val cancelService = com.itsaky.androidide.javac.services.CancelService.instance(context) + val cancelService = org.appdevforall.codeonthego.javac.services.CancelService.instance(context) val lexer = scannerFactory.newScanner(buf, true) if ( endPositions - is com.itsaky.androidide.javac.services.NBParserFactory.NBJavacParser.EndPosTableImpl + is org.appdevforall.codeonthego.javac.services.NBParserFactory.NBJavacParser.EndPosTableImpl ) { endPositions.resetErrorEndPos() } return object : - com.itsaky.androidide.javac.services.NBParserFactory.NBJavacParser( + org.appdevforall.codeonthego.javac.services.NBParserFactory.NBJavacParser( factory, lexer, true, diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/partial/RichDiagnostic.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/partial/RichDiagnostic.java similarity index 97% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/partial/RichDiagnostic.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/partial/RichDiagnostic.java index 20c7775a7b..5c24a55bb0 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/partial/RichDiagnostic.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/partial/RichDiagnostic.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.partial; +package org.appdevforall.codeonthego.javac.services.partial; import java.util.Locale; import jdkx.tools.Diagnostic; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/util/JavaDiagnosticUtils.kt b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/util/JavaDiagnosticUtils.kt similarity index 94% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/util/JavaDiagnosticUtils.kt rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/util/JavaDiagnosticUtils.kt index 360c53439b..ed09c2a403 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/util/JavaDiagnosticUtils.kt +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/util/JavaDiagnosticUtils.kt @@ -1,59 +1,59 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.javac.services.util - -import jdkx.tools.Diagnostic -import jdkx.tools.JavaFileObject -import openjdk.tools.javac.api.ClientCodeWrapper -import openjdk.tools.javac.util.JCDiagnostic - -/** @author Akash Yadav */ -class JavaDiagnosticUtils { - companion object { - @JvmStatic - fun asJCDiagnostic(diagnostic: Diagnostic): JCDiagnostic? { - if (diagnostic is JCDiagnostic) { - return diagnostic - } else if (diagnostic is ClientCodeWrapper.DiagnosticSourceUnwrapper) { - return diagnostic.d - } - - return null - } - - @JvmStatic - fun asUnwrapper( - diagnostic: Diagnostic - ): ClientCodeWrapper.DiagnosticSourceUnwrapper? { - if (diagnostic is ClientCodeWrapper.DiagnosticSourceUnwrapper) { - return diagnostic - } else if (diagnostic is JCDiagnostic) { - return wrap(diagnostic) - } - - return null - } - - private fun wrap(diagnostic: JCDiagnostic): ClientCodeWrapper.DiagnosticSourceUnwrapper { - val klass = ClientCodeWrapper.DiagnosticSourceUnwrapper::class.java - val construct = klass.getDeclaredConstructor(JCDiagnostic::class.java) - construct.isAccessible = true - return construct.newInstance(diagnostic) - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.javac.services.util + +import jdkx.tools.Diagnostic +import jdkx.tools.JavaFileObject +import openjdk.tools.javac.api.ClientCodeWrapper +import openjdk.tools.javac.util.JCDiagnostic + +/** @author Akash Yadav */ +class JavaDiagnosticUtils { + companion object { + @JvmStatic + fun asJCDiagnostic(diagnostic: Diagnostic): JCDiagnostic? { + if (diagnostic is JCDiagnostic) { + return diagnostic + } else if (diagnostic is ClientCodeWrapper.DiagnosticSourceUnwrapper) { + return diagnostic.d + } + + return null + } + + @JvmStatic + fun asUnwrapper( + diagnostic: Diagnostic + ): ClientCodeWrapper.DiagnosticSourceUnwrapper? { + if (diagnostic is ClientCodeWrapper.DiagnosticSourceUnwrapper) { + return diagnostic + } else if (diagnostic is JCDiagnostic) { + return wrap(diagnostic) + } + + return null + } + + private fun wrap(diagnostic: JCDiagnostic): ClientCodeWrapper.DiagnosticSourceUnwrapper { + val klass = ClientCodeWrapper.DiagnosticSourceUnwrapper::class.java + val construct = klass.getDeclaredConstructor(JCDiagnostic::class.java) + construct.isAccessible = true + return construct.newInstance(diagnostic) + } + } +} diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/util/ReparserUtils.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/util/ReparserUtils.java similarity index 96% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/util/ReparserUtils.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/util/ReparserUtils.java index 38f91b421b..080097761f 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/util/ReparserUtils.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/util/ReparserUtils.java @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.util; +package org.appdevforall.codeonthego.javac.services.util; import androidx.annotation.Nullable; -import com.itsaky.androidide.javac.services.visitors.UnEnter; -import com.itsaky.androidide.utils.VMUtils; +import org.appdevforall.codeonthego.javac.services.visitors.UnEnter; +import org.appdevforall.codeonthego.utils.VMUtils; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.Map; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/visitors/ErrorAwareTreeScanner.kt b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/visitors/ErrorAwareTreeScanner.kt similarity index 94% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/visitors/ErrorAwareTreeScanner.kt rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/visitors/ErrorAwareTreeScanner.kt index bd062afb6d..80577d49a1 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/visitors/ErrorAwareTreeScanner.kt +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/visitors/ErrorAwareTreeScanner.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.visitors +package org.appdevforall.codeonthego.javac.services.visitors import openjdk.source.tree.ErroneousTree import openjdk.source.util.TreeScanner diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/visitors/FindAnonymousVisitor.kt b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/visitors/FindAnonymousVisitor.kt similarity index 88% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/visitors/FindAnonymousVisitor.kt rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/visitors/FindAnonymousVisitor.kt index 9e4d66ab40..57d3b22e68 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/visitors/FindAnonymousVisitor.kt +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/visitors/FindAnonymousVisitor.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.visitors +package org.appdevforall.codeonthego.javac.services.visitors -import com.itsaky.androidide.javac.services.visitors.FindAnonymousVisitor.Mode.CHECK -import com.itsaky.androidide.javac.services.visitors.FindAnonymousVisitor.Mode.COLLECT +import org.appdevforall.codeonthego.javac.services.visitors.FindAnonymousVisitor.Mode.CHECK +import org.appdevforall.codeonthego.javac.services.visitors.FindAnonymousVisitor.Mode.COLLECT import openjdk.source.tree.ClassTree import openjdk.source.tree.MethodTree import openjdk.source.tree.Tree diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/visitors/TranslateMethodPositionsVisitor.java b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/visitors/TranslateMethodPositionsVisitor.java similarity index 98% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/visitors/TranslateMethodPositionsVisitor.java rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/visitors/TranslateMethodPositionsVisitor.java index 55b0cb5c86..76163919d4 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/visitors/TranslateMethodPositionsVisitor.java +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/visitors/TranslateMethodPositionsVisitor.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.visitors; +package org.appdevforall.codeonthego.javac.services.visitors; import openjdk.source.tree.CompilationUnitTree; import openjdk.source.tree.MethodTree; diff --git a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/visitors/UnEnter.kt b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/visitors/UnEnter.kt similarity index 93% rename from subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/visitors/UnEnter.kt rename to subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/visitors/UnEnter.kt index c0f851f051..76cfc29617 100644 --- a/subprojects/javac-services/src/main/java/com/itsaky/androidide/javac/services/visitors/UnEnter.kt +++ b/subprojects/javac-services/src/main/java/org/appdevforall/codeonthego/javac/services/visitors/UnEnter.kt @@ -14,9 +14,9 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.javac.services.visitors +package org.appdevforall.codeonthego.javac.services.visitors -import com.itsaky.androidide.utils.ReflectUtils +import org.appdevforall.codeonthego.utils.ReflectUtils import openjdk.tools.javac.code.Symbol.ModuleSymbol import openjdk.tools.javac.comp.Enter import openjdk.tools.javac.tree.JCTree.JCClassDecl diff --git a/subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/MyClass.kt b/subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/MyClass.kt deleted file mode 100644 index a32e930538..0000000000 --- a/subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/MyClass.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.itsaky.androidide.projects.models - -class MyClass diff --git a/subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/AndroidProjectExts.kt b/subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/AndroidProjectExts.kt similarity index 92% rename from subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/AndroidProjectExts.kt rename to subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/AndroidProjectExts.kt index 0f1f328fbb..fe8f632d3e 100644 --- a/subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/AndroidProjectExts.kt +++ b/subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/AndroidProjectExts.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.projects.models +package org.appdevforall.codeonthego.projects.models -import com.itsaky.androidide.project.AndroidModels +import org.appdevforall.codeonthego.project.AndroidModels import java.io.File val AndroidModels.AndroidProjectOrBuilder.classesJar: File? diff --git a/subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/CommonProjectExts.kt b/subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/CommonProjectExts.kt similarity index 53% rename from subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/CommonProjectExts.kt rename to subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/CommonProjectExts.kt index 1cf0e0f230..02e1d93f44 100644 --- a/subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/CommonProjectExts.kt +++ b/subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/CommonProjectExts.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.projects.models +package org.appdevforall.codeonthego.projects.models -import com.itsaky.androidide.project.JavaCompilerSettings +import org.appdevforall.codeonthego.project.JavaCompilerSettings val DEFAULT_COMPILER_SETTINGS = JavaCompilerSettings( diff --git a/subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/GradleProjectExts.kt b/subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/GradleProjectExts.kt similarity index 63% rename from subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/GradleProjectExts.kt rename to subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/GradleProjectExts.kt index bfe302e8ed..e48fb890ed 100644 --- a/subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/GradleProjectExts.kt +++ b/subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/GradleProjectExts.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.projects.models +package org.appdevforall.codeonthego.projects.models -import com.itsaky.androidide.project.GradleModels +import org.appdevforall.codeonthego.project.GradleModels import java.io.File val GradleModels.GradleProjectOrBuilder.projectDir: File diff --git a/subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/JavaProjectExts.kt b/subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/JavaProjectExts.kt similarity index 64% rename from subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/JavaProjectExts.kt rename to subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/JavaProjectExts.kt index e44540279e..ad57c1cda2 100644 --- a/subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/JavaProjectExts.kt +++ b/subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/JavaProjectExts.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.projects.models +package org.appdevforall.codeonthego.projects.models -import com.itsaky.androidide.project.JavaModels +import org.appdevforall.codeonthego.project.JavaModels import java.io.File val JavaModels.JavaSourceDirectoryOrBuilder.directory: File diff --git a/subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/MyClass.kt b/subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/MyClass.kt new file mode 100644 index 0000000000..443dea643b --- /dev/null +++ b/subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/MyClass.kt @@ -0,0 +1,3 @@ +package org.appdevforall.codeonthego.projects.models + +class MyClass diff --git a/subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/SyncMetaExts.kt b/subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/SyncMetaExts.kt similarity index 77% rename from subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/SyncMetaExts.kt rename to subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/SyncMetaExts.kt index 6f3906ff7b..9c788b7244 100644 --- a/subprojects/project-models/src/main/java/com/itsaky/androidide/projects/models/SyncMetaExts.kt +++ b/subprojects/project-models/src/main/java/org/appdevforall/codeonthego/projects/models/SyncMetaExts.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.projects.models +package org.appdevforall.codeonthego.projects.models -import com.itsaky.androidide.project.SyncMetaModels +import org.appdevforall.codeonthego.project.SyncMetaModels import java.io.File val SyncMetaModels.SyncMetaOrBuilder.rootProjectDir: File diff --git a/subprojects/project-models/src/main/proto/android.proto b/subprojects/project-models/src/main/proto/android.proto index 2e70d187c9..46aa675ec6 100644 --- a/subprojects/project-models/src/main/proto/android.proto +++ b/subprojects/project-models/src/main/proto/android.proto @@ -2,7 +2,7 @@ syntax = "proto3"; option optimize_for = LITE_RUNTIME; option java_outer_classname = "AndroidModels"; -package com.itsaky.androidide.project; +package org.appdevforall.codeonthego.project; import "common.proto"; diff --git a/subprojects/project-models/src/main/proto/common.proto b/subprojects/project-models/src/main/proto/common.proto index f01d284264..5018ef5aa1 100644 --- a/subprojects/project-models/src/main/proto/common.proto +++ b/subprojects/project-models/src/main/proto/common.proto @@ -1,7 +1,7 @@ syntax = "proto3"; option optimize_for = LITE_RUNTIME; -package com.itsaky.androidide.project; +package org.appdevforall.codeonthego.project; // Common compiler settings message JavaCompilerSettings { diff --git a/subprojects/project-models/src/main/proto/gradle.proto b/subprojects/project-models/src/main/proto/gradle.proto index 1cf3dc7739..a0115686cc 100644 --- a/subprojects/project-models/src/main/proto/gradle.proto +++ b/subprojects/project-models/src/main/proto/gradle.proto @@ -2,7 +2,7 @@ syntax = "proto3"; option optimize_for = LITE_RUNTIME; option java_outer_classname = "GradleModels"; -package com.itsaky.androidide.project; +package org.appdevforall.codeonthego.project; import "android.proto"; import "java.proto"; diff --git a/subprojects/project-models/src/main/proto/java.proto b/subprojects/project-models/src/main/proto/java.proto index ec23a375b2..2408406844 100644 --- a/subprojects/project-models/src/main/proto/java.proto +++ b/subprojects/project-models/src/main/proto/java.proto @@ -2,7 +2,7 @@ syntax = "proto3"; option optimize_for = LITE_RUNTIME; option java_outer_classname = "JavaModels"; -package com.itsaky.androidide.project; +package org.appdevforall.codeonthego.project; import "common.proto"; // A Java source directory. diff --git a/subprojects/project-models/src/main/proto/sync_meta.proto b/subprojects/project-models/src/main/proto/sync_meta.proto index 90dec57cc5..e6b99051d0 100644 --- a/subprojects/project-models/src/main/proto/sync_meta.proto +++ b/subprojects/project-models/src/main/proto/sync_meta.proto @@ -2,7 +2,7 @@ syntax = "proto3"; option optimize_for = LITE_RUNTIME; option java_outer_classname = "SyncMetaModels"; -package com.itsaky.androidide.project; +package org.appdevforall.codeonthego.project; // Metadata about a file contributing to the sync. message FileInfo { diff --git a/subprojects/project-serial/src/main/java/com/itsaky/androidide/projects/serial/ProtoProject.kt b/subprojects/project-serial/src/main/java/org/appdevforall/codeonthego/projects/serial/ProtoProject.kt similarity index 92% rename from subprojects/project-serial/src/main/java/com/itsaky/androidide/projects/serial/ProtoProject.kt rename to subprojects/project-serial/src/main/java/org/appdevforall/codeonthego/projects/serial/ProtoProject.kt index fd51686117..f89d7a5ce3 100644 --- a/subprojects/project-serial/src/main/java/com/itsaky/androidide/projects/serial/ProtoProject.kt +++ b/subprojects/project-serial/src/main/java/org/appdevforall/codeonthego/projects/serial/ProtoProject.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.projects.serial +package org.appdevforall.codeonthego.projects.serial -import com.itsaky.androidide.project.GradleModels +import org.appdevforall.codeonthego.project.GradleModels import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.slf4j.LoggerFactory @@ -40,7 +40,7 @@ object ProtoProject { /** * Write the Gradle build model. The model files will be written to the root project's - * directory of the provided [com.itsaky.androidide.project.GradleModels.GradleBuild]. + * directory of the provided [org.appdevforall.codeonthego.project.GradleModels.GradleBuild]. * * @param gradleBuild The Gradle build model. * @param targetFile The target file. diff --git a/subprojects/project-serialization/src/main/java/com/itsaky/androidide/project/serial/ProtoProject.kt b/subprojects/project-serialization/src/main/java/org/appdevforall/codeonthego/project/serial/ProtoProject.kt similarity index 50% rename from subprojects/project-serialization/src/main/java/com/itsaky/androidide/project/serial/ProtoProject.kt rename to subprojects/project-serialization/src/main/java/org/appdevforall/codeonthego/project/serial/ProtoProject.kt index 991305b6ca..3acbd0b703 100644 --- a/subprojects/project-serialization/src/main/java/com/itsaky/androidide/project/serial/ProtoProject.kt +++ b/subprojects/project-serialization/src/main/java/org/appdevforall/codeonthego/project/serial/ProtoProject.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.project.serial +package org.appdevforall.codeonthego.project.serial /** * @author Akash Yadav diff --git a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/FileManager.kt b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/FileManager.kt similarity index 90% rename from subprojects/projects/src/main/java/com/itsaky/androidide/projects/FileManager.kt rename to subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/FileManager.kt index c19d05f1d9..64f9f6e026 100644 --- a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/FileManager.kt +++ b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/FileManager.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects - -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentCloseEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentOpenEvent -import com.itsaky.androidide.eventbus.events.file.FileDeletionEvent -import com.itsaky.androidide.eventbus.events.file.FileRenameEvent -import com.itsaky.androidide.progress.ProgressManager -import com.itsaky.androidide.projects.models.ActiveDocument +package org.appdevforall.codeonthego.projects + +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentCloseEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentOpenEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileDeletionEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileRenameEvent +import org.appdevforall.codeonthego.progress.ProgressManager +import org.appdevforall.codeonthego.projects.models.ActiveDocument import org.apache.commons.io.FileUtils import org.slf4j.LoggerFactory import java.io.BufferedReader diff --git a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/IProjectManager.kt b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/IProjectManager.kt similarity index 91% rename from subprojects/projects/src/main/java/com/itsaky/androidide/projects/IProjectManager.kt rename to subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/IProjectManager.kt index 9b9479cda7..37c706adf8 100644 --- a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/IProjectManager.kt +++ b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/IProjectManager.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects +package org.appdevforall.codeonthego.projects import androidx.annotation.RestrictTo -import com.itsaky.androidide.project.GradleModels -import com.itsaky.androidide.projects.api.AndroidModule -import com.itsaky.androidide.projects.api.ModuleProject -import com.itsaky.androidide.projects.api.Workspace -import com.itsaky.androidide.tooling.api.models.BuildVariantInfo +import org.appdevforall.codeonthego.project.GradleModels +import org.appdevforall.codeonthego.projects.api.AndroidModule +import org.appdevforall.codeonthego.projects.api.ModuleProject +import org.appdevforall.codeonthego.projects.api.Workspace +import org.appdevforall.codeonthego.tooling.api.models.BuildVariantInfo -import com.itsaky.androidide.utils.ServiceLoader +import org.appdevforall.codeonthego.utils.ServiceLoader import java.io.File import java.nio.file.Path diff --git a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/ProjectManagerImpl.kt b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/ProjectManagerImpl.kt similarity index 89% rename from subprojects/projects/src/main/java/com/itsaky/androidide/projects/ProjectManagerImpl.kt rename to subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/ProjectManagerImpl.kt index 20a5f1c9a7..90d6efd166 100644 --- a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/ProjectManagerImpl.kt +++ b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/ProjectManagerImpl.kt @@ -15,38 +15,40 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects +package org.appdevforall.codeonthego.projects + +import com.itsaky.androidide.projects.R import androidx.annotation.RestrictTo import androidx.annotation.VisibleForTesting import com.google.auto.service.AutoService import com.google.common.collect.ImmutableList -import com.itsaky.androidide.app.BaseApplication -import com.itsaky.androidide.eventbus.events.EventReceiver -import com.itsaky.androidide.eventbus.events.editor.DocumentSaveEvent -import com.itsaky.androidide.eventbus.events.file.FileCreationEvent -import com.itsaky.androidide.eventbus.events.file.FileDeletionEvent -import com.itsaky.androidide.eventbus.events.file.FileEvent -import com.itsaky.androidide.eventbus.events.file.FileRenameEvent -import com.itsaky.androidide.eventbus.events.project.ProjectInitializedEvent -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.project.AndroidModels -import com.itsaky.androidide.project.GradleModels -import com.itsaky.androidide.projects.api.AndroidModule -import com.itsaky.androidide.projects.api.GradleProject -import com.itsaky.androidide.projects.api.JavaModule -import com.itsaky.androidide.projects.api.ModuleProject -import com.itsaky.androidide.projects.api.Workspace -import com.itsaky.androidide.projects.builder.BuildService -import com.itsaky.androidide.projects.models.resDirs -import com.itsaky.androidide.tasks.executeAsync -import com.itsaky.androidide.tooling.api.IAndroidProject -import com.itsaky.androidide.tooling.api.models.BuildVariantInfo -import com.itsaky.androidide.tooling.api.sync.ProjectSyncHelper -import com.itsaky.androidide.utils.DocumentUtils -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.flashError -import com.itsaky.androidide.utils.withStopWatch +import org.appdevforall.codeonthego.app.BaseApplication +import org.appdevforall.codeonthego.eventbus.events.EventReceiver +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentSaveEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileCreationEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileDeletionEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileRenameEvent +import org.appdevforall.codeonthego.eventbus.events.project.ProjectInitializedEvent +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.project.AndroidModels +import org.appdevforall.codeonthego.project.GradleModels +import org.appdevforall.codeonthego.projects.api.AndroidModule +import org.appdevforall.codeonthego.projects.api.GradleProject +import org.appdevforall.codeonthego.projects.api.JavaModule +import org.appdevforall.codeonthego.projects.api.ModuleProject +import org.appdevforall.codeonthego.projects.api.Workspace +import org.appdevforall.codeonthego.projects.builder.BuildService +import org.appdevforall.codeonthego.projects.models.resDirs +import org.appdevforall.codeonthego.tasks.executeAsync +import org.appdevforall.codeonthego.tooling.api.IAndroidProject +import org.appdevforall.codeonthego.tooling.api.models.BuildVariantInfo +import org.appdevforall.codeonthego.tooling.api.sync.ProjectSyncHelper +import org.appdevforall.codeonthego.utils.DocumentUtils +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.withStopWatch import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.async diff --git a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/api/AndroidModule.kt b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/api/AndroidModule.kt similarity index 93% rename from subprojects/projects/src/main/java/com/itsaky/androidide/projects/api/AndroidModule.kt rename to subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/api/AndroidModule.kt index a2c48ed5e3..55c54e81a6 100644 --- a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/api/AndroidModule.kt +++ b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/api/AndroidModule.kt @@ -15,34 +15,34 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects.api +package org.appdevforall.codeonthego.projects.api import com.android.SdkConstants import com.android.aaptcompiler.AaptResourceType import com.android.aaptcompiler.ResourceTable import com.google.protobuf.MessageLite -import com.itsaky.androidide.builder.model.UNKNOWN_PACKAGE -import com.itsaky.androidide.project.AndroidModels -import com.itsaky.androidide.project.GradleModels -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.models.artifact -import com.itsaky.androidide.projects.models.bootClassPaths -import com.itsaky.androidide.projects.models.buildDir -import com.itsaky.androidide.projects.models.classJars -import com.itsaky.androidide.projects.models.classesJar -import com.itsaky.androidide.projects.models.compileJarFiles -import com.itsaky.androidide.projects.models.generatedSourceFolders -import com.itsaky.androidide.projects.models.javaDirs -import com.itsaky.androidide.projects.models.kotlinDirs -import com.itsaky.androidide.projects.models.resDirs -import com.itsaky.androidide.projects.models.resFolder -import com.itsaky.androidide.tooling.api.util.findPackageName -import com.itsaky.androidide.utils.withStopWatch -import com.itsaky.androidide.xml.resources.ResourceTableRegistry -import com.itsaky.androidide.xml.versions.ApiVersions -import com.itsaky.androidide.xml.versions.ApiVersionsRegistry -import com.itsaky.androidide.xml.widgets.WidgetTable -import com.itsaky.androidide.xml.widgets.WidgetTableRegistry +import org.appdevforall.codeonthego.builder.model.UNKNOWN_PACKAGE +import org.appdevforall.codeonthego.project.AndroidModels +import org.appdevforall.codeonthego.project.GradleModels +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.models.artifact +import org.appdevforall.codeonthego.projects.models.bootClassPaths +import org.appdevforall.codeonthego.projects.models.buildDir +import org.appdevforall.codeonthego.projects.models.classJars +import org.appdevforall.codeonthego.projects.models.classesJar +import org.appdevforall.codeonthego.projects.models.compileJarFiles +import org.appdevforall.codeonthego.projects.models.generatedSourceFolders +import org.appdevforall.codeonthego.projects.models.javaDirs +import org.appdevforall.codeonthego.projects.models.kotlinDirs +import org.appdevforall.codeonthego.projects.models.resDirs +import org.appdevforall.codeonthego.projects.models.resFolder +import org.appdevforall.codeonthego.tooling.api.util.findPackageName +import org.appdevforall.codeonthego.utils.withStopWatch +import org.appdevforall.codeonthego.xml.resources.ResourceTableRegistry +import org.appdevforall.codeonthego.xml.versions.ApiVersions +import org.appdevforall.codeonthego.xml.versions.ApiVersionsRegistry +import org.appdevforall.codeonthego.xml.widgets.WidgetTable +import org.appdevforall.codeonthego.xml.widgets.WidgetTableRegistry import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers diff --git a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/api/GradleProject.kt b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/api/GradleProject.kt similarity index 89% rename from subprojects/projects/src/main/java/com/itsaky/androidide/projects/api/GradleProject.kt rename to subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/api/GradleProject.kt index f338274a3b..75a399da4b 100644 --- a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/api/GradleProject.kt +++ b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/api/GradleProject.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects.api +package org.appdevforall.codeonthego.projects.api -import com.itsaky.androidide.project.GradleModels +import org.appdevforall.codeonthego.project.GradleModels /** * A Gradle project model. diff --git a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/api/JavaModule.kt b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/api/JavaModule.kt similarity index 92% rename from subprojects/projects/src/main/java/com/itsaky/androidide/projects/api/JavaModule.kt rename to subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/api/JavaModule.kt index 556696ddf9..7fda2cd3b2 100644 --- a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/api/JavaModule.kt +++ b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/api/JavaModule.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects.api +package org.appdevforall.codeonthego.projects.api import com.google.protobuf.MessageLite -import com.itsaky.androidide.project.GradleModels -import com.itsaky.androidide.project.JavaModels -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.models.buildDir -import com.itsaky.androidide.projects.models.directory -import com.itsaky.androidide.projects.models.jarFile +import org.appdevforall.codeonthego.project.GradleModels +import org.appdevforall.codeonthego.project.JavaModels +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.models.buildDir +import org.appdevforall.codeonthego.projects.models.directory +import org.appdevforall.codeonthego.projects.models.jarFile import java.io.File /** diff --git a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/api/ModuleProject.kt b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/api/ModuleProject.kt similarity index 93% rename from subprojects/projects/src/main/java/com/itsaky/androidide/projects/api/ModuleProject.kt rename to subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/api/ModuleProject.kt index 775db620c0..6adc2ae5a8 100644 --- a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/api/ModuleProject.kt +++ b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/api/ModuleProject.kt @@ -15,23 +15,23 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects.api +package org.appdevforall.codeonthego.projects.api import android.text.TextUtils import androidx.annotation.RestrictTo -import com.itsaky.androidide.javac.services.fs.CacheFSInfoSingleton -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.project.Common -import com.itsaky.androidide.project.GradleModels -import com.itsaky.androidide.projects.classpath.JarFsClasspathReader -import com.itsaky.androidide.projects.models.DEFAULT_COMPILER_SETTINGS -import com.itsaky.androidide.projects.models.bootClassPaths -import com.itsaky.androidide.projects.util.BootClasspathProvider -import com.itsaky.androidide.utils.ClassTrie -import com.itsaky.androidide.utils.DocumentUtils -import com.itsaky.androidide.utils.SourceClassTrie -import com.itsaky.androidide.utils.SourceClassTrie.SourceNode -import com.itsaky.androidide.utils.StopWatch +import org.appdevforall.codeonthego.javac.services.fs.CacheFSInfoSingleton +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.project.Common +import org.appdevforall.codeonthego.project.GradleModels +import org.appdevforall.codeonthego.projects.classpath.JarFsClasspathReader +import org.appdevforall.codeonthego.projects.models.DEFAULT_COMPILER_SETTINGS +import org.appdevforall.codeonthego.projects.models.bootClassPaths +import org.appdevforall.codeonthego.projects.util.BootClasspathProvider +import org.appdevforall.codeonthego.utils.ClassTrie +import org.appdevforall.codeonthego.utils.DocumentUtils +import org.appdevforall.codeonthego.utils.SourceClassTrie +import org.appdevforall.codeonthego.utils.SourceClassTrie.SourceNode +import org.appdevforall.codeonthego.utils.StopWatch import org.slf4j.LoggerFactory import java.io.File import java.nio.file.Path diff --git a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/api/Workspace.kt b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/api/Workspace.kt similarity index 93% rename from subprojects/projects/src/main/java/com/itsaky/androidide/projects/api/Workspace.kt rename to subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/api/Workspace.kt index cdd9c6611d..809901cce0 100644 --- a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/api/Workspace.kt +++ b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/api/Workspace.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects.api +package org.appdevforall.codeonthego.projects.api -import com.itsaky.androidide.project.AndroidModels -import com.itsaky.androidide.project.GradleModels -import com.itsaky.androidide.projects.models.projectDir +import org.appdevforall.codeonthego.project.AndroidModels +import org.appdevforall.codeonthego.project.GradleModels +import org.appdevforall.codeonthego.projects.models.projectDir import java.io.File import java.nio.file.Path diff --git a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/builder/BuildService.kt b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/builder/BuildService.kt similarity index 82% rename from subprojects/projects/src/main/java/com/itsaky/androidide/projects/builder/BuildService.kt rename to subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/builder/BuildService.kt index d0c60f3305..70a3fc63a9 100644 --- a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/builder/BuildService.kt +++ b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/builder/BuildService.kt @@ -15,18 +15,18 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects.builder +package org.appdevforall.codeonthego.projects.builder -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.lookup.Lookup.Key -import com.itsaky.androidide.tooling.api.messages.BuildId -import com.itsaky.androidide.tooling.api.messages.BuildRunType -import com.itsaky.androidide.tooling.api.messages.InitializeProjectParams -import com.itsaky.androidide.tooling.api.messages.TaskExecutionMessage -import com.itsaky.androidide.tooling.api.messages.result.BuildCancellationRequestResult -import com.itsaky.androidide.tooling.api.messages.result.InitializeResult -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult -import com.itsaky.androidide.tooling.api.models.ToolingServerMetadata +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.lookup.Lookup.Key +import org.appdevforall.codeonthego.tooling.api.messages.BuildId +import org.appdevforall.codeonthego.tooling.api.messages.BuildRunType +import org.appdevforall.codeonthego.tooling.api.messages.InitializeProjectParams +import org.appdevforall.codeonthego.tooling.api.messages.TaskExecutionMessage +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildCancellationRequestResult +import org.appdevforall.codeonthego.tooling.api.messages.result.InitializeResult +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult +import org.appdevforall.codeonthego.tooling.api.models.ToolingServerMetadata import java.util.concurrent.CompletableFuture /** diff --git a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/classpath/ClassInfo.kt b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/classpath/ClassInfo.kt similarity index 97% rename from subprojects/projects/src/main/java/com/itsaky/androidide/projects/classpath/ClassInfo.kt rename to subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/classpath/ClassInfo.kt index a1e94303b7..e352b7b7dc 100644 --- a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/classpath/ClassInfo.kt +++ b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/classpath/ClassInfo.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects.classpath +package org.appdevforall.codeonthego.projects.classpath /** * Information about a class in a JAR file. diff --git a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/classpath/IClasspathReader.kt b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/classpath/IClasspathReader.kt similarity index 94% rename from subprojects/projects/src/main/java/com/itsaky/androidide/projects/classpath/IClasspathReader.kt rename to subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/classpath/IClasspathReader.kt index 1701821574..f4ddff52e8 100644 --- a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/classpath/IClasspathReader.kt +++ b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/classpath/IClasspathReader.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects.classpath +package org.appdevforall.codeonthego.projects.classpath import com.google.common.collect.ImmutableSet import java.io.File diff --git a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/classpath/JarFsClasspathReader.kt b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/classpath/JarFsClasspathReader.kt similarity index 95% rename from subprojects/projects/src/main/java/com/itsaky/androidide/projects/classpath/JarFsClasspathReader.kt rename to subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/classpath/JarFsClasspathReader.kt index f203c2d97d..3e225fe16c 100644 --- a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/classpath/JarFsClasspathReader.kt +++ b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/classpath/JarFsClasspathReader.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects.classpath +package org.appdevforall.codeonthego.projects.classpath import com.google.common.collect.ImmutableSet -import com.itsaky.androidide.javac.services.fs.CachedJarFileSystem -import com.itsaky.androidide.javac.services.fs.CachingJarFileSystemProvider +import org.appdevforall.codeonthego.javac.services.fs.CachedJarFileSystem +import org.appdevforall.codeonthego.javac.services.fs.CachingJarFileSystemProvider import org.slf4j.LoggerFactory import java.io.File import java.io.IOException diff --git a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/classpath/ZipFileClasspathReader.kt b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/classpath/ZipFileClasspathReader.kt similarity index 96% rename from subprojects/projects/src/main/java/com/itsaky/androidide/projects/classpath/ZipFileClasspathReader.kt rename to subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/classpath/ZipFileClasspathReader.kt index 3847308c02..936423af80 100644 --- a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/classpath/ZipFileClasspathReader.kt +++ b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/classpath/ZipFileClasspathReader.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects.classpath +package org.appdevforall.codeonthego.projects.classpath import com.google.common.collect.ImmutableSet import java.io.File diff --git a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/models/ActiveDocument.kt b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/models/ActiveDocument.kt similarity index 98% rename from subprojects/projects/src/main/java/com/itsaky/androidide/projects/models/ActiveDocument.kt rename to subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/models/ActiveDocument.kt index 09b28ce6f6..eb29b123db 100644 --- a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/models/ActiveDocument.kt +++ b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/models/ActiveDocument.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects.models +package org.appdevforall.codeonthego.projects.models import java.io.BufferedInputStream import java.io.BufferedReader diff --git a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/models/ActiveJavaDocument.kt b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/models/ActiveJavaDocument.kt similarity index 90% rename from subprojects/projects/src/main/java/com/itsaky/androidide/projects/models/ActiveJavaDocument.kt rename to subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/models/ActiveJavaDocument.kt index 02e4f4bfd0..8595a1fda4 100644 --- a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/models/ActiveJavaDocument.kt +++ b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/models/ActiveJavaDocument.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects.models +package org.appdevforall.codeonthego.projects.models -import com.itsaky.androidide.projects.util.StringSearch +import org.appdevforall.codeonthego.projects.util.StringSearch import java.nio.file.Path import java.time.Instant diff --git a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/util/BootClasspathProvider.java b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/util/BootClasspathProvider.java similarity index 94% rename from subprojects/projects/src/main/java/com/itsaky/androidide/projects/util/BootClasspathProvider.java rename to subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/util/BootClasspathProvider.java index 3203decfa9..5b31cb792e 100644 --- a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/util/BootClasspathProvider.java +++ b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/util/BootClasspathProvider.java @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects.util; +package org.appdevforall.codeonthego.projects.util; -import com.itsaky.androidide.projects.classpath.JarFsClasspathReader; -import com.itsaky.androidide.utils.ClassTrie; -import com.itsaky.androidide.utils.StopWatch; +import org.appdevforall.codeonthego.projects.classpath.JarFsClasspathReader; +import org.appdevforall.codeonthego.utils.ClassTrie; +import org.appdevforall.codeonthego.utils.StopWatch; import java.io.File; import java.util.Collection; import java.util.Collections; diff --git a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/util/StringSearch.java b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/util/StringSearch.java similarity index 95% rename from subprojects/projects/src/main/java/com/itsaky/androidide/projects/util/StringSearch.java rename to subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/util/StringSearch.java index 63cd643a94..d26b032a8a 100644 --- a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/util/StringSearch.java +++ b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/util/StringSearch.java @@ -1,455 +1,455 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.projects.util; - -import androidx.annotation.Nullable; -import com.itsaky.androidide.projects.FileManager; -import com.itsaky.androidide.projects.models.ActiveJavaDocument; -import com.itsaky.androidide.utils.Cache; -import java.io.BufferedReader; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.StringReader; -import java.net.URI; -import java.nio.ByteBuffer; -import java.nio.CharBuffer; -import java.nio.channels.FileChannel; -import java.nio.charset.StandardCharsets; -import java.nio.file.NoSuchFileException; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Objects; -import java.util.logging.Logger; -import java.util.regex.Pattern; - -// Translated from https://golang.org/src/strings/search.go - -// Search efficiently finds strings in a source text. It's implemented -// using the Boyer-Moore string search algorithm: -// https://en.wikipedia.org/wiki/Boyer-Moore_string_search_algorithm -// https://www.cs.utexas.edu/~moore/publications/fstrpos.pdf (note: this aged -// document uses 1-based indexing) -public class StringSearch { - private static final ByteBuffer SEARCH_BUFFER = ByteBuffer.allocateDirect(1024 * 1024); - private static final Logger LOG = Logger.getLogger("main"); - private static final Cache cacheContainsClass = new Cache<>(); - private static final Cache cacheContainsInterface = new Cache<>(); - // pattern is the string that we are searching for in the text. - private final byte[] pattern; - // badCharSkip[b] contains the distance between the last byte of pattern - // and the rightmost occurrence of b in pattern. If b is not in pattern, - // badCharSkip[b] is len(pattern). - // - // Whenever a mismatch is found with byte b in the text, we can safely - // shift the matching frame at least badCharSkip[b] until the next time - // the matching char could be in alignment. - // TODO 256 is not coloring - private final int[] badCharSkip = new int[256]; - // goodSuffixSkip[i] defines how far we can shift the matching frame given - // that the suffix pattern[i+1:] matches, but the byte pattern[i] does - // not. There are two cases to consider: - // - // 1. The matched suffix occurs elsewhere in pattern (with a different - // byte preceding it that we might possibly match). In this case, we can - // shift the matching frame to align with the next suffix chunk. For - // example, the pattern "mississi" has the suffix "issi" next occurring - // (in right-to-left order) at index 1, so goodSuffixSkip[3] == - // shift+len(suffix) == 3+4 == 7. - // - // 2. If the matched suffix does not occur elsewhere in pattern, then the - // matching frame may share part of its prefix with the end of the - // matching suffix. In this case, goodSuffixSkip[i] will contain how far - // to shift the frame to align this portion of the prefix to the - // suffix. For example, in the pattern "abcxxxabc", when the first - // mismatch from the back is found to be in position 3, the matching - // suffix "xxabc" is not found elsewhere in the pattern. However, its - // rightmost "abc" (at position 6) is a prefix of the whole pattern, so - // goodSuffixSkip[3] == shift+len(suffix) == 6+5 == 11. - private final int[] goodSuffixSkip; - - public StringSearch(String patternSting) { - this.pattern = patternSting.getBytes(); - this.goodSuffixSkip = new int[pattern.length]; - - // last is the index of the last character in the pattern. - int last = pattern.length - 1; - - // Build bad character table. - // Bytes not in the pattern can skip one pattern's length. - Arrays.fill(badCharSkip, pattern.length); - // The loop condition is < instead of <= so that the last byte does not - // have a zero distance to itself. Finding this byte out of place implies - // that it is not in the last position. - for (int i = 0; i < last; i++) { - badCharSkip[pattern[i] + 128] = last - i; - } - - // Build good suffix table. - // First pass: set each value to the next index which starts a prefix of - // pattern. - int lastPrefix = last; - for (int i = last; i >= 0; i--) { - if (hasPrefix(pattern, new Slice(pattern, i + 1))) lastPrefix = i + 1; - // lastPrefix is the shift, and (last-i) is len(suffix). - goodSuffixSkip[i] = lastPrefix + last - i; - } - // Second pass: find repeats of pattern's suffix starting from the front. - for (int i = 0; i < last; i++) { - int lenSuffix = longestCommonSuffix(pattern, new Slice(pattern, 1, i + 1)); - if (pattern[i - lenSuffix] != pattern[last - lenSuffix]) { - // (last-i) is the shift, and lenSuffix is len(suffix). - goodSuffixSkip[last - lenSuffix] = lenSuffix + last - i; - } - } - } - - private boolean hasPrefix(byte[] s, Slice prefix) { - for (int i = 0; i < prefix.length(); i++) { - if (s[i] != prefix.get(i)) return false; - } - return true; - } - - private int longestCommonSuffix(byte[] a, Slice b) { - int i = 0; - for (; i < a.length && i < b.length(); i++) { - if (a[a.length - 1 - i] != b.get(b.length() - 1 - i)) { - break; - } - } - return i; - } - - // TODO cache the progress made by searching shorter queries - public static boolean containsWordMatching(Path java, String query) { - String text = tryGetActiveDocContent(java); - if (text != null) { - return matchesTitleCase(text, query); - } - try (FileChannel channel = FileChannel.open(java)) { - // Read up to 1 MB of data from file - int limit = Math.min((int) channel.size(), SEARCH_BUFFER.capacity()); - SEARCH_BUFFER.position(0); - SEARCH_BUFFER.limit(limit); - channel.read(SEARCH_BUFFER); - SEARCH_BUFFER.position(0); - CharBuffer chars = StandardCharsets.UTF_8.decode(SEARCH_BUFFER); - return matchesTitleCase(chars, query); - } catch (NoSuchFileException e) { - LOG.warning(e.getMessage()); - return false; - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - @Nullable - private static String tryGetActiveDocContent(Path file) { - final var doc = FileManager.INSTANCE.getActiveDocument(file); - if (doc != null) { - return doc.getContent(); - } - - return null; - } - - /** - * Check if `candidate` contains all the characters of `find`, in-order, case-insensitive. Matches - * can be discontinuous if the letters of `find` match the first letters of words in `candidate` - * For example, fb matches FooBar, but it doesn't match Foobar (exposed for testing) - */ - public static boolean matchesTitleCase(CharSequence candidate, String find) { - Objects.requireNonNull(candidate, "candidate is null"); - int i = 0; - - tokenLoop: - while (i < candidate.length()) { - i = startOfToken(candidate, i); - - for (char f : find.toCharArray()) { - // If we have reached the end of candidate without matching all of find, fail - if (i >= candidate.length()) return false; - // If the next character in candidate matches, advance i - else if (Character.toLowerCase(f) == Character.toLowerCase(candidate.charAt(i))) i++; - else { - // Find the start of the next word - while (i < candidate.length()) { - char c = candidate.charAt(i); - // If the next character is not a word, try again with the next token - if (!isWordChar(c)) continue tokenLoop; - // TODO match things like fb ~ foo_bar - boolean isStartOfWord = Character.isUpperCase(c); - boolean isMatch = Character.toLowerCase(f) == Character.toLowerCase(c); - if (isStartOfWord && isMatch) { - i++; - break; - } else i++; - } - if (i >= candidate.length()) return false; - } - } - // All of find was matched! - return true; - } - return false; - } - - private static int startOfToken(CharSequence candidate, int offset) { - while (offset < candidate.length()) { - char c = candidate.charAt(offset); - if (isWordChar(c)) break; - offset++; - } - return offset; - } - - private static boolean isWordChar(char c) { - return Character.isAlphabetic(c) || Character.isDigit(c) || c == '_' || c == '$'; - } - - public static boolean containsWord(Path java, String query) { - StringSearch search = new StringSearch(query); - String text = tryGetActiveDocContent(java); - if (text != null) { - return search.nextWord(text.getBytes()) != -1; - } - try (FileChannel channel = FileChannel.open(java)) { - // Read up to 1 MB of data from file - int limit = Math.min((int) channel.size(), SEARCH_BUFFER.capacity()); - SEARCH_BUFFER.position(0); - SEARCH_BUFFER.limit(limit); - channel.read(SEARCH_BUFFER); - SEARCH_BUFFER.position(0); - return search.nextWord(SEARCH_BUFFER) != -1; - } catch (NoSuchFileException e) { - LOG.warning(e.getMessage()); - return false; - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public static boolean containsClass(Path file, String simpleName) { - if (cacheContainsClass.needs(file, simpleName)) { - cacheContainsClass.load(file, simpleName, containsString(file, "class " + simpleName)); - // TODO verify this by actually parsing the file - } - return cacheContainsClass.get(file, simpleName); - } - - public static boolean containsInterface(Path file, String simpleName) { - if (cacheContainsInterface.needs(file, simpleName)) { - cacheContainsInterface.load( - file, simpleName, containsString(file, "interface " + simpleName)); - // TODO verify this by actually parsing the file - } - return cacheContainsInterface.get(file, simpleName); - } - - // TODO this doesn't work for inner classes, eliminate - public static String mostName(String name) { - int lastDot = name.lastIndexOf('.'); - return lastDot == -1 ? "" : name.substring(0, lastDot); - } - - // TODO this doesn't work for inner classes, eliminate - public static String lastName(String name) { - int i = name.lastIndexOf('.'); - if (i == -1) return name; - else return name.substring(i + 1); - } - - public static String fileName(URI uri) { - String[] parts = uri.toString().split("/"); - if (parts.length == 0) return ""; - return parts[parts.length - 1]; - } - - public static String packageName(Path file) { - final var doc = FileManager.INSTANCE.getActiveDocument(file); - if (doc instanceof ActiveJavaDocument) { - return ((ActiveJavaDocument) doc).getPackageName(); - } - - return packageName(createIOReader(file)); - } - - private static BufferedReader createIOReader(final Path file) { - try { - return new BufferedReader(new InputStreamReader(new FileInputStream(file.toFile()))); - } catch (Throwable err) { - return new BufferedReader(new StringReader("")); - } - } - - public static String packageName(final BufferedReader reader) { - try (reader) { - final var packagePattern = Pattern.compile("^package +(.*);"); - final var startOfClass = Pattern.compile("^[\\w ]*class +\\w+"); - for (var line = reader.readLine(); line != null; line = reader.readLine()) { - if (startOfClass.matcher(line).find()) { - return ""; - } - - final var matchPackage = packagePattern.matcher(line); - if (matchPackage.matches()) { - return matchPackage.group(1); - } - } - } catch (IOException e) { - throw new RuntimeException(e); - } - - // TODO fall back on parsing file - return ""; - } - - public static boolean matchesPartialName(CharSequence candidate, CharSequence partialName) { - if (candidate.length() < partialName.length()) return false; - for (int i = 0; i < partialName.length(); i++) { - if (candidate.charAt(i) != partialName.charAt(i)) return false; - } - return true; - } - - /** Convert from line/column (1-based) to offset (0-based) */ - public static int offset(String contents, int line, int column) { - line--; - column--; - int cursor = 0; - while (line > 0) { - if (contents.charAt(cursor) == '\n') { - line--; - } - cursor++; - } - return cursor + column; - } - - private static boolean containsString(Path java, String query) { - StringSearch search = new StringSearch(query); - String text = tryGetActiveDocContent(java); - if (text != null) { - return search.next(text.getBytes()) != -1; - } - try (FileChannel channel = FileChannel.open(java)) { - // Read up to 1 MB of data from file - int limit = Math.min((int) channel.size(), SEARCH_BUFFER.capacity()); - SEARCH_BUFFER.position(0); - SEARCH_BUFFER.limit(limit); - channel.read(SEARCH_BUFFER); - SEARCH_BUFFER.position(0); - return search.next(SEARCH_BUFFER) != -1; - } catch (NoSuchFileException e) { - LOG.warning(e.getMessage()); - return false; - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public int next(String text) { - return next(text.getBytes()); - } - - private int next(byte[] text) { - return next(ByteBuffer.wrap(text)); - } - - private int next(ByteBuffer text) { - return next(text, 0); - } - - private int next(ByteBuffer text, int startingAfter) { - int i = startingAfter + pattern.length - 1; - while (i < text.limit()) { - // Compare backwards from the end until the first unmatching character. - int j = pattern.length - 1; - while (j >= 0 && text.get(i) == pattern[j]) { - i--; - j--; - } - if (j < 0) { - return i + 1; // match - } - i += Math.max(badCharSkip[text.get(i) + 128], goodSuffixSkip[j]); - } - return -1; - } - - public int nextWord(String text) { - return nextWord(text.getBytes()); - } - - private int nextWord(byte[] text) { - return nextWord(ByteBuffer.wrap(text)); - } - - private int nextWord(ByteBuffer text) { - int i = 0; - while (true) { - i = next(text, i); - if (i == -1) return -1; - if (isWord(text, i)) return i; - i++; - } - } - - private boolean isWord(ByteBuffer text, int offset) { - return startsWord(text, offset) && endsWord(text, offset + pattern.length - 1); - } - - private boolean startsWord(ByteBuffer text, int offset) { - if (offset == 0) return true; - return !isWordChar(text.get(offset - 1)); - } - - private boolean isWordChar(byte b) { - char c = (char) (b + 128); - return Character.isAlphabetic(c) || Character.isDigit(c) || c == '$' || c == '_'; - } - - private boolean endsWord(ByteBuffer text, int offset) { - if (offset + 1 >= text.limit()) return true; - return !isWordChar(text.get(offset + 1)); - } - - private static class Slice { - private final byte[] target; - private int from, until; - - Slice(byte[] target, int from) { - this(target, from, target.length); - } - - Slice(byte[] target, int from, int until) { - this.target = target; - this.from = from; - this.until = until; - } - - int length() { - return until - from; - } - - byte get(int i) { - return target[from + i]; - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.projects.util; + +import androidx.annotation.Nullable; +import org.appdevforall.codeonthego.projects.FileManager; +import org.appdevforall.codeonthego.projects.models.ActiveJavaDocument; +import org.appdevforall.codeonthego.utils.Cache; +import java.io.BufferedReader; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.StringReader; +import java.net.URI; +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.channels.FileChannel; +import java.nio.charset.StandardCharsets; +import java.nio.file.NoSuchFileException; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Objects; +import java.util.logging.Logger; +import java.util.regex.Pattern; + +// Translated from https://golang.org/src/strings/search.go + +// Search efficiently finds strings in a source text. It's implemented +// using the Boyer-Moore string search algorithm: +// https://en.wikipedia.org/wiki/Boyer-Moore_string_search_algorithm +// https://www.cs.utexas.edu/~moore/publications/fstrpos.pdf (note: this aged +// document uses 1-based indexing) +public class StringSearch { + private static final ByteBuffer SEARCH_BUFFER = ByteBuffer.allocateDirect(1024 * 1024); + private static final Logger LOG = Logger.getLogger("main"); + private static final Cache cacheContainsClass = new Cache<>(); + private static final Cache cacheContainsInterface = new Cache<>(); + // pattern is the string that we are searching for in the text. + private final byte[] pattern; + // badCharSkip[b] contains the distance between the last byte of pattern + // and the rightmost occurrence of b in pattern. If b is not in pattern, + // badCharSkip[b] is len(pattern). + // + // Whenever a mismatch is found with byte b in the text, we can safely + // shift the matching frame at least badCharSkip[b] until the next time + // the matching char could be in alignment. + // TODO 256 is not coloring + private final int[] badCharSkip = new int[256]; + // goodSuffixSkip[i] defines how far we can shift the matching frame given + // that the suffix pattern[i+1:] matches, but the byte pattern[i] does + // not. There are two cases to consider: + // + // 1. The matched suffix occurs elsewhere in pattern (with a different + // byte preceding it that we might possibly match). In this case, we can + // shift the matching frame to align with the next suffix chunk. For + // example, the pattern "mississi" has the suffix "issi" next occurring + // (in right-to-left order) at index 1, so goodSuffixSkip[3] == + // shift+len(suffix) == 3+4 == 7. + // + // 2. If the matched suffix does not occur elsewhere in pattern, then the + // matching frame may share part of its prefix with the end of the + // matching suffix. In this case, goodSuffixSkip[i] will contain how far + // to shift the frame to align this portion of the prefix to the + // suffix. For example, in the pattern "abcxxxabc", when the first + // mismatch from the back is found to be in position 3, the matching + // suffix "xxabc" is not found elsewhere in the pattern. However, its + // rightmost "abc" (at position 6) is a prefix of the whole pattern, so + // goodSuffixSkip[3] == shift+len(suffix) == 6+5 == 11. + private final int[] goodSuffixSkip; + + public StringSearch(String patternSting) { + this.pattern = patternSting.getBytes(); + this.goodSuffixSkip = new int[pattern.length]; + + // last is the index of the last character in the pattern. + int last = pattern.length - 1; + + // Build bad character table. + // Bytes not in the pattern can skip one pattern's length. + Arrays.fill(badCharSkip, pattern.length); + // The loop condition is < instead of <= so that the last byte does not + // have a zero distance to itself. Finding this byte out of place implies + // that it is not in the last position. + for (int i = 0; i < last; i++) { + badCharSkip[pattern[i] + 128] = last - i; + } + + // Build good suffix table. + // First pass: set each value to the next index which starts a prefix of + // pattern. + int lastPrefix = last; + for (int i = last; i >= 0; i--) { + if (hasPrefix(pattern, new Slice(pattern, i + 1))) lastPrefix = i + 1; + // lastPrefix is the shift, and (last-i) is len(suffix). + goodSuffixSkip[i] = lastPrefix + last - i; + } + // Second pass: find repeats of pattern's suffix starting from the front. + for (int i = 0; i < last; i++) { + int lenSuffix = longestCommonSuffix(pattern, new Slice(pattern, 1, i + 1)); + if (pattern[i - lenSuffix] != pattern[last - lenSuffix]) { + // (last-i) is the shift, and lenSuffix is len(suffix). + goodSuffixSkip[last - lenSuffix] = lenSuffix + last - i; + } + } + } + + private boolean hasPrefix(byte[] s, Slice prefix) { + for (int i = 0; i < prefix.length(); i++) { + if (s[i] != prefix.get(i)) return false; + } + return true; + } + + private int longestCommonSuffix(byte[] a, Slice b) { + int i = 0; + for (; i < a.length && i < b.length(); i++) { + if (a[a.length - 1 - i] != b.get(b.length() - 1 - i)) { + break; + } + } + return i; + } + + // TODO cache the progress made by searching shorter queries + public static boolean containsWordMatching(Path java, String query) { + String text = tryGetActiveDocContent(java); + if (text != null) { + return matchesTitleCase(text, query); + } + try (FileChannel channel = FileChannel.open(java)) { + // Read up to 1 MB of data from file + int limit = Math.min((int) channel.size(), SEARCH_BUFFER.capacity()); + SEARCH_BUFFER.position(0); + SEARCH_BUFFER.limit(limit); + channel.read(SEARCH_BUFFER); + SEARCH_BUFFER.position(0); + CharBuffer chars = StandardCharsets.UTF_8.decode(SEARCH_BUFFER); + return matchesTitleCase(chars, query); + } catch (NoSuchFileException e) { + LOG.warning(e.getMessage()); + return false; + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @Nullable + private static String tryGetActiveDocContent(Path file) { + final var doc = FileManager.INSTANCE.getActiveDocument(file); + if (doc != null) { + return doc.getContent(); + } + + return null; + } + + /** + * Check if `candidate` contains all the characters of `find`, in-order, case-insensitive. Matches + * can be discontinuous if the letters of `find` match the first letters of words in `candidate` + * For example, fb matches FooBar, but it doesn't match Foobar (exposed for testing) + */ + public static boolean matchesTitleCase(CharSequence candidate, String find) { + Objects.requireNonNull(candidate, "candidate is null"); + int i = 0; + + tokenLoop: + while (i < candidate.length()) { + i = startOfToken(candidate, i); + + for (char f : find.toCharArray()) { + // If we have reached the end of candidate without matching all of find, fail + if (i >= candidate.length()) return false; + // If the next character in candidate matches, advance i + else if (Character.toLowerCase(f) == Character.toLowerCase(candidate.charAt(i))) i++; + else { + // Find the start of the next word + while (i < candidate.length()) { + char c = candidate.charAt(i); + // If the next character is not a word, try again with the next token + if (!isWordChar(c)) continue tokenLoop; + // TODO match things like fb ~ foo_bar + boolean isStartOfWord = Character.isUpperCase(c); + boolean isMatch = Character.toLowerCase(f) == Character.toLowerCase(c); + if (isStartOfWord && isMatch) { + i++; + break; + } else i++; + } + if (i >= candidate.length()) return false; + } + } + // All of find was matched! + return true; + } + return false; + } + + private static int startOfToken(CharSequence candidate, int offset) { + while (offset < candidate.length()) { + char c = candidate.charAt(offset); + if (isWordChar(c)) break; + offset++; + } + return offset; + } + + private static boolean isWordChar(char c) { + return Character.isAlphabetic(c) || Character.isDigit(c) || c == '_' || c == '$'; + } + + public static boolean containsWord(Path java, String query) { + StringSearch search = new StringSearch(query); + String text = tryGetActiveDocContent(java); + if (text != null) { + return search.nextWord(text.getBytes()) != -1; + } + try (FileChannel channel = FileChannel.open(java)) { + // Read up to 1 MB of data from file + int limit = Math.min((int) channel.size(), SEARCH_BUFFER.capacity()); + SEARCH_BUFFER.position(0); + SEARCH_BUFFER.limit(limit); + channel.read(SEARCH_BUFFER); + SEARCH_BUFFER.position(0); + return search.nextWord(SEARCH_BUFFER) != -1; + } catch (NoSuchFileException e) { + LOG.warning(e.getMessage()); + return false; + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + public static boolean containsClass(Path file, String simpleName) { + if (cacheContainsClass.needs(file, simpleName)) { + cacheContainsClass.load(file, simpleName, containsString(file, "class " + simpleName)); + // TODO verify this by actually parsing the file + } + return cacheContainsClass.get(file, simpleName); + } + + public static boolean containsInterface(Path file, String simpleName) { + if (cacheContainsInterface.needs(file, simpleName)) { + cacheContainsInterface.load( + file, simpleName, containsString(file, "interface " + simpleName)); + // TODO verify this by actually parsing the file + } + return cacheContainsInterface.get(file, simpleName); + } + + // TODO this doesn't work for inner classes, eliminate + public static String mostName(String name) { + int lastDot = name.lastIndexOf('.'); + return lastDot == -1 ? "" : name.substring(0, lastDot); + } + + // TODO this doesn't work for inner classes, eliminate + public static String lastName(String name) { + int i = name.lastIndexOf('.'); + if (i == -1) return name; + else return name.substring(i + 1); + } + + public static String fileName(URI uri) { + String[] parts = uri.toString().split("/"); + if (parts.length == 0) return ""; + return parts[parts.length - 1]; + } + + public static String packageName(Path file) { + final var doc = FileManager.INSTANCE.getActiveDocument(file); + if (doc instanceof ActiveJavaDocument) { + return ((ActiveJavaDocument) doc).getPackageName(); + } + + return packageName(createIOReader(file)); + } + + private static BufferedReader createIOReader(final Path file) { + try { + return new BufferedReader(new InputStreamReader(new FileInputStream(file.toFile()))); + } catch (Throwable err) { + return new BufferedReader(new StringReader("")); + } + } + + public static String packageName(final BufferedReader reader) { + try (reader) { + final var packagePattern = Pattern.compile("^package +(.*);"); + final var startOfClass = Pattern.compile("^[\\w ]*class +\\w+"); + for (var line = reader.readLine(); line != null; line = reader.readLine()) { + if (startOfClass.matcher(line).find()) { + return ""; + } + + final var matchPackage = packagePattern.matcher(line); + if (matchPackage.matches()) { + return matchPackage.group(1); + } + } + } catch (IOException e) { + throw new RuntimeException(e); + } + + // TODO fall back on parsing file + return ""; + } + + public static boolean matchesPartialName(CharSequence candidate, CharSequence partialName) { + if (candidate.length() < partialName.length()) return false; + for (int i = 0; i < partialName.length(); i++) { + if (candidate.charAt(i) != partialName.charAt(i)) return false; + } + return true; + } + + /** Convert from line/column (1-based) to offset (0-based) */ + public static int offset(String contents, int line, int column) { + line--; + column--; + int cursor = 0; + while (line > 0) { + if (contents.charAt(cursor) == '\n') { + line--; + } + cursor++; + } + return cursor + column; + } + + private static boolean containsString(Path java, String query) { + StringSearch search = new StringSearch(query); + String text = tryGetActiveDocContent(java); + if (text != null) { + return search.next(text.getBytes()) != -1; + } + try (FileChannel channel = FileChannel.open(java)) { + // Read up to 1 MB of data from file + int limit = Math.min((int) channel.size(), SEARCH_BUFFER.capacity()); + SEARCH_BUFFER.position(0); + SEARCH_BUFFER.limit(limit); + channel.read(SEARCH_BUFFER); + SEARCH_BUFFER.position(0); + return search.next(SEARCH_BUFFER) != -1; + } catch (NoSuchFileException e) { + LOG.warning(e.getMessage()); + return false; + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + public int next(String text) { + return next(text.getBytes()); + } + + private int next(byte[] text) { + return next(ByteBuffer.wrap(text)); + } + + private int next(ByteBuffer text) { + return next(text, 0); + } + + private int next(ByteBuffer text, int startingAfter) { + int i = startingAfter + pattern.length - 1; + while (i < text.limit()) { + // Compare backwards from the end until the first unmatching character. + int j = pattern.length - 1; + while (j >= 0 && text.get(i) == pattern[j]) { + i--; + j--; + } + if (j < 0) { + return i + 1; // match + } + i += Math.max(badCharSkip[text.get(i) + 128], goodSuffixSkip[j]); + } + return -1; + } + + public int nextWord(String text) { + return nextWord(text.getBytes()); + } + + private int nextWord(byte[] text) { + return nextWord(ByteBuffer.wrap(text)); + } + + private int nextWord(ByteBuffer text) { + int i = 0; + while (true) { + i = next(text, i); + if (i == -1) return -1; + if (isWord(text, i)) return i; + i++; + } + } + + private boolean isWord(ByteBuffer text, int offset) { + return startsWord(text, offset) && endsWord(text, offset + pattern.length - 1); + } + + private boolean startsWord(ByteBuffer text, int offset) { + if (offset == 0) return true; + return !isWordChar(text.get(offset - 1)); + } + + private boolean isWordChar(byte b) { + char c = (char) (b + 128); + return Character.isAlphabetic(c) || Character.isDigit(c) || c == '$' || c == '_'; + } + + private boolean endsWord(ByteBuffer text, int offset) { + if (offset + 1 >= text.limit()) return true; + return !isWordChar(text.get(offset + 1)); + } + + private static class Slice { + private final byte[] target; + private int from, until; + + Slice(byte[] target, int from) { + this(target, from, target.length); + } + + Slice(byte[] target, int from, int until) { + this.target = target; + this.from = from; + this.until = until; + } + + int length() { + return until - from; + } + + byte get(int i) { + return target[from + i]; + } + } +} diff --git a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/util/projects.kt b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/util/projects.kt similarity index 84% rename from subprojects/projects/src/main/java/com/itsaky/androidide/projects/util/projects.kt rename to subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/util/projects.kt index 8101d1c4a9..bedc28cb3c 100644 --- a/subprojects/projects/src/main/java/com/itsaky/androidide/projects/util/projects.kt +++ b/subprojects/projects/src/main/java/org/appdevforall/codeonthego/projects/util/projects.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects.util +package org.appdevforall.codeonthego.projects.util import androidx.annotation.RestrictTo -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.api.AndroidModule +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.api.AndroidModule /** * **For testing purposes only!** diff --git a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/ActiveDocumentVersionTest.kt b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/ActiveDocumentVersionTest.kt similarity index 75% rename from subprojects/projects/src/test/java/com/itsaky/androidide/projects/ActiveDocumentVersionTest.kt rename to subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/ActiveDocumentVersionTest.kt index b6efed4f33..1567e0ef6f 100644 --- a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/ActiveDocumentVersionTest.kt +++ b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/ActiveDocumentVersionTest.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.projects +package org.appdevforall.codeonthego.projects import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.eventbus.events.editor.ChangeType -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentCloseEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentOpenEvent -import com.itsaky.androidide.models.Range +import org.appdevforall.codeonthego.eventbus.events.editor.ChangeType +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentCloseEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentOpenEvent +import org.appdevforall.codeonthego.models.Range import org.junit.After import org.junit.Test import java.nio.file.Paths diff --git a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/ProjectManagerImplGenerateSourcesTest.kt b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/ProjectManagerImplGenerateSourcesTest.kt similarity index 87% rename from subprojects/projects/src/test/java/com/itsaky/androidide/projects/ProjectManagerImplGenerateSourcesTest.kt rename to subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/ProjectManagerImplGenerateSourcesTest.kt index 748a04e935..bacb5f1cd4 100644 --- a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/ProjectManagerImplGenerateSourcesTest.kt +++ b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/ProjectManagerImplGenerateSourcesTest.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.projects +package org.appdevforall.codeonthego.projects import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.projects.builder.BuildService -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult -import com.itsaky.androidide.utils.flashError +import org.appdevforall.codeonthego.projects.builder.BuildService +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult +import org.appdevforall.codeonthego.utils.flashError import io.mockk.every import io.mockk.justRun import io.mockk.mockk @@ -32,13 +32,13 @@ class ProjectManagerImplGenerateSourcesTest { fun setUp() { // The server-down branch flashes an error bar; there is no foreground activity in // this test, so stub the top-level flashError out. - mockkStatic("com.itsaky.androidide.utils.FlashbarUtilsKt") + mockkStatic("org.appdevforall.codeonthego.utils.FlashbarUtilsKt") justRun { flashError(any()) } } @After fun tearDown() { - unmockkStatic("com.itsaky.androidide.utils.FlashbarUtilsKt") + unmockkStatic("org.appdevforall.codeonthego.utils.FlashbarUtilsKt") } @Test diff --git a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/ProjectManagerImplResourceChangeTest.kt b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/ProjectManagerImplResourceChangeTest.kt similarity index 91% rename from subprojects/projects/src/test/java/com/itsaky/androidide/projects/ProjectManagerImplResourceChangeTest.kt rename to subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/ProjectManagerImplResourceChangeTest.kt index c01cc0b7f6..7638bd5570 100644 --- a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/ProjectManagerImplResourceChangeTest.kt +++ b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/ProjectManagerImplResourceChangeTest.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.projects +package org.appdevforall.codeonthego.projects import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.eventbus.events.file.FileCreationEvent -import com.itsaky.androidide.eventbus.events.file.FileDeletionEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileCreationEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileDeletionEvent import io.mockk.every import io.mockk.spyk import io.mockk.verify diff --git a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/ProjectManagerImplUninitializedPathTest.kt b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/ProjectManagerImplUninitializedPathTest.kt similarity index 98% rename from subprojects/projects/src/test/java/com/itsaky/androidide/projects/ProjectManagerImplUninitializedPathTest.kt rename to subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/ProjectManagerImplUninitializedPathTest.kt index fef173bc04..95ad572a36 100644 --- a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/ProjectManagerImplUninitializedPathTest.kt +++ b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/ProjectManagerImplUninitializedPathTest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects +package org.appdevforall.codeonthego.projects import com.google.common.truth.Truth.assertThat import org.junit.Test diff --git a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/api/AndroidModuleIntermediateClasspathsTest.kt b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/api/AndroidModuleIntermediateClasspathsTest.kt similarity index 94% rename from subprojects/projects/src/test/java/com/itsaky/androidide/projects/api/AndroidModuleIntermediateClasspathsTest.kt rename to subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/api/AndroidModuleIntermediateClasspathsTest.kt index 9a5faf9dcd..abd54a6644 100644 --- a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/api/AndroidModuleIntermediateClasspathsTest.kt +++ b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/api/AndroidModuleIntermediateClasspathsTest.kt @@ -1,8 +1,8 @@ -package com.itsaky.androidide.projects.api +package org.appdevforall.codeonthego.projects.api import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.project.AndroidModels -import com.itsaky.androidide.project.GradleModels +import org.appdevforall.codeonthego.project.AndroidModels +import org.appdevforall.codeonthego.project.GradleModels import org.junit.After import org.junit.Before import org.junit.Test diff --git a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/api/AndroidModuleResourceDirectoriesTest.kt b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/api/AndroidModuleResourceDirectoriesTest.kt similarity index 93% rename from subprojects/projects/src/test/java/com/itsaky/androidide/projects/api/AndroidModuleResourceDirectoriesTest.kt rename to subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/api/AndroidModuleResourceDirectoriesTest.kt index 8567c4633e..9ecc755c52 100644 --- a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/api/AndroidModuleResourceDirectoriesTest.kt +++ b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/api/AndroidModuleResourceDirectoriesTest.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.projects.api +package org.appdevforall.codeonthego.projects.api import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.project.AndroidModels -import com.itsaky.androidide.project.GradleModels -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.tooling.api.models.BuildVariantInfo +import org.appdevforall.codeonthego.project.AndroidModels +import org.appdevforall.codeonthego.project.GradleModels +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.tooling.api.models.BuildVariantInfo import org.junit.After import org.junit.Rule import org.junit.Test diff --git a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/api/CompileModuleProjectsCycleTest.kt b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/api/CompileModuleProjectsCycleTest.kt similarity index 98% rename from subprojects/projects/src/test/java/com/itsaky/androidide/projects/api/CompileModuleProjectsCycleTest.kt rename to subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/api/CompileModuleProjectsCycleTest.kt index d115016047..224837c52c 100644 --- a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/api/CompileModuleProjectsCycleTest.kt +++ b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/api/CompileModuleProjectsCycleTest.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects.api +package org.appdevforall.codeonthego.projects.api import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.project.AndroidModels -import com.itsaky.androidide.project.GradleModels -import com.itsaky.androidide.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.project.AndroidModels +import org.appdevforall.codeonthego.project.GradleModels +import org.appdevforall.codeonthego.projects.ProjectManagerImpl import org.junit.After import org.junit.Test import org.junit.runner.RunWith diff --git a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/classpath/JarFsClasspathReaderCorruptJarTest.kt b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/classpath/JarFsClasspathReaderCorruptJarTest.kt similarity index 95% rename from subprojects/projects/src/test/java/com/itsaky/androidide/projects/classpath/JarFsClasspathReaderCorruptJarTest.kt rename to subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/classpath/JarFsClasspathReaderCorruptJarTest.kt index c6869fd623..ef36688c2e 100644 --- a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/classpath/JarFsClasspathReaderCorruptJarTest.kt +++ b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/classpath/JarFsClasspathReaderCorruptJarTest.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects.classpath +package org.appdevforall.codeonthego.projects.classpath import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.javac.services.fs.CachingJarFileSystemProvider -import com.itsaky.androidide.utils.FileProvider +import org.appdevforall.codeonthego.javac.services.fs.CachingJarFileSystemProvider +import org.appdevforall.codeonthego.utils.FileProvider import org.junit.After import org.junit.Before import org.junit.Test diff --git a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/classpath/ZipFileClasspathReaderTest.kt b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/classpath/ZipFileClasspathReaderTest.kt similarity index 95% rename from subprojects/projects/src/test/java/com/itsaky/androidide/projects/classpath/ZipFileClasspathReaderTest.kt rename to subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/classpath/ZipFileClasspathReaderTest.kt index cc43238cff..983c2c3c41 100644 --- a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/classpath/ZipFileClasspathReaderTest.kt +++ b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/classpath/ZipFileClasspathReaderTest.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects.classpath +package org.appdevforall.codeonthego.projects.classpath import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.utils.FileProvider +import org.appdevforall.codeonthego.utils.FileProvider import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner diff --git a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/util/ClassTrieTest.kt b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/util/ClassTrieTest.kt similarity index 96% rename from subprojects/projects/src/test/java/com/itsaky/androidide/projects/util/ClassTrieTest.kt rename to subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/util/ClassTrieTest.kt index 9700789dfd..99d037423c 100644 --- a/subprojects/projects/src/test/java/com/itsaky/androidide/projects/util/ClassTrieTest.kt +++ b/subprojects/projects/src/test/java/org/appdevforall/codeonthego/projects/util/ClassTrieTest.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.projects.util +package org.appdevforall.codeonthego.projects.util import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.utils.ClassTrie +import org.appdevforall.codeonthego.utils.ClassTrie import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner diff --git a/subprojects/shizuku-manager/src/main/AndroidManifest.xml b/subprojects/shizuku-manager/src/main/AndroidManifest.xml index fc2eea8f0b..7fd6c1118a 100644 --- a/subprojects/shizuku-manager/src/main/AndroidManifest.xml +++ b/subprojects/shizuku-manager/src/main/AndroidManifest.xml @@ -10,30 +10,30 @@ android:name="android.permission.WRITE_SECURE_SETTINGS" tools:ignore="ProtectedPermissions" /> - + - + @@ -56,7 +56,7 @@ - + . - */ - -package com.itsaky.androidide.tooling.events - -/** @author Akash Yadav */ -interface FinishEvent { - val result: OperationResult -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events + +/** @author Akash Yadav */ +interface FinishEvent { + val result: OperationResult +} diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/OperationDescriptor.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/OperationDescriptor.kt similarity index 92% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/OperationDescriptor.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/OperationDescriptor.kt index 7e756fc739..3ccea7b8c7 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/OperationDescriptor.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/OperationDescriptor.kt @@ -1,30 +1,30 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events - -/** - * Describes an operation for which an event has occurred. - * - * @author Akash Yadav - */ -abstract class OperationDescriptor { - abstract val name: String - abstract val displayName: String - - private val gsonType = javaClass.name -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events + +/** + * Describes an operation for which an event has occurred. + * + * @author Akash Yadav + */ +abstract class OperationDescriptor { + abstract val name: String + abstract val displayName: String + + private val gsonType = javaClass.name +} diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/OperationResult.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/OperationResult.kt similarity index 92% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/OperationResult.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/OperationResult.kt index 8e27b8dacb..40ef943ac5 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/OperationResult.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/OperationResult.kt @@ -1,26 +1,26 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events - -/** @author Akash Yadav */ -abstract class OperationResult { - abstract val startTime: Long - abstract val endTime: Long - - private val gsonType = javaClass.name -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events + +/** @author Akash Yadav */ +abstract class OperationResult { + abstract val startTime: Long + abstract val endTime: Long + + private val gsonType = javaClass.name +} diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/ProgressEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/ProgressEvent.kt similarity index 92% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/ProgressEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/ProgressEvent.kt index afd74db0e6..91903a93c0 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/ProgressEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/ProgressEvent.kt @@ -1,31 +1,31 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events - -/** - * Base class for all progress events. - * - * @author Akash Yadav - */ -abstract class ProgressEvent { - abstract val displayName: String - abstract val eventTime: Long - abstract val descriptor: OperationDescriptor - - private val gsonType: String = javaClass.name -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events + +/** + * Base class for all progress events. + * + * @author Akash Yadav + */ +abstract class ProgressEvent { + abstract val displayName: String + abstract val eventTime: Long + abstract val descriptor: OperationDescriptor + + private val gsonType: String = javaClass.name +} diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/StartEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/StartEvent.kt similarity index 91% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/StartEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/StartEvent.kt index 5c0d72bd93..d63cf0e123 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/StartEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/StartEvent.kt @@ -1,21 +1,21 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events - -/** @author Akash Yadav */ -interface StartEvent +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events + +/** @author Akash Yadav */ +interface StartEvent diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/StatusEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/StatusEvent.kt similarity index 92% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/StatusEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/StatusEvent.kt index 17837b32d6..0f1b645136 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/StatusEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/StatusEvent.kt @@ -1,28 +1,28 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events - -/** @author Akash Yadav */ -class StatusEvent( - val progress: Long, - val total: Long, - val unit: String, - override val displayName: String, - override val eventTime: Long, - override val descriptor: OperationDescriptor -) : ProgressEvent() +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events + +/** @author Akash Yadav */ +class StatusEvent( + val progress: Long, + val total: Long, + val unit: String, + override val displayName: String, + override val eventTime: Long, + override val descriptor: OperationDescriptor +) : ProgressEvent() diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/configuration/ProjectConfigurationFinishEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/configuration/ProjectConfigurationFinishEvent.kt similarity index 87% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/configuration/ProjectConfigurationFinishEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/configuration/ProjectConfigurationFinishEvent.kt index 647e5e16b8..d5d1fc81c9 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/configuration/ProjectConfigurationFinishEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/configuration/ProjectConfigurationFinishEvent.kt @@ -1,28 +1,28 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.configuration - -import com.itsaky.androidide.tooling.events.FinishEvent - -/** @author Akash Yadav */ -class ProjectConfigurationFinishEvent( - override val result: ProjectConfigurationOperationResult, - displayName: String, - eventTime: Long, - descriptor: ProjectConfigurationOperationDescriptor -) : ProjectConfigurationProgressEvent(displayName, eventTime, descriptor), FinishEvent +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.configuration + +import org.appdevforall.codeonthego.tooling.events.FinishEvent + +/** @author Akash Yadav */ +class ProjectConfigurationFinishEvent( + override val result: ProjectConfigurationOperationResult, + displayName: String, + eventTime: Long, + descriptor: ProjectConfigurationOperationDescriptor +) : ProjectConfigurationProgressEvent(displayName, eventTime, descriptor), FinishEvent diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/configuration/ProjectConfigurationOperationDescriptor.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/configuration/ProjectConfigurationOperationDescriptor.kt similarity index 85% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/configuration/ProjectConfigurationOperationDescriptor.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/configuration/ProjectConfigurationOperationDescriptor.kt index 8b05b54971..c217d5ac86 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/configuration/ProjectConfigurationOperationDescriptor.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/configuration/ProjectConfigurationOperationDescriptor.kt @@ -1,46 +1,46 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.configuration - -import com.itsaky.androidide.tooling.events.OperationDescriptor -import com.itsaky.androidide.tooling.model.ProjectIdentifier - -/** @author Akash Yadav */ -class ProjectConfigurationOperationDescriptor( - val project: ProjectIdentifier, - override val name: String, - override val displayName: String -) : OperationDescriptor() { - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other !is ProjectConfigurationOperationDescriptor) return false - - if (project != other.project) return false - if (name != other.name) return false - if (displayName != other.displayName) return false - - return true - } - - override fun hashCode(): Int { - var result = project.hashCode() - result = 31 * result + name.hashCode() - result = 31 * result + displayName.hashCode() - return result - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.configuration + +import org.appdevforall.codeonthego.tooling.events.OperationDescriptor +import org.appdevforall.codeonthego.tooling.model.ProjectIdentifier + +/** @author Akash Yadav */ +class ProjectConfigurationOperationDescriptor( + val project: ProjectIdentifier, + override val name: String, + override val displayName: String +) : OperationDescriptor() { + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is ProjectConfigurationOperationDescriptor) return false + + if (project != other.project) return false + if (name != other.name) return false + if (displayName != other.displayName) return false + + return true + } + + override fun hashCode(): Int { + var result = project.hashCode() + result = 31 * result + name.hashCode() + result = 31 * result + displayName.hashCode() + return result + } +} diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/configuration/ProjectConfigurationOperationResult.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/configuration/ProjectConfigurationOperationResult.kt similarity index 83% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/configuration/ProjectConfigurationOperationResult.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/configuration/ProjectConfigurationOperationResult.kt index f6ba447aa4..15b88eb3b8 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/configuration/ProjectConfigurationOperationResult.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/configuration/ProjectConfigurationOperationResult.kt @@ -1,31 +1,31 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.configuration - -import com.itsaky.androidide.tooling.events.OperationResult -import com.itsaky.androidide.tooling.model.PluginIdentifier - -/** @author Akash Yadav */ -class ProjectConfigurationOperationResult( - val success: Boolean, - val pluginApplicationResults: List, - override val startTime: Long, - override val endTime: Long -) : OperationResult() { - class PluginApplicationResult(val plugin: PluginIdentifier, val duration: Long) -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.configuration + +import org.appdevforall.codeonthego.tooling.events.OperationResult +import org.appdevforall.codeonthego.tooling.model.PluginIdentifier + +/** @author Akash Yadav */ +class ProjectConfigurationOperationResult( + val success: Boolean, + val pluginApplicationResults: List, + override val startTime: Long, + override val endTime: Long +) : OperationResult() { + class PluginApplicationResult(val plugin: PluginIdentifier, val duration: Long) +} diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/configuration/ProjectConfigurationProgressEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/configuration/ProjectConfigurationProgressEvent.kt similarity index 86% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/configuration/ProjectConfigurationProgressEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/configuration/ProjectConfigurationProgressEvent.kt index ba1ce4c6da..a91dc4df72 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/configuration/ProjectConfigurationProgressEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/configuration/ProjectConfigurationProgressEvent.kt @@ -1,27 +1,27 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.configuration - -import com.itsaky.androidide.tooling.events.ProgressEvent - -/** @author Akash Yadav */ -open class ProjectConfigurationProgressEvent( - override val displayName: String, - override val eventTime: Long, - override val descriptor: ProjectConfigurationOperationDescriptor -) : ProgressEvent() +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.configuration + +import org.appdevforall.codeonthego.tooling.events.ProgressEvent + +/** @author Akash Yadav */ +open class ProjectConfigurationProgressEvent( + override val displayName: String, + override val eventTime: Long, + override val descriptor: ProjectConfigurationOperationDescriptor +) : ProgressEvent() diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/configuration/ProjectConfigurationStartEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/configuration/ProjectConfigurationStartEvent.kt similarity index 87% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/configuration/ProjectConfigurationStartEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/configuration/ProjectConfigurationStartEvent.kt index 13a10e957b..533708fc6f 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/configuration/ProjectConfigurationStartEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/configuration/ProjectConfigurationStartEvent.kt @@ -1,27 +1,27 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.configuration - -import com.itsaky.androidide.tooling.events.StartEvent - -/** @author Akash Yadav */ -class ProjectConfigurationStartEvent( - displayName: String, - eventTime: Long, - descriptor: ProjectConfigurationOperationDescriptor -) : ProjectConfigurationProgressEvent(displayName, eventTime, descriptor), StartEvent +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.configuration + +import org.appdevforall.codeonthego.tooling.events.StartEvent + +/** @author Akash Yadav */ +class ProjectConfigurationStartEvent( + displayName: String, + eventTime: Long, + descriptor: ProjectConfigurationOperationDescriptor +) : ProjectConfigurationProgressEvent(displayName, eventTime, descriptor), StartEvent diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/download/FileDownloadFinishEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/download/FileDownloadFinishEvent.kt similarity index 87% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/download/FileDownloadFinishEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/download/FileDownloadFinishEvent.kt index 0417453366..aeec8431df 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/download/FileDownloadFinishEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/download/FileDownloadFinishEvent.kt @@ -1,28 +1,28 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.download - -import com.itsaky.androidide.tooling.events.FinishEvent - -/** @author Akash Yadav */ -class FileDownloadFinishEvent( - displayName: String, - eventTime: Long, - descriptor: FileDownloadOperationDescriptor, - override val result: FileDownloadResult -) : FileDownloadProgressEvent(displayName, eventTime, descriptor), FinishEvent +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.download + +import org.appdevforall.codeonthego.tooling.events.FinishEvent + +/** @author Akash Yadav */ +class FileDownloadFinishEvent( + displayName: String, + eventTime: Long, + descriptor: FileDownloadOperationDescriptor, + override val result: FileDownloadResult +) : FileDownloadProgressEvent(displayName, eventTime, descriptor), FinishEvent diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/download/FileDownloadOperationDescriptor.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/download/FileDownloadOperationDescriptor.kt similarity index 89% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/download/FileDownloadOperationDescriptor.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/download/FileDownloadOperationDescriptor.kt index a96ac9b92b..72b6820588 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/download/FileDownloadOperationDescriptor.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/download/FileDownloadOperationDescriptor.kt @@ -1,46 +1,46 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.download - -import com.itsaky.androidide.tooling.events.OperationDescriptor -import java.net.URI - -/** @author Akash Yadav */ -class FileDownloadOperationDescriptor( - val uri: URI, - override val name: String, - override val displayName: String -) : OperationDescriptor() { - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other !is FileDownloadOperationDescriptor) return false - - if (uri != other.uri) return false - if (name != other.name) return false - if (displayName != other.displayName) return false - - return true - } - - override fun hashCode(): Int { - var result = uri.hashCode() - result = 31 * result + name.hashCode() - result = 31 * result + displayName.hashCode() - return result - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.download + +import org.appdevforall.codeonthego.tooling.events.OperationDescriptor +import java.net.URI + +/** @author Akash Yadav */ +class FileDownloadOperationDescriptor( + val uri: URI, + override val name: String, + override val displayName: String +) : OperationDescriptor() { + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is FileDownloadOperationDescriptor) return false + + if (uri != other.uri) return false + if (name != other.name) return false + if (displayName != other.displayName) return false + + return true + } + + override fun hashCode(): Int { + var result = uri.hashCode() + result = 31 * result + name.hashCode() + result = 31 * result + displayName.hashCode() + return result + } +} diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/download/FileDownloadProgressEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/download/FileDownloadProgressEvent.kt similarity index 86% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/download/FileDownloadProgressEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/download/FileDownloadProgressEvent.kt index 4450b49d2c..8ecd59cb8e 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/download/FileDownloadProgressEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/download/FileDownloadProgressEvent.kt @@ -1,27 +1,27 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.download - -import com.itsaky.androidide.tooling.events.ProgressEvent - -/** @author Akash Yadav */ -open class FileDownloadProgressEvent( - override val displayName: String, - override val eventTime: Long, - override val descriptor: FileDownloadOperationDescriptor -) : ProgressEvent() +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.download + +import org.appdevforall.codeonthego.tooling.events.ProgressEvent + +/** @author Akash Yadav */ +open class FileDownloadProgressEvent( + override val displayName: String, + override val eventTime: Long, + override val descriptor: FileDownloadOperationDescriptor +) : ProgressEvent() diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/download/FileDownloadResult.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/download/FileDownloadResult.kt similarity index 86% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/download/FileDownloadResult.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/download/FileDownloadResult.kt index 1cad277290..281fceb1a9 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/download/FileDownloadResult.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/download/FileDownloadResult.kt @@ -1,27 +1,27 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.download - -import com.itsaky.androidide.tooling.events.OperationResult - -/** @author Akash Yadav */ -class FileDownloadResult( - val bytesDownloaded: Long, - override val startTime: Long, - override val endTime: Long -) : OperationResult() +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.download + +import org.appdevforall.codeonthego.tooling.events.OperationResult + +/** @author Akash Yadav */ +class FileDownloadResult( + val bytesDownloaded: Long, + override val startTime: Long, + override val endTime: Long +) : OperationResult() diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/download/FileDownloadStartEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/download/FileDownloadStartEvent.kt similarity index 87% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/download/FileDownloadStartEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/download/FileDownloadStartEvent.kt index 44557f6f24..525f4f837a 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/download/FileDownloadStartEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/download/FileDownloadStartEvent.kt @@ -1,27 +1,27 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.download - -import com.itsaky.androidide.tooling.events.StartEvent - -/** @author Akash Yadav */ -class FileDownloadStartEvent( - displayName: String, - eventTime: Long, - descriptor: FileDownloadOperationDescriptor -) : FileDownloadProgressEvent(displayName, eventTime, descriptor), StartEvent +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.download + +import org.appdevforall.codeonthego.tooling.events.StartEvent + +/** @author Akash Yadav */ +class FileDownloadStartEvent( + displayName: String, + eventTime: Long, + descriptor: FileDownloadOperationDescriptor +) : FileDownloadProgressEvent(displayName, eventTime, descriptor), StartEvent diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/internal/DefaultFinishEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/internal/DefaultFinishEvent.kt similarity index 78% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/internal/DefaultFinishEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/internal/DefaultFinishEvent.kt index bee3036d98..5cb7e72a02 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/internal/DefaultFinishEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/internal/DefaultFinishEvent.kt @@ -1,30 +1,30 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.internal - -import com.itsaky.androidide.tooling.events.FinishEvent -import com.itsaky.androidide.tooling.events.OperationDescriptor -import com.itsaky.androidide.tooling.events.OperationResult - -/** @author Akash Yadav */ -class DefaultFinishEvent( - displayName: String, - eventTime: Long, - descriptor: OperationDescriptor, - override val result: OperationResult -) : DefaultProgressEvent(displayName, eventTime, descriptor), FinishEvent +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.internal + +import org.appdevforall.codeonthego.tooling.events.FinishEvent +import org.appdevforall.codeonthego.tooling.events.OperationDescriptor +import org.appdevforall.codeonthego.tooling.events.OperationResult + +/** @author Akash Yadav */ +class DefaultFinishEvent( + displayName: String, + eventTime: Long, + descriptor: OperationDescriptor, + override val result: OperationResult +) : DefaultProgressEvent(displayName, eventTime, descriptor), FinishEvent diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/internal/DefaultOperationDescriptor.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/internal/DefaultOperationDescriptor.kt similarity index 88% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/internal/DefaultOperationDescriptor.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/internal/DefaultOperationDescriptor.kt index 5394569b74..0d300fc6a6 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/internal/DefaultOperationDescriptor.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/internal/DefaultOperationDescriptor.kt @@ -1,40 +1,40 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.tooling.events.internal - -import com.itsaky.androidide.tooling.events.OperationDescriptor - -/** @author Akash Yadav */ -class DefaultOperationDescriptor(override val name: String, override val displayName: String) : - OperationDescriptor() { - - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other !is DefaultOperationDescriptor) return false - - if (name != other.name) return false - if (displayName != other.displayName) return false - - return true - } - - override fun hashCode(): Int { - var result = name.hashCode() - result = 31 * result + displayName.hashCode() - return result - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.tooling.events.internal + +import org.appdevforall.codeonthego.tooling.events.OperationDescriptor + +/** @author Akash Yadav */ +class DefaultOperationDescriptor(override val name: String, override val displayName: String) : + OperationDescriptor() { + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is DefaultOperationDescriptor) return false + + if (name != other.name) return false + if (displayName != other.displayName) return false + + return true + } + + override fun hashCode(): Int { + var result = name.hashCode() + result = 31 * result + displayName.hashCode() + return result + } +} diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/internal/DefaultOperationResult.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/internal/DefaultOperationResult.kt similarity index 85% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/internal/DefaultOperationResult.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/internal/DefaultOperationResult.kt index 7707a0f782..239b792c23 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/internal/DefaultOperationResult.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/internal/DefaultOperationResult.kt @@ -1,24 +1,24 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.internal - -import com.itsaky.androidide.tooling.events.OperationResult - -/** @author Akash Yadav */ -class DefaultOperationResult(override val startTime: Long, override val endTime: Long) : - OperationResult() +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.internal + +import org.appdevforall.codeonthego.tooling.events.OperationResult + +/** @author Akash Yadav */ +class DefaultOperationResult(override val startTime: Long, override val endTime: Long) : + OperationResult() diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/internal/DefaultProgressEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/internal/DefaultProgressEvent.kt similarity index 81% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/internal/DefaultProgressEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/internal/DefaultProgressEvent.kt index 5a453305cc..e1484e8495 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/internal/DefaultProgressEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/internal/DefaultProgressEvent.kt @@ -1,28 +1,28 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.internal - -import com.itsaky.androidide.tooling.events.OperationDescriptor -import com.itsaky.androidide.tooling.events.ProgressEvent - -/** @author Akash Yadav */ -open class DefaultProgressEvent( - override val displayName: String, - override val eventTime: Long, - override val descriptor: OperationDescriptor -) : ProgressEvent() +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.internal + +import org.appdevforall.codeonthego.tooling.events.OperationDescriptor +import org.appdevforall.codeonthego.tooling.events.ProgressEvent + +/** @author Akash Yadav */ +open class DefaultProgressEvent( + override val displayName: String, + override val eventTime: Long, + override val descriptor: OperationDescriptor +) : ProgressEvent() diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/internal/DefaultStartEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/internal/DefaultStartEvent.kt similarity index 81% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/internal/DefaultStartEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/internal/DefaultStartEvent.kt index cf98200c33..f5a346ef84 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/internal/DefaultStartEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/internal/DefaultStartEvent.kt @@ -1,25 +1,25 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.internal - -import com.itsaky.androidide.tooling.events.OperationDescriptor -import com.itsaky.androidide.tooling.events.StartEvent - -/** @author Akash Yadav */ -class DefaultStartEvent(displayName: String, eventTime: Long, descriptor: OperationDescriptor) : - DefaultProgressEvent(displayName, eventTime, descriptor), StartEvent +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.internal + +import org.appdevforall.codeonthego.tooling.events.OperationDescriptor +import org.appdevforall.codeonthego.tooling.events.StartEvent + +/** @author Akash Yadav */ +class DefaultStartEvent(displayName: String, eventTime: Long, descriptor: OperationDescriptor) : + DefaultProgressEvent(displayName, eventTime, descriptor), StartEvent diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskExecutionResult.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskExecutionResult.kt similarity index 92% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskExecutionResult.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskExecutionResult.kt index feb81e4766..738746ac90 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskExecutionResult.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskExecutionResult.kt @@ -1,26 +1,26 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.task - -/** @author Akash Yadav */ -open class TaskExecutionResult( - startTime: Long, - endTime: Long, - val isIncremental: Boolean, - val executionReasons: List -) : TaskOperationResult(startTime, endTime) +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.task + +/** @author Akash Yadav */ +open class TaskExecutionResult( + startTime: Long, + endTime: Long, + val isIncremental: Boolean, + val executionReasons: List +) : TaskOperationResult(startTime, endTime) diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskFailureResult.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskFailureResult.kt similarity index 92% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskFailureResult.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskFailureResult.kt index 0da439bcc5..77d17d00b7 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskFailureResult.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskFailureResult.kt @@ -1,21 +1,21 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.task - -/** @author Akash Yadav */ -class TaskFailureResult(startTime: Long, endTime: Long) : TaskOperationResult(startTime, endTime) {} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.task + +/** @author Akash Yadav */ +class TaskFailureResult(startTime: Long, endTime: Long) : TaskOperationResult(startTime, endTime) {} diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskFinishEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskFinishEvent.kt similarity index 87% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskFinishEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskFinishEvent.kt index 583dcc09da..ad10f19c96 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskFinishEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskFinishEvent.kt @@ -1,28 +1,28 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.task - -import com.itsaky.androidide.tooling.events.FinishEvent - -/** @author Akash Yadav */ -class TaskFinishEvent( - displayName: String, - eventTime: Long, - descriptor: TaskOperationDescriptor, - override val result: TaskOperationResult -) : TaskProgressEvent(displayName, eventTime, descriptor), FinishEvent +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.task + +import org.appdevforall.codeonthego.tooling.events.FinishEvent + +/** @author Akash Yadav */ +class TaskFinishEvent( + displayName: String, + eventTime: Long, + descriptor: TaskOperationDescriptor, + override val result: TaskOperationResult +) : TaskProgressEvent(displayName, eventTime, descriptor), FinishEvent diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskOperationDescriptor.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskOperationDescriptor.kt similarity index 88% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskOperationDescriptor.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskOperationDescriptor.kt index a5b2fecd95..af9fd2139e 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskOperationDescriptor.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskOperationDescriptor.kt @@ -1,52 +1,52 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.task - -import com.itsaky.androidide.tooling.events.OperationDescriptor -import com.itsaky.androidide.tooling.model.PluginIdentifier - -/** @author Akash Yadav */ -class TaskOperationDescriptor( - val dependencies: Set, - val originPlugin: PluginIdentifier, - val taskPath: String, - override val name: String, - override val displayName: String -) : OperationDescriptor() { - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other !is TaskOperationDescriptor) return false - - if (dependencies != other.dependencies) return false - if (originPlugin != other.originPlugin) return false - if (taskPath != other.taskPath) return false - if (name != other.name) return false - if (displayName != other.displayName) return false - - return true - } - - override fun hashCode(): Int { - var result = dependencies.hashCode() - result = 31 * result + originPlugin.hashCode() - result = 31 * result + taskPath.hashCode() - result = 31 * result + name.hashCode() - result = 31 * result + displayName.hashCode() - return result - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.task + +import org.appdevforall.codeonthego.tooling.events.OperationDescriptor +import org.appdevforall.codeonthego.tooling.model.PluginIdentifier + +/** @author Akash Yadav */ +class TaskOperationDescriptor( + val dependencies: Set, + val originPlugin: PluginIdentifier, + val taskPath: String, + override val name: String, + override val displayName: String +) : OperationDescriptor() { + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is TaskOperationDescriptor) return false + + if (dependencies != other.dependencies) return false + if (originPlugin != other.originPlugin) return false + if (taskPath != other.taskPath) return false + if (name != other.name) return false + if (displayName != other.displayName) return false + + return true + } + + override fun hashCode(): Int { + var result = dependencies.hashCode() + result = 31 * result + originPlugin.hashCode() + result = 31 * result + taskPath.hashCode() + result = 31 * result + name.hashCode() + result = 31 * result + displayName.hashCode() + return result + } +} diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskOperationResult.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskOperationResult.kt similarity index 86% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskOperationResult.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskOperationResult.kt index f0497d690a..45abea9110 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskOperationResult.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskOperationResult.kt @@ -1,24 +1,24 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.task - -import com.itsaky.androidide.tooling.events.OperationResult - -/** @author Akash Yadav */ -open class TaskOperationResult(override val startTime: Long, override val endTime: Long) : - OperationResult() +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.task + +import org.appdevforall.codeonthego.tooling.events.OperationResult + +/** @author Akash Yadav */ +open class TaskOperationResult(override val startTime: Long, override val endTime: Long) : + OperationResult() diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskProgressEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskProgressEvent.kt similarity index 86% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskProgressEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskProgressEvent.kt index fbee69dac7..45fcb40ecf 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskProgressEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskProgressEvent.kt @@ -1,27 +1,27 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.task - -import com.itsaky.androidide.tooling.events.ProgressEvent - -/** @author Akash Yadav */ -open class TaskProgressEvent( - override val displayName: String, - override val eventTime: Long, - override val descriptor: TaskOperationDescriptor -) : ProgressEvent() +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.task + +import org.appdevforall.codeonthego.tooling.events.ProgressEvent + +/** @author Akash Yadav */ +open class TaskProgressEvent( + override val displayName: String, + override val eventTime: Long, + override val descriptor: TaskOperationDescriptor +) : ProgressEvent() diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskSkippedResult.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskSkippedResult.kt similarity index 92% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskSkippedResult.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskSkippedResult.kt index 2794e7a087..42a253ecde 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskSkippedResult.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskSkippedResult.kt @@ -1,22 +1,22 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.task - -/** @author Akash Yadav */ -class TaskSkippedResult(val skipMessage: String, startTime: Long, endTime: Long) : - TaskOperationResult(startTime, endTime) +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.task + +/** @author Akash Yadav */ +class TaskSkippedResult(val skipMessage: String, startTime: Long, endTime: Long) : + TaskOperationResult(startTime, endTime) diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskStartEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskStartEvent.kt similarity index 87% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskStartEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskStartEvent.kt index 0dbe4e0e30..e34b75a8b6 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskStartEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskStartEvent.kt @@ -1,24 +1,24 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.task - -import com.itsaky.androidide.tooling.events.StartEvent - -/** @author Akash Yadav */ -class TaskStartEvent(displayName: String, eventTime: Long, descriptor: TaskOperationDescriptor) : - TaskProgressEvent(displayName, eventTime, descriptor), StartEvent +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.task + +import org.appdevforall.codeonthego.tooling.events.StartEvent + +/** @author Akash Yadav */ +class TaskStartEvent(displayName: String, eventTime: Long, descriptor: TaskOperationDescriptor) : + TaskProgressEvent(displayName, eventTime, descriptor), StartEvent diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskSuccessResult.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskSuccessResult.kt similarity index 92% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskSuccessResult.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskSuccessResult.kt index ab0cdeb2e1..0782f20ce0 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/task/TaskSuccessResult.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/task/TaskSuccessResult.kt @@ -1,28 +1,28 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.task - -/** @author Akash Yadav */ -class TaskSuccessResult( - val isUpToDate: Boolean, - val isFromCache: Boolean, - startTime: Long, - endTime: Long, - isIncremental: Boolean, - executionReasons: List -) : TaskExecutionResult(startTime, endTime, isIncremental, executionReasons) +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.task + +/** @author Akash Yadav */ +class TaskSuccessResult( + val isUpToDate: Boolean, + val isFromCache: Boolean, + startTime: Long, + endTime: Long, + isIncremental: Boolean, + executionReasons: List +) : TaskExecutionResult(startTime, endTime, isIncremental, executionReasons) diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/test/TestFinishEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/test/TestFinishEvent.kt similarity index 87% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/test/TestFinishEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/test/TestFinishEvent.kt index 16396840f6..b3ec9f30f1 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/test/TestFinishEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/test/TestFinishEvent.kt @@ -1,28 +1,28 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.test - -import com.itsaky.androidide.tooling.events.FinishEvent - -/** @author Akash Yadav */ -class TestFinishEvent( - displayName: String, - eventTime: Long, - operationDescriptor: TestOperationDescriptor, - override val result: TestOperationResult -) : TestProgressEvent(displayName, eventTime, operationDescriptor), FinishEvent +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.test + +import org.appdevforall.codeonthego.tooling.events.FinishEvent + +/** @author Akash Yadav */ +class TestFinishEvent( + displayName: String, + eventTime: Long, + operationDescriptor: TestOperationDescriptor, + override val result: TestOperationResult +) : TestProgressEvent(displayName, eventTime, operationDescriptor), FinishEvent diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/test/TestOperationDescriptor.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/test/TestOperationDescriptor.kt similarity index 88% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/test/TestOperationDescriptor.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/test/TestOperationDescriptor.kt index bd477659a4..3b66bc3cd8 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/test/TestOperationDescriptor.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/test/TestOperationDescriptor.kt @@ -1,40 +1,40 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.test - -import com.itsaky.androidide.tooling.events.OperationDescriptor - -/** @author Akash Yadav */ -class TestOperationDescriptor(override val name: String, override val displayName: String) : - OperationDescriptor() { - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other !is TestOperationDescriptor) return false - - if (name != other.name) return false - if (displayName != other.displayName) return false - - return true - } - - override fun hashCode(): Int { - var result = name.hashCode() - result = 31 * result + displayName.hashCode() - return result - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.test + +import org.appdevforall.codeonthego.tooling.events.OperationDescriptor + +/** @author Akash Yadav */ +class TestOperationDescriptor(override val name: String, override val displayName: String) : + OperationDescriptor() { + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is TestOperationDescriptor) return false + + if (name != other.name) return false + if (displayName != other.displayName) return false + + return true + } + + override fun hashCode(): Int { + var result = name.hashCode() + result = 31 * result + displayName.hashCode() + return result + } +} diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/test/TestOperationResult.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/test/TestOperationResult.kt similarity index 86% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/test/TestOperationResult.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/test/TestOperationResult.kt index aa995e1859..b7b6cd4bd9 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/test/TestOperationResult.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/test/TestOperationResult.kt @@ -1,27 +1,27 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.test - -import com.itsaky.androidide.tooling.events.OperationResult - -/** @author Akash Yadav */ -class TestOperationResult( - val success: Boolean, - override val startTime: Long, - override val endTime: Long -) : OperationResult() +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.test + +import org.appdevforall.codeonthego.tooling.events.OperationResult + +/** @author Akash Yadav */ +class TestOperationResult( + val success: Boolean, + override val startTime: Long, + override val endTime: Long +) : OperationResult() diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/test/TestProgressEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/test/TestProgressEvent.kt similarity index 86% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/test/TestProgressEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/test/TestProgressEvent.kt index 19194c4fa5..733122c86a 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/test/TestProgressEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/test/TestProgressEvent.kt @@ -1,27 +1,27 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.test - -import com.itsaky.androidide.tooling.events.ProgressEvent - -/** @author Akash Yadav */ -open class TestProgressEvent( - override val displayName: String, - override val eventTime: Long, - override val descriptor: TestOperationDescriptor -) : ProgressEvent() +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.test + +import org.appdevforall.codeonthego.tooling.events.ProgressEvent + +/** @author Akash Yadav */ +open class TestProgressEvent( + override val displayName: String, + override val eventTime: Long, + override val descriptor: TestOperationDescriptor +) : ProgressEvent() diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/test/TestStartEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/test/TestStartEvent.kt similarity index 87% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/test/TestStartEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/test/TestStartEvent.kt index ae06b823ab..619e23351a 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/test/TestStartEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/test/TestStartEvent.kt @@ -1,27 +1,27 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.test - -import com.itsaky.androidide.tooling.events.StartEvent - -/** @author Akash Yadav */ -class TestStartEvent( - displayName: String, - eventTime: Long, - operationDescriptor: TestOperationDescriptor -) : TestProgressEvent(displayName, eventTime, operationDescriptor), StartEvent +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.test + +import org.appdevforall.codeonthego.tooling.events.StartEvent + +/** @author Akash Yadav */ +class TestStartEvent( + displayName: String, + eventTime: Long, + operationDescriptor: TestOperationDescriptor +) : TestProgressEvent(displayName, eventTime, operationDescriptor), StartEvent diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/transform/TransformFinishEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/transform/TransformFinishEvent.kt similarity index 87% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/transform/TransformFinishEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/transform/TransformFinishEvent.kt index 62575e9910..9448e67fc5 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/transform/TransformFinishEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/transform/TransformFinishEvent.kt @@ -1,28 +1,28 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.transform - -import com.itsaky.androidide.tooling.events.FinishEvent - -/** @author Akash Yadav */ -class TransformFinishEvent( - displayName: String, - eventTime: Long, - operationDescriptor: TransformOperationDescriptor, - override val result: TransformOperationResult -) : TransformProgressEvent(displayName, eventTime, operationDescriptor), FinishEvent +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.transform + +import org.appdevforall.codeonthego.tooling.events.FinishEvent + +/** @author Akash Yadav */ +class TransformFinishEvent( + displayName: String, + eventTime: Long, + operationDescriptor: TransformOperationDescriptor, + override val result: TransformOperationResult +) : TransformProgressEvent(displayName, eventTime, operationDescriptor), FinishEvent diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/transform/TransformOperationDescriptor.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/transform/TransformOperationDescriptor.kt similarity index 91% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/transform/TransformOperationDescriptor.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/transform/TransformOperationDescriptor.kt index fbbfc36fa5..01973e0d66 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/transform/TransformOperationDescriptor.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/transform/TransformOperationDescriptor.kt @@ -1,55 +1,55 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.transform - -import com.itsaky.androidide.tooling.events.OperationDescriptor - -/** @author Akash Yadav */ -class TransformOperationDescriptor( - val dependencies: Set, - val subject: SubjectDescriptor, - val transformer: TransformerDescriptor, - override val name: String, - override val displayName: String -) : OperationDescriptor() { - class SubjectDescriptor(val displayName: String) - - class TransformerDescriptor(val displayName: String) - - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other !is TransformOperationDescriptor) return false - - if (dependencies != other.dependencies) return false - if (subject != other.subject) return false - if (transformer != other.transformer) return false - if (name != other.name) return false - if (displayName != other.displayName) return false - - return true - } - - override fun hashCode(): Int { - var result = dependencies.hashCode() - result = 31 * result + subject.hashCode() - result = 31 * result + transformer.hashCode() - result = 31 * result + name.hashCode() - result = 31 * result + displayName.hashCode() - return result - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.transform + +import org.appdevforall.codeonthego.tooling.events.OperationDescriptor + +/** @author Akash Yadav */ +class TransformOperationDescriptor( + val dependencies: Set, + val subject: SubjectDescriptor, + val transformer: TransformerDescriptor, + override val name: String, + override val displayName: String +) : OperationDescriptor() { + class SubjectDescriptor(val displayName: String) + + class TransformerDescriptor(val displayName: String) + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is TransformOperationDescriptor) return false + + if (dependencies != other.dependencies) return false + if (subject != other.subject) return false + if (transformer != other.transformer) return false + if (name != other.name) return false + if (displayName != other.displayName) return false + + return true + } + + override fun hashCode(): Int { + var result = dependencies.hashCode() + result = 31 * result + subject.hashCode() + result = 31 * result + transformer.hashCode() + result = 31 * result + name.hashCode() + result = 31 * result + displayName.hashCode() + return result + } +} diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/transform/TransformOperationResult.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/transform/TransformOperationResult.kt similarity index 85% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/transform/TransformOperationResult.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/transform/TransformOperationResult.kt index 9f5dcc7ceb..78240151b2 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/transform/TransformOperationResult.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/transform/TransformOperationResult.kt @@ -1,27 +1,27 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.transform - -import com.itsaky.androidide.tooling.events.OperationResult - -/** @author Akash Yadav */ -class TransformOperationResult( - val success: Boolean, - override val startTime: Long, - override val endTime: Long -) : OperationResult() +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.transform + +import org.appdevforall.codeonthego.tooling.events.OperationResult + +/** @author Akash Yadav */ +class TransformOperationResult( + val success: Boolean, + override val startTime: Long, + override val endTime: Long +) : OperationResult() diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/transform/TransformProgressEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/transform/TransformProgressEvent.kt similarity index 86% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/transform/TransformProgressEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/transform/TransformProgressEvent.kt index 358f2a8607..15a98bd1a6 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/transform/TransformProgressEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/transform/TransformProgressEvent.kt @@ -1,27 +1,27 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.transform - -import com.itsaky.androidide.tooling.events.ProgressEvent - -/** @author Akash Yadav */ -open class TransformProgressEvent( - override val displayName: String, - override val eventTime: Long, - override val descriptor: TransformOperationDescriptor -) : ProgressEvent() +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.transform + +import org.appdevforall.codeonthego.tooling.events.ProgressEvent + +/** @author Akash Yadav */ +open class TransformProgressEvent( + override val displayName: String, + override val eventTime: Long, + override val descriptor: TransformOperationDescriptor +) : ProgressEvent() diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/transform/TransformStartEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/transform/TransformStartEvent.kt similarity index 86% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/transform/TransformStartEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/transform/TransformStartEvent.kt index 681fec98f7..be17927dfe 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/transform/TransformStartEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/transform/TransformStartEvent.kt @@ -1,27 +1,27 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.transform - -import com.itsaky.androidide.tooling.events.StartEvent - -/** @author Akash Yadav */ -class TransformStartEvent( - displayName: String, - eventTime: Long, - descriptor: TransformOperationDescriptor -) : TransformProgressEvent(displayName, eventTime, descriptor), StartEvent +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.transform + +import org.appdevforall.codeonthego.tooling.events.StartEvent + +/** @author Akash Yadav */ +class TransformStartEvent( + displayName: String, + eventTime: Long, + descriptor: TransformOperationDescriptor +) : TransformProgressEvent(displayName, eventTime, descriptor), StartEvent diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/work/WorkItemFinishEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/work/WorkItemFinishEvent.kt similarity index 87% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/work/WorkItemFinishEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/work/WorkItemFinishEvent.kt index 509a0f9035..e170ff9832 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/work/WorkItemFinishEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/work/WorkItemFinishEvent.kt @@ -1,28 +1,28 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.work - -import com.itsaky.androidide.tooling.events.FinishEvent - -/** @author Akash Yadav */ -class WorkItemFinishEvent( - displayName: String, - eventTime: Long, - operationDescriptor: WorkItemOperationDescriptor, - override val result: WorkItemOperationResult -) : WorkItemProgressEvent(displayName, eventTime, operationDescriptor), FinishEvent +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.work + +import org.appdevforall.codeonthego.tooling.events.FinishEvent + +/** @author Akash Yadav */ +class WorkItemFinishEvent( + displayName: String, + eventTime: Long, + operationDescriptor: WorkItemOperationDescriptor, + override val result: WorkItemOperationResult +) : WorkItemProgressEvent(displayName, eventTime, operationDescriptor), FinishEvent diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/work/WorkItemOperationDescriptor.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/work/WorkItemOperationDescriptor.kt similarity index 89% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/work/WorkItemOperationDescriptor.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/work/WorkItemOperationDescriptor.kt index f122c5a0fd..c5f7054e0d 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/work/WorkItemOperationDescriptor.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/work/WorkItemOperationDescriptor.kt @@ -1,45 +1,45 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.work - -import com.itsaky.androidide.tooling.events.OperationDescriptor - -/** @author Akash Yadav */ -class WorkItemOperationDescriptor( - val className: String, - override val name: String, - override val displayName: String -) : OperationDescriptor() { - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other !is WorkItemOperationDescriptor) return false - - if (className != other.className) return false - if (name != other.name) return false - if (displayName != other.displayName) return false - - return true - } - - override fun hashCode(): Int { - var result = className.hashCode() - result = 31 * result + name.hashCode() - result = 31 * result + displayName.hashCode() - return result - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.work + +import org.appdevforall.codeonthego.tooling.events.OperationDescriptor + +/** @author Akash Yadav */ +class WorkItemOperationDescriptor( + val className: String, + override val name: String, + override val displayName: String +) : OperationDescriptor() { + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is WorkItemOperationDescriptor) return false + + if (className != other.className) return false + if (name != other.name) return false + if (displayName != other.displayName) return false + + return true + } + + override fun hashCode(): Int { + var result = className.hashCode() + result = 31 * result + name.hashCode() + result = 31 * result + displayName.hashCode() + return result + } +} diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/work/WorkItemOperationResult.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/work/WorkItemOperationResult.kt similarity index 86% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/work/WorkItemOperationResult.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/work/WorkItemOperationResult.kt index e3ab50575d..33b338ed76 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/work/WorkItemOperationResult.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/work/WorkItemOperationResult.kt @@ -1,27 +1,27 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.work - -import com.itsaky.androidide.tooling.events.OperationResult - -/** @author Akash Yadav */ -class WorkItemOperationResult( - val success: Boolean, - override val startTime: Long, - override val endTime: Long -) : OperationResult() +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.work + +import org.appdevforall.codeonthego.tooling.events.OperationResult + +/** @author Akash Yadav */ +class WorkItemOperationResult( + val success: Boolean, + override val startTime: Long, + override val endTime: Long +) : OperationResult() diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/work/WorkItemProgressEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/work/WorkItemProgressEvent.kt similarity index 87% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/work/WorkItemProgressEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/work/WorkItemProgressEvent.kt index e560d70dc1..4d38980dc0 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/work/WorkItemProgressEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/work/WorkItemProgressEvent.kt @@ -1,27 +1,27 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.work - -import com.itsaky.androidide.tooling.events.ProgressEvent - -/** @author Akash Yadav */ -open class WorkItemProgressEvent( - override val displayName: String, - override val eventTime: Long, - override val descriptor: WorkItemOperationDescriptor -) : ProgressEvent() +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.work + +import org.appdevforall.codeonthego.tooling.events.ProgressEvent + +/** @author Akash Yadav */ +open class WorkItemProgressEvent( + override val displayName: String, + override val eventTime: Long, + override val descriptor: WorkItemOperationDescriptor +) : ProgressEvent() diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/work/WorkItemStartEvent.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/work/WorkItemStartEvent.kt similarity index 87% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/work/WorkItemStartEvent.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/work/WorkItemStartEvent.kt index fe6d543cbe..9221aa6b3d 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/events/work/WorkItemStartEvent.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/events/work/WorkItemStartEvent.kt @@ -1,27 +1,27 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.events.work - -import com.itsaky.androidide.tooling.events.StartEvent - -/** @author Akash Yadav */ -class WorkItemStartEvent( - displayName: String, - eventTime: Long, - descriptor: WorkItemOperationDescriptor -) : WorkItemProgressEvent(displayName, eventTime, descriptor), StartEvent +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.events.work + +import org.appdevforall.codeonthego.tooling.events.StartEvent + +/** @author Akash Yadav */ +class WorkItemStartEvent( + displayName: String, + eventTime: Long, + descriptor: WorkItemOperationDescriptor +) : WorkItemProgressEvent(displayName, eventTime, descriptor), StartEvent diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/model/BuildIdentifier.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/model/BuildIdentifier.kt similarity index 92% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/model/BuildIdentifier.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/model/BuildIdentifier.kt index 4d9ed8f363..6dd34c9b0a 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/model/BuildIdentifier.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/model/BuildIdentifier.kt @@ -1,22 +1,22 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.tooling.model - -import java.io.File - -/** @author Akash Yadav */ -data class BuildIdentifier(val rootDir: File) +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.tooling.model + +import java.io.File + +/** @author Akash Yadav */ +data class BuildIdentifier(val rootDir: File) diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/model/PluginIdentifier.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/model/PluginIdentifier.kt similarity index 92% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/model/PluginIdentifier.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/model/PluginIdentifier.kt index 582af9d51e..1fc2bdf07e 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/model/PluginIdentifier.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/model/PluginIdentifier.kt @@ -1,20 +1,20 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.tooling.model - -/** @author Akash Yadav */ -data class PluginIdentifier(val displayName: String) +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.tooling.model + +/** @author Akash Yadav */ +data class PluginIdentifier(val displayName: String) diff --git a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/model/ProjectIdentifier.kt b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/model/ProjectIdentifier.kt similarity index 92% rename from subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/model/ProjectIdentifier.kt rename to subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/model/ProjectIdentifier.kt index 223b9b07bb..4fcc67b1d1 100644 --- a/subprojects/tooling-api-events/src/main/java/com/itsaky/androidide/tooling/model/ProjectIdentifier.kt +++ b/subprojects/tooling-api-events/src/main/java/org/appdevforall/codeonthego/tooling/model/ProjectIdentifier.kt @@ -1,20 +1,20 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.tooling.model - -/** @author Akash Yadav */ -data class ProjectIdentifier(val buildIdentifier: BuildIdentifier, val projectPath: String) {} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.tooling.model + +/** @author Akash Yadav */ +data class ProjectIdentifier(val buildIdentifier: BuildIdentifier, val projectPath: String) {} diff --git a/subprojects/tooling-api-impl/build.gradle.kts b/subprojects/tooling-api-impl/build.gradle.kts index 6d6c1c547a..b836323937 100644 --- a/subprojects/tooling-api-impl/build.gradle.kts +++ b/subprojects/tooling-api-impl/build.gradle.kts @@ -27,7 +27,7 @@ plugins { } tasks.withType { - manifest { attributes("Main-Class" to "${BuildConfig.PACKAGE_NAME}.tooling.impl.Main") } + manifest { attributes("Main-Class" to "org.appdevforall.codeonthego.tooling.impl.Main") } } tasks.register("deleteExistingJarFiles") { diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/GradleDaemonWatcher.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/GradleDaemonWatcher.kt similarity index 99% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/GradleDaemonWatcher.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/GradleDaemonWatcher.kt index 2327e3b27b..835ed35df4 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/GradleDaemonWatcher.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/GradleDaemonWatcher.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.impl +package org.appdevforall.codeonthego.tooling.impl import org.slf4j.LoggerFactory import java.io.File diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/LoggingOutputStream.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/LoggingOutputStream.kt similarity index 88% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/LoggingOutputStream.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/LoggingOutputStream.kt index cc816adac5..7a0277a574 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/LoggingOutputStream.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/LoggingOutputStream.kt @@ -1,38 +1,38 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.impl - -import com.itsaky.androidide.tooling.api.IToolingApiClient -import java.io.OutputStream - -/** - * Sends the output received from Gradle build to the [IToolingApiClient]. - * @author Akash Yadav - */ -class LoggingOutputStream : OutputStream() { - private val lineBuilder = StringBuilder() - override fun write(b: Int) { - val c = b.toChar() - lineBuilder.append(c) - - if (c == '\n' && Main.client != null) { - Main.client?.logOutput(lineBuilder.toString()) - lineBuilder.clear() - } - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.impl + +import org.appdevforall.codeonthego.tooling.api.IToolingApiClient +import java.io.OutputStream + +/** + * Sends the output received from Gradle build to the [IToolingApiClient]. + * @author Akash Yadav + */ +class LoggingOutputStream : OutputStream() { + private val lineBuilder = StringBuilder() + override fun write(b: Int) { + val c = b.toChar() + lineBuilder.append(c) + + if (c == '\n' && Main.client != null) { + Main.client?.logOutput(lineBuilder.toString()) + lineBuilder.clear() + } + } +} diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/Main.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/Main.kt similarity index 92% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/Main.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/Main.kt index a9734c31fc..3b46dc49d5 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/Main.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/Main.kt @@ -14,14 +14,14 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.impl +package org.appdevforall.codeonthego.tooling.impl import androidx.annotation.VisibleForTesting -import com.itsaky.androidide.logging.provider.IdeLogRouter -import com.itsaky.androidide.tooling.api.IToolingApiClient -import com.itsaky.androidide.tooling.api.util.ToolingApiLauncher.newServerLauncher -import com.itsaky.androidide.tooling.api.util.ToolingProps -import com.itsaky.androidide.tooling.impl.logging.ToolingApiAppender +import org.appdevforall.codeonthego.logging.provider.IdeLogRouter +import org.appdevforall.codeonthego.tooling.api.IToolingApiClient +import org.appdevforall.codeonthego.tooling.api.util.ToolingApiLauncher.newServerLauncher +import org.appdevforall.codeonthego.tooling.api.util.ToolingProps +import org.appdevforall.codeonthego.tooling.impl.logging.ToolingApiAppender import kotlinx.coroutines.delay import kotlinx.coroutines.runBlocking import org.gradle.tooling.events.OperationType diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/ProjectInitializationExeption.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/ProjectInitializationExeption.kt similarity index 94% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/ProjectInitializationExeption.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/ProjectInitializationExeption.kt index 29aa55a673..684f425988 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/ProjectInitializationExeption.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/ProjectInitializationExeption.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.impl +package org.appdevforall.codeonthego.tooling.impl /** * Exception thrown when the project fails to sync/initialize. diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/ToolingApiServerImpl.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/ToolingApiServerImpl.kt similarity index 85% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/ToolingApiServerImpl.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/ToolingApiServerImpl.kt index 1943edb4c1..0b9757a7bd 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/ToolingApiServerImpl.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/ToolingApiServerImpl.kt @@ -15,42 +15,42 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.impl - -import com.itsaky.androidide.tooling.api.IToolingApiClient -import com.itsaky.androidide.tooling.api.IToolingApiServer -import com.itsaky.androidide.tooling.api.messages.BuildId -import com.itsaky.androidide.tooling.api.messages.ClientGradleBuildConfig -import com.itsaky.androidide.tooling.api.messages.GradleDistributionParams -import com.itsaky.androidide.tooling.api.messages.GradleDistributionType -import com.itsaky.androidide.tooling.api.messages.InitializeProjectParams -import com.itsaky.androidide.tooling.api.messages.TaskExecutionMessage -import com.itsaky.androidide.tooling.api.messages.result.BuildCancellationRequestResult -import com.itsaky.androidide.tooling.api.messages.result.BuildCancellationRequestResult.Reason.CANCELLATION_ERROR -import com.itsaky.androidide.tooling.api.messages.result.BuildInfo -import com.itsaky.androidide.tooling.api.messages.result.BuildResult -import com.itsaky.androidide.tooling.api.messages.result.InitializeResult -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure.BUILD_CANCELLED -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure.BUILD_FAILED -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure.CONNECTION_CLOSED -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure.CONNECTION_ERROR -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure.PROJECT_DIRECTORY_INACCESSIBLE -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure.PROJECT_NOT_DIRECTORY -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure.PROJECT_NOT_FOUND -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure.PROJECT_NOT_INITIALIZED -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure.UNKNOWN -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure.UNSUPPORTED_BUILD_ARGUMENT -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure.UNSUPPORTED_CONFIGURATION -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult.Failure.UNSUPPORTED_GRADLE_VERSION -import com.itsaky.androidide.tooling.api.models.ToolingServerMetadata -import com.itsaky.androidide.tooling.api.sync.ProjectSyncHelper -import com.itsaky.androidide.tooling.impl.sync.RootModelBuilder -import com.itsaky.androidide.tooling.impl.sync.RootProjectModelBuilderParams -import com.itsaky.androidide.tooling.impl.util.configureFrom -import com.itsaky.androidide.utils.StopWatch -import com.itsaky.androidide.utils.withStopWatch +package org.appdevforall.codeonthego.tooling.impl + +import org.appdevforall.codeonthego.tooling.api.IToolingApiClient +import org.appdevforall.codeonthego.tooling.api.IToolingApiServer +import org.appdevforall.codeonthego.tooling.api.messages.BuildId +import org.appdevforall.codeonthego.tooling.api.messages.ClientGradleBuildConfig +import org.appdevforall.codeonthego.tooling.api.messages.GradleDistributionParams +import org.appdevforall.codeonthego.tooling.api.messages.GradleDistributionType +import org.appdevforall.codeonthego.tooling.api.messages.InitializeProjectParams +import org.appdevforall.codeonthego.tooling.api.messages.TaskExecutionMessage +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildCancellationRequestResult +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildCancellationRequestResult.Reason.CANCELLATION_ERROR +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildInfo +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildResult +import org.appdevforall.codeonthego.tooling.api.messages.result.InitializeResult +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure.BUILD_CANCELLED +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure.BUILD_FAILED +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure.CONNECTION_CLOSED +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure.CONNECTION_ERROR +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure.PROJECT_DIRECTORY_INACCESSIBLE +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure.PROJECT_NOT_DIRECTORY +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure.PROJECT_NOT_FOUND +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure.PROJECT_NOT_INITIALIZED +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure.UNKNOWN +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure.UNSUPPORTED_BUILD_ARGUMENT +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure.UNSUPPORTED_CONFIGURATION +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult.Failure.UNSUPPORTED_GRADLE_VERSION +import org.appdevforall.codeonthego.tooling.api.models.ToolingServerMetadata +import org.appdevforall.codeonthego.tooling.api.sync.ProjectSyncHelper +import org.appdevforall.codeonthego.tooling.impl.sync.RootModelBuilder +import org.appdevforall.codeonthego.tooling.impl.sync.RootProjectModelBuilderParams +import org.appdevforall.codeonthego.tooling.impl.util.configureFrom +import org.appdevforall.codeonthego.utils.StopWatch +import org.appdevforall.codeonthego.utils.withStopWatch import org.gradle.tooling.BuildCancelledException import org.gradle.tooling.BuildException import org.gradle.tooling.CancellationTokenSource @@ -530,7 +530,7 @@ internal class ToolingApiServerImpl( this.isInitialized = false // cancelling this future will finish the Tooling API server process - // see com.itsaky.androidide.tooling.impl.Main.main(String[]) + // see org.appdevforall.codeonthego.tooling.impl.Main.main(String[]) log.info("Cancelling awaiting future...") Main.future?.cancel(true) diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/logging/ToolingApiAppender.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/logging/ToolingApiAppender.kt similarity index 80% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/logging/ToolingApiAppender.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/logging/ToolingApiAppender.kt index a9e279a076..fab947f68c 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/logging/ToolingApiAppender.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/logging/ToolingApiAppender.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.impl.logging +package org.appdevforall.codeonthego.tooling.impl.logging -import com.itsaky.androidide.logging.provider.IdeLogFormatter -import com.itsaky.androidide.logging.provider.IdeLogRouter -import com.itsaky.androidide.tooling.api.messages.LogMessageParams -import com.itsaky.androidide.tooling.impl.Main +import org.appdevforall.codeonthego.logging.provider.IdeLogFormatter +import org.appdevforall.codeonthego.logging.provider.IdeLogRouter +import org.appdevforall.codeonthego.tooling.api.messages.LogMessageParams +import org.appdevforall.codeonthego.tooling.impl.Main import org.slf4j.event.Level /** diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/progress/EventTransformer.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/progress/EventTransformer.kt similarity index 73% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/progress/EventTransformer.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/progress/EventTransformer.kt index c12dbd5977..e494a2deef 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/progress/EventTransformer.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/progress/EventTransformer.kt @@ -1,471 +1,471 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.impl.progress - -import com.itsaky.androidide.tooling.events.StatusEvent -import com.itsaky.androidide.tooling.events.configuration.ProjectConfigurationOperationResult.PluginApplicationResult -import com.itsaky.androidide.tooling.events.download.FileDownloadFinishEvent -import com.itsaky.androidide.tooling.events.download.FileDownloadProgressEvent -import com.itsaky.androidide.tooling.events.download.FileDownloadStartEvent -import com.itsaky.androidide.tooling.events.internal.DefaultFinishEvent -import com.itsaky.androidide.tooling.events.internal.DefaultOperationDescriptor -import com.itsaky.androidide.tooling.events.internal.DefaultOperationResult -import com.itsaky.androidide.tooling.events.internal.DefaultProgressEvent -import com.itsaky.androidide.tooling.events.internal.DefaultStartEvent -import com.itsaky.androidide.tooling.events.task.TaskFinishEvent -import com.itsaky.androidide.tooling.events.task.TaskProgressEvent -import com.itsaky.androidide.tooling.events.task.TaskStartEvent -import com.itsaky.androidide.tooling.events.test.TestFinishEvent -import com.itsaky.androidide.tooling.events.test.TestOperationResult -import com.itsaky.androidide.tooling.events.test.TestProgressEvent -import com.itsaky.androidide.tooling.events.test.TestStartEvent -import com.itsaky.androidide.tooling.events.transform.TransformFinishEvent -import com.itsaky.androidide.tooling.events.transform.TransformOperationDescriptor.SubjectDescriptor -import com.itsaky.androidide.tooling.events.transform.TransformOperationResult -import com.itsaky.androidide.tooling.events.transform.TransformStartEvent -import com.itsaky.androidide.tooling.events.work.WorkItemFinishEvent -import com.itsaky.androidide.tooling.events.work.WorkItemOperationResult -import com.itsaky.androidide.tooling.events.work.WorkItemProgressEvent -import com.itsaky.androidide.tooling.events.work.WorkItemStartEvent -import com.itsaky.androidide.tooling.model.PluginIdentifier -import org.gradle.tooling.events.OperationDescriptor -import org.gradle.tooling.events.ProgressEvent -import org.gradle.tooling.events.configuration.ProjectConfigurationFinishEvent -import org.gradle.tooling.events.configuration.ProjectConfigurationOperationDescriptor -import org.gradle.tooling.events.configuration.ProjectConfigurationOperationResult -import org.gradle.tooling.events.configuration.ProjectConfigurationProgressEvent -import org.gradle.tooling.events.configuration.ProjectConfigurationStartEvent -import org.gradle.tooling.events.configuration.ProjectConfigurationSuccessResult -import org.gradle.tooling.events.download.FileDownloadOperationDescriptor -import org.gradle.tooling.events.download.FileDownloadResult -import org.gradle.tooling.events.task.TaskExecutionResult -import org.gradle.tooling.events.task.TaskFailureResult -import org.gradle.tooling.events.task.TaskOperationDescriptor -import org.gradle.tooling.events.task.TaskOperationResult -import org.gradle.tooling.events.task.TaskSkippedResult -import org.gradle.tooling.events.task.TaskSuccessResult -import org.gradle.tooling.events.test.TestOperationDescriptor -import org.gradle.tooling.events.test.TestSuccessResult -import org.gradle.tooling.events.transform.TransformOperationDescriptor -import org.gradle.tooling.events.transform.TransformSuccessResult -import org.gradle.tooling.events.work.WorkItemOperationDescriptor -import org.gradle.tooling.events.work.WorkItemSuccessResult -import org.gradle.tooling.model.ProjectIdentifier - -/** @author Akash Yadav */ -class EventTransformer { - companion object { - - // ------------------------ COMMON ------------------------- - private fun operationDescriptor( - descriptor: OperationDescriptor? - ): com.itsaky.androidide.tooling.events.OperationDescriptor? = - when (descriptor) { - null -> null - is ProjectConfigurationOperationDescriptor -> projectConfigurationDescriptor(descriptor) - is FileDownloadOperationDescriptor -> fileDownloadDescriptor(descriptor) - is TaskOperationDescriptor -> taskDescriptor(descriptor) - is TransformOperationDescriptor -> transformDescriptor(descriptor) - is WorkItemOperationDescriptor -> workDescriptor(descriptor) - else -> - DefaultOperationDescriptor(name = descriptor.name, displayName = descriptor.displayName) - } - - // ----------------- PROJECT CONFIGURATION -------------------- - @JvmStatic - fun projectConfigurationStart( - event: ProjectConfigurationStartEvent - ): com.itsaky.androidide.tooling.events.configuration.ProjectConfigurationProgressEvent = - com.itsaky.androidide.tooling.events.configuration.ProjectConfigurationStartEvent( - displayName = event.displayName, - eventTime = event.eventTime, - descriptor = projectConfigurationDescriptor(event.descriptor) - ) - - @JvmStatic - fun projectConfigurationProgress( - event: ProjectConfigurationProgressEvent - ): com.itsaky.androidide.tooling.events.configuration.ProjectConfigurationProgressEvent = - com.itsaky.androidide.tooling.events.configuration.ProjectConfigurationProgressEvent( - displayName = event.displayName, - eventTime = event.eventTime, - descriptor = projectConfigurationDescriptor(event.descriptor) - ) - - @JvmStatic - fun projectConfigurationFinish( - event: ProjectConfigurationFinishEvent - ): com.itsaky.androidide.tooling.events.configuration.ProjectConfigurationProgressEvent = - com.itsaky.androidide.tooling.events.configuration.ProjectConfigurationFinishEvent( - displayName = event.displayName, - eventTime = event.eventTime, - descriptor = projectConfigurationDescriptor(event.descriptor), - result = projectConfigurationResult(event.result) - ) - - private fun projectConfigurationResult( - result: ProjectConfigurationOperationResult - ): com.itsaky.androidide.tooling.events.configuration.ProjectConfigurationOperationResult = - com.itsaky.androidide.tooling.events.configuration.ProjectConfigurationOperationResult( - pluginApplicationResults = - result.pluginApplicationResults.map { - PluginApplicationResult( - plugin = PluginIdentifier(it.plugin?.displayName ?: "Unknown plugin"), - it.totalConfigurationTime.toMillis() - ) - }, - startTime = result.startTime, - endTime = result.endTime, - success = result is ProjectConfigurationSuccessResult - ) - - private fun projectConfigurationDescriptor( - descriptor: ProjectConfigurationOperationDescriptor - ): com.itsaky.androidide.tooling.events.configuration.ProjectConfigurationOperationDescriptor = - com.itsaky.androidide.tooling.events.configuration.ProjectConfigurationOperationDescriptor( - project = projectIdentifier(descriptor.project), - name = descriptor.name, - displayName = descriptor.displayName - ) - - private fun projectIdentifier( - project: ProjectIdentifier - ): com.itsaky.androidide.tooling.model.ProjectIdentifier = - com.itsaky.androidide.tooling.model.ProjectIdentifier( - projectPath = project.projectPath, - buildIdentifier = - com.itsaky.androidide.tooling.model.BuildIdentifier(project.buildIdentifier.rootDir) - ) - - // ---------------------- FILE DOWNLOAD --------------------------------- - @JvmStatic - fun fileDownloadStart( - event: org.gradle.tooling.events.download.FileDownloadStartEvent - ): FileDownloadStartEvent = - FileDownloadStartEvent( - eventTime = event.eventTime, - displayName = event.displayName, - descriptor = fileDownloadDescriptor(event.descriptor) - ) - - @JvmStatic - fun fileDownloadProgress( - event: org.gradle.tooling.events.download.FileDownloadProgressEvent - ): FileDownloadProgressEvent = - FileDownloadProgressEvent( - eventTime = event.eventTime, - displayName = event.displayName, - descriptor = fileDownloadDescriptor(event.descriptor) - ) - - @JvmStatic - fun fileDownloadFinish( - event: org.gradle.tooling.events.download.FileDownloadFinishEvent - ): FileDownloadFinishEvent = - FileDownloadFinishEvent( - eventTime = event.eventTime, - displayName = event.displayName, - descriptor = fileDownloadDescriptor(event.descriptor), - result = fileDownloadResult(event.result) - ) - - private fun fileDownloadResult( - result: FileDownloadResult - ): com.itsaky.androidide.tooling.events.download.FileDownloadResult = - com.itsaky.androidide.tooling.events.download.FileDownloadResult( - bytesDownloaded = result.bytesDownloaded, - startTime = result.startTime, - endTime = result.endTime - ) - - private fun fileDownloadDescriptor( - descriptor: FileDownloadOperationDescriptor - ): com.itsaky.androidide.tooling.events.download.FileDownloadOperationDescriptor = - com.itsaky.androidide.tooling.events.download.FileDownloadOperationDescriptor( - descriptor.uri, - descriptor.name, - descriptor.displayName - ) - - // -------------------- TASK ------------------------------- - @JvmStatic - fun taskStart(event: org.gradle.tooling.events.task.TaskStartEvent): TaskStartEvent = - TaskStartEvent( - eventTime = event.eventTime, - displayName = event.displayName, - descriptor = taskDescriptor(event.descriptor) - ) - - @JvmStatic - fun taskProgress(event: org.gradle.tooling.events.task.TaskProgressEvent): TaskProgressEvent = - TaskProgressEvent( - eventTime = event.eventTime, - displayName = event.displayName, - descriptor = taskDescriptor(event.descriptor) - ) - - @JvmStatic - fun taskFinish(event: org.gradle.tooling.events.task.TaskFinishEvent): TaskFinishEvent = - TaskFinishEvent( - eventTime = event.eventTime, - displayName = event.displayName, - descriptor = taskDescriptor(event.descriptor), - result = taskResult(event.result) - ) - - private fun taskResult( - result: TaskOperationResult - ): com.itsaky.androidide.tooling.events.task.TaskOperationResult { - - // The order of conditions must not change here. - - if (result is TaskSuccessResult) { - return com.itsaky.androidide.tooling.events.task.TaskSuccessResult( - result.isUpToDate, - result.isFromCache, - result.startTime, - result.endTime, - result.isIncremental, - result.executionReasons - ) - } - - if (result is TaskFailureResult) { - return com.itsaky.androidide.tooling.events.task.TaskFailureResult( - result.startTime, - result.endTime - ) - } - - if (result is TaskExecutionResult) { - return com.itsaky.androidide.tooling.events.task.TaskExecutionResult( - result.startTime, - result.endTime, - result.isIncremental, - result.executionReasons - ) - } - - if (result is TaskSkippedResult) { - return com.itsaky.androidide.tooling.events.task.TaskSkippedResult( - result.skipMessage, - result.startTime, - result.endTime - ) - } - - return com.itsaky.androidide.tooling.events.task.TaskOperationResult( - startTime = result.startTime, - endTime = result.endTime - ) - } - - private fun taskDescriptor( - descriptor: TaskOperationDescriptor - ): com.itsaky.androidide.tooling.events.task.TaskOperationDescriptor = - com.itsaky.androidide.tooling.events.task.TaskOperationDescriptor( - dependencies = - descriptor.dependencies.filterNotNull().mapNotNull { operationDescriptor(it) }.toSet(), - originPlugin = PluginIdentifier(descriptor.originPlugin?.displayName ?: "Unknown plugin"), - taskPath = descriptor.taskPath, - name = descriptor.name, - displayName = descriptor.displayName - ) - - // ----------------------- TEST ------------------------- - @JvmStatic - fun testStart(event: org.gradle.tooling.events.test.TestStartEvent): TestStartEvent = - TestStartEvent( - eventTime = event.eventTime, - displayName = event.displayName, - operationDescriptor = testDescriptor(event.descriptor) - ) - - @JvmStatic - fun testProgress(event: org.gradle.tooling.events.test.TestProgressEvent): TestProgressEvent = - TestProgressEvent( - eventTime = event.eventTime, - displayName = event.displayName, - descriptor = testDescriptor(event.descriptor) - ) - - @JvmStatic - fun testFinish(event: org.gradle.tooling.events.test.TestFinishEvent): TestFinishEvent = - TestFinishEvent( - eventTime = event.eventTime, - displayName = event.displayName, - operationDescriptor = testDescriptor(event.descriptor), - result = testResult(event.result) - ) - - private fun testResult( - result: org.gradle.tooling.events.test.TestOperationResult - ): TestOperationResult = - TestOperationResult( - startTime = result.startTime, - endTime = result.endTime, - success = result is TestSuccessResult - ) - - private fun testDescriptor( - descriptor: TestOperationDescriptor - ): com.itsaky.androidide.tooling.events.test.TestOperationDescriptor = - com.itsaky.androidide.tooling.events.test.TestOperationDescriptor( - name = descriptor.name, - displayName = descriptor.displayName - ) - - // ----------------------- TRANSFORM ------------------------- - @JvmStatic - fun transformStart( - event: org.gradle.tooling.events.transform.TransformStartEvent - ): TransformStartEvent = - TransformStartEvent( - eventTime = event.eventTime, - displayName = event.displayName, - descriptor = transformDescriptor(event.descriptor) - ) - - @JvmStatic - fun transformProgress( - event: org.gradle.tooling.events.transform.TransformProgressEvent - ): TransformStartEvent = - TransformStartEvent( - eventTime = event.eventTime, - displayName = event.displayName, - descriptor = transformDescriptor(event.descriptor) - ) - - @JvmStatic - fun transformFinish( - event: org.gradle.tooling.events.transform.TransformFinishEvent - ): TransformFinishEvent = - TransformFinishEvent( - eventTime = event.eventTime, - displayName = event.displayName, - operationDescriptor = transformDescriptor(event.descriptor), - result = transformResult(event.result) - ) - - private fun transformResult( - result: org.gradle.tooling.events.transform.TransformOperationResult - ): TransformOperationResult = - TransformOperationResult( - success = result is TransformSuccessResult, - startTime = result.startTime, - endTime = result.endTime - ) - - private fun transformDescriptor( - descriptor: TransformOperationDescriptor - ): com.itsaky.androidide.tooling.events.transform.TransformOperationDescriptor = - com.itsaky.androidide.tooling.events.transform.TransformOperationDescriptor( - name = descriptor.name, - displayName = descriptor.displayName, - subject = SubjectDescriptor(descriptor.subject.displayName), - transformer = - com.itsaky.androidide.tooling.events.transform.TransformOperationDescriptor - .TransformerDescriptor(descriptor.transformer.displayName), - dependencies = descriptor.dependencies.mapNotNull { operationDescriptor(it) }.toSet() - ) - - // ----------------------- WORK ITEM ------------------------- - @JvmStatic - fun workStart(event: org.gradle.tooling.events.work.WorkItemStartEvent): WorkItemStartEvent = - WorkItemStartEvent( - eventTime = event.eventTime, - displayName = event.displayName, - descriptor = workDescriptor(event.descriptor) - ) - - @JvmStatic - fun workProgress( - event: org.gradle.tooling.events.work.WorkItemProgressEvent - ): WorkItemProgressEvent = - WorkItemProgressEvent( - eventTime = event.eventTime, - displayName = event.displayName, - descriptor = workDescriptor(event.descriptor) - ) - - @JvmStatic - fun workFinish(event: org.gradle.tooling.events.work.WorkItemFinishEvent): WorkItemFinishEvent = - WorkItemFinishEvent( - eventTime = event.eventTime, - displayName = event.displayName, - operationDescriptor = workDescriptor(event.descriptor), - result = workResult(event.result) - ) - - private fun workResult( - result: org.gradle.tooling.events.work.WorkItemOperationResult - ): WorkItemOperationResult = - WorkItemOperationResult( - success = result is WorkItemSuccessResult, - startTime = result.startTime, - endTime = result.endTime - ) - - private fun workDescriptor( - descriptor: WorkItemOperationDescriptor - ): com.itsaky.androidide.tooling.events.work.WorkItemOperationDescriptor = - com.itsaky.androidide.tooling.events.work.WorkItemOperationDescriptor( - name = descriptor.name, - displayName = descriptor.displayName, - className = descriptor.className - ) - - // ---------------------------- STATUS --------------------------------- - fun statusEvent(event: org.gradle.tooling.events.StatusEvent): StatusEvent = - StatusEvent( - total = event.total, - progress = event.progress, - unit = event.unit, - displayName = event.displayName, - eventTime = event.eventTime, - descriptor = operationDescriptor(event.descriptor)!! - ) - - // ----------------------- DEFAULT ---------------------------------- - fun progress(event: ProgressEvent): com.itsaky.androidide.tooling.events.ProgressEvent = - DefaultProgressEvent( - eventTime = event.eventTime, - displayName = event.displayName, - descriptor = operationDescriptor(event.descriptor)!! - ) - - fun start( - event: org.gradle.tooling.events.StartEvent - ): com.itsaky.androidide.tooling.events.ProgressEvent = - DefaultStartEvent( - eventTime = event.eventTime, - displayName = event.displayName, - descriptor = operationDescriptor(event.descriptor)!! - ) - - fun finish( - event: org.gradle.tooling.events.FinishEvent - ): com.itsaky.androidide.tooling.events.ProgressEvent = - DefaultFinishEvent( - eventTime = event.eventTime, - displayName = event.displayName, - descriptor = operationDescriptor(event.descriptor)!!, - result = DefaultOperationResult(event.result.startTime, event.result.endTime) - ) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.impl.progress + +import org.appdevforall.codeonthego.tooling.events.StatusEvent +import org.appdevforall.codeonthego.tooling.events.configuration.ProjectConfigurationOperationResult.PluginApplicationResult +import org.appdevforall.codeonthego.tooling.events.download.FileDownloadFinishEvent +import org.appdevforall.codeonthego.tooling.events.download.FileDownloadProgressEvent +import org.appdevforall.codeonthego.tooling.events.download.FileDownloadStartEvent +import org.appdevforall.codeonthego.tooling.events.internal.DefaultFinishEvent +import org.appdevforall.codeonthego.tooling.events.internal.DefaultOperationDescriptor +import org.appdevforall.codeonthego.tooling.events.internal.DefaultOperationResult +import org.appdevforall.codeonthego.tooling.events.internal.DefaultProgressEvent +import org.appdevforall.codeonthego.tooling.events.internal.DefaultStartEvent +import org.appdevforall.codeonthego.tooling.events.task.TaskFinishEvent +import org.appdevforall.codeonthego.tooling.events.task.TaskProgressEvent +import org.appdevforall.codeonthego.tooling.events.task.TaskStartEvent +import org.appdevforall.codeonthego.tooling.events.test.TestFinishEvent +import org.appdevforall.codeonthego.tooling.events.test.TestOperationResult +import org.appdevforall.codeonthego.tooling.events.test.TestProgressEvent +import org.appdevforall.codeonthego.tooling.events.test.TestStartEvent +import org.appdevforall.codeonthego.tooling.events.transform.TransformFinishEvent +import org.appdevforall.codeonthego.tooling.events.transform.TransformOperationDescriptor.SubjectDescriptor +import org.appdevforall.codeonthego.tooling.events.transform.TransformOperationResult +import org.appdevforall.codeonthego.tooling.events.transform.TransformStartEvent +import org.appdevforall.codeonthego.tooling.events.work.WorkItemFinishEvent +import org.appdevforall.codeonthego.tooling.events.work.WorkItemOperationResult +import org.appdevforall.codeonthego.tooling.events.work.WorkItemProgressEvent +import org.appdevforall.codeonthego.tooling.events.work.WorkItemStartEvent +import org.appdevforall.codeonthego.tooling.model.PluginIdentifier +import org.gradle.tooling.events.OperationDescriptor +import org.gradle.tooling.events.ProgressEvent +import org.gradle.tooling.events.configuration.ProjectConfigurationFinishEvent +import org.gradle.tooling.events.configuration.ProjectConfigurationOperationDescriptor +import org.gradle.tooling.events.configuration.ProjectConfigurationOperationResult +import org.gradle.tooling.events.configuration.ProjectConfigurationProgressEvent +import org.gradle.tooling.events.configuration.ProjectConfigurationStartEvent +import org.gradle.tooling.events.configuration.ProjectConfigurationSuccessResult +import org.gradle.tooling.events.download.FileDownloadOperationDescriptor +import org.gradle.tooling.events.download.FileDownloadResult +import org.gradle.tooling.events.task.TaskExecutionResult +import org.gradle.tooling.events.task.TaskFailureResult +import org.gradle.tooling.events.task.TaskOperationDescriptor +import org.gradle.tooling.events.task.TaskOperationResult +import org.gradle.tooling.events.task.TaskSkippedResult +import org.gradle.tooling.events.task.TaskSuccessResult +import org.gradle.tooling.events.test.TestOperationDescriptor +import org.gradle.tooling.events.test.TestSuccessResult +import org.gradle.tooling.events.transform.TransformOperationDescriptor +import org.gradle.tooling.events.transform.TransformSuccessResult +import org.gradle.tooling.events.work.WorkItemOperationDescriptor +import org.gradle.tooling.events.work.WorkItemSuccessResult +import org.gradle.tooling.model.ProjectIdentifier + +/** @author Akash Yadav */ +class EventTransformer { + companion object { + + // ------------------------ COMMON ------------------------- + private fun operationDescriptor( + descriptor: OperationDescriptor? + ): org.appdevforall.codeonthego.tooling.events.OperationDescriptor? = + when (descriptor) { + null -> null + is ProjectConfigurationOperationDescriptor -> projectConfigurationDescriptor(descriptor) + is FileDownloadOperationDescriptor -> fileDownloadDescriptor(descriptor) + is TaskOperationDescriptor -> taskDescriptor(descriptor) + is TransformOperationDescriptor -> transformDescriptor(descriptor) + is WorkItemOperationDescriptor -> workDescriptor(descriptor) + else -> + DefaultOperationDescriptor(name = descriptor.name, displayName = descriptor.displayName) + } + + // ----------------- PROJECT CONFIGURATION -------------------- + @JvmStatic + fun projectConfigurationStart( + event: ProjectConfigurationStartEvent + ): org.appdevforall.codeonthego.tooling.events.configuration.ProjectConfigurationProgressEvent = + org.appdevforall.codeonthego.tooling.events.configuration.ProjectConfigurationStartEvent( + displayName = event.displayName, + eventTime = event.eventTime, + descriptor = projectConfigurationDescriptor(event.descriptor) + ) + + @JvmStatic + fun projectConfigurationProgress( + event: ProjectConfigurationProgressEvent + ): org.appdevforall.codeonthego.tooling.events.configuration.ProjectConfigurationProgressEvent = + org.appdevforall.codeonthego.tooling.events.configuration.ProjectConfigurationProgressEvent( + displayName = event.displayName, + eventTime = event.eventTime, + descriptor = projectConfigurationDescriptor(event.descriptor) + ) + + @JvmStatic + fun projectConfigurationFinish( + event: ProjectConfigurationFinishEvent + ): org.appdevforall.codeonthego.tooling.events.configuration.ProjectConfigurationProgressEvent = + org.appdevforall.codeonthego.tooling.events.configuration.ProjectConfigurationFinishEvent( + displayName = event.displayName, + eventTime = event.eventTime, + descriptor = projectConfigurationDescriptor(event.descriptor), + result = projectConfigurationResult(event.result) + ) + + private fun projectConfigurationResult( + result: ProjectConfigurationOperationResult + ): org.appdevforall.codeonthego.tooling.events.configuration.ProjectConfigurationOperationResult = + org.appdevforall.codeonthego.tooling.events.configuration.ProjectConfigurationOperationResult( + pluginApplicationResults = + result.pluginApplicationResults.map { + PluginApplicationResult( + plugin = PluginIdentifier(it.plugin?.displayName ?: "Unknown plugin"), + it.totalConfigurationTime.toMillis() + ) + }, + startTime = result.startTime, + endTime = result.endTime, + success = result is ProjectConfigurationSuccessResult + ) + + private fun projectConfigurationDescriptor( + descriptor: ProjectConfigurationOperationDescriptor + ): org.appdevforall.codeonthego.tooling.events.configuration.ProjectConfigurationOperationDescriptor = + org.appdevforall.codeonthego.tooling.events.configuration.ProjectConfigurationOperationDescriptor( + project = projectIdentifier(descriptor.project), + name = descriptor.name, + displayName = descriptor.displayName + ) + + private fun projectIdentifier( + project: ProjectIdentifier + ): org.appdevforall.codeonthego.tooling.model.ProjectIdentifier = + org.appdevforall.codeonthego.tooling.model.ProjectIdentifier( + projectPath = project.projectPath, + buildIdentifier = + org.appdevforall.codeonthego.tooling.model.BuildIdentifier(project.buildIdentifier.rootDir) + ) + + // ---------------------- FILE DOWNLOAD --------------------------------- + @JvmStatic + fun fileDownloadStart( + event: org.gradle.tooling.events.download.FileDownloadStartEvent + ): FileDownloadStartEvent = + FileDownloadStartEvent( + eventTime = event.eventTime, + displayName = event.displayName, + descriptor = fileDownloadDescriptor(event.descriptor) + ) + + @JvmStatic + fun fileDownloadProgress( + event: org.gradle.tooling.events.download.FileDownloadProgressEvent + ): FileDownloadProgressEvent = + FileDownloadProgressEvent( + eventTime = event.eventTime, + displayName = event.displayName, + descriptor = fileDownloadDescriptor(event.descriptor) + ) + + @JvmStatic + fun fileDownloadFinish( + event: org.gradle.tooling.events.download.FileDownloadFinishEvent + ): FileDownloadFinishEvent = + FileDownloadFinishEvent( + eventTime = event.eventTime, + displayName = event.displayName, + descriptor = fileDownloadDescriptor(event.descriptor), + result = fileDownloadResult(event.result) + ) + + private fun fileDownloadResult( + result: FileDownloadResult + ): org.appdevforall.codeonthego.tooling.events.download.FileDownloadResult = + org.appdevforall.codeonthego.tooling.events.download.FileDownloadResult( + bytesDownloaded = result.bytesDownloaded, + startTime = result.startTime, + endTime = result.endTime + ) + + private fun fileDownloadDescriptor( + descriptor: FileDownloadOperationDescriptor + ): org.appdevforall.codeonthego.tooling.events.download.FileDownloadOperationDescriptor = + org.appdevforall.codeonthego.tooling.events.download.FileDownloadOperationDescriptor( + descriptor.uri, + descriptor.name, + descriptor.displayName + ) + + // -------------------- TASK ------------------------------- + @JvmStatic + fun taskStart(event: org.gradle.tooling.events.task.TaskStartEvent): TaskStartEvent = + TaskStartEvent( + eventTime = event.eventTime, + displayName = event.displayName, + descriptor = taskDescriptor(event.descriptor) + ) + + @JvmStatic + fun taskProgress(event: org.gradle.tooling.events.task.TaskProgressEvent): TaskProgressEvent = + TaskProgressEvent( + eventTime = event.eventTime, + displayName = event.displayName, + descriptor = taskDescriptor(event.descriptor) + ) + + @JvmStatic + fun taskFinish(event: org.gradle.tooling.events.task.TaskFinishEvent): TaskFinishEvent = + TaskFinishEvent( + eventTime = event.eventTime, + displayName = event.displayName, + descriptor = taskDescriptor(event.descriptor), + result = taskResult(event.result) + ) + + private fun taskResult( + result: TaskOperationResult + ): org.appdevforall.codeonthego.tooling.events.task.TaskOperationResult { + + // The order of conditions must not change here. + + if (result is TaskSuccessResult) { + return org.appdevforall.codeonthego.tooling.events.task.TaskSuccessResult( + result.isUpToDate, + result.isFromCache, + result.startTime, + result.endTime, + result.isIncremental, + result.executionReasons + ) + } + + if (result is TaskFailureResult) { + return org.appdevforall.codeonthego.tooling.events.task.TaskFailureResult( + result.startTime, + result.endTime + ) + } + + if (result is TaskExecutionResult) { + return org.appdevforall.codeonthego.tooling.events.task.TaskExecutionResult( + result.startTime, + result.endTime, + result.isIncremental, + result.executionReasons + ) + } + + if (result is TaskSkippedResult) { + return org.appdevforall.codeonthego.tooling.events.task.TaskSkippedResult( + result.skipMessage, + result.startTime, + result.endTime + ) + } + + return org.appdevforall.codeonthego.tooling.events.task.TaskOperationResult( + startTime = result.startTime, + endTime = result.endTime + ) + } + + private fun taskDescriptor( + descriptor: TaskOperationDescriptor + ): org.appdevforall.codeonthego.tooling.events.task.TaskOperationDescriptor = + org.appdevforall.codeonthego.tooling.events.task.TaskOperationDescriptor( + dependencies = + descriptor.dependencies.filterNotNull().mapNotNull { operationDescriptor(it) }.toSet(), + originPlugin = PluginIdentifier(descriptor.originPlugin?.displayName ?: "Unknown plugin"), + taskPath = descriptor.taskPath, + name = descriptor.name, + displayName = descriptor.displayName + ) + + // ----------------------- TEST ------------------------- + @JvmStatic + fun testStart(event: org.gradle.tooling.events.test.TestStartEvent): TestStartEvent = + TestStartEvent( + eventTime = event.eventTime, + displayName = event.displayName, + operationDescriptor = testDescriptor(event.descriptor) + ) + + @JvmStatic + fun testProgress(event: org.gradle.tooling.events.test.TestProgressEvent): TestProgressEvent = + TestProgressEvent( + eventTime = event.eventTime, + displayName = event.displayName, + descriptor = testDescriptor(event.descriptor) + ) + + @JvmStatic + fun testFinish(event: org.gradle.tooling.events.test.TestFinishEvent): TestFinishEvent = + TestFinishEvent( + eventTime = event.eventTime, + displayName = event.displayName, + operationDescriptor = testDescriptor(event.descriptor), + result = testResult(event.result) + ) + + private fun testResult( + result: org.gradle.tooling.events.test.TestOperationResult + ): TestOperationResult = + TestOperationResult( + startTime = result.startTime, + endTime = result.endTime, + success = result is TestSuccessResult + ) + + private fun testDescriptor( + descriptor: TestOperationDescriptor + ): org.appdevforall.codeonthego.tooling.events.test.TestOperationDescriptor = + org.appdevforall.codeonthego.tooling.events.test.TestOperationDescriptor( + name = descriptor.name, + displayName = descriptor.displayName + ) + + // ----------------------- TRANSFORM ------------------------- + @JvmStatic + fun transformStart( + event: org.gradle.tooling.events.transform.TransformStartEvent + ): TransformStartEvent = + TransformStartEvent( + eventTime = event.eventTime, + displayName = event.displayName, + descriptor = transformDescriptor(event.descriptor) + ) + + @JvmStatic + fun transformProgress( + event: org.gradle.tooling.events.transform.TransformProgressEvent + ): TransformStartEvent = + TransformStartEvent( + eventTime = event.eventTime, + displayName = event.displayName, + descriptor = transformDescriptor(event.descriptor) + ) + + @JvmStatic + fun transformFinish( + event: org.gradle.tooling.events.transform.TransformFinishEvent + ): TransformFinishEvent = + TransformFinishEvent( + eventTime = event.eventTime, + displayName = event.displayName, + operationDescriptor = transformDescriptor(event.descriptor), + result = transformResult(event.result) + ) + + private fun transformResult( + result: org.gradle.tooling.events.transform.TransformOperationResult + ): TransformOperationResult = + TransformOperationResult( + success = result is TransformSuccessResult, + startTime = result.startTime, + endTime = result.endTime + ) + + private fun transformDescriptor( + descriptor: TransformOperationDescriptor + ): org.appdevforall.codeonthego.tooling.events.transform.TransformOperationDescriptor = + org.appdevforall.codeonthego.tooling.events.transform.TransformOperationDescriptor( + name = descriptor.name, + displayName = descriptor.displayName, + subject = SubjectDescriptor(descriptor.subject.displayName), + transformer = + org.appdevforall.codeonthego.tooling.events.transform.TransformOperationDescriptor + .TransformerDescriptor(descriptor.transformer.displayName), + dependencies = descriptor.dependencies.mapNotNull { operationDescriptor(it) }.toSet() + ) + + // ----------------------- WORK ITEM ------------------------- + @JvmStatic + fun workStart(event: org.gradle.tooling.events.work.WorkItemStartEvent): WorkItemStartEvent = + WorkItemStartEvent( + eventTime = event.eventTime, + displayName = event.displayName, + descriptor = workDescriptor(event.descriptor) + ) + + @JvmStatic + fun workProgress( + event: org.gradle.tooling.events.work.WorkItemProgressEvent + ): WorkItemProgressEvent = + WorkItemProgressEvent( + eventTime = event.eventTime, + displayName = event.displayName, + descriptor = workDescriptor(event.descriptor) + ) + + @JvmStatic + fun workFinish(event: org.gradle.tooling.events.work.WorkItemFinishEvent): WorkItemFinishEvent = + WorkItemFinishEvent( + eventTime = event.eventTime, + displayName = event.displayName, + operationDescriptor = workDescriptor(event.descriptor), + result = workResult(event.result) + ) + + private fun workResult( + result: org.gradle.tooling.events.work.WorkItemOperationResult + ): WorkItemOperationResult = + WorkItemOperationResult( + success = result is WorkItemSuccessResult, + startTime = result.startTime, + endTime = result.endTime + ) + + private fun workDescriptor( + descriptor: WorkItemOperationDescriptor + ): org.appdevforall.codeonthego.tooling.events.work.WorkItemOperationDescriptor = + org.appdevforall.codeonthego.tooling.events.work.WorkItemOperationDescriptor( + name = descriptor.name, + displayName = descriptor.displayName, + className = descriptor.className + ) + + // ---------------------------- STATUS --------------------------------- + fun statusEvent(event: org.gradle.tooling.events.StatusEvent): StatusEvent = + StatusEvent( + total = event.total, + progress = event.progress, + unit = event.unit, + displayName = event.displayName, + eventTime = event.eventTime, + descriptor = operationDescriptor(event.descriptor)!! + ) + + // ----------------------- DEFAULT ---------------------------------- + fun progress(event: ProgressEvent): org.appdevforall.codeonthego.tooling.events.ProgressEvent = + DefaultProgressEvent( + eventTime = event.eventTime, + displayName = event.displayName, + descriptor = operationDescriptor(event.descriptor)!! + ) + + fun start( + event: org.gradle.tooling.events.StartEvent + ): org.appdevforall.codeonthego.tooling.events.ProgressEvent = + DefaultStartEvent( + eventTime = event.eventTime, + displayName = event.displayName, + descriptor = operationDescriptor(event.descriptor)!! + ) + + fun finish( + event: org.gradle.tooling.events.FinishEvent + ): org.appdevforall.codeonthego.tooling.events.ProgressEvent = + DefaultFinishEvent( + eventTime = event.eventTime, + displayName = event.displayName, + descriptor = operationDescriptor(event.descriptor)!!, + result = DefaultOperationResult(event.result.startTime, event.result.endTime) + ) + } +} diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/progress/ForwardingProgressListener.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/progress/ForwardingProgressListener.kt similarity index 92% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/progress/ForwardingProgressListener.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/progress/ForwardingProgressListener.kt index 7f08ef6a28..d676efdd27 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/progress/ForwardingProgressListener.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/progress/ForwardingProgressListener.kt @@ -1,108 +1,108 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.impl.progress - -import com.itsaky.androidide.tooling.api.IToolingApiClient -import com.itsaky.androidide.tooling.impl.Main -import org.gradle.tooling.events.FinishEvent -import org.gradle.tooling.events.ProgressEvent -import org.gradle.tooling.events.ProgressListener -import org.gradle.tooling.events.StartEvent -import org.gradle.tooling.events.StatusEvent -import org.gradle.tooling.events.configuration.ProjectConfigurationFinishEvent -import org.gradle.tooling.events.configuration.ProjectConfigurationProgressEvent -import org.gradle.tooling.events.configuration.ProjectConfigurationStartEvent -import org.gradle.tooling.events.download.FileDownloadOperationDescriptor -import org.gradle.tooling.events.task.TaskFinishEvent -import org.gradle.tooling.events.task.TaskProgressEvent -import org.gradle.tooling.events.task.TaskStartEvent -import org.gradle.tooling.events.test.TestFinishEvent -import org.gradle.tooling.events.test.TestProgressEvent -import org.gradle.tooling.events.test.TestStartEvent -import org.gradle.tooling.events.transform.TransformFinishEvent -import org.gradle.tooling.events.transform.TransformProgressEvent -import org.gradle.tooling.events.transform.TransformStartEvent -import org.gradle.tooling.events.work.WorkItemFinishEvent -import org.gradle.tooling.events.work.WorkItemProgressEvent -import org.gradle.tooling.events.work.WorkItemStartEvent - -/** - * A [ProgressListener] which forwards all of its event to [IToolingApiClient]. - * @author Akash Yadav - */ -class ForwardingProgressListener : ProgressListener { - - override fun statusChanged(event: ProgressEvent?) { - if (event == null || Main.client == null) { - return - } - - // File download progress event must not be sent - if (event.descriptor is FileDownloadOperationDescriptor) { - return - } - - val ideEvent: com.itsaky.androidide.tooling.events.ProgressEvent = - when (event) { - is ProjectConfigurationProgressEvent -> - when (event) { - is ProjectConfigurationStartEvent -> EventTransformer.projectConfigurationStart(event) - is ProjectConfigurationFinishEvent -> EventTransformer.projectConfigurationFinish(event) - else -> EventTransformer.projectConfigurationProgress(event) - } - - is TaskProgressEvent -> - when (event) { - is TaskStartEvent -> EventTransformer.taskStart(event) - is TaskFinishEvent -> EventTransformer.taskFinish(event) - else -> EventTransformer.taskProgress(event) - } - - is TestProgressEvent -> - when (event) { - is TestStartEvent -> EventTransformer.testStart(event) - is TestFinishEvent -> EventTransformer.testFinish(event) - else -> EventTransformer.testProgress(event) - } - - is TransformProgressEvent -> - when (event) { - is TransformStartEvent -> EventTransformer.transformStart(event) - is TransformFinishEvent -> EventTransformer.transformFinish(event) - else -> EventTransformer.transformProgress(event) - } - - is WorkItemProgressEvent -> - when (event) { - is WorkItemStartEvent -> EventTransformer.workStart(event) - is WorkItemFinishEvent -> EventTransformer.workFinish(event) - else -> EventTransformer.workProgress(event) - } - - is StatusEvent -> EventTransformer.statusEvent(event) - else -> - when (event) { - is StartEvent -> EventTransformer.start(event) - is FinishEvent -> EventTransformer.finish(event) - else -> EventTransformer.progress(event) - } - } - - Main.client?.onProgressEvent(ideEvent) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.impl.progress + +import org.appdevforall.codeonthego.tooling.api.IToolingApiClient +import org.appdevforall.codeonthego.tooling.impl.Main +import org.gradle.tooling.events.FinishEvent +import org.gradle.tooling.events.ProgressEvent +import org.gradle.tooling.events.ProgressListener +import org.gradle.tooling.events.StartEvent +import org.gradle.tooling.events.StatusEvent +import org.gradle.tooling.events.configuration.ProjectConfigurationFinishEvent +import org.gradle.tooling.events.configuration.ProjectConfigurationProgressEvent +import org.gradle.tooling.events.configuration.ProjectConfigurationStartEvent +import org.gradle.tooling.events.download.FileDownloadOperationDescriptor +import org.gradle.tooling.events.task.TaskFinishEvent +import org.gradle.tooling.events.task.TaskProgressEvent +import org.gradle.tooling.events.task.TaskStartEvent +import org.gradle.tooling.events.test.TestFinishEvent +import org.gradle.tooling.events.test.TestProgressEvent +import org.gradle.tooling.events.test.TestStartEvent +import org.gradle.tooling.events.transform.TransformFinishEvent +import org.gradle.tooling.events.transform.TransformProgressEvent +import org.gradle.tooling.events.transform.TransformStartEvent +import org.gradle.tooling.events.work.WorkItemFinishEvent +import org.gradle.tooling.events.work.WorkItemProgressEvent +import org.gradle.tooling.events.work.WorkItemStartEvent + +/** + * A [ProgressListener] which forwards all of its event to [IToolingApiClient]. + * @author Akash Yadav + */ +class ForwardingProgressListener : ProgressListener { + + override fun statusChanged(event: ProgressEvent?) { + if (event == null || Main.client == null) { + return + } + + // File download progress event must not be sent + if (event.descriptor is FileDownloadOperationDescriptor) { + return + } + + val ideEvent: org.appdevforall.codeonthego.tooling.events.ProgressEvent = + when (event) { + is ProjectConfigurationProgressEvent -> + when (event) { + is ProjectConfigurationStartEvent -> EventTransformer.projectConfigurationStart(event) + is ProjectConfigurationFinishEvent -> EventTransformer.projectConfigurationFinish(event) + else -> EventTransformer.projectConfigurationProgress(event) + } + + is TaskProgressEvent -> + when (event) { + is TaskStartEvent -> EventTransformer.taskStart(event) + is TaskFinishEvent -> EventTransformer.taskFinish(event) + else -> EventTransformer.taskProgress(event) + } + + is TestProgressEvent -> + when (event) { + is TestStartEvent -> EventTransformer.testStart(event) + is TestFinishEvent -> EventTransformer.testFinish(event) + else -> EventTransformer.testProgress(event) + } + + is TransformProgressEvent -> + when (event) { + is TransformStartEvent -> EventTransformer.transformStart(event) + is TransformFinishEvent -> EventTransformer.transformFinish(event) + else -> EventTransformer.transformProgress(event) + } + + is WorkItemProgressEvent -> + when (event) { + is WorkItemStartEvent -> EventTransformer.workStart(event) + is WorkItemFinishEvent -> EventTransformer.workFinish(event) + else -> EventTransformer.workProgress(event) + } + + is StatusEvent -> EventTransformer.statusEvent(event) + else -> + when (event) { + is StartEvent -> EventTransformer.start(event) + is FinishEvent -> EventTransformer.finish(event) + else -> EventTransformer.progress(event) + } + } + + Main.client?.onProgressEvent(ideEvent) + } +} diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/serial/AndroidProjectExts.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/serial/AndroidProjectExts.kt similarity index 92% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/serial/AndroidProjectExts.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/serial/AndroidProjectExts.kt index ec7f3a7d93..e3efeccbc8 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/serial/AndroidProjectExts.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/serial/AndroidProjectExts.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.tooling.impl.serial +package org.appdevforall.codeonthego.tooling.impl.serial import com.android.builder.model.v2.dsl.BuildType import com.android.builder.model.v2.ide.AndroidArtifact @@ -21,25 +21,25 @@ import com.android.builder.model.v2.models.AndroidProject import com.android.builder.model.v2.models.BasicAndroidProject import com.android.builder.model.v2.models.VariantDependencies import com.android.builder.model.v2.models.Versions -import com.itsaky.androidide.project.AndroidArtifact -import com.itsaky.androidide.project.AndroidLibraryData -import com.itsaky.androidide.project.AndroidModels -import com.itsaky.androidide.project.AndroidProject -import com.itsaky.androidide.project.AndroidVariant -import com.itsaky.androidide.project.ArtifactDependencies -import com.itsaky.androidide.project.DependencyGraph -import com.itsaky.androidide.project.GraphNode -import com.itsaky.androidide.project.JavaCompilerSettings -import com.itsaky.androidide.project.Library -import com.itsaky.androidide.project.LibraryInfo -import com.itsaky.androidide.project.ProjectInfo -import com.itsaky.androidide.project.SourceProvider -import com.itsaky.androidide.project.SourceSetContainer -import com.itsaky.androidide.project.UnresolvedDependency -import com.itsaky.androidide.project.VariantDependencies -import com.itsaky.androidide.project.ViewBindingOptions -import com.itsaky.androidide.utils.AndroidPluginVersion -import com.itsaky.androidide.utils.capitalizeString +import org.appdevforall.codeonthego.project.AndroidArtifact +import org.appdevforall.codeonthego.project.AndroidLibraryData +import org.appdevforall.codeonthego.project.AndroidModels +import org.appdevforall.codeonthego.project.AndroidProject +import org.appdevforall.codeonthego.project.AndroidVariant +import org.appdevforall.codeonthego.project.ArtifactDependencies +import org.appdevforall.codeonthego.project.DependencyGraph +import org.appdevforall.codeonthego.project.GraphNode +import org.appdevforall.codeonthego.project.JavaCompilerSettings +import org.appdevforall.codeonthego.project.Library +import org.appdevforall.codeonthego.project.LibraryInfo +import org.appdevforall.codeonthego.project.ProjectInfo +import org.appdevforall.codeonthego.project.SourceProvider +import org.appdevforall.codeonthego.project.SourceSetContainer +import org.appdevforall.codeonthego.project.UnresolvedDependency +import org.appdevforall.codeonthego.project.VariantDependencies +import org.appdevforall.codeonthego.project.ViewBindingOptions +import org.appdevforall.codeonthego.utils.AndroidPluginVersion +import org.appdevforall.codeonthego.utils.capitalizeString import java.io.File fun createAndroidProjectProtoModel( diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/serial/GradleProjectExts.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/serial/GradleProjectExts.kt similarity index 71% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/serial/GradleProjectExts.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/serial/GradleProjectExts.kt index 0e20a6daf3..e8b0460d22 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/serial/GradleProjectExts.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/serial/GradleProjectExts.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.tooling.impl.serial +package org.appdevforall.codeonthego.tooling.impl.serial -import com.itsaky.androidide.project.AndroidModels -import com.itsaky.androidide.project.GradleModels -import com.itsaky.androidide.project.GradleProject -import com.itsaky.androidide.project.GradleTask -import com.itsaky.androidide.project.JavaModels +import org.appdevforall.codeonthego.project.AndroidModels +import org.appdevforall.codeonthego.project.GradleModels +import org.appdevforall.codeonthego.project.GradleProject +import org.appdevforall.codeonthego.project.GradleTask +import org.appdevforall.codeonthego.project.JavaModels import org.gradle.tooling.model.GradleProject import org.gradle.tooling.model.GradleTask diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/serial/JavaProjectExts.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/serial/JavaProjectExts.kt similarity index 82% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/serial/JavaProjectExts.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/serial/JavaProjectExts.kt index be15aab5ab..f66a56f93d 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/serial/JavaProjectExts.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/serial/JavaProjectExts.kt @@ -1,15 +1,15 @@ -package com.itsaky.androidide.tooling.impl.serial +package org.appdevforall.codeonthego.tooling.impl.serial -import com.itsaky.androidide.project.Common -import com.itsaky.androidide.project.JavaCompilerSettings -import com.itsaky.androidide.project.JavaContentRoot -import com.itsaky.androidide.project.JavaDependency -import com.itsaky.androidide.project.JavaExternalLibraryDependency -import com.itsaky.androidide.project.JavaModuleDependency -import com.itsaky.androidide.project.JavaProject -import com.itsaky.androidide.project.JavaSourceDirectory -import com.itsaky.androidide.project.LibraryInfo -import com.itsaky.androidide.projects.models.DEFAULT_COMPILER_SETTINGS +import org.appdevforall.codeonthego.project.Common +import org.appdevforall.codeonthego.project.JavaCompilerSettings +import org.appdevforall.codeonthego.project.JavaContentRoot +import org.appdevforall.codeonthego.project.JavaDependency +import org.appdevforall.codeonthego.project.JavaExternalLibraryDependency +import org.appdevforall.codeonthego.project.JavaModuleDependency +import org.appdevforall.codeonthego.project.JavaProject +import org.appdevforall.codeonthego.project.JavaSourceDirectory +import org.appdevforall.codeonthego.project.LibraryInfo +import org.appdevforall.codeonthego.projects.models.DEFAULT_COMPILER_SETTINGS import org.gradle.tooling.model.idea.IdeaContentRoot import org.gradle.tooling.model.idea.IdeaDependency import org.gradle.tooling.model.idea.IdeaModule diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/AbstractModelBuilder.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/AbstractModelBuilder.kt similarity index 91% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/AbstractModelBuilder.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/AbstractModelBuilder.kt index b994b5af68..142e1c033d 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/AbstractModelBuilder.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/AbstractModelBuilder.kt @@ -14,18 +14,18 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.impl.sync +package org.appdevforall.codeonthego.tooling.impl.sync import com.android.builder.model.v2.ide.SyncIssue import com.android.builder.model.v2.models.Versions -import com.itsaky.androidide.builder.model.DefaultSyncIssue -import com.itsaky.androidide.builder.model.IDESyncIssue -import com.itsaky.androidide.tooling.api.util.ToolingProps -import com.itsaky.androidide.utils.AndroidPluginVersion -import com.itsaky.androidide.utils.AndroidPluginVersion.Companion.MINIMUM_SUPPORTED -import com.itsaky.androidide.utils.ILogger -import com.itsaky.androidide.utils.StacktraceUtils -import com.itsaky.androidide.utils.StopWatch +import org.appdevforall.codeonthego.builder.model.DefaultSyncIssue +import org.appdevforall.codeonthego.builder.model.IDESyncIssue +import org.appdevforall.codeonthego.tooling.api.util.ToolingProps +import org.appdevforall.codeonthego.utils.AndroidPluginVersion +import org.appdevforall.codeonthego.utils.AndroidPluginVersion.Companion.MINIMUM_SUPPORTED +import org.appdevforall.codeonthego.utils.ILogger +import org.appdevforall.codeonthego.utils.StacktraceUtils +import org.appdevforall.codeonthego.utils.StopWatch import org.gradle.api.Action import org.gradle.tooling.BuildController import org.gradle.tooling.UnknownModelException @@ -205,7 +205,7 @@ abstract class AbstractModelBuilder : IModelBuilder { /** * Generates the log message for the given objects. This works similar to - * [ generateMessage(Object...)][com.itsaky.androidide.utils.ILogger.generateMessage] in [ILogger][com.itsaky.androidide.utils.ILogger]. + * [ generateMessage(Object...)][org.appdevforall.codeonthego.utils.ILogger.generateMessage] in [ILogger][org.appdevforall.codeonthego.utils.ILogger]. * * @param objects The objects to print in the message. * @return The generated message. diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/AbstractProjectModelBuilder.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/AbstractProjectModelBuilder.kt similarity index 66% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/AbstractProjectModelBuilder.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/AbstractProjectModelBuilder.kt index 69d4624c0c..2d53ea1d36 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/AbstractProjectModelBuilder.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/AbstractProjectModelBuilder.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.tooling.impl.sync +package org.appdevforall.codeonthego.tooling.impl.sync -import com.itsaky.androidide.project.GradleModels +import org.appdevforall.codeonthego.project.GradleModels /** * Abstract implementation of [IProjectModelBuilder]. diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/AndroidProjectModelBuilder.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/AndroidProjectModelBuilder.kt similarity index 92% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/AndroidProjectModelBuilder.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/AndroidProjectModelBuilder.kt index abc529f50f..85bd0d08c7 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/AndroidProjectModelBuilder.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/AndroidProjectModelBuilder.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.impl.sync +package org.appdevforall.codeonthego.tooling.impl.sync import com.android.builder.model.v2.models.AndroidDsl import com.android.builder.model.v2.models.AndroidProject @@ -22,10 +22,10 @@ import com.android.builder.model.v2.models.BasicAndroidProject import com.android.builder.model.v2.models.ModelBuilderParameter import com.android.builder.model.v2.models.ProjectSyncIssues import com.android.builder.model.v2.models.VariantDependencies -import com.itsaky.androidide.project.AndroidModels -import com.itsaky.androidide.tooling.api.IAndroidProject -import com.itsaky.androidide.tooling.api.messages.InitializeProjectParams -import com.itsaky.androidide.tooling.impl.serial.createAndroidProjectProtoModel +import org.appdevforall.codeonthego.project.AndroidModels +import org.appdevforall.codeonthego.tooling.api.IAndroidProject +import org.appdevforall.codeonthego.tooling.api.messages.InitializeProjectParams +import org.appdevforall.codeonthego.tooling.impl.serial.createAndroidProjectProtoModel import org.gradle.tooling.model.GradleProject import java.io.File diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/GradleProjectModelBuilder.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/GradleProjectModelBuilder.kt similarity index 78% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/GradleProjectModelBuilder.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/GradleProjectModelBuilder.kt index fef547ed9e..8d974f888f 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/GradleProjectModelBuilder.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/GradleProjectModelBuilder.kt @@ -14,11 +14,11 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.impl.sync +package org.appdevforall.codeonthego.tooling.impl.sync -import com.itsaky.androidide.project.GradleModels -import com.itsaky.androidide.tooling.api.messages.InitializeProjectParams -import com.itsaky.androidide.tooling.impl.serial.asProtoModel +import org.appdevforall.codeonthego.project.GradleModels +import org.appdevforall.codeonthego.tooling.api.messages.InitializeProjectParams +import org.appdevforall.codeonthego.tooling.impl.serial.asProtoModel import org.gradle.tooling.model.GradleProject object GradleProjectModelBuilder : AbstractProjectModelBuilder() { diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/IModelBuilder.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/IModelBuilder.kt similarity index 90% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/IModelBuilder.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/IModelBuilder.kt index 26090f15ac..9b82ba5269 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/IModelBuilder.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/IModelBuilder.kt @@ -14,9 +14,9 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.impl.sync +package org.appdevforall.codeonthego.tooling.impl.sync -import com.itsaky.androidide.tooling.api.messages.InitializeProjectParams +import org.appdevforall.codeonthego.tooling.api.messages.InitializeProjectParams /** * A model builder builds project models when the project is initialized/synced. diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/IProjectModelBuilder.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/IProjectModelBuilder.kt similarity index 63% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/IProjectModelBuilder.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/IProjectModelBuilder.kt index f99be8e81b..0c3a24d6d9 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/IProjectModelBuilder.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/IProjectModelBuilder.kt @@ -1,6 +1,6 @@ -package com.itsaky.androidide.tooling.impl.sync +package org.appdevforall.codeonthego.tooling.impl.sync -import com.itsaky.androidide.project.GradleModels +import org.appdevforall.codeonthego.project.GradleModels /** * A [model builder][IModelBuilder] used specifically building project models. diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/ISyncIssueReporter.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/ISyncIssueReporter.kt similarity index 96% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/ISyncIssueReporter.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/ISyncIssueReporter.kt index a35565e34a..3bceafab48 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/ISyncIssueReporter.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/ISyncIssueReporter.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.impl.sync +package org.appdevforall.codeonthego.tooling.impl.sync import com.android.builder.model.v2.ide.SyncIssue import com.android.builder.model.v2.models.ProjectSyncIssues diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/JavaProjectModelBuilder.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/JavaProjectModelBuilder.kt similarity index 80% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/JavaProjectModelBuilder.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/JavaProjectModelBuilder.kt index cd22f70718..9cc180b3a0 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/JavaProjectModelBuilder.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/JavaProjectModelBuilder.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.impl.sync +package org.appdevforall.codeonthego.tooling.impl.sync -import com.itsaky.androidide.project.JavaModels -import com.itsaky.androidide.tooling.api.messages.InitializeProjectParams -import com.itsaky.androidide.tooling.impl.serial.createJavaProjectProtoModel +import org.appdevforall.codeonthego.project.JavaModels +import org.appdevforall.codeonthego.tooling.api.messages.InitializeProjectParams +import org.appdevforall.codeonthego.tooling.impl.serial.createJavaProjectProtoModel /** * Builds model for Java library projects. diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/ModelBuilderException.java b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/ModelBuilderException.java similarity index 95% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/ModelBuilderException.java rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/ModelBuilderException.java index a1c2dc7ebc..e9336291af 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/ModelBuilderException.java +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/ModelBuilderException.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.impl.sync; +package org.appdevforall.codeonthego.tooling.impl.sync; /** * Exception thrown while building project models. diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/NotAnAndroidProjectException.java b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/NotAnAndroidProjectException.java similarity index 95% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/NotAnAndroidProjectException.java rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/NotAnAndroidProjectException.java index 31c143dea1..d521d2391b 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/NotAnAndroidProjectException.java +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/NotAnAndroidProjectException.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.impl.sync; +package org.appdevforall.codeonthego.tooling.impl.sync; /** * Exception thrown to indicate that a project is not an Android project. diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/RootModelBuilder.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/RootModelBuilder.kt similarity index 89% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/RootModelBuilder.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/RootModelBuilder.kt index c59294d27a..bf33456fe8 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/RootModelBuilder.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/RootModelBuilder.kt @@ -15,21 +15,21 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.impl.sync +package org.appdevforall.codeonthego.tooling.impl.sync import com.android.builder.model.v2.ide.SyncIssue -import com.itsaky.androidide.builder.model.shouldBeIgnored -import com.itsaky.androidide.project.GradleBuild -import com.itsaky.androidide.project.GradleModels -import com.itsaky.androidide.project.ProjectModelInfo -import com.itsaky.androidide.project.SyncIssue -import com.itsaky.androidide.projects.models.projectDir -import com.itsaky.androidide.tooling.api.IAndroidProject -import com.itsaky.androidide.tooling.api.messages.InitializeProjectParams -import com.itsaky.androidide.tooling.api.sync.ProjectSyncHelper -import com.itsaky.androidide.tooling.impl.Main -import com.itsaky.androidide.tooling.impl.util.configureFrom -import com.itsaky.androidide.utils.sha256 +import org.appdevforall.codeonthego.builder.model.shouldBeIgnored +import org.appdevforall.codeonthego.project.GradleBuild +import org.appdevforall.codeonthego.project.GradleModels +import org.appdevforall.codeonthego.project.ProjectModelInfo +import org.appdevforall.codeonthego.project.SyncIssue +import org.appdevforall.codeonthego.projects.models.projectDir +import org.appdevforall.codeonthego.tooling.api.IAndroidProject +import org.appdevforall.codeonthego.tooling.api.messages.InitializeProjectParams +import org.appdevforall.codeonthego.tooling.api.sync.ProjectSyncHelper +import org.appdevforall.codeonthego.tooling.impl.Main +import org.appdevforall.codeonthego.tooling.impl.util.configureFrom +import org.appdevforall.codeonthego.utils.sha256 import kotlinx.coroutines.runBlocking import org.gradle.tooling.ConfigurableLauncher import org.gradle.tooling.model.idea.IdeaProject diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/types.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/types.kt similarity index 95% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/types.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/types.kt index 3c0b37842c..389be52cd3 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/sync/types.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/sync/types.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.impl.sync +package org.appdevforall.codeonthego.tooling.impl.sync import com.android.builder.model.v2.models.Versions -import com.itsaky.androidide.tooling.api.messages.ClientGradleBuildConfig +import org.appdevforall.codeonthego.tooling.api.messages.ClientGradleBuildConfig import org.gradle.tooling.BuildController import org.gradle.tooling.CancellationToken import org.gradle.tooling.ProjectConnection diff --git a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/util/GradleBuildExts.kt b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/util/GradleBuildExts.kt similarity index 77% rename from subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/util/GradleBuildExts.kt rename to subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/util/GradleBuildExts.kt index 6b16ab3555..bc439fd894 100644 --- a/subprojects/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/util/GradleBuildExts.kt +++ b/subprojects/tooling-api-impl/src/main/java/org/appdevforall/codeonthego/tooling/impl/util/GradleBuildExts.kt @@ -1,10 +1,10 @@ -package com.itsaky.androidide.tooling.impl.util +package org.appdevforall.codeonthego.tooling.impl.util -import com.itsaky.androidide.tooling.api.messages.ClientGradleBuildConfig -import com.itsaky.androidide.tooling.api.messages.GradleBuildParams -import com.itsaky.androidide.tooling.impl.LoggingOutputStream -import com.itsaky.androidide.tooling.impl.Main -import com.itsaky.androidide.tooling.impl.progress.ForwardingProgressListener +import org.appdevforall.codeonthego.tooling.api.messages.ClientGradleBuildConfig +import org.appdevforall.codeonthego.tooling.api.messages.GradleBuildParams +import org.appdevforall.codeonthego.tooling.impl.LoggingOutputStream +import org.appdevforall.codeonthego.tooling.impl.Main +import org.appdevforall.codeonthego.tooling.impl.progress.ForwardingProgressListener import org.gradle.tooling.ConfigurableLauncher import org.slf4j.LoggerFactory import java.io.ByteArrayInputStream diff --git a/subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/api/sync/SyncLockTest.kt b/subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/api/sync/SyncLockTest.kt similarity index 97% rename from subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/api/sync/SyncLockTest.kt rename to subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/api/sync/SyncLockTest.kt index 7280053fa1..978e751114 100644 --- a/subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/api/sync/SyncLockTest.kt +++ b/subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/api/sync/SyncLockTest.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.sync +package org.appdevforall.codeonthego.tooling.api.sync import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.utils.SharedEnvironment +import org.appdevforall.codeonthego.utils.SharedEnvironment import org.junit.Assume.assumeTrue import org.junit.Rule import org.junit.Test diff --git a/subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/api/sync/SyncMetaVersionTest.kt b/subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/api/sync/SyncMetaVersionTest.kt similarity index 99% rename from subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/api/sync/SyncMetaVersionTest.kt rename to subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/api/sync/SyncMetaVersionTest.kt index 799c705e8e..732cc0bcca 100644 --- a/subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/api/sync/SyncMetaVersionTest.kt +++ b/subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/api/sync/SyncMetaVersionTest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.sync +package org.appdevforall.codeonthego.tooling.api.sync import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.runBlocking diff --git a/subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/GradleDaemonWatcherTest.kt b/subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/impl/GradleDaemonWatcherTest.kt similarity index 99% rename from subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/GradleDaemonWatcherTest.kt rename to subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/impl/GradleDaemonWatcherTest.kt index 1c45307d2e..a243036734 100644 --- a/subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/GradleDaemonWatcherTest.kt +++ b/subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/impl/GradleDaemonWatcherTest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.impl +package org.appdevforall.codeonthego.tooling.impl import com.google.common.truth.Truth.assertThat import io.mockk.every diff --git a/subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/ToolingApiServerImplTest.kt b/subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/impl/ToolingApiServerImplTest.kt similarity index 93% rename from subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/ToolingApiServerImplTest.kt rename to subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/impl/ToolingApiServerImplTest.kt index 9353bf29e1..b3ea327ecd 100644 --- a/subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/ToolingApiServerImplTest.kt +++ b/subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/impl/ToolingApiServerImplTest.kt @@ -1,16 +1,16 @@ -package com.itsaky.androidide.tooling.impl +package org.appdevforall.codeonthego.tooling.impl import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.tooling.api.IToolingApiClient -import com.itsaky.androidide.tooling.api.messages.BuildId -import com.itsaky.androidide.tooling.api.messages.InitializeProjectParams -import com.itsaky.androidide.tooling.api.messages.result.BuildCancellationRequestResult -import com.itsaky.androidide.tooling.api.messages.result.BuildResult -import com.itsaky.androidide.tooling.api.messages.result.InitializeResult -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult -import com.itsaky.androidide.tooling.api.messages.result.isSuccessful -import com.itsaky.androidide.tooling.api.sync.ProjectSyncHelper -import com.itsaky.androidide.tooling.impl.sync.RootModelBuilder +import org.appdevforall.codeonthego.tooling.api.IToolingApiClient +import org.appdevforall.codeonthego.tooling.api.messages.BuildId +import org.appdevforall.codeonthego.tooling.api.messages.InitializeProjectParams +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildCancellationRequestResult +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildResult +import org.appdevforall.codeonthego.tooling.api.messages.result.InitializeResult +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult +import org.appdevforall.codeonthego.tooling.api.messages.result.isSuccessful +import org.appdevforall.codeonthego.tooling.api.sync.ProjectSyncHelper +import org.appdevforall.codeonthego.tooling.impl.sync.RootModelBuilder import io.mockk.every import io.mockk.mockk import io.mockk.mockkObject diff --git a/subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/logging/ToolingApiAppenderTest.kt b/subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/impl/logging/ToolingApiAppenderTest.kt similarity index 80% rename from subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/logging/ToolingApiAppenderTest.kt rename to subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/impl/logging/ToolingApiAppenderTest.kt index fbc49f934a..58799182fe 100644 --- a/subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/logging/ToolingApiAppenderTest.kt +++ b/subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/impl/logging/ToolingApiAppenderTest.kt @@ -1,9 +1,9 @@ -package com.itsaky.androidide.tooling.impl.logging +package org.appdevforall.codeonthego.tooling.impl.logging import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.tooling.api.IToolingApiClient -import com.itsaky.androidide.tooling.api.messages.LogMessageParams -import com.itsaky.androidide.tooling.impl.Main +import org.appdevforall.codeonthego.tooling.api.IToolingApiClient +import org.appdevforall.codeonthego.tooling.api.messages.LogMessageParams +import org.appdevforall.codeonthego.tooling.impl.Main import io.mockk.mockk import io.mockk.slot import io.mockk.verify @@ -32,12 +32,12 @@ class ToolingApiAppenderTest { val client = mockk(relaxed = true) Main.setClientForTesting(client) - ToolingApiAppender.onLog(Level.WARN, "com.itsaky.androidide.Foo", "hello world", null) + ToolingApiAppender.onLog(Level.WARN, "org.appdevforall.codeonthego.Foo", "hello world", null) val captured = slot() verify { client.logMessage(capture(captured)) } assertThat(captured.captured.level).isEqualTo('W') - assertThat(captured.captured.tag).isEqualTo("com.itsaky.androidide.Foo") + assertThat(captured.captured.tag).isEqualTo("org.appdevforall.codeonthego.Foo") assertThat(captured.captured.message).contains("hello world") } diff --git a/subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/serial/DependencyGraphFlatteningTest.kt b/subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/impl/serial/DependencyGraphFlatteningTest.kt similarity index 98% rename from subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/serial/DependencyGraphFlatteningTest.kt rename to subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/impl/serial/DependencyGraphFlatteningTest.kt index 69039c3afc..7da1ba0f2f 100644 --- a/subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/serial/DependencyGraphFlatteningTest.kt +++ b/subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/impl/serial/DependencyGraphFlatteningTest.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.impl.serial +package org.appdevforall.codeonthego.tooling.impl.serial import com.android.builder.model.v2.ide.ArtifactDependencies import com.android.builder.model.v2.ide.GraphItem import com.android.builder.model.v2.ide.UnresolvedDependency import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.project.AndroidModels +import org.appdevforall.codeonthego.project.AndroidModels import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.JUnit4 diff --git a/subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/serial/VariantSourceProvidersTest.kt b/subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/impl/serial/VariantSourceProvidersTest.kt similarity index 98% rename from subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/serial/VariantSourceProvidersTest.kt rename to subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/impl/serial/VariantSourceProvidersTest.kt index 36094e9ada..c2a3dac21b 100644 --- a/subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/serial/VariantSourceProvidersTest.kt +++ b/subprojects/tooling-api-impl/src/test/java/org/appdevforall/codeonthego/tooling/impl/serial/VariantSourceProvidersTest.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.tooling.impl.serial +package org.appdevforall.codeonthego.tooling.impl.serial import com.android.builder.model.v2.ide.BasicArtifact import com.android.builder.model.v2.ide.BasicVariant diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/IAndroidProject.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/IAndroidProject.kt similarity index 98% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/IAndroidProject.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/IAndroidProject.kt index 2be85ed4c4..b677c5f3df 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/IAndroidProject.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/IAndroidProject.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api +package org.appdevforall.codeonthego.tooling.api /** * Model for an Android project/module. diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/IGradleProject.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/IGradleProject.kt similarity index 87% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/IGradleProject.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/IGradleProject.kt index 915f88f61d..7b6a0a4df4 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/IGradleProject.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/IGradleProject.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api +package org.appdevforall.codeonthego.tooling.api -import com.itsaky.androidide.tooling.api.models.GradleTask -import com.itsaky.androidide.tooling.api.models.ProjectMetadata +import org.appdevforall.codeonthego.tooling.api.models.GradleTask +import org.appdevforall.codeonthego.tooling.api.models.ProjectMetadata import org.eclipse.lsp4j.jsonrpc.services.JsonRequest import org.eclipse.lsp4j.jsonrpc.services.JsonSegment import java.util.concurrent.CompletableFuture diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/ProjectType.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/ProjectType.kt similarity index 96% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/ProjectType.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/ProjectType.kt index 98832d7be4..bee8faff1a 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/ProjectType.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/ProjectType.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api +package org.appdevforall.codeonthego.tooling.api /** * The type of [IGradleProject]. diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/AndroidArtifactMetadata.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/AndroidArtifactMetadata.kt similarity index 96% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/AndroidArtifactMetadata.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/AndroidArtifactMetadata.kt index f2734a900a..221dc4b406 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/AndroidArtifactMetadata.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/AndroidArtifactMetadata.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.models +package org.appdevforall.codeonthego.tooling.api.models import java.io.File import java.io.Serializable diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/AndroidProjectMetadata.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/AndroidProjectMetadata.kt similarity index 86% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/AndroidProjectMetadata.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/AndroidProjectMetadata.kt index 646e2c63ae..cd86625647 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/AndroidProjectMetadata.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/AndroidProjectMetadata.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.models +package org.appdevforall.codeonthego.tooling.api.models -import com.itsaky.androidide.builder.model.DefaultAndroidGradlePluginProjectFlags -import com.itsaky.androidide.builder.model.DefaultJavaCompileOptions -import com.itsaky.androidide.builder.model.DefaultViewBindingOptions -import com.itsaky.androidide.tooling.api.ProjectType +import org.appdevforall.codeonthego.builder.model.DefaultAndroidGradlePluginProjectFlags +import org.appdevforall.codeonthego.builder.model.DefaultJavaCompileOptions +import org.appdevforall.codeonthego.builder.model.DefaultViewBindingOptions +import org.appdevforall.codeonthego.tooling.api.ProjectType import java.io.File /** diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/AndroidVariantMetadata.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/AndroidVariantMetadata.kt similarity index 95% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/AndroidVariantMetadata.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/AndroidVariantMetadata.kt index 408555774d..09a6d733f8 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/AndroidVariantMetadata.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/AndroidVariantMetadata.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.models +package org.appdevforall.codeonthego.tooling.api.models /** * Metadata about a variant in an Android project. diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/BasicAndroidVariantMetadata.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/BasicAndroidVariantMetadata.kt similarity index 95% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/BasicAndroidVariantMetadata.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/BasicAndroidVariantMetadata.kt index 2c1402da75..9129b8b455 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/BasicAndroidVariantMetadata.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/BasicAndroidVariantMetadata.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.models +package org.appdevforall.codeonthego.tooling.api.models import java.io.Serializable diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/BasicProjectMetadata.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/BasicProjectMetadata.kt similarity index 95% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/BasicProjectMetadata.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/BasicProjectMetadata.kt index 44340c63ce..6a6ea4e354 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/BasicProjectMetadata.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/BasicProjectMetadata.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.models +package org.appdevforall.codeonthego.tooling.api.models import java.io.File import java.io.Serializable diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/BuildVariantInfo.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/BuildVariantInfo.kt similarity index 97% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/BuildVariantInfo.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/BuildVariantInfo.kt index f9327842f0..69ac9889b6 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/BuildVariantInfo.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/BuildVariantInfo.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.models +package org.appdevforall.codeonthego.tooling.api.models /** * Information about the build variants of an Android module. diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/GradleArtifact.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/GradleArtifact.kt similarity index 94% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/GradleArtifact.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/GradleArtifact.kt index 1153935d1d..86e85c8734 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/GradleArtifact.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/GradleArtifact.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.models +package org.appdevforall.codeonthego.tooling.api.models import java.io.Serializable diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/GradleTask.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/GradleTask.kt similarity index 95% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/GradleTask.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/GradleTask.kt index da57be4603..1aa808ec9c 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/GradleTask.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/GradleTask.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.models +package org.appdevforall.codeonthego.tooling.api.models /** * A Gradle task. diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/IModuleMetadata.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/IModuleMetadata.kt similarity index 94% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/IModuleMetadata.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/IModuleMetadata.kt index 3eab035a44..e45186115f 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/IModuleMetadata.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/IModuleMetadata.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.models +package org.appdevforall.codeonthego.tooling.api.models import java.io.File diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaContentRoot.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaContentRoot.kt similarity index 92% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaContentRoot.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaContentRoot.kt index eefeba3cbf..cd966cdf2b 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaContentRoot.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaContentRoot.kt @@ -1,27 +1,27 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.api.models - -import java.io.Serializable - -/** @author Akash Yadav */ -class JavaContentRoot : Serializable { - private val serialVersionUID = 1L - val sourceDirectories: List = mutableListOf() - val testDirectories: List = mutableListOf() -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.api.models + +import java.io.Serializable + +/** @author Akash Yadav */ +class JavaContentRoot : Serializable { + private val serialVersionUID = 1L + val sourceDirectories: List = mutableListOf() + val testDirectories: List = mutableListOf() +} diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaModuleCompilerSettings.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaModuleCompilerSettings.kt similarity index 91% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaModuleCompilerSettings.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaModuleCompilerSettings.kt index e3a59b2aa8..56415d33c4 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaModuleCompilerSettings.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaModuleCompilerSettings.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.models +package org.appdevforall.codeonthego.tooling.api.models -import com.itsaky.androidide.builder.model.IJavaCompilerSettings +import org.appdevforall.codeonthego.builder.model.IJavaCompilerSettings /** * Compiler settings for [JavaModule]. diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaModuleDependency.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaModuleDependency.kt similarity index 92% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaModuleDependency.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaModuleDependency.kt index ad578cee16..9d22c99e76 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaModuleDependency.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaModuleDependency.kt @@ -1,31 +1,31 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.api.models - -import java.io.File -import java.io.Serializable - -/** - * Dependency of an [JavaModule]. - * - * @author Akash Yadav - */ -abstract class JavaModuleDependency(val jarFile: File?, val scope: String, val exported: Boolean) : Serializable { - private val serialVersionUID = 1L - private val gsonType = javaClass.name -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.api.models + +import java.io.File +import java.io.Serializable + +/** + * Dependency of an [JavaModule]. + * + * @author Akash Yadav + */ +abstract class JavaModuleDependency(val jarFile: File?, val scope: String, val exported: Boolean) : Serializable { + private val serialVersionUID = 1L + private val gsonType = javaClass.name +} diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaModuleExternalDependency.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaModuleExternalDependency.kt similarity index 93% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaModuleExternalDependency.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaModuleExternalDependency.kt index 40d2ee6cb6..4599e6b232 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaModuleExternalDependency.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaModuleExternalDependency.kt @@ -1,45 +1,45 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.api.models - -import java.io.File -import java.io.Serializable - -/** - * An external dependency of an [JavaModule]. - * - * @author Akash Yadav - */ -class JavaModuleExternalDependency( - jar: File, - - /** `sources.jar` for this dependency. */ - val sources: File? = null, - - /** `javadoc.jar` for this dependency. */ - val javadoc: File? = null, - - /** The Gradle dependency artifact for this dependency. */ - val gradleArtifact: GradleArtifact?, - - /** Scope of this dependency. */ - scope: String, - - /** Whether the dependency is exported. */ - exported: Boolean -) : JavaModuleDependency(jar, scope, exported), Serializable +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.api.models + +import java.io.File +import java.io.Serializable + +/** + * An external dependency of an [JavaModule]. + * + * @author Akash Yadav + */ +class JavaModuleExternalDependency( + jar: File, + + /** `sources.jar` for this dependency. */ + val sources: File? = null, + + /** `javadoc.jar` for this dependency. */ + val javadoc: File? = null, + + /** The Gradle dependency artifact for this dependency. */ + val gradleArtifact: GradleArtifact?, + + /** Scope of this dependency. */ + scope: String, + + /** Whether the dependency is exported. */ + exported: Boolean +) : JavaModuleDependency(jar, scope, exported), Serializable diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaModuleProjectDependency.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaModuleProjectDependency.kt similarity index 93% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaModuleProjectDependency.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaModuleProjectDependency.kt index 2a026a3838..565bc227b0 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaModuleProjectDependency.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaModuleProjectDependency.kt @@ -1,40 +1,40 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.api.models - -import java.io.Serializable - -/** - * A project dependency of an [JavaModule]. More details about the project can be fetched by - * querying the [projectPath] in the root project. - * - * @author Akash Yadav - */ -class JavaModuleProjectDependency( - /** The name of the module project. */ - val moduleName: String, - - /** The path of the project. */ - val projectPath: String, - - /** Scope of this dependency. */ - scope: String, - - /** Whether the dependency is exported. */ - exported: Boolean -) : JavaModuleDependency(null, scope, exported), Serializable +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.api.models + +import java.io.Serializable + +/** + * A project dependency of an [JavaModule]. More details about the project can be fetched by + * querying the [projectPath] in the root project. + * + * @author Akash Yadav + */ +class JavaModuleProjectDependency( + /** The name of the module project. */ + val moduleName: String, + + /** The path of the project. */ + val projectPath: String, + + /** Scope of this dependency. */ + scope: String, + + /** Whether the dependency is exported. */ + exported: Boolean +) : JavaModuleDependency(null, scope, exported), Serializable diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaProjectMetadata.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaProjectMetadata.kt similarity index 89% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaProjectMetadata.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaProjectMetadata.kt index c638037b62..1145838049 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaProjectMetadata.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaProjectMetadata.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.models +package org.appdevforall.codeonthego.tooling.api.models -import com.itsaky.androidide.builder.model.IJavaCompilerSettings -import com.itsaky.androidide.tooling.api.ProjectType +import org.appdevforall.codeonthego.builder.model.IJavaCompilerSettings +import org.appdevforall.codeonthego.tooling.api.ProjectType import java.io.File /** diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaSourceDirectory.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaSourceDirectory.kt similarity index 92% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaSourceDirectory.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaSourceDirectory.kt index f1bd79c50f..6372cf86dd 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/JavaSourceDirectory.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/JavaSourceDirectory.kt @@ -1,31 +1,31 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.api.models - -import java.io.File -import java.io.Serializable - -/** - * A source directory of an [JavaModule]. - * - * @author Akash Yadav - */ -class JavaSourceDirectory(val directory: File, val isGenerated: Boolean) : Serializable { - private val gsonType: String = javaClass.name - private val serialVersionUID = 1L -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.api.models + +import java.io.File +import java.io.Serializable + +/** + * A source directory of an [JavaModule]. + * + * @author Akash Yadav + */ +class JavaSourceDirectory(val directory: File, val isGenerated: Boolean) : Serializable { + private val gsonType: String = javaClass.name + private val serialVersionUID = 1L +} diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/Launchable.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/Launchable.kt similarity index 95% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/Launchable.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/Launchable.kt index 22c4ebd335..b99332d7b5 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/Launchable.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/Launchable.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.models +package org.appdevforall.codeonthego.tooling.api.models import java.io.Serializable diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/ProjectMetadata.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/ProjectMetadata.kt similarity index 91% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/ProjectMetadata.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/ProjectMetadata.kt index fa8b414c4d..7d1e43faad 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/ProjectMetadata.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/ProjectMetadata.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.models +package org.appdevforall.codeonthego.tooling.api.models -import com.itsaky.androidide.tooling.api.ProjectType +import org.appdevforall.codeonthego.tooling.api.ProjectType import java.io.File /** diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/ToolingServerMetadata.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/ToolingServerMetadata.kt similarity index 93% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/ToolingServerMetadata.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/ToolingServerMetadata.kt index cdc9f6f426..8d6805b7be 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/ToolingServerMetadata.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/ToolingServerMetadata.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.models +package org.appdevforall.codeonthego.tooling.api.models /** * Metadata about the tooling server. diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/params/StringParameter.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/params/StringParameter.kt similarity index 93% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/params/StringParameter.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/params/StringParameter.kt index 3d22a22716..ecc0495413 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/params/StringParameter.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/params/StringParameter.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.models.params +package org.appdevforall.codeonthego.tooling.api.models.params /** * Use for requests/notification which accept one string parameter. diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/result/SelectProjectResult.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/result/SelectProjectResult.kt similarity index 88% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/result/SelectProjectResult.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/result/SelectProjectResult.kt index adb550b547..6ced029abe 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/models/result/SelectProjectResult.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/models/result/SelectProjectResult.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.models.result +package org.appdevforall.codeonthego.tooling.api.models.result /** - * Result sent to the client when selecting a project in [IProjectQueries][com.itsaky.androidide.tooling.api.IProjectQueries]. + * Result sent to the client when selecting a project in [IProjectQueries][org.appdevforall.codeonthego.tooling.api.IProjectQueries]. * * @param isSuccessful Whether the project selection was successful. If the value is `false`, it is * because the project with the provided path was not found. diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/util/AndroidModulePropertyCopier.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/util/AndroidModulePropertyCopier.kt similarity index 88% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/util/AndroidModulePropertyCopier.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/util/AndroidModulePropertyCopier.kt index 927e81a6c6..97442c1860 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/util/AndroidModulePropertyCopier.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/util/AndroidModulePropertyCopier.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.util +package org.appdevforall.codeonthego.tooling.api.util import com.android.builder.model.v2.CustomSourceDirectory import com.android.builder.model.v2.ide.AndroidGradlePluginProjectFlags @@ -34,22 +34,22 @@ import com.android.builder.model.v2.ide.SyncIssue import com.android.builder.model.v2.ide.UnresolvedDependency import com.android.builder.model.v2.ide.ViewBindingOptions import com.android.builder.model.v2.models.ProjectSyncIssues -import com.itsaky.androidide.builder.model.DefaultAndroidGradlePluginProjectFlags -import com.itsaky.androidide.builder.model.DefaultAndroidLibraryData -import com.itsaky.androidide.builder.model.DefaultApiVersion -import com.itsaky.androidide.builder.model.DefaultArtifactDependencies -import com.itsaky.androidide.builder.model.DefaultCustomSourceDirectory -import com.itsaky.androidide.builder.model.DefaultGraphItem -import com.itsaky.androidide.builder.model.DefaultJavaCompileOptions -import com.itsaky.androidide.builder.model.DefaultLibrary -import com.itsaky.androidide.builder.model.DefaultLibraryInfo -import com.itsaky.androidide.builder.model.DefaultProjectInfo -import com.itsaky.androidide.builder.model.DefaultProjectSyncIssues -import com.itsaky.androidide.builder.model.DefaultSourceProvider -import com.itsaky.androidide.builder.model.DefaultSourceSetContainer -import com.itsaky.androidide.builder.model.DefaultSyncIssue -import com.itsaky.androidide.builder.model.DefaultUnresolvedDependency -import com.itsaky.androidide.builder.model.DefaultViewBindingOptions +import org.appdevforall.codeonthego.builder.model.DefaultAndroidGradlePluginProjectFlags +import org.appdevforall.codeonthego.builder.model.DefaultAndroidLibraryData +import org.appdevforall.codeonthego.builder.model.DefaultApiVersion +import org.appdevforall.codeonthego.builder.model.DefaultArtifactDependencies +import org.appdevforall.codeonthego.builder.model.DefaultCustomSourceDirectory +import org.appdevforall.codeonthego.builder.model.DefaultGraphItem +import org.appdevforall.codeonthego.builder.model.DefaultJavaCompileOptions +import org.appdevforall.codeonthego.builder.model.DefaultLibrary +import org.appdevforall.codeonthego.builder.model.DefaultLibraryInfo +import org.appdevforall.codeonthego.builder.model.DefaultProjectInfo +import org.appdevforall.codeonthego.builder.model.DefaultProjectSyncIssues +import org.appdevforall.codeonthego.builder.model.DefaultSourceProvider +import org.appdevforall.codeonthego.builder.model.DefaultSourceSetContainer +import org.appdevforall.codeonthego.builder.model.DefaultSyncIssue +import org.appdevforall.codeonthego.builder.model.DefaultUnresolvedDependency +import org.appdevforall.codeonthego.builder.model.DefaultViewBindingOptions /** * As the data is sent over streams, and the instances of properties specified in [AndroidModule] diff --git a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/util/utils.kt b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/util/utils.kt similarity index 85% rename from subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/util/utils.kt rename to subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/util/utils.kt index 48092f72c8..f6a4433850 100644 --- a/subprojects/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/util/utils.kt +++ b/subprojects/tooling-api-model/src/main/java/org/appdevforall/codeonthego/tooling/api/util/utils.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.util +package org.appdevforall.codeonthego.tooling.api.util import com.android.builder.model.v2.ide.LibraryType.ANDROID_LIBRARY -import com.itsaky.androidide.builder.model.UNKNOWN_PACKAGE -import com.itsaky.androidide.project.AndroidModels -import com.itsaky.androidide.projects.models.manifestFile -import com.itsaky.androidide.tooling.api.IAndroidProject +import org.appdevforall.codeonthego.builder.model.UNKNOWN_PACKAGE +import org.appdevforall.codeonthego.project.AndroidModels +import org.appdevforall.codeonthego.projects.models.manifestFile +import org.appdevforall.codeonthego.tooling.api.IAndroidProject import org.eclipse.lemminx.dom.DOMParser import org.eclipse.lemminx.uriresolver.URIResolverExtensionManager import java.io.File diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/ForwardingToolingApiClient.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/ForwardingToolingApiClient.kt similarity index 79% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/ForwardingToolingApiClient.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/ForwardingToolingApiClient.kt index a6bf243111..21bd584d7f 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/ForwardingToolingApiClient.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/ForwardingToolingApiClient.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api +package org.appdevforall.codeonthego.tooling.api -import com.itsaky.androidide.tooling.api.messages.ClientGradleBuildConfig -import com.itsaky.androidide.tooling.api.messages.LogMessageParams -import com.itsaky.androidide.tooling.api.messages.result.BuildInfo -import com.itsaky.androidide.tooling.api.messages.result.BuildResult -import com.itsaky.androidide.tooling.api.messages.result.GradleWrapperCheckResult -import com.itsaky.androidide.tooling.events.ProgressEvent +import org.appdevforall.codeonthego.tooling.api.messages.ClientGradleBuildConfig +import org.appdevforall.codeonthego.tooling.api.messages.LogMessageParams +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildInfo +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildResult +import org.appdevforall.codeonthego.tooling.api.messages.result.GradleWrapperCheckResult +import org.appdevforall.codeonthego.tooling.events.ProgressEvent import java.util.concurrent.CompletableFuture /** diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/IToolingApiClient.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/IToolingApiClient.kt similarity index 88% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/IToolingApiClient.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/IToolingApiClient.kt index 7c50893e6d..7735d60c73 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/IToolingApiClient.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/IToolingApiClient.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api +package org.appdevforall.codeonthego.tooling.api -import com.itsaky.androidide.tooling.api.messages.ClientGradleBuildConfig -import com.itsaky.androidide.tooling.api.messages.LogMessageParams -import com.itsaky.androidide.tooling.api.messages.result.BuildInfo -import com.itsaky.androidide.tooling.api.messages.result.BuildResult -import com.itsaky.androidide.tooling.api.messages.result.GradleWrapperCheckResult -import com.itsaky.androidide.tooling.events.ProgressEvent +import org.appdevforall.codeonthego.tooling.api.messages.ClientGradleBuildConfig +import org.appdevforall.codeonthego.tooling.api.messages.LogMessageParams +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildInfo +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildResult +import org.appdevforall.codeonthego.tooling.api.messages.result.GradleWrapperCheckResult +import org.appdevforall.codeonthego.tooling.events.ProgressEvent import org.eclipse.lsp4j.jsonrpc.services.JsonNotification import org.eclipse.lsp4j.jsonrpc.services.JsonRequest import org.eclipse.lsp4j.jsonrpc.services.JsonSegment diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/IToolingApiServer.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/IToolingApiServer.kt similarity index 79% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/IToolingApiServer.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/IToolingApiServer.kt index 39fc60591a..38cfb28914 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/IToolingApiServer.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/IToolingApiServer.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api +package org.appdevforall.codeonthego.tooling.api -import com.itsaky.androidide.tooling.api.messages.InitializeProjectParams -import com.itsaky.androidide.tooling.api.messages.TaskExecutionMessage -import com.itsaky.androidide.tooling.api.messages.result.BuildCancellationRequestResult -import com.itsaky.androidide.tooling.api.messages.result.InitializeResult -import com.itsaky.androidide.tooling.api.messages.result.TaskExecutionResult -import com.itsaky.androidide.tooling.api.models.ToolingServerMetadata +import org.appdevforall.codeonthego.tooling.api.messages.InitializeProjectParams +import org.appdevforall.codeonthego.tooling.api.messages.TaskExecutionMessage +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildCancellationRequestResult +import org.appdevforall.codeonthego.tooling.api.messages.result.InitializeResult +import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult +import org.appdevforall.codeonthego.tooling.api.models.ToolingServerMetadata import org.eclipse.lsp4j.jsonrpc.services.JsonRequest import org.eclipse.lsp4j.jsonrpc.services.JsonSegment import java.util.concurrent.CompletableFuture diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/AndroidInitializationParams.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/AndroidInitializationParams.kt similarity index 95% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/AndroidInitializationParams.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/AndroidInitializationParams.kt index dc0c0acbad..3c07a1548b 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/AndroidInitializationParams.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/AndroidInitializationParams.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.messages +package org.appdevforall.codeonthego.tooling.api.messages import java.io.Serializable diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/BuildId.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/BuildId.kt similarity index 90% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/BuildId.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/BuildId.kt index 2984af70ea..3a4192e8be 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/BuildId.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/BuildId.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.tooling.api.messages +package org.appdevforall.codeonthego.tooling.api.messages import java.io.Serializable diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/ClientGradleBuildConfig.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/ClientGradleBuildConfig.kt similarity index 83% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/ClientGradleBuildConfig.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/ClientGradleBuildConfig.kt index 9857d97f41..9abcb05d55 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/ClientGradleBuildConfig.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/ClientGradleBuildConfig.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.tooling.api.messages +package org.appdevforall.codeonthego.tooling.api.messages import java.io.Serializable diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/GradleBuildParams.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/GradleBuildParams.kt similarity index 83% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/GradleBuildParams.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/GradleBuildParams.kt index e7be70224e..6fad156bb7 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/GradleBuildParams.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/GradleBuildParams.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.tooling.api.messages +package org.appdevforall.codeonthego.tooling.api.messages import java.io.Serializable diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/GradleDistributionParams.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/GradleDistributionParams.kt similarity index 97% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/GradleDistributionParams.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/GradleDistributionParams.kt index 7b5777fe3d..5e89ff8eec 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/GradleDistributionParams.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/GradleDistributionParams.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.messages +package org.appdevforall.codeonthego.tooling.api.messages import java.io.Serializable diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/InitializeProjectParams.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/InitializeProjectParams.kt similarity index 96% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/InitializeProjectParams.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/InitializeProjectParams.kt index b7803a96d0..ba66e0f564 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/InitializeProjectParams.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/InitializeProjectParams.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.messages +package org.appdevforall.codeonthego.tooling.api.messages import java.io.Serializable diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/LogMessageParams.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/LogMessageParams.kt similarity index 87% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/LogMessageParams.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/LogMessageParams.kt index 4015304a29..409d7d3da9 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/LogMessageParams.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/LogMessageParams.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.messages +package org.appdevforall.codeonthego.tooling.api.messages -import com.itsaky.androidide.models.LogLine -import com.itsaky.androidide.utils.ILogger +import org.appdevforall.codeonthego.models.LogLine +import org.appdevforall.codeonthego.utils.ILogger /** * Parameters for sending a log message from the tooling API to the IDE. diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/ShutDownMessage.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/ShutDownMessage.kt similarity index 91% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/ShutDownMessage.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/ShutDownMessage.kt index 5e4d076675..9c527018a4 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/ShutDownMessage.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/ShutDownMessage.kt @@ -1,25 +1,25 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.api.messages - -/** - * Notifies that the server should shutdown. - * - * @author Akash Yadav - */ -data class ShutDownMessage(val cancelRunningBuilds: Boolean = true) {} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.api.messages + +/** + * Notifies that the server should shutdown. + * + * @author Akash Yadav + */ +data class ShutDownMessage(val cancelRunningBuilds: Boolean = true) {} diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/TaskExecutionMessage.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/TaskExecutionMessage.kt similarity index 94% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/TaskExecutionMessage.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/TaskExecutionMessage.kt index b5d098e1d3..ca5ab97495 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/TaskExecutionMessage.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/TaskExecutionMessage.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.messages +package org.appdevforall.codeonthego.tooling.api.messages import java.io.Serializable diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/result/BuildCancellationRequestResult.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/result/BuildCancellationRequestResult.kt similarity index 93% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/result/BuildCancellationRequestResult.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/result/BuildCancellationRequestResult.kt index 8d15d6f731..73147e83e7 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/result/BuildCancellationRequestResult.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/result/BuildCancellationRequestResult.kt @@ -1,38 +1,38 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.api.messages.result - -/** - * Result for a build cancellation request. - * - * @param wasEnqueued `true`, if the cancellation request was enqueued,`false` otherwise. - * @param failureReason The reason for the cancellation request enqueue failure. - * @author Akash Yadav - */ -data class BuildCancellationRequestResult( - val wasEnqueued: Boolean, - val failureReason: Reason? = null -) { - - /** Reason for build cancellation request failure. */ - enum class Reason private constructor(var message: String) { - NO_RUNNING_BUILD("No running builds"), - CANCELLATION_ERROR("An error occurred performing the cancellation request"), - UNKNOWN("Unknown error") - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.api.messages.result + +/** + * Result for a build cancellation request. + * + * @param wasEnqueued `true`, if the cancellation request was enqueued,`false` otherwise. + * @param failureReason The reason for the cancellation request enqueue failure. + * @author Akash Yadav + */ +data class BuildCancellationRequestResult( + val wasEnqueued: Boolean, + val failureReason: Reason? = null +) { + + /** Reason for build cancellation request failure. */ + enum class Reason private constructor(var message: String) { + NO_RUNNING_BUILD("No running builds"), + CANCELLATION_ERROR("An error occurred performing the cancellation request"), + UNKNOWN("Unknown error") + } +} diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/result/BuildInfo.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/result/BuildInfo.kt similarity index 87% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/result/BuildInfo.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/result/BuildInfo.kt index 4b4d2232bd..9b73a84494 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/result/BuildInfo.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/result/BuildInfo.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.messages.result +package org.appdevforall.codeonthego.tooling.api.messages.result -import com.itsaky.androidide.tooling.api.messages.BuildId +import org.appdevforall.codeonthego.tooling.api.messages.BuildId /** * Information about a build sent to the client before the build is executed. diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/result/BuildResult.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/result/BuildResult.kt similarity index 93% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/result/BuildResult.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/result/BuildResult.kt index baf6359b9d..ac07438c54 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/result/BuildResult.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/result/BuildResult.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.messages.result +package org.appdevforall.codeonthego.tooling.api.messages.result -import com.itsaky.androidide.tooling.api.messages.BuildId +import org.appdevforall.codeonthego.tooling.api.messages.BuildId /** * Result obtained on a build success or failure. diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/result/GradleWrapperCheckResult.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/result/GradleWrapperCheckResult.kt similarity index 90% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/result/GradleWrapperCheckResult.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/result/GradleWrapperCheckResult.kt index 39316718c8..a037dd01a8 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/result/GradleWrapperCheckResult.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/result/GradleWrapperCheckResult.kt @@ -1,21 +1,21 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.api.messages.result - -/** @author Akash Yadav */ -data class GradleWrapperCheckResult(val isAvailable: Boolean) +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.api.messages.result + +/** @author Akash Yadav */ +data class GradleWrapperCheckResult(val isAvailable: Boolean) diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/result/InitializeResult.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/result/InitializeResult.kt similarity index 96% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/result/InitializeResult.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/result/InitializeResult.kt index ad00568897..050fb407ed 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/result/InitializeResult.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/result/InitializeResult.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.messages.result +package org.appdevforall.codeonthego.tooling.api.messages.result import java.io.File import java.io.Serializable diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/result/TaskExecutionResult.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/result/TaskExecutionResult.kt similarity index 95% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/result/TaskExecutionResult.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/result/TaskExecutionResult.kt index 0582c448a5..528431dff0 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/messages/result/TaskExecutionResult.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/messages/result/TaskExecutionResult.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.messages.result +package org.appdevforall.codeonthego.tooling.api.messages.result /** * Result for a task execution. diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/sync/ProjectSyncHelper.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/sync/ProjectSyncHelper.kt similarity index 98% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/sync/ProjectSyncHelper.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/sync/ProjectSyncHelper.kt index c515d4c475..6975627c41 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/sync/ProjectSyncHelper.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/sync/ProjectSyncHelper.kt @@ -1,11 +1,11 @@ -package com.itsaky.androidide.tooling.api.sync - -import com.itsaky.androidide.project.FileInfo -import com.itsaky.androidide.project.GradleModels -import com.itsaky.androidide.project.SyncMeta -import com.itsaky.androidide.project.SyncMetaModels -import com.itsaky.androidide.utils.SharedEnvironment -import com.itsaky.androidide.utils.sha256 +package org.appdevforall.codeonthego.tooling.api.sync + +import org.appdevforall.codeonthego.project.FileInfo +import org.appdevforall.codeonthego.project.GradleModels +import org.appdevforall.codeonthego.project.SyncMeta +import org.appdevforall.codeonthego.project.SyncMetaModels +import org.appdevforall.codeonthego.utils.SharedEnvironment +import org.appdevforall.codeonthego.utils.sha256 import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.async @@ -306,7 +306,7 @@ object ProjectSyncHelper { /** * Write the Gradle build model. The model files will be written to the root project's - * directory of the provided [com.itsaky.androidide.project.GradleModels.GradleBuild]. + * directory of the provided [org.appdevforall.codeonthego.project.GradleModels.GradleBuild]. * * @param gradleBuild The Gradle build model. * @param targetFile The target file. diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/util/FileTypeAdapter.java b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/util/FileTypeAdapter.java similarity index 96% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/util/FileTypeAdapter.java rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/util/FileTypeAdapter.java index 8204acf06b..2b9ea6dc77 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/util/FileTypeAdapter.java +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/util/FileTypeAdapter.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.util; +package org.appdevforall.codeonthego.tooling.api.util; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapter; diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/util/RuntimeTypeAdapterFactory.java b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/util/RuntimeTypeAdapterFactory.java similarity index 96% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/util/RuntimeTypeAdapterFactory.java rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/util/RuntimeTypeAdapterFactory.java index 8e6338300f..e87bbf9e3f 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/util/RuntimeTypeAdapterFactory.java +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/util/RuntimeTypeAdapterFactory.java @@ -1,312 +1,312 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ - -package com.itsaky.androidide.tooling.api.util; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.JsonPrimitive; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -import java.io.IOException; -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * Adapts values whose runtime type may differ from their declaration type. This is necessary when a - * field's type is not the same type that GSON should create when deserializing that field. For - * example, consider these types: - * - *

{@code
- * abstract class Shape {
- *   int x;
- *   int y;
- * }
- * class Circle extends Shape {
- *   int radius;
- * }
- * class Rectangle extends Shape {
- *   int width;
- *   int height;
- * }
- * class Diamond extends Shape {
- *   int width;
- *   int height;
- * }
- * class Drawing {
- *   Shape bottomShape;
- *   Shape topShape;
- * }
- * }
- * - *

Without additional type information, the serialized JSON is ambiguous. Is the bottom shape in - * this drawing a rectangle or a diamond? - * - *

{@code
- * {
- *   "bottomShape": {
- *     "width": 10,
- *     "height": 5,
- *     "x": 0,
- *     "y": 0
- *   },
- *   "topShape": {
- *     "radius": 2,
- *     "x": 4,
- *     "y": 1
- *   }
- * }
- * }
- * - * This class addresses this problem by adding type information to the serialized JSON and honoring - * that type information when the JSON is deserialized: - * - *
{@code
- * {
- *   "bottomShape": {
- *     "type": "Diamond",
- *     "width": 10,
- *     "height": 5,
- *     "x": 0,
- *     "y": 0
- *   },
- *   "topShape": {
- *     "type": "Circle",
- *     "radius": 2,
- *     "x": 4,
- *     "y": 1
- *   }
- * }
- * }
- * - * Both the type field name ({@code "type"}) and the type labels ({@code "Rectangle"}) are - * configurable. - * - *

Registering Types

- * - * Create a {@code RuntimeTypeAdapterFactory} by passing the base type and type field name to the - * {@link #of} factory method. If you don't supply an explicit type field name, {@code "type"} will - * be used. - * - *
{@code
- * RuntimeTypeAdapterFactory shapeAdapterFactory
- *     = RuntimeTypeAdapterFactory.of(Shape.class, "type");
- * }
- * - * Next register all of your subtypes. Every subtype must be explicitly registered. This protects - * your application from injection attacks. If you don't supply an explicit type label, the type's - * simple name will be used. - * - *
{@code
- * shapeAdapterFactory.registerSubtype(Rectangle.class, "Rectangle");
- * shapeAdapterFactory.registerSubtype(Circle.class, "Circle");
- * shapeAdapterFactory.registerSubtype(Diamond.class, "Diamond");
- * }
- * - * Finally, register the type adapter factory in your application's GSON builder: - * - *
{@code
- * Gson gson = new GsonBuilder()
- *     .registerTypeAdapterFactory(shapeAdapterFactory)
- *     .create();
- * }
- * - * Like {@code GsonBuilder}, this API supports chaining: - * - *
{@code
- * RuntimeTypeAdapterFactory shapeAdapterFactory = RuntimeTypeAdapterFactory.of(Shape.class)
- *     .registerSubtype(Rectangle.class)
- *     .registerSubtype(Circle.class)
- *     .registerSubtype(Diamond.class);
- * }
- * - *

Serialization and deserialization

- * - * In order to serialize and deserialize a polymorphic object, you must specify the base type - * explicitly. - * - *
{@code
- * Diamond diamond = new Diamond();
- * String json = gson.toJson(diamond, Shape.class);
- * }
- * - * And then: - * - *
{@code
- * Shape shape = gson.fromJson(json, Shape.class);
- * }
- */ -public final class RuntimeTypeAdapterFactory implements TypeAdapterFactory { - private final Class baseType; - private final String typeFieldName; - private final Map> labelToSubtype = new LinkedHashMap<>(); - private final Map, String> subtypeToLabel = new LinkedHashMap<>(); - private final boolean maintainType; - - private RuntimeTypeAdapterFactory(Class baseType, String typeFieldName, boolean maintainType) { - if (typeFieldName == null || baseType == null) { - throw new NullPointerException(); - } - this.baseType = baseType; - this.typeFieldName = typeFieldName; - this.maintainType = maintainType; - } - - /** - * Creates a new runtime type adapter using for {@code baseType} using {@code typeFieldName} as - * the type field name. Type field names are case sensitive. {@code maintainType} flag decide if - * the type will be stored in pojo or not. - */ - public static RuntimeTypeAdapterFactory of( - Class baseType, String typeFieldName, boolean maintainType) { - return new RuntimeTypeAdapterFactory<>(baseType, typeFieldName, maintainType); - } - - /** - * Creates a new runtime type adapter using for {@code baseType} using {@code typeFieldName} as - * the type field name. Type field names are case sensitive. - */ - public static RuntimeTypeAdapterFactory of(Class baseType, String typeFieldName) { - return new RuntimeTypeAdapterFactory<>(baseType, typeFieldName, false); - } - - /** - * Creates a new runtime type adapter for {@code baseType} using {@code "type"} as the type field - * name. - */ - public static RuntimeTypeAdapterFactory of(Class baseType) { - return new RuntimeTypeAdapterFactory<>(baseType, "type", false); - } - - /** - * Registers {@code type} identified by its {@link Class#getSimpleName simple name}. Labels are - * case sensitive. - * - * @throws IllegalArgumentException if either {@code type} or its simple name have already been - * registered on this type adapter. - */ - public RuntimeTypeAdapterFactory registerSubtype(Class type) { - return registerSubtype(type, type.getSimpleName()); - } - - /** - * Registers {@code type} identified by {@code label}. Labels are case sensitive. - * - * @throws IllegalArgumentException if either {@code type} or {@code label} have already been - * registered on this type adapter. - */ - public RuntimeTypeAdapterFactory registerSubtype(Class type, String label) { - if (type == null || label == null) { - throw new NullPointerException(); - } - if (subtypeToLabel.containsKey(type) || labelToSubtype.containsKey(label)) { - throw new IllegalArgumentException("types and labels must be unique"); - } - labelToSubtype.put(label, type); - subtypeToLabel.put(type, label); - return this; - } - - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (type.getRawType() != baseType) { - return null; - } - - final TypeAdapter jsonElementAdapter = gson.getAdapter(JsonElement.class); - final Map> labelToDelegate = new LinkedHashMap<>(); - final Map, TypeAdapter> subtypeToDelegate = new LinkedHashMap<>(); - for (Map.Entry> entry : labelToSubtype.entrySet()) { - TypeAdapter delegate = gson.getDelegateAdapter(this, TypeToken.get(entry.getValue())); - labelToDelegate.put(entry.getKey(), delegate); - subtypeToDelegate.put(entry.getValue(), delegate); - } - - return new TypeAdapter() { - @Override - public void write(JsonWriter out, R value) throws IOException { - Class srcType = value.getClass(); - String label = subtypeToLabel.get(srcType); - @SuppressWarnings("unchecked") // registration requires that subtype extends T - TypeAdapter delegate = (TypeAdapter) subtypeToDelegate.get(srcType); - if (delegate == null) { - throw new JsonParseException( - "cannot serialize " + srcType.getName() + "; did you forget to register a subtype?"); - } - JsonObject jsonObject = delegate.toJsonTree(value).getAsJsonObject(); - - if (maintainType) { - jsonElementAdapter.write(out, jsonObject); - return; - } - - JsonObject clone = new JsonObject(); - - if (jsonObject.has(typeFieldName)) { - throw new JsonParseException( - "cannot serialize " - + srcType.getName() - + " because it already defines a field named " - + typeFieldName); - } - clone.add(typeFieldName, new JsonPrimitive(label)); - - for (Map.Entry e : jsonObject.entrySet()) { - clone.add(e.getKey(), e.getValue()); - } - jsonElementAdapter.write(out, clone); - } - - @Override - public R read(JsonReader in) throws IOException { - JsonElement jsonElement = jsonElementAdapter.read(in); - JsonElement labelJsonElement; - if (maintainType) { - labelJsonElement = jsonElement.getAsJsonObject().get(typeFieldName); - } else { - labelJsonElement = jsonElement.getAsJsonObject().remove(typeFieldName); - } - - if (labelJsonElement == null) { - throw new JsonParseException( - "cannot deserialize " - + baseType - + " because it does not define a field named " - + typeFieldName); - } - String label = labelJsonElement.getAsString(); - @SuppressWarnings("unchecked") // registration requires that subtype extends T - TypeAdapter delegate = (TypeAdapter) labelToDelegate.get(label); - if (delegate == null) { - throw new JsonParseException( - "cannot deserialize " - + baseType - + " subtype named " - + label - + "; did you forget to register a subtype?"); - } - return delegate.fromJsonTree(jsonElement); - } - }.nullSafe(); - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ + +package org.appdevforall.codeonthego.tooling.api.util; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonPrimitive; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Adapts values whose runtime type may differ from their declaration type. This is necessary when a + * field's type is not the same type that GSON should create when deserializing that field. For + * example, consider these types: + * + *
{@code
+ * abstract class Shape {
+ *   int x;
+ *   int y;
+ * }
+ * class Circle extends Shape {
+ *   int radius;
+ * }
+ * class Rectangle extends Shape {
+ *   int width;
+ *   int height;
+ * }
+ * class Diamond extends Shape {
+ *   int width;
+ *   int height;
+ * }
+ * class Drawing {
+ *   Shape bottomShape;
+ *   Shape topShape;
+ * }
+ * }
+ * + *

Without additional type information, the serialized JSON is ambiguous. Is the bottom shape in + * this drawing a rectangle or a diamond? + * + *

{@code
+ * {
+ *   "bottomShape": {
+ *     "width": 10,
+ *     "height": 5,
+ *     "x": 0,
+ *     "y": 0
+ *   },
+ *   "topShape": {
+ *     "radius": 2,
+ *     "x": 4,
+ *     "y": 1
+ *   }
+ * }
+ * }
+ * + * This class addresses this problem by adding type information to the serialized JSON and honoring + * that type information when the JSON is deserialized: + * + *
{@code
+ * {
+ *   "bottomShape": {
+ *     "type": "Diamond",
+ *     "width": 10,
+ *     "height": 5,
+ *     "x": 0,
+ *     "y": 0
+ *   },
+ *   "topShape": {
+ *     "type": "Circle",
+ *     "radius": 2,
+ *     "x": 4,
+ *     "y": 1
+ *   }
+ * }
+ * }
+ * + * Both the type field name ({@code "type"}) and the type labels ({@code "Rectangle"}) are + * configurable. + * + *

Registering Types

+ * + * Create a {@code RuntimeTypeAdapterFactory} by passing the base type and type field name to the + * {@link #of} factory method. If you don't supply an explicit type field name, {@code "type"} will + * be used. + * + *
{@code
+ * RuntimeTypeAdapterFactory shapeAdapterFactory
+ *     = RuntimeTypeAdapterFactory.of(Shape.class, "type");
+ * }
+ * + * Next register all of your subtypes. Every subtype must be explicitly registered. This protects + * your application from injection attacks. If you don't supply an explicit type label, the type's + * simple name will be used. + * + *
{@code
+ * shapeAdapterFactory.registerSubtype(Rectangle.class, "Rectangle");
+ * shapeAdapterFactory.registerSubtype(Circle.class, "Circle");
+ * shapeAdapterFactory.registerSubtype(Diamond.class, "Diamond");
+ * }
+ * + * Finally, register the type adapter factory in your application's GSON builder: + * + *
{@code
+ * Gson gson = new GsonBuilder()
+ *     .registerTypeAdapterFactory(shapeAdapterFactory)
+ *     .create();
+ * }
+ * + * Like {@code GsonBuilder}, this API supports chaining: + * + *
{@code
+ * RuntimeTypeAdapterFactory shapeAdapterFactory = RuntimeTypeAdapterFactory.of(Shape.class)
+ *     .registerSubtype(Rectangle.class)
+ *     .registerSubtype(Circle.class)
+ *     .registerSubtype(Diamond.class);
+ * }
+ * + *

Serialization and deserialization

+ * + * In order to serialize and deserialize a polymorphic object, you must specify the base type + * explicitly. + * + *
{@code
+ * Diamond diamond = new Diamond();
+ * String json = gson.toJson(diamond, Shape.class);
+ * }
+ * + * And then: + * + *
{@code
+ * Shape shape = gson.fromJson(json, Shape.class);
+ * }
+ */ +public final class RuntimeTypeAdapterFactory implements TypeAdapterFactory { + private final Class baseType; + private final String typeFieldName; + private final Map> labelToSubtype = new LinkedHashMap<>(); + private final Map, String> subtypeToLabel = new LinkedHashMap<>(); + private final boolean maintainType; + + private RuntimeTypeAdapterFactory(Class baseType, String typeFieldName, boolean maintainType) { + if (typeFieldName == null || baseType == null) { + throw new NullPointerException(); + } + this.baseType = baseType; + this.typeFieldName = typeFieldName; + this.maintainType = maintainType; + } + + /** + * Creates a new runtime type adapter using for {@code baseType} using {@code typeFieldName} as + * the type field name. Type field names are case sensitive. {@code maintainType} flag decide if + * the type will be stored in pojo or not. + */ + public static RuntimeTypeAdapterFactory of( + Class baseType, String typeFieldName, boolean maintainType) { + return new RuntimeTypeAdapterFactory<>(baseType, typeFieldName, maintainType); + } + + /** + * Creates a new runtime type adapter using for {@code baseType} using {@code typeFieldName} as + * the type field name. Type field names are case sensitive. + */ + public static RuntimeTypeAdapterFactory of(Class baseType, String typeFieldName) { + return new RuntimeTypeAdapterFactory<>(baseType, typeFieldName, false); + } + + /** + * Creates a new runtime type adapter for {@code baseType} using {@code "type"} as the type field + * name. + */ + public static RuntimeTypeAdapterFactory of(Class baseType) { + return new RuntimeTypeAdapterFactory<>(baseType, "type", false); + } + + /** + * Registers {@code type} identified by its {@link Class#getSimpleName simple name}. Labels are + * case sensitive. + * + * @throws IllegalArgumentException if either {@code type} or its simple name have already been + * registered on this type adapter. + */ + public RuntimeTypeAdapterFactory registerSubtype(Class type) { + return registerSubtype(type, type.getSimpleName()); + } + + /** + * Registers {@code type} identified by {@code label}. Labels are case sensitive. + * + * @throws IllegalArgumentException if either {@code type} or {@code label} have already been + * registered on this type adapter. + */ + public RuntimeTypeAdapterFactory registerSubtype(Class type, String label) { + if (type == null || label == null) { + throw new NullPointerException(); + } + if (subtypeToLabel.containsKey(type) || labelToSubtype.containsKey(label)) { + throw new IllegalArgumentException("types and labels must be unique"); + } + labelToSubtype.put(label, type); + subtypeToLabel.put(type, label); + return this; + } + + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (type.getRawType() != baseType) { + return null; + } + + final TypeAdapter jsonElementAdapter = gson.getAdapter(JsonElement.class); + final Map> labelToDelegate = new LinkedHashMap<>(); + final Map, TypeAdapter> subtypeToDelegate = new LinkedHashMap<>(); + for (Map.Entry> entry : labelToSubtype.entrySet()) { + TypeAdapter delegate = gson.getDelegateAdapter(this, TypeToken.get(entry.getValue())); + labelToDelegate.put(entry.getKey(), delegate); + subtypeToDelegate.put(entry.getValue(), delegate); + } + + return new TypeAdapter() { + @Override + public void write(JsonWriter out, R value) throws IOException { + Class srcType = value.getClass(); + String label = subtypeToLabel.get(srcType); + @SuppressWarnings("unchecked") // registration requires that subtype extends T + TypeAdapter delegate = (TypeAdapter) subtypeToDelegate.get(srcType); + if (delegate == null) { + throw new JsonParseException( + "cannot serialize " + srcType.getName() + "; did you forget to register a subtype?"); + } + JsonObject jsonObject = delegate.toJsonTree(value).getAsJsonObject(); + + if (maintainType) { + jsonElementAdapter.write(out, jsonObject); + return; + } + + JsonObject clone = new JsonObject(); + + if (jsonObject.has(typeFieldName)) { + throw new JsonParseException( + "cannot serialize " + + srcType.getName() + + " because it already defines a field named " + + typeFieldName); + } + clone.add(typeFieldName, new JsonPrimitive(label)); + + for (Map.Entry e : jsonObject.entrySet()) { + clone.add(e.getKey(), e.getValue()); + } + jsonElementAdapter.write(out, clone); + } + + @Override + public R read(JsonReader in) throws IOException { + JsonElement jsonElement = jsonElementAdapter.read(in); + JsonElement labelJsonElement; + if (maintainType) { + labelJsonElement = jsonElement.getAsJsonObject().get(typeFieldName); + } else { + labelJsonElement = jsonElement.getAsJsonObject().remove(typeFieldName); + } + + if (labelJsonElement == null) { + throw new JsonParseException( + "cannot deserialize " + + baseType + + " because it does not define a field named " + + typeFieldName); + } + String label = labelJsonElement.getAsString(); + @SuppressWarnings("unchecked") // registration requires that subtype extends T + TypeAdapter delegate = (TypeAdapter) labelToDelegate.get(label); + if (delegate == null) { + throw new JsonParseException( + "cannot deserialize " + + baseType + + " subtype named " + + label + + "; did you forget to register a subtype?"); + } + return delegate.fromJsonTree(jsonElement); + } + }.nullSafe(); + } +} diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/util/ToolingApiLauncher.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/util/ToolingApiLauncher.kt similarity index 56% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/util/ToolingApiLauncher.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/util/ToolingApiLauncher.kt index f4c33fac65..fb362d96f8 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/util/ToolingApiLauncher.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/util/ToolingApiLauncher.kt @@ -14,68 +14,68 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.util +package org.appdevforall.codeonthego.tooling.api.util import com.google.gson.GsonBuilder -import com.itsaky.androidide.builder.model.DefaultJavaCompileOptions -import com.itsaky.androidide.builder.model.IJavaCompilerSettings -import com.itsaky.androidide.tooling.api.IToolingApiClient -import com.itsaky.androidide.tooling.api.IToolingApiServer -import com.itsaky.androidide.tooling.api.messages.result.InitializeResult -import com.itsaky.androidide.tooling.api.models.AndroidProjectMetadata -import com.itsaky.androidide.tooling.api.models.AndroidVariantMetadata -import com.itsaky.androidide.tooling.api.models.BasicAndroidVariantMetadata -import com.itsaky.androidide.tooling.api.models.BasicProjectMetadata -import com.itsaky.androidide.tooling.api.models.GradleTask -import com.itsaky.androidide.tooling.api.models.JavaModuleCompilerSettings -import com.itsaky.androidide.tooling.api.models.JavaModuleDependency -import com.itsaky.androidide.tooling.api.models.JavaModuleExternalDependency -import com.itsaky.androidide.tooling.api.models.JavaModuleProjectDependency -import com.itsaky.androidide.tooling.api.models.JavaProjectMetadata -import com.itsaky.androidide.tooling.api.models.Launchable -import com.itsaky.androidide.tooling.api.models.ProjectMetadata -import com.itsaky.androidide.tooling.events.OperationDescriptor -import com.itsaky.androidide.tooling.events.OperationResult -import com.itsaky.androidide.tooling.events.ProgressEvent -import com.itsaky.androidide.tooling.events.StatusEvent -import com.itsaky.androidide.tooling.events.configuration.ProjectConfigurationFinishEvent -import com.itsaky.androidide.tooling.events.configuration.ProjectConfigurationOperationDescriptor -import com.itsaky.androidide.tooling.events.configuration.ProjectConfigurationOperationResult -import com.itsaky.androidide.tooling.events.configuration.ProjectConfigurationProgressEvent -import com.itsaky.androidide.tooling.events.configuration.ProjectConfigurationStartEvent -import com.itsaky.androidide.tooling.events.download.FileDownloadFinishEvent -import com.itsaky.androidide.tooling.events.download.FileDownloadOperationDescriptor -import com.itsaky.androidide.tooling.events.download.FileDownloadProgressEvent -import com.itsaky.androidide.tooling.events.download.FileDownloadResult -import com.itsaky.androidide.tooling.events.download.FileDownloadStartEvent -import com.itsaky.androidide.tooling.events.internal.DefaultFinishEvent -import com.itsaky.androidide.tooling.events.internal.DefaultOperationDescriptor -import com.itsaky.androidide.tooling.events.internal.DefaultOperationResult -import com.itsaky.androidide.tooling.events.internal.DefaultProgressEvent -import com.itsaky.androidide.tooling.events.internal.DefaultStartEvent -import com.itsaky.androidide.tooling.events.task.TaskExecutionResult -import com.itsaky.androidide.tooling.events.task.TaskFailureResult -import com.itsaky.androidide.tooling.events.task.TaskFinishEvent -import com.itsaky.androidide.tooling.events.task.TaskOperationDescriptor -import com.itsaky.androidide.tooling.events.task.TaskOperationResult -import com.itsaky.androidide.tooling.events.task.TaskProgressEvent -import com.itsaky.androidide.tooling.events.task.TaskSkippedResult -import com.itsaky.androidide.tooling.events.task.TaskStartEvent -import com.itsaky.androidide.tooling.events.task.TaskSuccessResult -import com.itsaky.androidide.tooling.events.test.TestFinishEvent -import com.itsaky.androidide.tooling.events.test.TestOperationDescriptor -import com.itsaky.androidide.tooling.events.test.TestOperationResult -import com.itsaky.androidide.tooling.events.test.TestProgressEvent -import com.itsaky.androidide.tooling.events.test.TestStartEvent -import com.itsaky.androidide.tooling.events.transform.TransformFinishEvent -import com.itsaky.androidide.tooling.events.transform.TransformOperationDescriptor -import com.itsaky.androidide.tooling.events.transform.TransformProgressEvent -import com.itsaky.androidide.tooling.events.transform.TransformStartEvent -import com.itsaky.androidide.tooling.events.work.WorkItemFinishEvent -import com.itsaky.androidide.tooling.events.work.WorkItemOperationDescriptor -import com.itsaky.androidide.tooling.events.work.WorkItemOperationResult -import com.itsaky.androidide.tooling.events.work.WorkItemProgressEvent -import com.itsaky.androidide.tooling.events.work.WorkItemStartEvent +import org.appdevforall.codeonthego.builder.model.DefaultJavaCompileOptions +import org.appdevforall.codeonthego.builder.model.IJavaCompilerSettings +import org.appdevforall.codeonthego.tooling.api.IToolingApiClient +import org.appdevforall.codeonthego.tooling.api.IToolingApiServer +import org.appdevforall.codeonthego.tooling.api.messages.result.InitializeResult +import org.appdevforall.codeonthego.tooling.api.models.AndroidProjectMetadata +import org.appdevforall.codeonthego.tooling.api.models.AndroidVariantMetadata +import org.appdevforall.codeonthego.tooling.api.models.BasicAndroidVariantMetadata +import org.appdevforall.codeonthego.tooling.api.models.BasicProjectMetadata +import org.appdevforall.codeonthego.tooling.api.models.GradleTask +import org.appdevforall.codeonthego.tooling.api.models.JavaModuleCompilerSettings +import org.appdevforall.codeonthego.tooling.api.models.JavaModuleDependency +import org.appdevforall.codeonthego.tooling.api.models.JavaModuleExternalDependency +import org.appdevforall.codeonthego.tooling.api.models.JavaModuleProjectDependency +import org.appdevforall.codeonthego.tooling.api.models.JavaProjectMetadata +import org.appdevforall.codeonthego.tooling.api.models.Launchable +import org.appdevforall.codeonthego.tooling.api.models.ProjectMetadata +import org.appdevforall.codeonthego.tooling.events.OperationDescriptor +import org.appdevforall.codeonthego.tooling.events.OperationResult +import org.appdevforall.codeonthego.tooling.events.ProgressEvent +import org.appdevforall.codeonthego.tooling.events.StatusEvent +import org.appdevforall.codeonthego.tooling.events.configuration.ProjectConfigurationFinishEvent +import org.appdevforall.codeonthego.tooling.events.configuration.ProjectConfigurationOperationDescriptor +import org.appdevforall.codeonthego.tooling.events.configuration.ProjectConfigurationOperationResult +import org.appdevforall.codeonthego.tooling.events.configuration.ProjectConfigurationProgressEvent +import org.appdevforall.codeonthego.tooling.events.configuration.ProjectConfigurationStartEvent +import org.appdevforall.codeonthego.tooling.events.download.FileDownloadFinishEvent +import org.appdevforall.codeonthego.tooling.events.download.FileDownloadOperationDescriptor +import org.appdevforall.codeonthego.tooling.events.download.FileDownloadProgressEvent +import org.appdevforall.codeonthego.tooling.events.download.FileDownloadResult +import org.appdevforall.codeonthego.tooling.events.download.FileDownloadStartEvent +import org.appdevforall.codeonthego.tooling.events.internal.DefaultFinishEvent +import org.appdevforall.codeonthego.tooling.events.internal.DefaultOperationDescriptor +import org.appdevforall.codeonthego.tooling.events.internal.DefaultOperationResult +import org.appdevforall.codeonthego.tooling.events.internal.DefaultProgressEvent +import org.appdevforall.codeonthego.tooling.events.internal.DefaultStartEvent +import org.appdevforall.codeonthego.tooling.events.task.TaskExecutionResult +import org.appdevforall.codeonthego.tooling.events.task.TaskFailureResult +import org.appdevforall.codeonthego.tooling.events.task.TaskFinishEvent +import org.appdevforall.codeonthego.tooling.events.task.TaskOperationDescriptor +import org.appdevforall.codeonthego.tooling.events.task.TaskOperationResult +import org.appdevforall.codeonthego.tooling.events.task.TaskProgressEvent +import org.appdevforall.codeonthego.tooling.events.task.TaskSkippedResult +import org.appdevforall.codeonthego.tooling.events.task.TaskStartEvent +import org.appdevforall.codeonthego.tooling.events.task.TaskSuccessResult +import org.appdevforall.codeonthego.tooling.events.test.TestFinishEvent +import org.appdevforall.codeonthego.tooling.events.test.TestOperationDescriptor +import org.appdevforall.codeonthego.tooling.events.test.TestOperationResult +import org.appdevforall.codeonthego.tooling.events.test.TestProgressEvent +import org.appdevforall.codeonthego.tooling.events.test.TestStartEvent +import org.appdevforall.codeonthego.tooling.events.transform.TransformFinishEvent +import org.appdevforall.codeonthego.tooling.events.transform.TransformOperationDescriptor +import org.appdevforall.codeonthego.tooling.events.transform.TransformProgressEvent +import org.appdevforall.codeonthego.tooling.events.transform.TransformStartEvent +import org.appdevforall.codeonthego.tooling.events.work.WorkItemFinishEvent +import org.appdevforall.codeonthego.tooling.events.work.WorkItemOperationDescriptor +import org.appdevforall.codeonthego.tooling.events.work.WorkItemOperationResult +import org.appdevforall.codeonthego.tooling.events.work.WorkItemProgressEvent +import org.appdevforall.codeonthego.tooling.events.work.WorkItemStartEvent import org.eclipse.lsp4j.jsonrpc.Launcher import java.io.File import java.io.InputStream diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/util/ToolingProps.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/util/ToolingProps.kt similarity index 93% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/util/ToolingProps.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/util/ToolingProps.kt index 9646cfa7da..9c197c7ddd 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/util/ToolingProps.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/util/ToolingProps.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.util +package org.appdevforall.codeonthego.tooling.api.util -import com.itsaky.androidide.tooling.api.util.ToolingProps.DESCENDANT_FORCE_KILL_TIMEOUT_MS -import com.itsaky.androidide.utils.AndroidPluginVersion +import org.appdevforall.codeonthego.tooling.api.util.ToolingProps.DESCENDANT_FORCE_KILL_TIMEOUT_MS +import org.appdevforall.codeonthego.utils.AndroidPluginVersion import kotlin.time.Duration import kotlin.time.Duration.Companion.milliseconds diff --git a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/util/versions.kt b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/util/versions.kt similarity index 96% rename from subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/util/versions.kt rename to subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/util/versions.kt index f36174928c..8efec9deb9 100644 --- a/subprojects/tooling-api/src/main/java/com/itsaky/androidide/tooling/api/util/versions.kt +++ b/subprojects/tooling-api/src/main/java/org/appdevforall/codeonthego/tooling/api/util/versions.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.tooling.api.util +package org.appdevforall.codeonthego.tooling.api.util /** * Compare the given semantic versions and return : diff --git a/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/commons/ILineTracker.java b/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/commons/ILineTracker.java index ed6d76808f..ae617e8a07 100644 --- a/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/commons/ILineTracker.java +++ b/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/commons/ILineTracker.java @@ -1,144 +1,144 @@ -/******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.lemminx.commons; - -import com.itsaky.androidide.models.Position; - -/** - * A line tracker maps character positions to line numbers and vice versa. Initially the line - * tracker is informed about its underlying text in order to initialize the mapping information. - * After that, the line tracker is informed about all changes of the underlying text allowing for - * incremental updates of the mapping information. It is the client's responsibility to actively - * inform the line tacker about text changes. For example, when using a line tracker in combination - * with a document the document controls the line tracker. - * - *

In order to provide backward compatibility for clients of ILineTracker, extension - * interfaces are used to provide a means of evolution. The following extension interfaces exist: - * - *

    - *
  • {@link org.eclipse.jface.text.ILineTrackerExtension} since version 3.1 introducing the - * concept of rewrite sessions. - *
- * - *

Clients may implement this interface or use the standard implementation {@link - * org.eclipse.jface.text.DefaultLineTracker}or {@link - * org.eclipse.jface.text.ConfigurableLineTracker}. - */ -public interface ILineTracker { - - /** - * Returns the line delimiter of the specified line. Returns null if the line is not - * closed with a line delimiter. - * - * @param line the line whose line delimiter is queried - * @return the line's delimiter or null if line does not have a delimiter - * @exception BadLocationException if the line number is invalid in this tracker's line structure - */ - String getLineDelimiter(int line) throws BadLocationException; - - /** - * Computes the number of lines in the given text. - * - * @param text the text whose number of lines should be computed - * @return the number of lines in the given text - */ - int computeNumberOfLines(String text); - - /** - * Returns the number of lines. - * - *

Note that a document always has at least one line. - * - * @return the number of lines in this tracker's line structure - */ - int getNumberOfLines(); - - /** - * Returns the number of lines which are occupied by a given text range. - * - * @param offset the offset of the specified text range - * @param length the length of the specified text range - * @return the number of lines occupied by the specified range - * @exception BadLocationException if specified range is unknown to this tracker - */ - int getNumberOfLines(int offset, int length) throws BadLocationException; - - /** - * Returns the position of the first character of the specified line. - * - * @param line the line of interest - * @return offset of the first character of the line - * @exception BadLocationException if the line is unknown to this tracker - */ - int getLineOffset(int line) throws BadLocationException; - - /** - * Returns length of the specified line including the line's delimiter. - * - * @param line the line of interest - * @return the length of the line - * @exception BadLocationException if line is unknown to this tracker - */ - int getLineLength(int line) throws BadLocationException; - - /** - * Returns the line number the character at the given offset belongs to. - * - * @param offset the offset whose line number to be determined - * @return the number of the line the offset is on - * @exception BadLocationException if the offset is invalid in this tracker - */ - int getLineNumberOfOffset(int offset) throws BadLocationException; - - /** - * Returns a line description of the line at the given offset. The description contains the start - * offset and the length of the line excluding the line's delimiter. - * - * @param offset the offset whose line should be described - * @return a region describing the line - * @exception BadLocationException if offset is invalid in this tracker - */ - Line getLineInformationOfOffset(int offset) throws BadLocationException; - - /** - * Returns a line description of the given line. The description contains the start offset and the - * length of the line excluding the line's delimiter. - * - * @param line the line that should be described - * @return a region describing the line - * @exception BadLocationException if line is unknown to this tracker - */ - Line getLineInformation(int line) throws BadLocationException; - - /** - * Informs the line tracker about the specified change in the tracked text. - * - * @param offset the offset of the replaced text - * @param length the length of the replaced text - * @param text the substitution text - * @exception BadLocationException if specified range is unknown to this tracker - */ - void replace(int offset, int length, String text) throws BadLocationException; - - /** - * Sets the tracked text to the specified text. - * - * @param text the new tracked text - */ - void set(String text); - - Position getPositionAt(int position) throws BadLocationException; - - int getOffsetAt(Position position) throws BadLocationException; -} +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.lemminx.commons; + +import org.appdevforall.codeonthego.models.Position; + +/** + * A line tracker maps character positions to line numbers and vice versa. Initially the line + * tracker is informed about its underlying text in order to initialize the mapping information. + * After that, the line tracker is informed about all changes of the underlying text allowing for + * incremental updates of the mapping information. It is the client's responsibility to actively + * inform the line tacker about text changes. For example, when using a line tracker in combination + * with a document the document controls the line tracker. + * + *

In order to provide backward compatibility for clients of ILineTracker, extension + * interfaces are used to provide a means of evolution. The following extension interfaces exist: + * + *

    + *
  • {@link org.eclipse.jface.text.ILineTrackerExtension} since version 3.1 introducing the + * concept of rewrite sessions. + *
+ * + *

Clients may implement this interface or use the standard implementation {@link + * org.eclipse.jface.text.DefaultLineTracker}or {@link + * org.eclipse.jface.text.ConfigurableLineTracker}. + */ +public interface ILineTracker { + + /** + * Returns the line delimiter of the specified line. Returns null if the line is not + * closed with a line delimiter. + * + * @param line the line whose line delimiter is queried + * @return the line's delimiter or null if line does not have a delimiter + * @exception BadLocationException if the line number is invalid in this tracker's line structure + */ + String getLineDelimiter(int line) throws BadLocationException; + + /** + * Computes the number of lines in the given text. + * + * @param text the text whose number of lines should be computed + * @return the number of lines in the given text + */ + int computeNumberOfLines(String text); + + /** + * Returns the number of lines. + * + *

Note that a document always has at least one line. + * + * @return the number of lines in this tracker's line structure + */ + int getNumberOfLines(); + + /** + * Returns the number of lines which are occupied by a given text range. + * + * @param offset the offset of the specified text range + * @param length the length of the specified text range + * @return the number of lines occupied by the specified range + * @exception BadLocationException if specified range is unknown to this tracker + */ + int getNumberOfLines(int offset, int length) throws BadLocationException; + + /** + * Returns the position of the first character of the specified line. + * + * @param line the line of interest + * @return offset of the first character of the line + * @exception BadLocationException if the line is unknown to this tracker + */ + int getLineOffset(int line) throws BadLocationException; + + /** + * Returns length of the specified line including the line's delimiter. + * + * @param line the line of interest + * @return the length of the line + * @exception BadLocationException if line is unknown to this tracker + */ + int getLineLength(int line) throws BadLocationException; + + /** + * Returns the line number the character at the given offset belongs to. + * + * @param offset the offset whose line number to be determined + * @return the number of the line the offset is on + * @exception BadLocationException if the offset is invalid in this tracker + */ + int getLineNumberOfOffset(int offset) throws BadLocationException; + + /** + * Returns a line description of the line at the given offset. The description contains the start + * offset and the length of the line excluding the line's delimiter. + * + * @param offset the offset whose line should be described + * @return a region describing the line + * @exception BadLocationException if offset is invalid in this tracker + */ + Line getLineInformationOfOffset(int offset) throws BadLocationException; + + /** + * Returns a line description of the given line. The description contains the start offset and the + * length of the line excluding the line's delimiter. + * + * @param line the line that should be described + * @return a region describing the line + * @exception BadLocationException if line is unknown to this tracker + */ + Line getLineInformation(int line) throws BadLocationException; + + /** + * Informs the line tracker about the specified change in the tracked text. + * + * @param offset the offset of the replaced text + * @param length the length of the replaced text + * @param text the substitution text + * @exception BadLocationException if specified range is unknown to this tracker + */ + void replace(int offset, int length, String text) throws BadLocationException; + + /** + * Sets the tracked text to the specified text. + * + * @param text the new tracked text + */ + void set(String text); + + Position getPositionAt(int position) throws BadLocationException; + + int getOffsetAt(Position position) throws BadLocationException; +} diff --git a/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/commons/ListLineTracker.java b/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/commons/ListLineTracker.java index 898e81b2c8..3fec6a1a6b 100644 --- a/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/commons/ListLineTracker.java +++ b/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/commons/ListLineTracker.java @@ -1,455 +1,455 @@ -/******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v2.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v20.html - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - * This class is a copy/paste of org.eclipse.jface.text.ListLineTracker - *******************************************************************************/ -package org.eclipse.lemminx.commons; - -import com.itsaky.androidide.models.Position; - -import java.util.ArrayList; -import java.util.List; - -/** - * Abstract, read-only implementation of ILineTracker. It lets the definition of line - * delimiters to subclasses. Assuming that '\n' is the only line delimiter, this abstract - * implementation defines the following line scheme: - * - *

    - *
  • "" -> [0,0] - *
  • "a" -> [0,1] - *
  • "\n" -> [0,1], [1,0] - *
  • "a\n" -> [0,2], [2,0] - *
  • "a\nb" -> [0,2], [2,1] - *
  • "a\nbc\n" -> [0,2], [2,3], [5,0] - *
- * - * This class must be subclassed. - * - * @since 3.2 - */ -class ListLineTracker implements ILineTracker { - - /** The predefined delimiters of this tracker */ - public static final String[] DELIMITERS = { - "\r", "\n", "\r\n" - }; //$NON-NLS-3$ //$NON-NLS-1$ //$NON-NLS-2$ - /** A predefined delimiter information which is always reused as return value */ - private DelimiterInfo fDelimiterInfo = new DelimiterInfo(); - - /** The line information */ - private final List fLines = new ArrayList<>(); - /** The length of the tracked text */ - private int fTextLength; - - /** - * Combines the information of the occurrence of a line delimiter. delimiterIndex is - * the index where a line delimiter starts, whereas delimiterLength, indicates the - * length of the delimiter. - */ - protected static class DelimiterInfo { - public int delimiterIndex; - public int delimiterLength; - public String delimiter; - } - - /** Creates a new line tracker. */ - protected ListLineTracker() {} - - /** - * Binary search for the line at a given offset. - * - * @param offset the offset whose line should be found - * @return the line of the offset - */ - private int findLine(int offset) { - - if (fLines.size() == 0) { - return -1; - } - int left = 0; - int right = fLines.size(); - while (left < right - 1) { - int mid = (right + left) >> 1; - Line line = fLines.get(mid); - if (line.offset <= offset) { - left = mid; - } else { - right = mid; - } - } - return (fLines.get(left).offset > offset) ? left - 1 : left; - } - - @Override - public final Position getPositionAt(int offset) throws BadLocationException { - int lineNumber = getLineNumberOfOffset(offset); - int lines = fLines.size(); - int character = 0; - if (lines > 0) { - if (lineNumber == lines) { - Line l = fLines.get(lineNumber - 1); - character = offset - l.offset - l.length; - } else { - Line l = fLines.get(lineNumber); - character = offset - l.offset; - } - } - return new Position(lineNumber, character); - } - - /** - * Returns the number of lines covered by the specified text range. - * - * @param startLine the line where the text range starts - * @param offset the start offset of the text range - * @param length the length of the text range - * @return the number of lines covered by this text range - * @exception BadLocationException if range is undefined in this tracker - */ - private int getNumberOfLines(int startLine, int offset, int length) throws BadLocationException { - - if (length == 0) { - return 1; - } - - int target = offset + length; - - Line l = fLines.get(startLine); - - if (l.delimiter == null) { - return 1; - } - - if (l.offset + l.length > target) { - return 1; - } - - if (l.offset + l.length == target) { - return 2; - } - - return getLineNumberOfOffset(target) - startLine + 1; - } - - @Override - public final int getLineLength(int line) throws BadLocationException { - int lines = fLines.size(); - - if (line < 0 || line > lines) { - throw new BadLocationException(); - } - - if (lines == 0 || lines == line) { - return 0; - } - - Line l = fLines.get(line); - return l.length; - } - - @Override - public final int getLineNumberOfOffset(int position) throws BadLocationException { - if (position < 0) { - throw new BadLocationException("Negative offset : " + position); // $NON-NLS-1$ - } else if (position > fTextLength) { - throw new BadLocationException( - "Offset > length: " + position + " > " + fTextLength); // $NON-NLS-1$//$NON-NLS-2$ - } - - if (position == fTextLength) { - - int lastLine = fLines.size() - 1; - if (lastLine < 0) { - return 0; - } - - Line l = fLines.get(lastLine); - return (l.delimiter != null ? lastLine + 1 : lastLine); - } - - return findLine(position); - } - - @Override - public int getOffsetAt(Position position) throws BadLocationException { - int line = position.getLine(); - int lines = fLines.size(); - - if (line < 0 || line > lines) { - throw new BadLocationException("The line value, {" + line + "}, is out of bounds."); - } - - int lineOffset = -1; - int lineLength = -1; - if (lines == 0) { - lineOffset = 0; - lineLength = 0; - } else { - if (line == lines) { - Line l = fLines.get(line - 1); - lineOffset = l.offset + l.length; - lineLength = 0; - } else { - Line l = fLines.get(line); - lineOffset = l.offset; - lineLength = l.delimiter != null ? l.length - l.delimiter.length() : l.length; - } - } - int character = position.getColumn(); - int offset = lineOffset + character; - int endLineOffset = lineOffset + lineLength; - if (offset > endLineOffset) { - throw new BadLocationException( - "The character value, {" + character + "} of the line" + line + "}, is out of bounds."); - } - return offset; - } - - @Override - public final Line getLineInformationOfOffset(int position) throws BadLocationException { - if (position > fTextLength) { - throw new BadLocationException( - "Offset > length: " + position + " > " + fTextLength); // $NON-NLS-1$//$NON-NLS-2$ - } - - if (position == fTextLength) { - int size = fLines.size(); - if (size == 0) { - return new Line(0, 0); - } - Line l = fLines.get(size - 1); - - return (l.delimiter != null - ? new Line(fTextLength, 0) - : new Line(fTextLength - l.length, l.length)); - } - - return getLineInformation(findLine(position)); - } - - @Override - public final Line getLineInformation(int line) throws BadLocationException { - int lines = fLines.size(); - - if (line < 0 || line > lines) { - throw new BadLocationException("The line value, {" + line + "}, is out of bounds."); - } - - if (lines == 0) { - return new Line(0, 0); - } - - if (line == lines) { - Line l = fLines.get(line - 1); - return new Line(l.offset + l.length, 0); - } - - Line l = fLines.get(line); - return (l.delimiter != null ? new Line(l.offset, l.length - l.delimiter.length()) : l); - } - - @Override - public final int getLineOffset(int line) throws BadLocationException { - int lines = fLines.size(); - - if (line < 0 || line > lines) { - throw new BadLocationException("The line value, {" + line + "}, is out of bounds."); - } - - if (lines == 0) { - return 0; - } - - if (line == lines) { - Line l = fLines.get(line - 1); - if (l.delimiter != null) { - return l.offset + l.length; - } - throw new BadLocationException(); - } - - Line l = fLines.get(line); - return l.offset; - } - - @Override - public final int getNumberOfLines() { - int lines = fLines.size(); - - if (lines == 0) { - return 1; - } - - Line l = fLines.get(lines - 1); - return (l.delimiter != null ? lines + 1 : lines); - } - - @Override - public final int getNumberOfLines(int position, int length) throws BadLocationException { - - if (position < 0 || position + length > fTextLength) { - throw new BadLocationException(); - } - - if (length == 0) { - return 1; - } - - return getNumberOfLines(getLineNumberOfOffset(position), position, length); - } - - @Override - public final int computeNumberOfLines(String text) { - int count = 0; - int start = 0; - DelimiterInfo delimiterInfo = nextDelimiterInfo(text, start); - while (delimiterInfo != null && delimiterInfo.delimiterIndex > -1) { - ++count; - start = delimiterInfo.delimiterIndex + delimiterInfo.delimiterLength; - delimiterInfo = nextDelimiterInfo(text, start); - } - return count; - } - - public final String getLineDelimiter(int line) throws BadLocationException { - int lines = fLines.size(); - - if (line < 0 || line > lines) { - throw new BadLocationException("The line value, {" + line + "}, is out of bounds."); - } - - if (lines == 0) { - return null; - } - - if (line == lines) { - return null; - } - - Line l = fLines.get(line); - return l.delimiter; - } - - /** - * Returns the information about the first delimiter found in the given text starting at the given - * offset. - * - * @param text the text to be searched - * @param offset the offset in the given text - * @return the information of the first found delimiter or null - */ - protected DelimiterInfo nextDelimiterInfo(String text, int offset) { - char ch; - int length = text.length(); - for (int i = offset; i < length; i++) { - - ch = text.charAt(i); - if (ch == '\r') { - - if (i + 1 < length) { - if (text.charAt(i + 1) == '\n') { - fDelimiterInfo.delimiter = DELIMITERS[2]; - fDelimiterInfo.delimiterIndex = i; - fDelimiterInfo.delimiterLength = 2; - return fDelimiterInfo; - } - } - - fDelimiterInfo.delimiter = DELIMITERS[0]; - fDelimiterInfo.delimiterIndex = i; - fDelimiterInfo.delimiterLength = 1; - return fDelimiterInfo; - - } else if (ch == '\n') { - - fDelimiterInfo.delimiter = DELIMITERS[1]; - fDelimiterInfo.delimiterIndex = i; - fDelimiterInfo.delimiterLength = 1; - return fDelimiterInfo; - } - } - - return null; - } - - /** - * Creates the line structure for the given text. Newly created lines are inserted into the line - * structure starting at the given position. Returns the number of newly created lines. - * - * @param text the text for which to create a line structure - * @param insertPosition the position at which the newly created lines are inserted into the - * tracker's line structure - * @param offset the offset of all newly created lines - * @return the number of newly created lines - */ - private int createLines(String text, int insertPosition, int offset) { - - int count = 0; - int start = 0; - DelimiterInfo delimiterInfo = nextDelimiterInfo(text, 0); - - while (delimiterInfo != null && delimiterInfo.delimiterIndex > -1) { - - int index = delimiterInfo.delimiterIndex + (delimiterInfo.delimiterLength - 1); - - if (insertPosition + count >= fLines.size()) { - fLines.add(new Line(offset + start, offset + index, delimiterInfo.delimiter)); - } else { - fLines.add( - insertPosition + count, - new Line(offset + start, offset + index, delimiterInfo.delimiter)); - } - - ++count; - start = index + 1; - delimiterInfo = nextDelimiterInfo(text, start); - } - - if (start < text.length()) { - if (insertPosition + count < fLines.size()) { - // there is a line below the current - Line l = fLines.get(insertPosition + count); - int delta = text.length() - start; - l.offset -= delta; - l.length += delta; - } else { - fLines.add(new Line(offset + start, offset + text.length() - 1, null)); - ++count; - } - } - - return count; - } - - @Override - public final void replace(int position, int length, String text) throws BadLocationException { - throw new UnsupportedOperationException(); - } - - @Override - public final void set(String text) { - fLines.clear(); - if (text != null) { - fTextLength = text.length(); - createLines(text, 0, 0); - } - } - - /** - * Returns the internal data structure, a {@link List} of {@link Line}s. - * - * @return the internal list of lines. - */ - final List getLines() { - return fLines; - } -} +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * IBM Corporation - initial API and implementation + * This class is a copy/paste of org.eclipse.jface.text.ListLineTracker + *******************************************************************************/ +package org.eclipse.lemminx.commons; + +import org.appdevforall.codeonthego.models.Position; + +import java.util.ArrayList; +import java.util.List; + +/** + * Abstract, read-only implementation of ILineTracker. It lets the definition of line + * delimiters to subclasses. Assuming that '\n' is the only line delimiter, this abstract + * implementation defines the following line scheme: + * + *
    + *
  • "" -> [0,0] + *
  • "a" -> [0,1] + *
  • "\n" -> [0,1], [1,0] + *
  • "a\n" -> [0,2], [2,0] + *
  • "a\nb" -> [0,2], [2,1] + *
  • "a\nbc\n" -> [0,2], [2,3], [5,0] + *
+ * + * This class must be subclassed. + * + * @since 3.2 + */ +class ListLineTracker implements ILineTracker { + + /** The predefined delimiters of this tracker */ + public static final String[] DELIMITERS = { + "\r", "\n", "\r\n" + }; //$NON-NLS-3$ //$NON-NLS-1$ //$NON-NLS-2$ + /** A predefined delimiter information which is always reused as return value */ + private DelimiterInfo fDelimiterInfo = new DelimiterInfo(); + + /** The line information */ + private final List fLines = new ArrayList<>(); + /** The length of the tracked text */ + private int fTextLength; + + /** + * Combines the information of the occurrence of a line delimiter. delimiterIndex is + * the index where a line delimiter starts, whereas delimiterLength, indicates the + * length of the delimiter. + */ + protected static class DelimiterInfo { + public int delimiterIndex; + public int delimiterLength; + public String delimiter; + } + + /** Creates a new line tracker. */ + protected ListLineTracker() {} + + /** + * Binary search for the line at a given offset. + * + * @param offset the offset whose line should be found + * @return the line of the offset + */ + private int findLine(int offset) { + + if (fLines.size() == 0) { + return -1; + } + int left = 0; + int right = fLines.size(); + while (left < right - 1) { + int mid = (right + left) >> 1; + Line line = fLines.get(mid); + if (line.offset <= offset) { + left = mid; + } else { + right = mid; + } + } + return (fLines.get(left).offset > offset) ? left - 1 : left; + } + + @Override + public final Position getPositionAt(int offset) throws BadLocationException { + int lineNumber = getLineNumberOfOffset(offset); + int lines = fLines.size(); + int character = 0; + if (lines > 0) { + if (lineNumber == lines) { + Line l = fLines.get(lineNumber - 1); + character = offset - l.offset - l.length; + } else { + Line l = fLines.get(lineNumber); + character = offset - l.offset; + } + } + return new Position(lineNumber, character); + } + + /** + * Returns the number of lines covered by the specified text range. + * + * @param startLine the line where the text range starts + * @param offset the start offset of the text range + * @param length the length of the text range + * @return the number of lines covered by this text range + * @exception BadLocationException if range is undefined in this tracker + */ + private int getNumberOfLines(int startLine, int offset, int length) throws BadLocationException { + + if (length == 0) { + return 1; + } + + int target = offset + length; + + Line l = fLines.get(startLine); + + if (l.delimiter == null) { + return 1; + } + + if (l.offset + l.length > target) { + return 1; + } + + if (l.offset + l.length == target) { + return 2; + } + + return getLineNumberOfOffset(target) - startLine + 1; + } + + @Override + public final int getLineLength(int line) throws BadLocationException { + int lines = fLines.size(); + + if (line < 0 || line > lines) { + throw new BadLocationException(); + } + + if (lines == 0 || lines == line) { + return 0; + } + + Line l = fLines.get(line); + return l.length; + } + + @Override + public final int getLineNumberOfOffset(int position) throws BadLocationException { + if (position < 0) { + throw new BadLocationException("Negative offset : " + position); // $NON-NLS-1$ + } else if (position > fTextLength) { + throw new BadLocationException( + "Offset > length: " + position + " > " + fTextLength); // $NON-NLS-1$//$NON-NLS-2$ + } + + if (position == fTextLength) { + + int lastLine = fLines.size() - 1; + if (lastLine < 0) { + return 0; + } + + Line l = fLines.get(lastLine); + return (l.delimiter != null ? lastLine + 1 : lastLine); + } + + return findLine(position); + } + + @Override + public int getOffsetAt(Position position) throws BadLocationException { + int line = position.getLine(); + int lines = fLines.size(); + + if (line < 0 || line > lines) { + throw new BadLocationException("The line value, {" + line + "}, is out of bounds."); + } + + int lineOffset = -1; + int lineLength = -1; + if (lines == 0) { + lineOffset = 0; + lineLength = 0; + } else { + if (line == lines) { + Line l = fLines.get(line - 1); + lineOffset = l.offset + l.length; + lineLength = 0; + } else { + Line l = fLines.get(line); + lineOffset = l.offset; + lineLength = l.delimiter != null ? l.length - l.delimiter.length() : l.length; + } + } + int character = position.getColumn(); + int offset = lineOffset + character; + int endLineOffset = lineOffset + lineLength; + if (offset > endLineOffset) { + throw new BadLocationException( + "The character value, {" + character + "} of the line" + line + "}, is out of bounds."); + } + return offset; + } + + @Override + public final Line getLineInformationOfOffset(int position) throws BadLocationException { + if (position > fTextLength) { + throw new BadLocationException( + "Offset > length: " + position + " > " + fTextLength); // $NON-NLS-1$//$NON-NLS-2$ + } + + if (position == fTextLength) { + int size = fLines.size(); + if (size == 0) { + return new Line(0, 0); + } + Line l = fLines.get(size - 1); + + return (l.delimiter != null + ? new Line(fTextLength, 0) + : new Line(fTextLength - l.length, l.length)); + } + + return getLineInformation(findLine(position)); + } + + @Override + public final Line getLineInformation(int line) throws BadLocationException { + int lines = fLines.size(); + + if (line < 0 || line > lines) { + throw new BadLocationException("The line value, {" + line + "}, is out of bounds."); + } + + if (lines == 0) { + return new Line(0, 0); + } + + if (line == lines) { + Line l = fLines.get(line - 1); + return new Line(l.offset + l.length, 0); + } + + Line l = fLines.get(line); + return (l.delimiter != null ? new Line(l.offset, l.length - l.delimiter.length()) : l); + } + + @Override + public final int getLineOffset(int line) throws BadLocationException { + int lines = fLines.size(); + + if (line < 0 || line > lines) { + throw new BadLocationException("The line value, {" + line + "}, is out of bounds."); + } + + if (lines == 0) { + return 0; + } + + if (line == lines) { + Line l = fLines.get(line - 1); + if (l.delimiter != null) { + return l.offset + l.length; + } + throw new BadLocationException(); + } + + Line l = fLines.get(line); + return l.offset; + } + + @Override + public final int getNumberOfLines() { + int lines = fLines.size(); + + if (lines == 0) { + return 1; + } + + Line l = fLines.get(lines - 1); + return (l.delimiter != null ? lines + 1 : lines); + } + + @Override + public final int getNumberOfLines(int position, int length) throws BadLocationException { + + if (position < 0 || position + length > fTextLength) { + throw new BadLocationException(); + } + + if (length == 0) { + return 1; + } + + return getNumberOfLines(getLineNumberOfOffset(position), position, length); + } + + @Override + public final int computeNumberOfLines(String text) { + int count = 0; + int start = 0; + DelimiterInfo delimiterInfo = nextDelimiterInfo(text, start); + while (delimiterInfo != null && delimiterInfo.delimiterIndex > -1) { + ++count; + start = delimiterInfo.delimiterIndex + delimiterInfo.delimiterLength; + delimiterInfo = nextDelimiterInfo(text, start); + } + return count; + } + + public final String getLineDelimiter(int line) throws BadLocationException { + int lines = fLines.size(); + + if (line < 0 || line > lines) { + throw new BadLocationException("The line value, {" + line + "}, is out of bounds."); + } + + if (lines == 0) { + return null; + } + + if (line == lines) { + return null; + } + + Line l = fLines.get(line); + return l.delimiter; + } + + /** + * Returns the information about the first delimiter found in the given text starting at the given + * offset. + * + * @param text the text to be searched + * @param offset the offset in the given text + * @return the information of the first found delimiter or null + */ + protected DelimiterInfo nextDelimiterInfo(String text, int offset) { + char ch; + int length = text.length(); + for (int i = offset; i < length; i++) { + + ch = text.charAt(i); + if (ch == '\r') { + + if (i + 1 < length) { + if (text.charAt(i + 1) == '\n') { + fDelimiterInfo.delimiter = DELIMITERS[2]; + fDelimiterInfo.delimiterIndex = i; + fDelimiterInfo.delimiterLength = 2; + return fDelimiterInfo; + } + } + + fDelimiterInfo.delimiter = DELIMITERS[0]; + fDelimiterInfo.delimiterIndex = i; + fDelimiterInfo.delimiterLength = 1; + return fDelimiterInfo; + + } else if (ch == '\n') { + + fDelimiterInfo.delimiter = DELIMITERS[1]; + fDelimiterInfo.delimiterIndex = i; + fDelimiterInfo.delimiterLength = 1; + return fDelimiterInfo; + } + } + + return null; + } + + /** + * Creates the line structure for the given text. Newly created lines are inserted into the line + * structure starting at the given position. Returns the number of newly created lines. + * + * @param text the text for which to create a line structure + * @param insertPosition the position at which the newly created lines are inserted into the + * tracker's line structure + * @param offset the offset of all newly created lines + * @return the number of newly created lines + */ + private int createLines(String text, int insertPosition, int offset) { + + int count = 0; + int start = 0; + DelimiterInfo delimiterInfo = nextDelimiterInfo(text, 0); + + while (delimiterInfo != null && delimiterInfo.delimiterIndex > -1) { + + int index = delimiterInfo.delimiterIndex + (delimiterInfo.delimiterLength - 1); + + if (insertPosition + count >= fLines.size()) { + fLines.add(new Line(offset + start, offset + index, delimiterInfo.delimiter)); + } else { + fLines.add( + insertPosition + count, + new Line(offset + start, offset + index, delimiterInfo.delimiter)); + } + + ++count; + start = index + 1; + delimiterInfo = nextDelimiterInfo(text, start); + } + + if (start < text.length()) { + if (insertPosition + count < fLines.size()) { + // there is a line below the current + Line l = fLines.get(insertPosition + count); + int delta = text.length() - start; + l.offset -= delta; + l.length += delta; + } else { + fLines.add(new Line(offset + start, offset + text.length() - 1, null)); + ++count; + } + } + + return count; + } + + @Override + public final void replace(int position, int length, String text) throws BadLocationException { + throw new UnsupportedOperationException(); + } + + @Override + public final void set(String text) { + fLines.clear(); + if (text != null) { + fTextLength = text.length(); + createLines(text, 0, 0); + } + } + + /** + * Returns the internal data structure, a {@link List} of {@link Line}s. + * + * @return the internal list of lines. + */ + final List getLines() { + return fLines; + } +} diff --git a/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/commons/TextDocument.java b/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/commons/TextDocument.java index 6ed6cd7ff7..339bf1c893 100644 --- a/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/commons/TextDocument.java +++ b/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/commons/TextDocument.java @@ -1,127 +1,127 @@ -/** - * Copyright (c) 2018 Angelo ZERR. All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v2.0 which accompanies this - * distribution, and is available at http://www.eclipse.org/legal/epl-v20.html - * - *

SPDX-License-Identifier: EPL-2.0 - * - *

Contributors: Angelo Zerr - initial API and implementation - */ -package org.eclipse.lemminx.commons; - -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class TextDocument { - - private static String DEFAULT_DELIMTER = System.lineSeparator(); - - private ILineTracker lineTracker; - - private String text; - private String uri; - - public TextDocument(String text, String uri) { - setUri(uri); - setText(text); - } - - public void setUri(final String uri) { - this.uri = uri; - } - - public String getUri() { - return uri; - } - - public void setText(final String text) { - this.text = text; - } - - public String getText() { - return text; - } - - public Position positionAt(int position) throws BadLocationException { - ILineTracker lineTracker = getLineTracker(); - return lineTracker.getPositionAt(position); - } - - public int offsetAt(Position position) throws BadLocationException { - ILineTracker lineTracker = getLineTracker(); - return lineTracker.getOffsetAt(position); - } - - public String lineText(int lineNumber) throws BadLocationException { - ILineTracker lineTracker = getLineTracker(); - Line line = lineTracker.getLineInformation(lineNumber); - String text = getText(); - return text.substring(line.offset, line.offset + line.length); - } - - public int lineOffsetAt(int position) throws BadLocationException { - ILineTracker lineTracker = getLineTracker(); - Line line = lineTracker.getLineInformationOfOffset(position); - return line.offset; - } - - public String lineDelimiter(int lineNumber) throws BadLocationException { - ILineTracker lineTracker = getLineTracker(); - String lineDelimiter = lineTracker.getLineDelimiter(lineNumber); - if (lineDelimiter == null) { - if (lineTracker.getNumberOfLines() > 0) { - lineDelimiter = lineTracker.getLineInformation(0).delimiter; - } - } - if (lineDelimiter == null) { - lineDelimiter = DEFAULT_DELIMTER; - } - return lineDelimiter; - } - - public Range getWordRangeAt(int textOffset, Pattern wordDefinition) { - try { - Position pos = positionAt(textOffset); - ILineTracker lineTracker = getLineTracker(); - Line line = lineTracker.getLineInformation(pos.getLine()); - String text = getText(); - String lineText = text.substring(line.offset, textOffset); - int position = lineText.length(); - Matcher m = wordDefinition.matcher(lineText); - int currentPosition = 0; - while (currentPosition != position) { - if (m.find()) { - currentPosition = m.end(); - if (currentPosition == position) { - return new Range(new Position(pos.getLine(), m.start()), pos); - } - } else { - currentPosition++; - } - m.region(currentPosition, position); - } - return new Range(pos, pos); - } catch (BadLocationException e) { - return null; - } - } - - private ILineTracker getLineTracker() { - if (lineTracker == null) { - lineTracker = createLineTracker(); - } - return lineTracker; - } - - private synchronized ILineTracker createLineTracker() { - if (lineTracker != null) { - return lineTracker; - } - ILineTracker lineTracker = new ListLineTracker(); - lineTracker.set(getText()); - return lineTracker; - } -} +/** + * Copyright (c) 2018 Angelo ZERR. All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 which accompanies this + * distribution, and is available at http://www.eclipse.org/legal/epl-v20.html + * + *

SPDX-License-Identifier: EPL-2.0 + * + *

Contributors: Angelo Zerr - initial API and implementation + */ +package org.eclipse.lemminx.commons; + +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class TextDocument { + + private static String DEFAULT_DELIMTER = System.lineSeparator(); + + private ILineTracker lineTracker; + + private String text; + private String uri; + + public TextDocument(String text, String uri) { + setUri(uri); + setText(text); + } + + public void setUri(final String uri) { + this.uri = uri; + } + + public String getUri() { + return uri; + } + + public void setText(final String text) { + this.text = text; + } + + public String getText() { + return text; + } + + public Position positionAt(int position) throws BadLocationException { + ILineTracker lineTracker = getLineTracker(); + return lineTracker.getPositionAt(position); + } + + public int offsetAt(Position position) throws BadLocationException { + ILineTracker lineTracker = getLineTracker(); + return lineTracker.getOffsetAt(position); + } + + public String lineText(int lineNumber) throws BadLocationException { + ILineTracker lineTracker = getLineTracker(); + Line line = lineTracker.getLineInformation(lineNumber); + String text = getText(); + return text.substring(line.offset, line.offset + line.length); + } + + public int lineOffsetAt(int position) throws BadLocationException { + ILineTracker lineTracker = getLineTracker(); + Line line = lineTracker.getLineInformationOfOffset(position); + return line.offset; + } + + public String lineDelimiter(int lineNumber) throws BadLocationException { + ILineTracker lineTracker = getLineTracker(); + String lineDelimiter = lineTracker.getLineDelimiter(lineNumber); + if (lineDelimiter == null) { + if (lineTracker.getNumberOfLines() > 0) { + lineDelimiter = lineTracker.getLineInformation(0).delimiter; + } + } + if (lineDelimiter == null) { + lineDelimiter = DEFAULT_DELIMTER; + } + return lineDelimiter; + } + + public Range getWordRangeAt(int textOffset, Pattern wordDefinition) { + try { + Position pos = positionAt(textOffset); + ILineTracker lineTracker = getLineTracker(); + Line line = lineTracker.getLineInformation(pos.getLine()); + String text = getText(); + String lineText = text.substring(line.offset, textOffset); + int position = lineText.length(); + Matcher m = wordDefinition.matcher(lineText); + int currentPosition = 0; + while (currentPosition != position) { + if (m.find()) { + currentPosition = m.end(); + if (currentPosition == position) { + return new Range(new Position(pos.getLine(), m.start()), pos); + } + } else { + currentPosition++; + } + m.region(currentPosition, position); + } + return new Range(pos, pos); + } catch (BadLocationException e) { + return null; + } + } + + private ILineTracker getLineTracker() { + if (lineTracker == null) { + lineTracker = createLineTracker(); + } + return lineTracker; + } + + private synchronized ILineTracker createLineTracker() { + if (lineTracker != null) { + return lineTracker; + } + ILineTracker lineTracker = new ListLineTracker(); + lineTracker.set(getText()); + return lineTracker; + } +} diff --git a/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/dom/DOMDocument.java b/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/dom/DOMDocument.java index c9a261e781..6fabff0703 100644 --- a/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/dom/DOMDocument.java +++ b/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/dom/DOMDocument.java @@ -1,920 +1,920 @@ -/** - * Copyright (c) 2018-2020 Angelo ZERR. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v2.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v20.html - * - * SPDX-License-Identifier: EPL-2.0 - * - * Initial code from https://github.com/Microsoft/vscode-html-languageservice - * Initial copyright Copyright (C) Microsoft Corporation. All rights reserved. - * Initial license: MIT - * - * Contributors: - * - Microsoft Corporation: Initial code, written in TypeScript, licensed under MIT license - * - Angelo Zerr - translation and adaptation to Java - */ -package org.eclipse.lemminx.dom; - -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import org.eclipse.lemminx.commons.BadLocationException; -import org.eclipse.lemminx.commons.TextDocument; -import org.eclipse.lemminx.dom.parser.Constants; -import org.eclipse.lemminx.uriresolver.URIResolverExtensionManager; -import org.eclipse.lemminx.utils.DOMUtils; -import org.eclipse.lemminx.utils.StringUtils; -import org.eclipse.lemminx.utils.XMLPositionUtility; -import org.eclipse.lsp4j.jsonrpc.CancelChecker; -import org.w3c.dom.CDATASection; -import org.w3c.dom.DOMConfiguration; -import org.w3c.dom.DOMException; -import org.w3c.dom.DOMImplementation; -import org.w3c.dom.Document; -import org.w3c.dom.DocumentFragment; -import org.w3c.dom.EntityReference; -import org.w3c.dom.NodeList; - -/** - * XML document. - * - */ -public class DOMDocument extends DOMNode implements Document { - - private SchemaLocation schemaLocation; - private NoNamespaceSchemaLocation noNamespaceSchemaLocation; - - private boolean referencedExternalGrammarInitialized; - private boolean referencedSchemaInitialized; - private final URIResolverExtensionManager resolverExtensionManager; - - private final TextDocument textDocument; - private boolean hasNamespaces; - private Map externalGrammarLocation; - private String schemaInstancePrefix; - private String schemaPrefix; - private CancelChecker cancelChecker; - private String externalGrammarFromNamespaceURI; - - public DOMDocument(TextDocument textDocument, URIResolverExtensionManager resolverExtensionManager) { - super(0, textDocument.getText().length()); - this.textDocument = textDocument; - this.resolverExtensionManager = resolverExtensionManager; - resetGrammar(); - } - - public void setCancelChecker(CancelChecker cancelChecker) { - this.cancelChecker = cancelChecker; - } - - public CancelChecker getCancelChecker() { - return cancelChecker; - } - - public List getRoots() { - return super.getChildren(); - } - - public Position positionAt(int offset) throws BadLocationException { - checkCanceled(); - return textDocument.positionAt(offset); - } - - public int offsetAt(Position position) throws BadLocationException { - checkCanceled(); - return textDocument.offsetAt(position); - } - - public String lineText(int lineNumber) throws BadLocationException { - checkCanceled(); - return textDocument.lineText(lineNumber); - } - - public String lineDelimiter(int lineNumber) throws BadLocationException { - checkCanceled(); - return textDocument.lineDelimiter(lineNumber); - } - - public LineIndentInfo getLineIndentInfo(int lineNumber) throws BadLocationException { - String lineText = lineText(lineNumber); - String lineDelimiter = lineDelimiter(lineNumber); - String whitespacesIndent = StringUtils.getStartWhitespaces(lineText); - return new LineIndentInfo(lineDelimiter, whitespacesIndent); - } - - /** - * Returns the element name on the left of the given position and null - * otherwise. - * - * @param textOffset - * @return the element name on the left of the given position and null - * otherwise. - */ - public Range getElementNameRangeAt(int textOffset) { - checkCanceled(); - return textDocument.getWordRangeAt(textOffset, Constants.ELEMENT_NAME_REGEX); - } - - @Override - public String getNamespaceURI() { - DOMElement documentElement = getDocumentElement(); - return documentElement != null ? documentElement.getNamespaceURI() : null; - } - - /** - * Returns the text content of the XML document. - * - * @return the text content of the XML document. - */ - public String getText() { - return textDocument.getText(); - } - - public TextDocument getTextDocument() { - return textDocument; - } - - /** - * Returns true if the document is bound to a grammar and false otherwise. - * - * @return true if the document is bound to a grammar and false otherwise. - */ - public boolean hasGrammar() { - return hasDTD() || hasSchemaLocation() || hasNoNamespaceSchemaLocation() || hasExternalGrammar(); - } - - // -------------------------- Grammar with XML Schema - - /** - * Returns the declared "xsi:schemaLocation" and null otherwise. - * - * @return the declared "xsi:schemaLocation" and null otherwise. - */ - public SchemaLocation getSchemaLocation() { - initializeReferencedSchemaIfNeeded(); - return schemaLocation; - } - - /** - * Returns true if XML root element declares a "xsi:schemaLocation" and false - * otherwise. - * - * @return true if XML root element declares a "xsi:schemaLocation" and false - * otherwise. - */ - public boolean hasSchemaLocation() { - return getSchemaLocation() != null; - } - - /** - * Returns the declared "xsi:noNamespaceSchemaLocation" and null otherwise. - * - * @return the declared "xsi:noNamespaceSchemaLocation" and null otherwise. - */ - public NoNamespaceSchemaLocation getNoNamespaceSchemaLocation() { - initializeReferencedSchemaIfNeeded(); - return noNamespaceSchemaLocation; - } - - /** - * Returns true if XML root element declares a "xsi:noNamespaceSchemaLocation" - * and false otherwise. - * - * @return true if XML root element declares a "xsi:noNamespaceSchemaLocation" - * and false otherwise. - */ - public boolean hasNoNamespaceSchemaLocation() { - return getNoNamespaceSchemaLocation() != null; - } - - /** - * Returns true if document defines namespaces (with xmlns) and false otherwise. - * - * @return true if document defines namespaces (with xmlns) and false otherwise. - */ - public boolean hasNamespaces() { - initializeReferencedSchemaIfNeeded(); - return hasNamespaces; - } - - /** - * Returns the (xsi) schema instance prefix and null otherwise. - * - * @return the (xsi) schema instance prefix and null otherwise. - */ - public String getSchemaInstancePrefix() { - initializeReferencedSchemaIfNeeded(); - return schemaInstancePrefix; - } - - /** - * Returns true if (xsi) schema instance prefix exists. - * - * @return true if (xsi) schema instance prefix exists. - */ - public boolean hasSchemaInstancePrefix() { - initializeReferencedSchemaIfNeeded(); - return schemaInstancePrefix != null; - } - - /** - * Initialize schemaLocation, noNamespaceSchemaLocation and hasNamespaces - * information if needed. - */ - private void initializeReferencedSchemaIfNeeded() { - if (referencedSchemaInitialized) { - return; - } - initializeReferencedSchema(); - referencedSchemaInitialized = true; - } - - /** - * Initialize namespaces and schema location declaration . - */ - private synchronized void initializeReferencedSchema() { - if (referencedSchemaInitialized) { - return; - } - // Get root element - DOMElement documentElement = getDocumentElement(); - if (documentElement == null) { - return; - } - schemaInstancePrefix = null; - schemaPrefix = null; - // Search if document element root declares namespace with "xmlns". - if (documentElement.hasAttributes()) { - for (DOMAttr attr : documentElement.getAttributeNodes()) { - String attributeName = attr.getName(); - if (attributeName != null) { - if (attributeName.equals(DOMAttr.XMLNS_ATTR) - || attributeName.startsWith(DOMAttr.XMLNS_NO_DEFAULT_ATTR)) { - hasNamespaces = true; - String attributeValue = documentElement.getAttribute(attributeName); - if (attributeValue != null && attributeValue.startsWith("http://www.w3.org/")) { - if (attributeValue.endsWith("/XMLSchema-instance")) { - schemaInstancePrefix = attributeName.equals("xmlns") ? "" - : getUnprefixedName(attributeName); - } else if (attributeValue.endsWith("/XMLSchema")) { - schemaPrefix = attributeName.equals("xmlns") ? "" : getUnprefixedName(attributeName); - } - } - } - } - } - if (schemaInstancePrefix != null) { - // DOM document can declared xsi:noNamespaceSchemaLocation and - // xsi:schemaLocation both even it's not valid - noNamespaceSchemaLocation = createNoNamespaceSchemaLocation(documentElement, schemaInstancePrefix); - schemaLocation = createSchemaLocation(documentElement, schemaInstancePrefix); - } - } - } - - /** - * If document has {@code } - * - * @return - */ - public boolean hasProlog() { - List children = getChildren(); - return (children != null && !children.isEmpty() && children.get(0).isProlog()); - } - - /** - * If document has {@code }, return this prolog, null otherwise - * - * @return prolog DOMNode, if the document has one, null otherwise - */ - public DOMNode getProlog() { - if (hasProlog()) { - return getChild(0); - } else { - return null; - } - } - - /** - * Returns true, if the given offset is before XML declaration - * ({@code }), false otherwise. - * - * @param offset the offset position in question - * @return true, if before xml declaration; false otherwise - */ - public boolean isBeforeProlog(int offset) { - return hasProlog() && offset <= getProlog().getStart(); - } - - private static SchemaLocation createSchemaLocation(DOMNode root, String schemaInstancePrefix) { - DOMAttr attr = root.getAttributeNode(getPrefixedName(schemaInstancePrefix, "schemaLocation")); - // Check that the attribute and the attribute value of xsi:schemaLocation is not null - if (attr == null || attr.getNodeAttrValue() == null) { - return null; - } - return new SchemaLocation(attr); - } - - private static NoNamespaceSchemaLocation createNoNamespaceSchemaLocation(DOMNode root, - String schemaInstancePrefix) { - DOMAttr attr = root.getAttributeNode(getPrefixedName(schemaInstancePrefix, "noNamespaceSchemaLocation")); - if (attr == null || attr.getValue() == null) { - return null; - } - return new NoNamespaceSchemaLocation(attr); - } - - // -------------------------- Grammar with DTD - - /** - * Returns true if XML document has a DTD declaration and false otherwise. - * - * @return true if XML document has a DTD declaration and false otherwise. - */ - public boolean hasDTD() { - return getDoctype() != null; - } - - // -------------------------- External Grammar (XML file associations, catalog) - - /** - * Returns true if the document is bound to an external grammar (XML file - * associations, XLM catalog) and false otherwise. - * - * @return true if the document is bound to an external grammar (XML file - * associations, XLM catalog) and false otherwise. - */ - public boolean hasExternalGrammar() { - return getExternalGrammarLocation() != null || getExternalGrammarFromNamespaceURI() != null; - } - - /** - * Returns the external grammar location (XSD, DTD from xml file associations) - * and null otherwise. - * - * @return the external grammar location (XSD, DTD from xml file associations) - * and null otherwise. - */ - public Map getExternalGrammarLocation() { - initializeReferencedExternalGrammarIfNeeded(); - return externalGrammarLocation; - } - - /** - * Returns the grammar location found by the namespace URI from the document - * root element (ex : found with XML catalog) and null otherwise. - * - * @return the grammar location found by the namespace URI from the document - * root element (ex : found with XML catalog) and null otherwise. - */ - public String getExternalGrammarFromNamespaceURI() { - initializeReferencedExternalGrammarIfNeeded(); - return externalGrammarFromNamespaceURI; - } - - private void initializeReferencedExternalGrammarIfNeeded() { - if (referencedExternalGrammarInitialized) { - return; - } - intializeExternalGrammar(); - } - - private synchronized void intializeExternalGrammar() { - if (referencedExternalGrammarInitialized) { - return; - } - try { - if (resolverExtensionManager != null) { - // No grammar found with standard mean, check if it some components like XML - // file associations bind this XML document to a grammar with external schema - // location. - try { - externalGrammarLocation = resolverExtensionManager - .getExternalGrammarLocation(new URI(getDocumentURI())); - if (externalGrammarLocation != null) { - return; - } - } catch (URISyntaxException e) { - // Do nothing - } - - // No grammar found with standard mean and external schema location, check if - // it some components like XML - // Catalog, XSL and XSD resolvers, etc bind this XML document to a grammar. - // Get root element - DOMElement documentElement = getDocumentElement(); - if (documentElement == null) { - return; - } - String namespaceURI = documentElement.getNamespaceURI(); - externalGrammarFromNamespaceURI = resolverExtensionManager.resolve(getDocumentURI(), namespaceURI, - null); - } - } finally { - referencedExternalGrammarInitialized = true; - } - } - - private static String getUnprefixedName(String name) { - int index = name.indexOf(":"); //$NON-NLS-1$ - if (index != -1) { - name = name.substring(index + 1); - } - return name; - } - - private static String getPrefixedName(String prefix, String localName) { - return prefix != null && prefix.length() > 0 ? prefix + ":" + localName : localName; //$NON-NLS-1$ - } - - public DOMElement createElement(int start, int end) { - return new DOMElement(start, end); - } - - public DOMCDATASection createCDataSection(int start, int end) { - return new DOMCDATASection(start, end); - } - - public DOMProcessingInstruction createProcessingInstruction(int start, int end) { - return new DOMProcessingInstruction(start, end); - } - - public DOMComment createComment(int start, int end) { - return new DOMComment(start, end); - } - - public DOMText createText(int start, int end) { - return new DOMText(start, end); - } - - public DOMDocumentType createDocumentType(int start, int end) { - return new DOMDocumentType(start, end); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Node#getNodeType() - */ - @Override - public short getNodeType() { - return DOMNode.DOCUMENT_NODE; - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Node#getNodeName() - */ - @Override - public String getNodeName() { - return "#document"; - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#getDocumentElement() - */ - @Override - public DOMElement getDocumentElement() { - List roots = getRoots(); - if (roots != null) { - for (DOMNode node : roots) { - if (node.isElement()) { - return (DOMElement) node; - } - } - } - return null; - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#getDoctype() - */ - @Override - public DOMDocumentType getDoctype() { - List roots = getRoots(); - if (roots != null) { - for (DOMNode node : roots) { - if (node.isDoctype()) { - return (DOMDocumentType) node; - } - } - } - return null; - } - - @Override - public DOMDocument getOwnerDocument() { - return this; - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#getDocumentURI() - */ - @Override - public String getDocumentURI() { - return textDocument.getUri(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#setDocumentURI(java.lang.String) - */ - @Override - public void setDocumentURI(String documentURI) { - textDocument.setUri(documentURI); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#adoptNode(org.w3c.dom.Node) - */ - @Override - public DOMNode adoptNode(org.w3c.dom.Node source) throws DOMException { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#createAttribute(java.lang.String) - */ - @Override - public DOMAttr createAttribute(String name) throws DOMException { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#createAttributeNS(java.lang.String, - * java.lang.String) - */ - @Override - public DOMAttr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#createCDATASection(java.lang.String) - */ - @Override - public CDATASection createCDATASection(String data) throws DOMException { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#createComment(java.lang.String) - */ - @Override - public DOMComment createComment(String data) { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#createDocumentFragment() - */ - @Override - public DocumentFragment createDocumentFragment() { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#createElement(java.lang.String) - */ - @Override - public DOMElement createElement(String tagName) throws DOMException { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#createElementNS(java.lang.String, java.lang.String) - */ - @Override - public DOMElement createElementNS(String namespaceURI, String qualifiedName) throws DOMException { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#createEntityReference(java.lang.String) - */ - @Override - public EntityReference createEntityReference(String name) throws DOMException { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#createProcessingInstruction(java.lang.String, - * java.lang.String) - */ - @Override - public DOMProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#createTextNode(java.lang.String) - */ - @Override - public DOMText createTextNode(String data) { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#getDomConfig() - */ - @Override - public DOMConfiguration getDomConfig() { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#getElementById(java.lang.String) - */ - @Override - public DOMElement getElementById(String elementId) { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#getElementsByTagName(java.lang.String) - */ - @Override - public NodeList getElementsByTagName(String tagname) { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#getElementsByTagNameNS(java.lang.String, - * java.lang.String) - */ - @Override - public NodeList getElementsByTagNameNS(String namespaceURI, String localName) { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#getImplementation() - */ - @Override - public DOMImplementation getImplementation() { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#getInputEncoding() - */ - @Override - public String getInputEncoding() { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#getStrictErrorChecking() - */ - @Override - public boolean getStrictErrorChecking() { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#getXmlEncoding() - */ - @Override - public String getXmlEncoding() { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#getXmlStandalone() - */ - @Override - public boolean getXmlStandalone() { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#getXmlVersion() - */ - @Override - public String getXmlVersion() { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#importNode(org.w3c.dom.Node, boolean) - */ - @Override - public DOMNode importNode(org.w3c.dom.Node importedNode, boolean deep) throws DOMException { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#normalizeDocument() - */ - @Override - public void normalizeDocument() { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#renameNode(org.w3c.dom.Node, java.lang.String, - * java.lang.String) - */ - @Override - public DOMNode renameNode(org.w3c.dom.Node n, String namespaceURI, String qualifiedName) throws DOMException { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#setStrictErrorChecking(boolean) - */ - @Override - public void setStrictErrorChecking(boolean strictErrorChecking) { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#setXmlStandalone(boolean) - */ - @Override - public void setXmlStandalone(boolean xmlStandalone) throws DOMException { - throw new UnsupportedOperationException(); - } - - /* - * (non-Javadoc) - * - * @see org.w3c.dom.Document#setXmlVersion(java.lang.String) - */ - @Override - public void setXmlVersion(String xmlVersion) throws DOMException { - throw new UnsupportedOperationException(); - } - - /** - * Reset the cached grammar flag. - */ - public void resetGrammar() { - this.referencedExternalGrammarInitialized = false; - this.referencedSchemaInitialized = false; - } - - public URIResolverExtensionManager getResolverExtensionManager() { - return resolverExtensionManager; - } - - /** - * Returns true if the XML document is a DTD and false otherwise. - * - * @return true if the XML document is a DTD and false otherwise. - */ - public boolean isDTD() { - String uri = this.getDocumentURI(); - if (DOMUtils.isDTD(uri)) { - return true; - } - return false; - } - - /** - * Returns true if 'offset' is within an internal DOCTYPE dtd. Else false. - * - * @param offset - * @return - */ - public boolean isWithinInternalDTD(int offset) { - DOMDocumentType doctype = this.getDoctype(); - if (doctype != null && doctype.internalSubset != null) { - return offset > doctype.internalSubset.start && offset < doctype.internalSubset.end; - } - return false; - } - - public Range getTrimmedRange(Range range) { - if (range != null) { - return getTrimmedRange(range.getStart().getColumn(), range.getEnd().getColumn()); - } - return null; - - } - - public Range getTrimmedRange(int start, int end) { - String text = getText(); - char c = text.charAt(start); - while (Character.isWhitespace(c)) { - start++; - c = text.charAt(start); - } - if (start == end) { - return null; - } - end--; - c = text.charAt(end); - while (Character.isWhitespace(c)) { - end--; - c = text.charAt(end); - } - end++; - return XMLPositionUtility.createRange(start, end, this); - } - - /** - * Returns the DTD Attribute list for the given element name and empty - * otherwise. - * - * @param elementName - * @return the DTD Attribute list for the given element name and empty - * otherwise. - */ - public Collection findDTDAttrList(String elementName) { - DOMDocumentType docType = getDoctype(); - if (docType == null || elementName == null) { - return Collections.emptyList(); - } - return docType.getChildren().stream().filter(DOMNode::isDTDAttListDecl) - .filter(n -> elementName.equals(((DTDAttlistDecl) n).getElementName())).collect(Collectors.toList()); - } - - /** - * Returns the XML Schema prefix (ex : 'xs' for - * xmlns:xs="http://www.w3.org/2001/XMLSchema") - * - * @return the XML Schema prefix (ex : 'xs' for - * xmlns:xs="http://www.w3.org/2001/XMLSchema") - */ - public String getSchemaPrefix() { - initializeReferencedSchemaIfNeeded(); - return schemaPrefix; - } - - private void checkCanceled() { - if (cancelChecker != null) { - cancelChecker.checkCanceled(); - } - } -} +/** + * Copyright (c) 2018-2020 Angelo ZERR. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Initial code from https://github.com/Microsoft/vscode-html-languageservice + * Initial copyright Copyright (C) Microsoft Corporation. All rights reserved. + * Initial license: MIT + * + * Contributors: + * - Microsoft Corporation: Initial code, written in TypeScript, licensed under MIT license + * - Angelo Zerr - translation and adaptation to Java + */ +package org.eclipse.lemminx.dom; + +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.eclipse.lemminx.commons.BadLocationException; +import org.eclipse.lemminx.commons.TextDocument; +import org.eclipse.lemminx.dom.parser.Constants; +import org.eclipse.lemminx.uriresolver.URIResolverExtensionManager; +import org.eclipse.lemminx.utils.DOMUtils; +import org.eclipse.lemminx.utils.StringUtils; +import org.eclipse.lemminx.utils.XMLPositionUtility; +import org.eclipse.lsp4j.jsonrpc.CancelChecker; +import org.w3c.dom.CDATASection; +import org.w3c.dom.DOMConfiguration; +import org.w3c.dom.DOMException; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentFragment; +import org.w3c.dom.EntityReference; +import org.w3c.dom.NodeList; + +/** + * XML document. + * + */ +public class DOMDocument extends DOMNode implements Document { + + private SchemaLocation schemaLocation; + private NoNamespaceSchemaLocation noNamespaceSchemaLocation; + + private boolean referencedExternalGrammarInitialized; + private boolean referencedSchemaInitialized; + private final URIResolverExtensionManager resolverExtensionManager; + + private final TextDocument textDocument; + private boolean hasNamespaces; + private Map externalGrammarLocation; + private String schemaInstancePrefix; + private String schemaPrefix; + private CancelChecker cancelChecker; + private String externalGrammarFromNamespaceURI; + + public DOMDocument(TextDocument textDocument, URIResolverExtensionManager resolverExtensionManager) { + super(0, textDocument.getText().length()); + this.textDocument = textDocument; + this.resolverExtensionManager = resolverExtensionManager; + resetGrammar(); + } + + public void setCancelChecker(CancelChecker cancelChecker) { + this.cancelChecker = cancelChecker; + } + + public CancelChecker getCancelChecker() { + return cancelChecker; + } + + public List getRoots() { + return super.getChildren(); + } + + public Position positionAt(int offset) throws BadLocationException { + checkCanceled(); + return textDocument.positionAt(offset); + } + + public int offsetAt(Position position) throws BadLocationException { + checkCanceled(); + return textDocument.offsetAt(position); + } + + public String lineText(int lineNumber) throws BadLocationException { + checkCanceled(); + return textDocument.lineText(lineNumber); + } + + public String lineDelimiter(int lineNumber) throws BadLocationException { + checkCanceled(); + return textDocument.lineDelimiter(lineNumber); + } + + public LineIndentInfo getLineIndentInfo(int lineNumber) throws BadLocationException { + String lineText = lineText(lineNumber); + String lineDelimiter = lineDelimiter(lineNumber); + String whitespacesIndent = StringUtils.getStartWhitespaces(lineText); + return new LineIndentInfo(lineDelimiter, whitespacesIndent); + } + + /** + * Returns the element name on the left of the given position and null + * otherwise. + * + * @param textOffset + * @return the element name on the left of the given position and null + * otherwise. + */ + public Range getElementNameRangeAt(int textOffset) { + checkCanceled(); + return textDocument.getWordRangeAt(textOffset, Constants.ELEMENT_NAME_REGEX); + } + + @Override + public String getNamespaceURI() { + DOMElement documentElement = getDocumentElement(); + return documentElement != null ? documentElement.getNamespaceURI() : null; + } + + /** + * Returns the text content of the XML document. + * + * @return the text content of the XML document. + */ + public String getText() { + return textDocument.getText(); + } + + public TextDocument getTextDocument() { + return textDocument; + } + + /** + * Returns true if the document is bound to a grammar and false otherwise. + * + * @return true if the document is bound to a grammar and false otherwise. + */ + public boolean hasGrammar() { + return hasDTD() || hasSchemaLocation() || hasNoNamespaceSchemaLocation() || hasExternalGrammar(); + } + + // -------------------------- Grammar with XML Schema + + /** + * Returns the declared "xsi:schemaLocation" and null otherwise. + * + * @return the declared "xsi:schemaLocation" and null otherwise. + */ + public SchemaLocation getSchemaLocation() { + initializeReferencedSchemaIfNeeded(); + return schemaLocation; + } + + /** + * Returns true if XML root element declares a "xsi:schemaLocation" and false + * otherwise. + * + * @return true if XML root element declares a "xsi:schemaLocation" and false + * otherwise. + */ + public boolean hasSchemaLocation() { + return getSchemaLocation() != null; + } + + /** + * Returns the declared "xsi:noNamespaceSchemaLocation" and null otherwise. + * + * @return the declared "xsi:noNamespaceSchemaLocation" and null otherwise. + */ + public NoNamespaceSchemaLocation getNoNamespaceSchemaLocation() { + initializeReferencedSchemaIfNeeded(); + return noNamespaceSchemaLocation; + } + + /** + * Returns true if XML root element declares a "xsi:noNamespaceSchemaLocation" + * and false otherwise. + * + * @return true if XML root element declares a "xsi:noNamespaceSchemaLocation" + * and false otherwise. + */ + public boolean hasNoNamespaceSchemaLocation() { + return getNoNamespaceSchemaLocation() != null; + } + + /** + * Returns true if document defines namespaces (with xmlns) and false otherwise. + * + * @return true if document defines namespaces (with xmlns) and false otherwise. + */ + public boolean hasNamespaces() { + initializeReferencedSchemaIfNeeded(); + return hasNamespaces; + } + + /** + * Returns the (xsi) schema instance prefix and null otherwise. + * + * @return the (xsi) schema instance prefix and null otherwise. + */ + public String getSchemaInstancePrefix() { + initializeReferencedSchemaIfNeeded(); + return schemaInstancePrefix; + } + + /** + * Returns true if (xsi) schema instance prefix exists. + * + * @return true if (xsi) schema instance prefix exists. + */ + public boolean hasSchemaInstancePrefix() { + initializeReferencedSchemaIfNeeded(); + return schemaInstancePrefix != null; + } + + /** + * Initialize schemaLocation, noNamespaceSchemaLocation and hasNamespaces + * information if needed. + */ + private void initializeReferencedSchemaIfNeeded() { + if (referencedSchemaInitialized) { + return; + } + initializeReferencedSchema(); + referencedSchemaInitialized = true; + } + + /** + * Initialize namespaces and schema location declaration . + */ + private synchronized void initializeReferencedSchema() { + if (referencedSchemaInitialized) { + return; + } + // Get root element + DOMElement documentElement = getDocumentElement(); + if (documentElement == null) { + return; + } + schemaInstancePrefix = null; + schemaPrefix = null; + // Search if document element root declares namespace with "xmlns". + if (documentElement.hasAttributes()) { + for (DOMAttr attr : documentElement.getAttributeNodes()) { + String attributeName = attr.getName(); + if (attributeName != null) { + if (attributeName.equals(DOMAttr.XMLNS_ATTR) + || attributeName.startsWith(DOMAttr.XMLNS_NO_DEFAULT_ATTR)) { + hasNamespaces = true; + String attributeValue = documentElement.getAttribute(attributeName); + if (attributeValue != null && attributeValue.startsWith("http://www.w3.org/")) { + if (attributeValue.endsWith("/XMLSchema-instance")) { + schemaInstancePrefix = attributeName.equals("xmlns") ? "" + : getUnprefixedName(attributeName); + } else if (attributeValue.endsWith("/XMLSchema")) { + schemaPrefix = attributeName.equals("xmlns") ? "" : getUnprefixedName(attributeName); + } + } + } + } + } + if (schemaInstancePrefix != null) { + // DOM document can declared xsi:noNamespaceSchemaLocation and + // xsi:schemaLocation both even it's not valid + noNamespaceSchemaLocation = createNoNamespaceSchemaLocation(documentElement, schemaInstancePrefix); + schemaLocation = createSchemaLocation(documentElement, schemaInstancePrefix); + } + } + } + + /** + * If document has {@code } + * + * @return + */ + public boolean hasProlog() { + List children = getChildren(); + return (children != null && !children.isEmpty() && children.get(0).isProlog()); + } + + /** + * If document has {@code }, return this prolog, null otherwise + * + * @return prolog DOMNode, if the document has one, null otherwise + */ + public DOMNode getProlog() { + if (hasProlog()) { + return getChild(0); + } else { + return null; + } + } + + /** + * Returns true, if the given offset is before XML declaration + * ({@code }), false otherwise. + * + * @param offset the offset position in question + * @return true, if before xml declaration; false otherwise + */ + public boolean isBeforeProlog(int offset) { + return hasProlog() && offset <= getProlog().getStart(); + } + + private static SchemaLocation createSchemaLocation(DOMNode root, String schemaInstancePrefix) { + DOMAttr attr = root.getAttributeNode(getPrefixedName(schemaInstancePrefix, "schemaLocation")); + // Check that the attribute and the attribute value of xsi:schemaLocation is not null + if (attr == null || attr.getNodeAttrValue() == null) { + return null; + } + return new SchemaLocation(attr); + } + + private static NoNamespaceSchemaLocation createNoNamespaceSchemaLocation(DOMNode root, + String schemaInstancePrefix) { + DOMAttr attr = root.getAttributeNode(getPrefixedName(schemaInstancePrefix, "noNamespaceSchemaLocation")); + if (attr == null || attr.getValue() == null) { + return null; + } + return new NoNamespaceSchemaLocation(attr); + } + + // -------------------------- Grammar with DTD + + /** + * Returns true if XML document has a DTD declaration and false otherwise. + * + * @return true if XML document has a DTD declaration and false otherwise. + */ + public boolean hasDTD() { + return getDoctype() != null; + } + + // -------------------------- External Grammar (XML file associations, catalog) + + /** + * Returns true if the document is bound to an external grammar (XML file + * associations, XLM catalog) and false otherwise. + * + * @return true if the document is bound to an external grammar (XML file + * associations, XLM catalog) and false otherwise. + */ + public boolean hasExternalGrammar() { + return getExternalGrammarLocation() != null || getExternalGrammarFromNamespaceURI() != null; + } + + /** + * Returns the external grammar location (XSD, DTD from xml file associations) + * and null otherwise. + * + * @return the external grammar location (XSD, DTD from xml file associations) + * and null otherwise. + */ + public Map getExternalGrammarLocation() { + initializeReferencedExternalGrammarIfNeeded(); + return externalGrammarLocation; + } + + /** + * Returns the grammar location found by the namespace URI from the document + * root element (ex : found with XML catalog) and null otherwise. + * + * @return the grammar location found by the namespace URI from the document + * root element (ex : found with XML catalog) and null otherwise. + */ + public String getExternalGrammarFromNamespaceURI() { + initializeReferencedExternalGrammarIfNeeded(); + return externalGrammarFromNamespaceURI; + } + + private void initializeReferencedExternalGrammarIfNeeded() { + if (referencedExternalGrammarInitialized) { + return; + } + intializeExternalGrammar(); + } + + private synchronized void intializeExternalGrammar() { + if (referencedExternalGrammarInitialized) { + return; + } + try { + if (resolverExtensionManager != null) { + // No grammar found with standard mean, check if it some components like XML + // file associations bind this XML document to a grammar with external schema + // location. + try { + externalGrammarLocation = resolverExtensionManager + .getExternalGrammarLocation(new URI(getDocumentURI())); + if (externalGrammarLocation != null) { + return; + } + } catch (URISyntaxException e) { + // Do nothing + } + + // No grammar found with standard mean and external schema location, check if + // it some components like XML + // Catalog, XSL and XSD resolvers, etc bind this XML document to a grammar. + // Get root element + DOMElement documentElement = getDocumentElement(); + if (documentElement == null) { + return; + } + String namespaceURI = documentElement.getNamespaceURI(); + externalGrammarFromNamespaceURI = resolverExtensionManager.resolve(getDocumentURI(), namespaceURI, + null); + } + } finally { + referencedExternalGrammarInitialized = true; + } + } + + private static String getUnprefixedName(String name) { + int index = name.indexOf(":"); //$NON-NLS-1$ + if (index != -1) { + name = name.substring(index + 1); + } + return name; + } + + private static String getPrefixedName(String prefix, String localName) { + return prefix != null && prefix.length() > 0 ? prefix + ":" + localName : localName; //$NON-NLS-1$ + } + + public DOMElement createElement(int start, int end) { + return new DOMElement(start, end); + } + + public DOMCDATASection createCDataSection(int start, int end) { + return new DOMCDATASection(start, end); + } + + public DOMProcessingInstruction createProcessingInstruction(int start, int end) { + return new DOMProcessingInstruction(start, end); + } + + public DOMComment createComment(int start, int end) { + return new DOMComment(start, end); + } + + public DOMText createText(int start, int end) { + return new DOMText(start, end); + } + + public DOMDocumentType createDocumentType(int start, int end) { + return new DOMDocumentType(start, end); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Node#getNodeType() + */ + @Override + public short getNodeType() { + return DOMNode.DOCUMENT_NODE; + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Node#getNodeName() + */ + @Override + public String getNodeName() { + return "#document"; + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#getDocumentElement() + */ + @Override + public DOMElement getDocumentElement() { + List roots = getRoots(); + if (roots != null) { + for (DOMNode node : roots) { + if (node.isElement()) { + return (DOMElement) node; + } + } + } + return null; + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#getDoctype() + */ + @Override + public DOMDocumentType getDoctype() { + List roots = getRoots(); + if (roots != null) { + for (DOMNode node : roots) { + if (node.isDoctype()) { + return (DOMDocumentType) node; + } + } + } + return null; + } + + @Override + public DOMDocument getOwnerDocument() { + return this; + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#getDocumentURI() + */ + @Override + public String getDocumentURI() { + return textDocument.getUri(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#setDocumentURI(java.lang.String) + */ + @Override + public void setDocumentURI(String documentURI) { + textDocument.setUri(documentURI); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#adoptNode(org.w3c.dom.Node) + */ + @Override + public DOMNode adoptNode(org.w3c.dom.Node source) throws DOMException { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#createAttribute(java.lang.String) + */ + @Override + public DOMAttr createAttribute(String name) throws DOMException { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#createAttributeNS(java.lang.String, + * java.lang.String) + */ + @Override + public DOMAttr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#createCDATASection(java.lang.String) + */ + @Override + public CDATASection createCDATASection(String data) throws DOMException { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#createComment(java.lang.String) + */ + @Override + public DOMComment createComment(String data) { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#createDocumentFragment() + */ + @Override + public DocumentFragment createDocumentFragment() { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#createElement(java.lang.String) + */ + @Override + public DOMElement createElement(String tagName) throws DOMException { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#createElementNS(java.lang.String, java.lang.String) + */ + @Override + public DOMElement createElementNS(String namespaceURI, String qualifiedName) throws DOMException { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#createEntityReference(java.lang.String) + */ + @Override + public EntityReference createEntityReference(String name) throws DOMException { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#createProcessingInstruction(java.lang.String, + * java.lang.String) + */ + @Override + public DOMProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#createTextNode(java.lang.String) + */ + @Override + public DOMText createTextNode(String data) { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#getDomConfig() + */ + @Override + public DOMConfiguration getDomConfig() { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#getElementById(java.lang.String) + */ + @Override + public DOMElement getElementById(String elementId) { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#getElementsByTagName(java.lang.String) + */ + @Override + public NodeList getElementsByTagName(String tagname) { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#getElementsByTagNameNS(java.lang.String, + * java.lang.String) + */ + @Override + public NodeList getElementsByTagNameNS(String namespaceURI, String localName) { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#getImplementation() + */ + @Override + public DOMImplementation getImplementation() { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#getInputEncoding() + */ + @Override + public String getInputEncoding() { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#getStrictErrorChecking() + */ + @Override + public boolean getStrictErrorChecking() { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#getXmlEncoding() + */ + @Override + public String getXmlEncoding() { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#getXmlStandalone() + */ + @Override + public boolean getXmlStandalone() { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#getXmlVersion() + */ + @Override + public String getXmlVersion() { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#importNode(org.w3c.dom.Node, boolean) + */ + @Override + public DOMNode importNode(org.w3c.dom.Node importedNode, boolean deep) throws DOMException { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#normalizeDocument() + */ + @Override + public void normalizeDocument() { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#renameNode(org.w3c.dom.Node, java.lang.String, + * java.lang.String) + */ + @Override + public DOMNode renameNode(org.w3c.dom.Node n, String namespaceURI, String qualifiedName) throws DOMException { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#setStrictErrorChecking(boolean) + */ + @Override + public void setStrictErrorChecking(boolean strictErrorChecking) { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#setXmlStandalone(boolean) + */ + @Override + public void setXmlStandalone(boolean xmlStandalone) throws DOMException { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see org.w3c.dom.Document#setXmlVersion(java.lang.String) + */ + @Override + public void setXmlVersion(String xmlVersion) throws DOMException { + throw new UnsupportedOperationException(); + } + + /** + * Reset the cached grammar flag. + */ + public void resetGrammar() { + this.referencedExternalGrammarInitialized = false; + this.referencedSchemaInitialized = false; + } + + public URIResolverExtensionManager getResolverExtensionManager() { + return resolverExtensionManager; + } + + /** + * Returns true if the XML document is a DTD and false otherwise. + * + * @return true if the XML document is a DTD and false otherwise. + */ + public boolean isDTD() { + String uri = this.getDocumentURI(); + if (DOMUtils.isDTD(uri)) { + return true; + } + return false; + } + + /** + * Returns true if 'offset' is within an internal DOCTYPE dtd. Else false. + * + * @param offset + * @return + */ + public boolean isWithinInternalDTD(int offset) { + DOMDocumentType doctype = this.getDoctype(); + if (doctype != null && doctype.internalSubset != null) { + return offset > doctype.internalSubset.start && offset < doctype.internalSubset.end; + } + return false; + } + + public Range getTrimmedRange(Range range) { + if (range != null) { + return getTrimmedRange(range.getStart().getColumn(), range.getEnd().getColumn()); + } + return null; + + } + + public Range getTrimmedRange(int start, int end) { + String text = getText(); + char c = text.charAt(start); + while (Character.isWhitespace(c)) { + start++; + c = text.charAt(start); + } + if (start == end) { + return null; + } + end--; + c = text.charAt(end); + while (Character.isWhitespace(c)) { + end--; + c = text.charAt(end); + } + end++; + return XMLPositionUtility.createRange(start, end, this); + } + + /** + * Returns the DTD Attribute list for the given element name and empty + * otherwise. + * + * @param elementName + * @return the DTD Attribute list for the given element name and empty + * otherwise. + */ + public Collection findDTDAttrList(String elementName) { + DOMDocumentType docType = getDoctype(); + if (docType == null || elementName == null) { + return Collections.emptyList(); + } + return docType.getChildren().stream().filter(DOMNode::isDTDAttListDecl) + .filter(n -> elementName.equals(((DTDAttlistDecl) n).getElementName())).collect(Collectors.toList()); + } + + /** + * Returns the XML Schema prefix (ex : 'xs' for + * xmlns:xs="http://www.w3.org/2001/XMLSchema") + * + * @return the XML Schema prefix (ex : 'xs' for + * xmlns:xs="http://www.w3.org/2001/XMLSchema") + */ + public String getSchemaPrefix() { + initializeReferencedSchemaIfNeeded(); + return schemaPrefix; + } + + private void checkCanceled() { + if (cancelChecker != null) { + cancelChecker.checkCanceled(); + } + } +} diff --git a/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/dom/DTDDeclParameter.java b/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/dom/DTDDeclParameter.java index 0b5b2d2ddd..c9190ebfa5 100644 --- a/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/dom/DTDDeclParameter.java +++ b/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/dom/DTDDeclParameter.java @@ -13,7 +13,7 @@ *******************************************************************************/ package org.eclipse.lemminx.dom; -import com.itsaky.androidide.models.Range; +import org.appdevforall.codeonthego.models.Range; import org.eclipse.lemminx.utils.XMLPositionUtility; diff --git a/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/dom/TargetRange.java b/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/dom/TargetRange.java index 3de9bcf634..8c8383e944 100644 --- a/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/dom/TargetRange.java +++ b/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/dom/TargetRange.java @@ -1,31 +1,31 @@ -/** - * Copyright (c) 2020 Red Hat, Inc. and others. All rights reserved. This program and the - * accompanying materials are made available under the terms of the Eclipse Public License v2.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v20.html - * - *

SPDX-License-Identifier: EPL-2.0 - * - *

Contributors: Red Hat Inc. - initial API and implementation - */ -package org.eclipse.lemminx.dom; - -import com.itsaky.androidide.models.Range; - -/** Target range API. */ -public interface TargetRange { - - /** - * Returns the target range. - * - * @return the target range. - */ - Range getTargetRange(); - - /** - * Returns the target URI. - * - * @return the target URI. - */ - String getTargetURI(); -} +/** + * Copyright (c) 2020 Red Hat, Inc. and others. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + *

SPDX-License-Identifier: EPL-2.0 + * + *

Contributors: Red Hat Inc. - initial API and implementation + */ +package org.eclipse.lemminx.dom; + +import org.appdevforall.codeonthego.models.Range; + +/** Target range API. */ +public interface TargetRange { + + /** + * Returns the target range. + * + * @return the target range. + */ + Range getTargetRange(); + + /** + * Returns the target URI. + * + * @return the target URI. + */ + String getTargetURI(); +} diff --git a/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/utils/XMLPositionUtility.java b/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/utils/XMLPositionUtility.java index c039dcae29..d750867c34 100644 --- a/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/utils/XMLPositionUtility.java +++ b/subprojects/xml-dom/src/main/java/org/eclipse/lemminx/utils/XMLPositionUtility.java @@ -1,1076 +1,1076 @@ -/** - * Copyright (c) 2018 Angelo ZERR - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v2.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v20.html - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Angelo Zerr - initial API and implementation - */ -package org.eclipse.lemminx.utils; - -import com.itsaky.androidide.models.Position; -import com.itsaky.androidide.models.Range; - -import java.util.List; -import java.util.function.Predicate; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.eclipse.lemminx.commons.BadLocationException; -import org.eclipse.lemminx.dom.DOMAttr; -import org.eclipse.lemminx.dom.DOMCharacterData; -import org.eclipse.lemminx.dom.DOMDocument; -import org.eclipse.lemminx.dom.DOMElement; -import org.eclipse.lemminx.dom.DOMNode; -import org.eclipse.lemminx.dom.DOMProcessingInstruction; -import org.eclipse.lemminx.dom.DOMRange; -import org.eclipse.lemminx.dom.DOMText; -import org.eclipse.lemminx.dom.DTDAttlistDecl; -import org.eclipse.lemminx.dom.DTDDeclNode; -import org.eclipse.lemminx.dom.DTDDeclParameter; -import org.eclipse.lemminx.dom.DTDElementDecl; -import org.eclipse.lemminx.dom.TargetRange; -import org.eclipse.lemminx.dom.parser.Scanner; -import org.eclipse.lemminx.dom.parser.TokenType; -import org.eclipse.lemminx.dom.parser.XMLScanner; - -/** - * XML position utility. - * - */ -public class XMLPositionUtility { - - private static final Logger LOGGER = Logger.getLogger(XMLPositionUtility.class.getName()); - - private static final Predicate ENTITY_NAME_PREDICATE = ch -> { - // [_:\w-.\d]* - return ch == '_' || ch == ':' || ch == '.' || ch == '-' || Character.isLetterOrDigit(ch); - }; - - public static class EntityReferenceRange { - - private final String name; - - private final Range range; - - public EntityReferenceRange(String name, Range range) { - this.name = name; - this.range = range; - } - - public String getName() { - return name; - } - - public Range getRange() { - return range; - } - - } - - private XMLPositionUtility() { - } - - // ------------ Attributes selection - - /** - * Returns the attribute name range and null otherwise. - * - * @param attr the attribute. - * @return the attribute name range and null otherwise. - */ - public static Range selectAttributeName(DOMAttr attr) { - if (attr != null) { - return createAttrNameRange(attr, attr.getOwnerDocument()); - } - return null; - } - - public static Range selectAttributeNameAt(int offset, DOMDocument document) { - offset = adjustOffsetForAttribute(offset, document); - DOMAttr attr = document.findAttrAt(offset); - return createAttrNameRange(attr, document); - } - - /** - * Returns the attribute value range and null otherwise. - * - * @param attr the attribute. - * @return the attribute value range and null otherwise. - */ - public static Range selectAttributeValue(DOMAttr attr) { - return selectAttributeValue(attr, false); - } - - /** - * Returns the attribute value range and null otherwise. - * - * @param attr the attribute. - * @param withouQuote true if range must remove the quote and false otherwise. - * @return the attribute value range and null otherwise. - */ - public static Range selectAttributeValue(DOMAttr attr, boolean withouQuote) { - if (attr != null) { - return createAttrValueRange(attr, attr.getOwnerDocument()); - } - return null; - } - - public static Range selectAttributeValueAt(String attrName, int offset, DOMDocument document) { - return selectAttributeValueAt(attrName, offset, false, document); - } - - public static Range selectAttributeValueAt(String attrName, int offset, boolean withouQuote, DOMDocument document) { - DOMNode element = document.findNodeAt(offset); - if (element != null) { - DOMAttr attr = element.getAttributeNode(attrName); - if (attr != null) { - return createAttrValueRange(attr, document, withouQuote); - } - } - return null; - } - - public static Range selectAttributeValueFromGivenValue(String attrValue, int offset, DOMDocument document) { - DOMNode element = document.findNodeAt(offset); - if (element != null && element.hasAttributes()) { - List attribues = element.getAttributeNodes(); - for (DOMAttr attr : attribues) { - if (attrValue.equals(attr.getValue())) { - return createAttrValueRange(attr, document); - } - } - } - return null; - } - - private static Range createAttrValueRange(DOMAttr attr, DOMDocument document) { - return createAttrValueRange(attr, document, false); - } - - private static Range createAttrValueRange(DOMAttr attr, DOMDocument document, boolean withoutQuote) { - DOMRange attrValue = attr.getNodeAttrValue(); - if (attrValue == null) { - return null; - } - if (withoutQuote) { - return selectValueWithoutQuote(attrValue); - } - return createRange(attrValue.getStart(), attrValue.getEnd(), document); - } - - public static Range selectAttributeValueByGivenValueAt(String attrValue, int offset, DOMDocument document) { - DOMNode element = document.findNodeAt(offset); - if (element != null && element.hasAttributes()) { - List attributes = element.getAttributeNodes(); - for (DOMAttr attr : attributes) { - if (attrValue.equals(attr.getValue())) { - return createAttrValueRange(attr, document); - } - } - } - return null; - } - - public static Range selectAttributeNameFromGivenNameAt(String attrName, int offset, DOMDocument document) { - DOMNode element = document.findNodeAt(offset); - if (element != null && element.hasAttributes()) { - DOMAttr attr = element.getAttributeNode(attrName); - if (attr != null) { - return createAttrNameRange(attr, document); - } - } - return null; - } - - /** - * Returns the range of the prefix of an attribute name - * - * For example, if attrName = "xsi:example", the range for "xsi" will be - * returned - */ - public static Range selectAttributePrefixFromGivenNameAt(String attrName, int offset, DOMDocument document) { - if (attrName == null) { - return null; - } - DOMNode element = document.findNodeAt(offset); - int prefixLength = attrName.indexOf(':'); - if (element != null && element.hasAttributes()) { - DOMAttr attr = element.getAttributeNode(attrName); - if (attr != null) { - int startOffset = attr.getNodeAttrName().getStart(); - int endOffset = startOffset + prefixLength; - return createRange(startOffset, endOffset, document); - } - } - return null; - } - - private static Range createAttrNameRange(DOMAttr attr, DOMDocument document) { - int startOffset = attr.getNodeAttrName().getStart(); - int endOffset = attr.getNodeAttrName().getEnd(); - return createRange(startOffset, endOffset, document); - } - - public static Range selectAttributeFromGivenNameAt(String attrName, int offset, DOMDocument document) { - DOMNode element = document.findNodeAt(offset); - if (element != null && element.hasAttributes()) { - DOMAttr attr = element.getAttributeNode(attrName); - if (attr != null) { - return createAttrRange(attr, document); - } - } - return null; - } - - /** - * Returns the range of the attribute value of a specific child node, if it - * exists - * - * @param childNodeName the tag name of the child node/tag - * @param attrName the attribute name - * @param offset text offset from beginning of document - * @param document the DOM document. - * @return the child node attribute value range and null otherwise. - */ - public static Range selectChildNodeAttributeValueFromGivenNameAt(String childNodeName, String attrName, int offset, - DOMDocument document) { - List childNodes = document.findNodeAt(offset).getChildren(); - if (childNodes.size() == 0) { - return null; - } - for (DOMNode domNode : childNodes) { - if (domNode.getNodeName().equals(childNodeName) && domNode.hasAttributes()) { - List attributes = domNode.getAttributeNodes(); - for (DOMAttr attr : attributes) { - if (attrName.equals(attr.getName())) { - return createAttrValueRange(attr, document); - } - } - } - } - return null; - } - - public static Range selectAllAttributes(int offset, DOMDocument document) { - DOMNode element = document.findNodeAt(offset); - if (element != null && element.hasAttributes()) { - int startOffset = -1; - int endOffset = 0; - List attributes = element.getAttributeNodes(); - for (DOMAttr attr : attributes) { - if (startOffset == -1) { - startOffset = attr.getStart(); - endOffset = attr.getEnd(); - } else { - startOffset = Math.min(attr.getStart(), startOffset); - endOffset = Math.min(attr.getEnd(), startOffset); - } - } - if (startOffset != -1) { - return createRange(startOffset, endOffset, document); - } - } - return null; - } - - private static Range createAttrRange(DOMAttr attr, DOMDocument document) { - int startOffset = attr.getStart(); - int endOffset = attr.getEnd(); - return createRange(startOffset, endOffset, document); - } - - private static int adjustOffsetForAttribute(int offset, DOMDocument document) { - // For attribute value, Xerces report the error offset after the spaces which - // are after " of the attribute value - // Here sample with offset marked with | - // -> - // -> - // Remove spaces - String text = document.getText(); - char c = text.charAt(offset); - if (c == '>') { - offset--; - c = text.charAt(offset); - if (c == '/') { - offset--; - } - } - while (offset >= 0) { - if (Character.isWhitespace(c)) { - offset--; - } else { - break; - } - c = text.charAt(offset); - } - return offset; - } - - /** - * Returns true if the given position is within an attribute value, and false - * otherwise - * - * @param xmlDocument the model of the document - * @param position the position to check - * @return true if the given position is within an attribute value, and false - * otherwise - */ - public static boolean isInAttributeValue(DOMDocument xmlDocument, Position position) { - try { - int offset = xmlDocument.offsetAt(position); - DOMNode node = DOMNode.findNodeOrAttrAt(xmlDocument, offset); - if (!(node instanceof DOMAttr)) { - return false; - } - DOMAttr attr = (DOMAttr) node; - Range valueRange = XMLPositionUtility.selectAttributeValue(attr); - int valueStart = xmlDocument.offsetAt(valueRange.getStart()); - int valueEnd = xmlDocument.offsetAt(valueRange.getEnd()); - return valueStart < offset && offset <= valueEnd; - } catch (BadLocationException e) { - LOGGER.log(Level.SEVERE, "Bad range when checking if a position is within an attribute value", e); - return false; - } - } - - /** - * Finds the root element of the given document and returns the attribute value - * Range for the attribute attrName. - * - * If attrName is not declared then null is returned. - * - * @param attrName The name of the attribute to find the range of the value for - * @param document The document to use the root element of - * @return The range in document where the declared value of - * attribute attrName resides (including quotations), or - * null if the attriubte is not declared. - */ - public static Range selectRootAttributeValue(String attrName, DOMDocument document) { - DOMNode root = document.getDocumentElement(); - if (root == null) { - root = document.getChild(0); - } - if (root == null) { - return null; - } - DOMAttr attr = root.getAttributeNode(attrName); - if (attr == null) { - return null; - } - return selectAttributeValue(attr); - } - - // ------------ Element selection - - public static Range selectChildEndTag(String childTag, int offset, DOMDocument document) { - DOMNode parent = document.findNodeAt(offset); - if (parent == null || !parent.isElement() || !((DOMElement) parent).hasTagName()) { - return null; - } - - DOMNode curr = parent; - DOMNode child; - while (curr != null) { - child = findUnclosedChildNode(childTag, curr.getChildren()); - if (child == null) { - curr = findUnclosedChildNode(curr.getChildren()); - } else { - return createRange(child.getStart() + 1, child.getStart() + 1 + childTag.length(), document); - } - } - - String parentName = ((DOMElement) parent).getTagName(); - return createRange(parent.getStart() + 2, parent.getStart() + 2 + parentName.length(), document); - } - - private static DOMNode findUnclosedChildNode(List children) { - for (DOMNode child : children) { - if (!child.isClosed()) { - return child; - } - } - return null; - } - - private static DOMNode findUnclosedChildNode(String childTag, List children) { - for (DOMNode child : children) { - if (child.isElement() && childTag != null && childTag.equals(((DOMElement) child).getTagName()) - && !child.isClosed()) { - return child; - } - } - return null; - } - - /** - * Returns the range of the root start tag (excludes the '<') of the given - * document and null otherwise. - * - * @param document the DOM document. - * @return the range of the root start tag (excludes the '<') of the given - * document and null otherwise. - */ - public static Range selectRootStartTag(DOMDocument document) { - DOMNode root = document.getDocumentElement(); - if (root == null) { - root = document.getChild(0); - } - if (root == null) { - return null; - } - return selectStartTagName(root); - } - - public static Range selectStartTagName(int offset, DOMDocument document) { - DOMNode element = document.findNodeAt(offset); - if (element != null) { - return selectStartTagName(element); - } - return null; - } - - /** - * Returns the range of the start tag name (excludes the '<') of the given - * element and null otherwise. - * - * @param element the DOM element - * @return the range of the start tag of the given element and null - * otherwise. - */ - public static Range selectStartTagName(DOMNode element) { - return selectStartTagName(element, false); - } - - /** - * Returns the range of a tag's local name. If the tag does not have a prefix, - * implying it doesn't have a local name, it will return null. - * - * @param element - * @return - */ - public static Range selectStartTagLocalName(DOMNode element) { - return selectStartTagName(element, true); - } - - /** - * Returns the range of the start tag name (excludes the '<') of the given - * element and null otherwise. - * - * If suffixOnly is true then it will try to return the range of the - * localName/suffix. Else it will return null. - * - * @param element the DOM element - * @param suffixOnly select the suffix portion, only when a prefix exists - * @return the range of the start tag of the given element and null - * otherwise. - */ - private static Range selectStartTagName(DOMNode element, boolean localNameOnly) { - int initialStartOffset = element.getStart() + 1; // < - int finalStartOffset = initialStartOffset; - if (localNameOnly) { - String prefix = element.getPrefix(); - if (prefix != null) { - finalStartOffset += prefix.length() + 1; // skips prefix name and ':' - } else { - return null; - } - } - - int endOffset = initialStartOffset + getStartTagLength(element); - if (element.isProcessingInstruction() || element.isProlog()) { - // in the case of prolog or processing instruction, tag is equals to "xml" - // without '?' -> element name and - * null otherwise. - * - * @param element the DOM element - * @return the range of the end tag of the given element and null - * otherwise. - */ - public static Range selectEndTagName(DOMElement element) { - return selectEndTagName(element, false); - } - - /** - * Returns the range of the end tag of the given LOCAL element name - * and null otherwise. - * - * @param element the DOM element - * @return the range of the end tag of the given element and null - * otherwise. - */ - public static Range selectEndTagLocalName(DOMElement element) { - return selectEndTagName(element, true); - } - - /** - * Returns the range of the end tag of the given element and null - * otherwise. - * - * @param element the DOM element - * @return the range of the end tag of the given element and null - * otherwise. - */ - public static Range selectEndTagName(DOMElement element, boolean localNameOnly) { - if (element.hasEndTag()) { - int initialStartOffset = element.getEndTagOpenOffset() + 2; // <\ - int finalStartOffset = initialStartOffset; - if (localNameOnly) { - String prefix = element.getPrefix(); - if (prefix != null) { - finalStartOffset += prefix.length() + 1; // skips prefix and ':' - } else { - return null; - } - } - int endOffset = initialStartOffset + getStartTagLength(element); - return createRange(finalStartOffset, endOffset, element.getOwnerDocument()); - } - return null; - } - - // ------------ Entities selection - - /** - * Returns the range of the entity reference in a text node (ex : &) and - * null otherwise. - * - * @param offset the offset - * @param document the document - * @return the range of the entity reference in a text node (ex : &) and - * null otherwise. - */ - public static EntityReferenceRange selectEntityReference(int offset, DOMDocument document) { - return selectEntityReference(offset, document, true); - } - - /** - * Returns the range of the entity reference in a text node (ex : &) and - * null otherwise. - * - * @param offset the offset - * @param document the document - * @param endsWithSemicolon true if the entity reference must end with ';' and - * false otherwise. - * @return the range of the entity reference in a text node (ex : &) and - * null otherwise. - */ - public static EntityReferenceRange selectEntityReference(int offset, DOMDocument document, - boolean endsWithSemicolon) { - String text = document.getText(); - // Search '&' or '%' character on the left of the offset - int entityReferenceStart = getEntityReferenceStartOffset(text, offset); - if (entityReferenceStart == -1) { - return null; - } - // Search ';' (or character on the right of the offset - int entityReferenceEnd = getEntityReferenceEndOffset(text, offset); - if (entityReferenceEnd == -1) { - if (endsWithSemicolon) { - return null; - } - entityReferenceEnd = offset; - } - String name = endsWithSemicolon ? document.getText().substring(entityReferenceStart + 1, entityReferenceEnd - 1) - : null; - return new EntityReferenceRange(name, createRange(entityReferenceStart, entityReferenceEnd, document)); - } - - /** - * Returns the start offset of the entity reference (ex : &am|p;) from the left - * of the given offset and -1 if no entity reference. - * - * @param text the XML content. - * @param offset the offset. - * @return the start offset of the entity reference (ex : &am|p;) from the left - * of the given offset and -1 if no entity reference. - */ - public static int getEntityReferenceStartOffset(String text, int offset) { - // adjust offset to get the left character of the offset - offset--; - if (offset < 0) { - // case where offset is on the first character - return -1; - } - char c = text.charAt(offset); - if (c == '&' || c == '%') { - // case with &|abcd or with %|abcd - return offset; - } - if (offset == 0) { - // case with a|bcd -> there are no '&' - return -1; - } - int startEntityOffset = StringUtils.findStartWord(text, offset, ENTITY_NAME_PREDICATE); - if (startEntityOffset <= 0) { - return -1; - } - // check if the left character is '&' or '%' - c = text.charAt(startEntityOffset - 1); - if (c != '&' && c != '%') { - return -1; - } - return startEntityOffset - 1; - } - - /** - * Returns the end offset of the entity reference (ex : &am|p;) from the right - * of the given offset and -1 if no entity reference. - * - * @param text the XML content. - * @param offset the offset. - * @return the end offset of the entity reference (ex : &am|p;) from the right - * of the given offset and -1 if no entity reference. - */ - public static int getEntityReferenceEndOffset(String text, int offset) { - int endEntityOffset = StringUtils.findEndWord(text, offset, ENTITY_NAME_PREDICATE); - if (endEntityOffset == -1) { - return -1; - } - if (endEntityOffset >= text.length() || text.charAt(endEntityOffset) != ';') { - return -1; - } - return endEntityOffset + 1; - } - - // ------------ Text selection - - public static Range selectFirstNonWhitespaceText(int offset, DOMDocument document) { - DOMNode element = document.findNodeAt(offset); - if (element != null) { - for (DOMNode node : element.getChildren()) { - if (node.isCharacterData()) { - DOMCharacterData data = (DOMCharacterData) node; - int start = data.getStartContent(); - Integer end = null; - String text = document.getText(); - for (int i = start; i < data.getEndContent(); i++) { - char c = text.charAt(i); - if (end == null) { - if (Character.isWhitespace(c)) { - start++; - } else { - end = start; - } - } else { - if (!Character.isWhitespace(c)) { - end++; - } else { - break; - } - } - } - if (end != null) { - end++; - return createRange(start, end, document); - } - } - } - } - return null; - } - - /** - * Returns the text content range and null otherwise. - * - * @param text the DOM text node.. - * @return the text content range and null otherwise. - */ - public static Range selectText(DOMText text) { - return selectText(text, text.getOwnerDocument()); - } - - private static Range selectText(DOMText text, DOMDocument document) { - return createRange(text.getStartContent(), text.getEndContent(), document); - } - - public static Range selectContent(int offset, DOMDocument document) { - DOMNode node = document.findNodeAt(offset); - if (node != null) { - if (node.isElement()) { - DOMElement element = (DOMElement) node; - if (node.hasChildNodes()) { - return createRange(element.getStartTagCloseOffset() + 1, element.getEndTagOpenOffset(), document); - } - // node has NO content (ex: , select the start tag - return selectStartTagName(node); - } else if (node.isText()) { - DOMText text = (DOMText) node; - return selectText(text, document); - } - } - return null; - } - - /** - * Returns the range covering the trimmed text belonging to the node located at - * offset. - * - * This method assumes that the node located at offset only contains text. - * - * For example, if the node located at offset is: - * - * hello - * - * - * - * the returned range will cover only "hello". - * - * @param offset - * @param document - * @return range covering the trimmed text belonging to the node located at - * offset - */ - public static Range selectTrimmedText(int offset, DOMDocument document) { - DOMNode node = document.findNodeAt(offset); - if (node == null || !node.isElement()) { - return null; - } - - DOMElement element = (DOMElement) node; - - if (DOMUtils.containsTextOnly(element)) { - DOMNode textNode = (DOMNode) element.getFirstChild(); - String text = element.getFirstChild().getTextContent(); - - int startOffset = textNode.getStart(); - int endOffset = textNode.getEnd(); - - if (!StringUtils.isWhitespace(text)) { - startOffset += StringUtils.getFrontWhitespaceLength(text); - endOffset -= StringUtils.getTrailingWhitespaceLength(text); - } - - try { - Position startPosition = document.positionAt(startOffset); - Position endPosition = document.positionAt(endOffset); - return new Range(startPosition, endPosition); - } catch (BadLocationException e) { - return null; - } - } - - return null; - } - - // ------------ DTD selection - - public static Range selectDTDElementDeclAt(int offset, DOMDocument document) { - DOMNode node = document.findNodeAt(offset); - if (node != null && node.isDTDElementDecl()) { - return createRange(node.getStart(), node.getEnd(), document); - } - return null; - } - - /** - * Will give the range for the last VALID DTD Decl parameter at 'offset'. An - * unrecognized Parameter is not considered VALID, - * - * eg: " params = decl.getParameters(); - DTDDeclParameter finalParam; - if (params == null || params.isEmpty()) { - return createRange(decl.declType.getStart(), decl.declType.getEnd(), document); - } - if (decl.unrecognized != null && decl.unrecognized.equals(params.get(params.size() - 1))) { - if (params.size() > 1) { // not only an unrecognized parameter - finalParam = params.get(params.size() - 2); - } else { - finalParam = decl.declType; // no valid parameters - } - } else { - finalParam = params.get(params.size() - 1); - } - if (selectWholeParameter) { - return createRange(finalParam.getStart(), finalParam.getEnd(), document); - } - return createRange(finalParam.getEnd(), finalParam.getEnd() + 1, document); - } - return null; - } - - public static Range getLastValidDTDDeclParameter(int offset, DOMDocument document) { - return getLastValidDTDDeclParameter(offset, document, false); - } - - /** - * Will give the range for the last VALID DTD Decl parameter at 'offset'. An - * unrecognized Parameter is not considered VALID, - * - * eg: internal = attlist.getInternalChildren(); - if (internal != null && !internal.isEmpty()) { - decl = internal.get(internal.size() - 1); // get last internal decl - } - } - List params = decl.getParameters(); - if (params == null || params.isEmpty()) { - return createRange(decl.declType.getStart(), decl.declType.getEnd(), document); - } - DTDDeclParameter finalParam = params.get(params.size() - 1); - if (decl.unrecognized != null && decl.unrecognized.equals(finalParam)) { - return createRange(finalParam.getStart(), finalParam.getEnd(), document); - } - return createRange(finalParam.getEnd(), finalParam.getEnd() + 1, document); - } - return null; - } - - /** - * Will give the range for the last DTD Decl parameter at 'offset'. An - * unrecognized Parameter is considered as well. - * - * eg: params = decl.getParameters(); - DTDDeclParameter lastParam; - if (params != null && !params.isEmpty()) { - lastParam = params.get(params.size() - 1); - return createRange(lastParam.getStart(), lastParam.getEnd(), document); - } - } - return null; - } - - public static Range selectDTDDeclTagNameAt(int offset, DOMDocument document) { - DOMNode node = document.findNodeAt(offset); - if (node instanceof DTDDeclNode) { - DTDDeclNode declNode = (DTDDeclNode) node; - return createRange(declNode.declType.getStart(), declNode.declType.getEnd(), document); - } - return null; - } - - public static Range getElementDeclMissingContentOrCategory(int offset, DOMDocument document) { - DOMNode node = document.findNodeAt(offset); - if (node instanceof DTDElementDecl) { - DTDElementDecl declNode = (DTDElementDecl) node; - List params = declNode.getParameters(); - if (params.isEmpty()) { - return null; - } - if (params.size() == 1) { - DTDDeclParameter param = params.get(0); - return createRange(param.getEnd(), param.getEnd() + 1, document); - } else { - return createRange(params.get(1).getStart(), params.get(1).getEnd(), document); - } - } - return null; - } - - // ------------ Other selection - - /** - * Returns the range for the given node. - * - * @param node the node - * @return the range for the given node. - */ - public static Range createRange(DOMRange range) { - return createRange(range.getStart(), range.getEnd(), range.getOwnerDocument()); - } - - public static Range createRange(int startOffset, int endOffset, DOMDocument document) { - try { - return new Range(document.positionAt(startOffset), document.positionAt(endOffset)); - } catch (BadLocationException e) { - LOGGER.log(Level.SEVERE, "While creating Range the Offset was a BadLocation", e); - return null; - } - } - - /** - * Returns the range covering the first child of the node located at offset. - * - * Returns null if node is not a DOMElement, or if a node does not exist at - * offset. - * - * @param offset - * @param document - * @return range covering the first child of the node located at offset - */ - public static Range selectFirstChild(int offset, DOMDocument document) { - DOMNode node = document.findNodeAt(offset); - if (node == null || !node.isElement()) { - return null; - } - - DOMElement element = (DOMElement) node; - DOMNode child = element.getFirstChild(); - - if (child == null) { - return null; - } - - int startOffset = child.getStart(); - int endOffset = child.getEnd(); - - try { - Position startPosition = document.positionAt(startOffset); - Position endPosition = document.positionAt(endOffset); - return new Range(startPosition, endPosition); - } catch (BadLocationException e) { - return null; - } - } - - public static Range selectWholeTag(int offset, DOMDocument document) { - DOMNode node = document.findNodeAt(offset); - if (node != null) { - return createRange(node.getStart(), node.getEnd(), document); - } - return null; - } - - public static boolean doesTagCoverPosition(Range startTagRange, Range endTagRange, Position position) { - return startTagRange != null && covers(startTagRange, position) - || endTagRange != null && covers(endTagRange, position); - } - - public static boolean covers(Range range, Position position) { - return isBeforeOrEqual(range.getStart(), position) && isBeforeOrEqual(position, range.getEnd()); - } - - public static boolean isBeforeOrEqual(Position pos1, Position pos2) { - return pos1.getLine() < pos2.getLine() - || (pos1.getLine() == pos2.getLine() && pos1.getColumn() <= pos2.getColumn()); - } - - public static Range getTagNameRange(TokenType tokenType, int startOffset, DOMDocument xmlDocument) { - - Scanner scanner = XMLScanner.createScanner(xmlDocument.getText(), startOffset); - - TokenType token = scanner.scan(); - while (token != TokenType.EOS && token != tokenType) { - token = scanner.scan(); - } - if (token != TokenType.EOS) { - try { - return new Range(xmlDocument.positionAt(scanner.getTokenOffset()), - xmlDocument.positionAt(scanner.getTokenEnd())); - } catch (BadLocationException e) { - LOGGER.log(Level.SEVERE, - "While creating Range in XMLHighlighting the Scanner's Offset was a BadLocation", e); - return null; - } - } - return null; - } - - public static Position getMatchingTagPosition(DOMDocument xmlDocument, Position position) { - try { - int offset = xmlDocument.offsetAt(position); - DOMNode node = xmlDocument.findNodeAt(offset); - - if (node.isElement()) { - DOMElement element = (DOMElement) node; - - if (!element.hasEndTag() || element.isSelfClosed() || !element.hasStartTag()) { - return null; - } - int tagNameLength = element.getTagName().length(); - int startTagNameStart = element.getStartTagOpenOffset() + 1; - int startTagNameEnd = startTagNameStart + tagNameLength; - int endTagNameStart = element.getEndTagOpenOffset() + 2; - int endTagNameEnd = endTagNameStart + tagNameLength; - - if (offset <= startTagNameEnd && offset >= startTagNameStart) { - int mirroredCursorOffset = endTagNameStart + (offset - startTagNameStart); - return xmlDocument.positionAt(mirroredCursorOffset); - } else { - if (offset >= endTagNameStart && offset <= endTagNameEnd) { - int mirroredCursorOffset = startTagNameStart + (offset - endTagNameStart); - return xmlDocument.positionAt(mirroredCursorOffset); - } - } - } - } catch (BadLocationException e) { - return null; - } - return null; - } - - /** - * Select the value from the start/end node without quote. - * - * For the given attr value: - * - *

- * - *

- * - * it will return range without ". - * - * @param node the DOM node. - * - * @return the value from the start/end node without quote. - */ - public static Range selectValueWithoutQuote(DOMRange node) { - DOMDocument document = node.getOwnerDocument(); - return createRange(node.getStart() + 1, node.getEnd() - 1, document); - } - +/** + * Copyright (c) 2018 Angelo ZERR + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Angelo Zerr - initial API and implementation + */ +package org.eclipse.lemminx.utils; + +import org.appdevforall.codeonthego.models.Position; +import org.appdevforall.codeonthego.models.Range; + +import java.util.List; +import java.util.function.Predicate; +import java.util.logging.Level; +import java.util.logging.Logger; + +import org.eclipse.lemminx.commons.BadLocationException; +import org.eclipse.lemminx.dom.DOMAttr; +import org.eclipse.lemminx.dom.DOMCharacterData; +import org.eclipse.lemminx.dom.DOMDocument; +import org.eclipse.lemminx.dom.DOMElement; +import org.eclipse.lemminx.dom.DOMNode; +import org.eclipse.lemminx.dom.DOMProcessingInstruction; +import org.eclipse.lemminx.dom.DOMRange; +import org.eclipse.lemminx.dom.DOMText; +import org.eclipse.lemminx.dom.DTDAttlistDecl; +import org.eclipse.lemminx.dom.DTDDeclNode; +import org.eclipse.lemminx.dom.DTDDeclParameter; +import org.eclipse.lemminx.dom.DTDElementDecl; +import org.eclipse.lemminx.dom.TargetRange; +import org.eclipse.lemminx.dom.parser.Scanner; +import org.eclipse.lemminx.dom.parser.TokenType; +import org.eclipse.lemminx.dom.parser.XMLScanner; + +/** + * XML position utility. + * + */ +public class XMLPositionUtility { + + private static final Logger LOGGER = Logger.getLogger(XMLPositionUtility.class.getName()); + + private static final Predicate ENTITY_NAME_PREDICATE = ch -> { + // [_:\w-.\d]* + return ch == '_' || ch == ':' || ch == '.' || ch == '-' || Character.isLetterOrDigit(ch); + }; + + public static class EntityReferenceRange { + + private final String name; + + private final Range range; + + public EntityReferenceRange(String name, Range range) { + this.name = name; + this.range = range; + } + + public String getName() { + return name; + } + + public Range getRange() { + return range; + } + + } + + private XMLPositionUtility() { + } + + // ------------ Attributes selection + + /** + * Returns the attribute name range and null otherwise. + * + * @param attr the attribute. + * @return the attribute name range and null otherwise. + */ + public static Range selectAttributeName(DOMAttr attr) { + if (attr != null) { + return createAttrNameRange(attr, attr.getOwnerDocument()); + } + return null; + } + + public static Range selectAttributeNameAt(int offset, DOMDocument document) { + offset = adjustOffsetForAttribute(offset, document); + DOMAttr attr = document.findAttrAt(offset); + return createAttrNameRange(attr, document); + } + + /** + * Returns the attribute value range and null otherwise. + * + * @param attr the attribute. + * @return the attribute value range and null otherwise. + */ + public static Range selectAttributeValue(DOMAttr attr) { + return selectAttributeValue(attr, false); + } + + /** + * Returns the attribute value range and null otherwise. + * + * @param attr the attribute. + * @param withouQuote true if range must remove the quote and false otherwise. + * @return the attribute value range and null otherwise. + */ + public static Range selectAttributeValue(DOMAttr attr, boolean withouQuote) { + if (attr != null) { + return createAttrValueRange(attr, attr.getOwnerDocument()); + } + return null; + } + + public static Range selectAttributeValueAt(String attrName, int offset, DOMDocument document) { + return selectAttributeValueAt(attrName, offset, false, document); + } + + public static Range selectAttributeValueAt(String attrName, int offset, boolean withouQuote, DOMDocument document) { + DOMNode element = document.findNodeAt(offset); + if (element != null) { + DOMAttr attr = element.getAttributeNode(attrName); + if (attr != null) { + return createAttrValueRange(attr, document, withouQuote); + } + } + return null; + } + + public static Range selectAttributeValueFromGivenValue(String attrValue, int offset, DOMDocument document) { + DOMNode element = document.findNodeAt(offset); + if (element != null && element.hasAttributes()) { + List attribues = element.getAttributeNodes(); + for (DOMAttr attr : attribues) { + if (attrValue.equals(attr.getValue())) { + return createAttrValueRange(attr, document); + } + } + } + return null; + } + + private static Range createAttrValueRange(DOMAttr attr, DOMDocument document) { + return createAttrValueRange(attr, document, false); + } + + private static Range createAttrValueRange(DOMAttr attr, DOMDocument document, boolean withoutQuote) { + DOMRange attrValue = attr.getNodeAttrValue(); + if (attrValue == null) { + return null; + } + if (withoutQuote) { + return selectValueWithoutQuote(attrValue); + } + return createRange(attrValue.getStart(), attrValue.getEnd(), document); + } + + public static Range selectAttributeValueByGivenValueAt(String attrValue, int offset, DOMDocument document) { + DOMNode element = document.findNodeAt(offset); + if (element != null && element.hasAttributes()) { + List attributes = element.getAttributeNodes(); + for (DOMAttr attr : attributes) { + if (attrValue.equals(attr.getValue())) { + return createAttrValueRange(attr, document); + } + } + } + return null; + } + + public static Range selectAttributeNameFromGivenNameAt(String attrName, int offset, DOMDocument document) { + DOMNode element = document.findNodeAt(offset); + if (element != null && element.hasAttributes()) { + DOMAttr attr = element.getAttributeNode(attrName); + if (attr != null) { + return createAttrNameRange(attr, document); + } + } + return null; + } + + /** + * Returns the range of the prefix of an attribute name + * + * For example, if attrName = "xsi:example", the range for "xsi" will be + * returned + */ + public static Range selectAttributePrefixFromGivenNameAt(String attrName, int offset, DOMDocument document) { + if (attrName == null) { + return null; + } + DOMNode element = document.findNodeAt(offset); + int prefixLength = attrName.indexOf(':'); + if (element != null && element.hasAttributes()) { + DOMAttr attr = element.getAttributeNode(attrName); + if (attr != null) { + int startOffset = attr.getNodeAttrName().getStart(); + int endOffset = startOffset + prefixLength; + return createRange(startOffset, endOffset, document); + } + } + return null; + } + + private static Range createAttrNameRange(DOMAttr attr, DOMDocument document) { + int startOffset = attr.getNodeAttrName().getStart(); + int endOffset = attr.getNodeAttrName().getEnd(); + return createRange(startOffset, endOffset, document); + } + + public static Range selectAttributeFromGivenNameAt(String attrName, int offset, DOMDocument document) { + DOMNode element = document.findNodeAt(offset); + if (element != null && element.hasAttributes()) { + DOMAttr attr = element.getAttributeNode(attrName); + if (attr != null) { + return createAttrRange(attr, document); + } + } + return null; + } + + /** + * Returns the range of the attribute value of a specific child node, if it + * exists + * + * @param childNodeName the tag name of the child node/tag + * @param attrName the attribute name + * @param offset text offset from beginning of document + * @param document the DOM document. + * @return the child node attribute value range and null otherwise. + */ + public static Range selectChildNodeAttributeValueFromGivenNameAt(String childNodeName, String attrName, int offset, + DOMDocument document) { + List childNodes = document.findNodeAt(offset).getChildren(); + if (childNodes.size() == 0) { + return null; + } + for (DOMNode domNode : childNodes) { + if (domNode.getNodeName().equals(childNodeName) && domNode.hasAttributes()) { + List attributes = domNode.getAttributeNodes(); + for (DOMAttr attr : attributes) { + if (attrName.equals(attr.getName())) { + return createAttrValueRange(attr, document); + } + } + } + } + return null; + } + + public static Range selectAllAttributes(int offset, DOMDocument document) { + DOMNode element = document.findNodeAt(offset); + if (element != null && element.hasAttributes()) { + int startOffset = -1; + int endOffset = 0; + List attributes = element.getAttributeNodes(); + for (DOMAttr attr : attributes) { + if (startOffset == -1) { + startOffset = attr.getStart(); + endOffset = attr.getEnd(); + } else { + startOffset = Math.min(attr.getStart(), startOffset); + endOffset = Math.min(attr.getEnd(), startOffset); + } + } + if (startOffset != -1) { + return createRange(startOffset, endOffset, document); + } + } + return null; + } + + private static Range createAttrRange(DOMAttr attr, DOMDocument document) { + int startOffset = attr.getStart(); + int endOffset = attr.getEnd(); + return createRange(startOffset, endOffset, document); + } + + private static int adjustOffsetForAttribute(int offset, DOMDocument document) { + // For attribute value, Xerces report the error offset after the spaces which + // are after " of the attribute value + // Here sample with offset marked with | + // -> + // -> + // Remove spaces + String text = document.getText(); + char c = text.charAt(offset); + if (c == '>') { + offset--; + c = text.charAt(offset); + if (c == '/') { + offset--; + } + } + while (offset >= 0) { + if (Character.isWhitespace(c)) { + offset--; + } else { + break; + } + c = text.charAt(offset); + } + return offset; + } + + /** + * Returns true if the given position is within an attribute value, and false + * otherwise + * + * @param xmlDocument the model of the document + * @param position the position to check + * @return true if the given position is within an attribute value, and false + * otherwise + */ + public static boolean isInAttributeValue(DOMDocument xmlDocument, Position position) { + try { + int offset = xmlDocument.offsetAt(position); + DOMNode node = DOMNode.findNodeOrAttrAt(xmlDocument, offset); + if (!(node instanceof DOMAttr)) { + return false; + } + DOMAttr attr = (DOMAttr) node; + Range valueRange = XMLPositionUtility.selectAttributeValue(attr); + int valueStart = xmlDocument.offsetAt(valueRange.getStart()); + int valueEnd = xmlDocument.offsetAt(valueRange.getEnd()); + return valueStart < offset && offset <= valueEnd; + } catch (BadLocationException e) { + LOGGER.log(Level.SEVERE, "Bad range when checking if a position is within an attribute value", e); + return false; + } + } + + /** + * Finds the root element of the given document and returns the attribute value + * Range for the attribute attrName. + * + * If attrName is not declared then null is returned. + * + * @param attrName The name of the attribute to find the range of the value for + * @param document The document to use the root element of + * @return The range in document where the declared value of + * attribute attrName resides (including quotations), or + * null if the attriubte is not declared. + */ + public static Range selectRootAttributeValue(String attrName, DOMDocument document) { + DOMNode root = document.getDocumentElement(); + if (root == null) { + root = document.getChild(0); + } + if (root == null) { + return null; + } + DOMAttr attr = root.getAttributeNode(attrName); + if (attr == null) { + return null; + } + return selectAttributeValue(attr); + } + + // ------------ Element selection + + public static Range selectChildEndTag(String childTag, int offset, DOMDocument document) { + DOMNode parent = document.findNodeAt(offset); + if (parent == null || !parent.isElement() || !((DOMElement) parent).hasTagName()) { + return null; + } + + DOMNode curr = parent; + DOMNode child; + while (curr != null) { + child = findUnclosedChildNode(childTag, curr.getChildren()); + if (child == null) { + curr = findUnclosedChildNode(curr.getChildren()); + } else { + return createRange(child.getStart() + 1, child.getStart() + 1 + childTag.length(), document); + } + } + + String parentName = ((DOMElement) parent).getTagName(); + return createRange(parent.getStart() + 2, parent.getStart() + 2 + parentName.length(), document); + } + + private static DOMNode findUnclosedChildNode(List children) { + for (DOMNode child : children) { + if (!child.isClosed()) { + return child; + } + } + return null; + } + + private static DOMNode findUnclosedChildNode(String childTag, List children) { + for (DOMNode child : children) { + if (child.isElement() && childTag != null && childTag.equals(((DOMElement) child).getTagName()) + && !child.isClosed()) { + return child; + } + } + return null; + } + + /** + * Returns the range of the root start tag (excludes the '<') of the given + * document and null otherwise. + * + * @param document the DOM document. + * @return the range of the root start tag (excludes the '<') of the given + * document and null otherwise. + */ + public static Range selectRootStartTag(DOMDocument document) { + DOMNode root = document.getDocumentElement(); + if (root == null) { + root = document.getChild(0); + } + if (root == null) { + return null; + } + return selectStartTagName(root); + } + + public static Range selectStartTagName(int offset, DOMDocument document) { + DOMNode element = document.findNodeAt(offset); + if (element != null) { + return selectStartTagName(element); + } + return null; + } + + /** + * Returns the range of the start tag name (excludes the '<') of the given + * element and null otherwise. + * + * @param element the DOM element + * @return the range of the start tag of the given element and null + * otherwise. + */ + public static Range selectStartTagName(DOMNode element) { + return selectStartTagName(element, false); + } + + /** + * Returns the range of a tag's local name. If the tag does not have a prefix, + * implying it doesn't have a local name, it will return null. + * + * @param element + * @return + */ + public static Range selectStartTagLocalName(DOMNode element) { + return selectStartTagName(element, true); + } + + /** + * Returns the range of the start tag name (excludes the '<') of the given + * element and null otherwise. + * + * If suffixOnly is true then it will try to return the range of the + * localName/suffix. Else it will return null. + * + * @param element the DOM element + * @param suffixOnly select the suffix portion, only when a prefix exists + * @return the range of the start tag of the given element and null + * otherwise. + */ + private static Range selectStartTagName(DOMNode element, boolean localNameOnly) { + int initialStartOffset = element.getStart() + 1; // < + int finalStartOffset = initialStartOffset; + if (localNameOnly) { + String prefix = element.getPrefix(); + if (prefix != null) { + finalStartOffset += prefix.length() + 1; // skips prefix name and ':' + } else { + return null; + } + } + + int endOffset = initialStartOffset + getStartTagLength(element); + if (element.isProcessingInstruction() || element.isProlog()) { + // in the case of prolog or processing instruction, tag is equals to "xml" + // without '?' -> element name and + * null otherwise. + * + * @param element the DOM element + * @return the range of the end tag of the given element and null + * otherwise. + */ + public static Range selectEndTagName(DOMElement element) { + return selectEndTagName(element, false); + } + + /** + * Returns the range of the end tag of the given LOCAL element name + * and null otherwise. + * + * @param element the DOM element + * @return the range of the end tag of the given element and null + * otherwise. + */ + public static Range selectEndTagLocalName(DOMElement element) { + return selectEndTagName(element, true); + } + + /** + * Returns the range of the end tag of the given element and null + * otherwise. + * + * @param element the DOM element + * @return the range of the end tag of the given element and null + * otherwise. + */ + public static Range selectEndTagName(DOMElement element, boolean localNameOnly) { + if (element.hasEndTag()) { + int initialStartOffset = element.getEndTagOpenOffset() + 2; // <\ + int finalStartOffset = initialStartOffset; + if (localNameOnly) { + String prefix = element.getPrefix(); + if (prefix != null) { + finalStartOffset += prefix.length() + 1; // skips prefix and ':' + } else { + return null; + } + } + int endOffset = initialStartOffset + getStartTagLength(element); + return createRange(finalStartOffset, endOffset, element.getOwnerDocument()); + } + return null; + } + + // ------------ Entities selection + + /** + * Returns the range of the entity reference in a text node (ex : &) and + * null otherwise. + * + * @param offset the offset + * @param document the document + * @return the range of the entity reference in a text node (ex : &) and + * null otherwise. + */ + public static EntityReferenceRange selectEntityReference(int offset, DOMDocument document) { + return selectEntityReference(offset, document, true); + } + + /** + * Returns the range of the entity reference in a text node (ex : &) and + * null otherwise. + * + * @param offset the offset + * @param document the document + * @param endsWithSemicolon true if the entity reference must end with ';' and + * false otherwise. + * @return the range of the entity reference in a text node (ex : &) and + * null otherwise. + */ + public static EntityReferenceRange selectEntityReference(int offset, DOMDocument document, + boolean endsWithSemicolon) { + String text = document.getText(); + // Search '&' or '%' character on the left of the offset + int entityReferenceStart = getEntityReferenceStartOffset(text, offset); + if (entityReferenceStart == -1) { + return null; + } + // Search ';' (or character on the right of the offset + int entityReferenceEnd = getEntityReferenceEndOffset(text, offset); + if (entityReferenceEnd == -1) { + if (endsWithSemicolon) { + return null; + } + entityReferenceEnd = offset; + } + String name = endsWithSemicolon ? document.getText().substring(entityReferenceStart + 1, entityReferenceEnd - 1) + : null; + return new EntityReferenceRange(name, createRange(entityReferenceStart, entityReferenceEnd, document)); + } + + /** + * Returns the start offset of the entity reference (ex : &am|p;) from the left + * of the given offset and -1 if no entity reference. + * + * @param text the XML content. + * @param offset the offset. + * @return the start offset of the entity reference (ex : &am|p;) from the left + * of the given offset and -1 if no entity reference. + */ + public static int getEntityReferenceStartOffset(String text, int offset) { + // adjust offset to get the left character of the offset + offset--; + if (offset < 0) { + // case where offset is on the first character + return -1; + } + char c = text.charAt(offset); + if (c == '&' || c == '%') { + // case with &|abcd or with %|abcd + return offset; + } + if (offset == 0) { + // case with a|bcd -> there are no '&' + return -1; + } + int startEntityOffset = StringUtils.findStartWord(text, offset, ENTITY_NAME_PREDICATE); + if (startEntityOffset <= 0) { + return -1; + } + // check if the left character is '&' or '%' + c = text.charAt(startEntityOffset - 1); + if (c != '&' && c != '%') { + return -1; + } + return startEntityOffset - 1; + } + + /** + * Returns the end offset of the entity reference (ex : &am|p;) from the right + * of the given offset and -1 if no entity reference. + * + * @param text the XML content. + * @param offset the offset. + * @return the end offset of the entity reference (ex : &am|p;) from the right + * of the given offset and -1 if no entity reference. + */ + public static int getEntityReferenceEndOffset(String text, int offset) { + int endEntityOffset = StringUtils.findEndWord(text, offset, ENTITY_NAME_PREDICATE); + if (endEntityOffset == -1) { + return -1; + } + if (endEntityOffset >= text.length() || text.charAt(endEntityOffset) != ';') { + return -1; + } + return endEntityOffset + 1; + } + + // ------------ Text selection + + public static Range selectFirstNonWhitespaceText(int offset, DOMDocument document) { + DOMNode element = document.findNodeAt(offset); + if (element != null) { + for (DOMNode node : element.getChildren()) { + if (node.isCharacterData()) { + DOMCharacterData data = (DOMCharacterData) node; + int start = data.getStartContent(); + Integer end = null; + String text = document.getText(); + for (int i = start; i < data.getEndContent(); i++) { + char c = text.charAt(i); + if (end == null) { + if (Character.isWhitespace(c)) { + start++; + } else { + end = start; + } + } else { + if (!Character.isWhitespace(c)) { + end++; + } else { + break; + } + } + } + if (end != null) { + end++; + return createRange(start, end, document); + } + } + } + } + return null; + } + + /** + * Returns the text content range and null otherwise. + * + * @param text the DOM text node.. + * @return the text content range and null otherwise. + */ + public static Range selectText(DOMText text) { + return selectText(text, text.getOwnerDocument()); + } + + private static Range selectText(DOMText text, DOMDocument document) { + return createRange(text.getStartContent(), text.getEndContent(), document); + } + + public static Range selectContent(int offset, DOMDocument document) { + DOMNode node = document.findNodeAt(offset); + if (node != null) { + if (node.isElement()) { + DOMElement element = (DOMElement) node; + if (node.hasChildNodes()) { + return createRange(element.getStartTagCloseOffset() + 1, element.getEndTagOpenOffset(), document); + } + // node has NO content (ex: , select the start tag + return selectStartTagName(node); + } else if (node.isText()) { + DOMText text = (DOMText) node; + return selectText(text, document); + } + } + return null; + } + + /** + * Returns the range covering the trimmed text belonging to the node located at + * offset. + * + * This method assumes that the node located at offset only contains text. + * + * For example, if the node located at offset is: + * + * hello + * + * + * + * the returned range will cover only "hello". + * + * @param offset + * @param document + * @return range covering the trimmed text belonging to the node located at + * offset + */ + public static Range selectTrimmedText(int offset, DOMDocument document) { + DOMNode node = document.findNodeAt(offset); + if (node == null || !node.isElement()) { + return null; + } + + DOMElement element = (DOMElement) node; + + if (DOMUtils.containsTextOnly(element)) { + DOMNode textNode = (DOMNode) element.getFirstChild(); + String text = element.getFirstChild().getTextContent(); + + int startOffset = textNode.getStart(); + int endOffset = textNode.getEnd(); + + if (!StringUtils.isWhitespace(text)) { + startOffset += StringUtils.getFrontWhitespaceLength(text); + endOffset -= StringUtils.getTrailingWhitespaceLength(text); + } + + try { + Position startPosition = document.positionAt(startOffset); + Position endPosition = document.positionAt(endOffset); + return new Range(startPosition, endPosition); + } catch (BadLocationException e) { + return null; + } + } + + return null; + } + + // ------------ DTD selection + + public static Range selectDTDElementDeclAt(int offset, DOMDocument document) { + DOMNode node = document.findNodeAt(offset); + if (node != null && node.isDTDElementDecl()) { + return createRange(node.getStart(), node.getEnd(), document); + } + return null; + } + + /** + * Will give the range for the last VALID DTD Decl parameter at 'offset'. An + * unrecognized Parameter is not considered VALID, + * + * eg: " params = decl.getParameters(); + DTDDeclParameter finalParam; + if (params == null || params.isEmpty()) { + return createRange(decl.declType.getStart(), decl.declType.getEnd(), document); + } + if (decl.unrecognized != null && decl.unrecognized.equals(params.get(params.size() - 1))) { + if (params.size() > 1) { // not only an unrecognized parameter + finalParam = params.get(params.size() - 2); + } else { + finalParam = decl.declType; // no valid parameters + } + } else { + finalParam = params.get(params.size() - 1); + } + if (selectWholeParameter) { + return createRange(finalParam.getStart(), finalParam.getEnd(), document); + } + return createRange(finalParam.getEnd(), finalParam.getEnd() + 1, document); + } + return null; + } + + public static Range getLastValidDTDDeclParameter(int offset, DOMDocument document) { + return getLastValidDTDDeclParameter(offset, document, false); + } + + /** + * Will give the range for the last VALID DTD Decl parameter at 'offset'. An + * unrecognized Parameter is not considered VALID, + * + * eg: internal = attlist.getInternalChildren(); + if (internal != null && !internal.isEmpty()) { + decl = internal.get(internal.size() - 1); // get last internal decl + } + } + List params = decl.getParameters(); + if (params == null || params.isEmpty()) { + return createRange(decl.declType.getStart(), decl.declType.getEnd(), document); + } + DTDDeclParameter finalParam = params.get(params.size() - 1); + if (decl.unrecognized != null && decl.unrecognized.equals(finalParam)) { + return createRange(finalParam.getStart(), finalParam.getEnd(), document); + } + return createRange(finalParam.getEnd(), finalParam.getEnd() + 1, document); + } + return null; + } + + /** + * Will give the range for the last DTD Decl parameter at 'offset'. An + * unrecognized Parameter is considered as well. + * + * eg: params = decl.getParameters(); + DTDDeclParameter lastParam; + if (params != null && !params.isEmpty()) { + lastParam = params.get(params.size() - 1); + return createRange(lastParam.getStart(), lastParam.getEnd(), document); + } + } + return null; + } + + public static Range selectDTDDeclTagNameAt(int offset, DOMDocument document) { + DOMNode node = document.findNodeAt(offset); + if (node instanceof DTDDeclNode) { + DTDDeclNode declNode = (DTDDeclNode) node; + return createRange(declNode.declType.getStart(), declNode.declType.getEnd(), document); + } + return null; + } + + public static Range getElementDeclMissingContentOrCategory(int offset, DOMDocument document) { + DOMNode node = document.findNodeAt(offset); + if (node instanceof DTDElementDecl) { + DTDElementDecl declNode = (DTDElementDecl) node; + List params = declNode.getParameters(); + if (params.isEmpty()) { + return null; + } + if (params.size() == 1) { + DTDDeclParameter param = params.get(0); + return createRange(param.getEnd(), param.getEnd() + 1, document); + } else { + return createRange(params.get(1).getStart(), params.get(1).getEnd(), document); + } + } + return null; + } + + // ------------ Other selection + + /** + * Returns the range for the given node. + * + * @param node the node + * @return the range for the given node. + */ + public static Range createRange(DOMRange range) { + return createRange(range.getStart(), range.getEnd(), range.getOwnerDocument()); + } + + public static Range createRange(int startOffset, int endOffset, DOMDocument document) { + try { + return new Range(document.positionAt(startOffset), document.positionAt(endOffset)); + } catch (BadLocationException e) { + LOGGER.log(Level.SEVERE, "While creating Range the Offset was a BadLocation", e); + return null; + } + } + + /** + * Returns the range covering the first child of the node located at offset. + * + * Returns null if node is not a DOMElement, or if a node does not exist at + * offset. + * + * @param offset + * @param document + * @return range covering the first child of the node located at offset + */ + public static Range selectFirstChild(int offset, DOMDocument document) { + DOMNode node = document.findNodeAt(offset); + if (node == null || !node.isElement()) { + return null; + } + + DOMElement element = (DOMElement) node; + DOMNode child = element.getFirstChild(); + + if (child == null) { + return null; + } + + int startOffset = child.getStart(); + int endOffset = child.getEnd(); + + try { + Position startPosition = document.positionAt(startOffset); + Position endPosition = document.positionAt(endOffset); + return new Range(startPosition, endPosition); + } catch (BadLocationException e) { + return null; + } + } + + public static Range selectWholeTag(int offset, DOMDocument document) { + DOMNode node = document.findNodeAt(offset); + if (node != null) { + return createRange(node.getStart(), node.getEnd(), document); + } + return null; + } + + public static boolean doesTagCoverPosition(Range startTagRange, Range endTagRange, Position position) { + return startTagRange != null && covers(startTagRange, position) + || endTagRange != null && covers(endTagRange, position); + } + + public static boolean covers(Range range, Position position) { + return isBeforeOrEqual(range.getStart(), position) && isBeforeOrEqual(position, range.getEnd()); + } + + public static boolean isBeforeOrEqual(Position pos1, Position pos2) { + return pos1.getLine() < pos2.getLine() + || (pos1.getLine() == pos2.getLine() && pos1.getColumn() <= pos2.getColumn()); + } + + public static Range getTagNameRange(TokenType tokenType, int startOffset, DOMDocument xmlDocument) { + + Scanner scanner = XMLScanner.createScanner(xmlDocument.getText(), startOffset); + + TokenType token = scanner.scan(); + while (token != TokenType.EOS && token != tokenType) { + token = scanner.scan(); + } + if (token != TokenType.EOS) { + try { + return new Range(xmlDocument.positionAt(scanner.getTokenOffset()), + xmlDocument.positionAt(scanner.getTokenEnd())); + } catch (BadLocationException e) { + LOGGER.log(Level.SEVERE, + "While creating Range in XMLHighlighting the Scanner's Offset was a BadLocation", e); + return null; + } + } + return null; + } + + public static Position getMatchingTagPosition(DOMDocument xmlDocument, Position position) { + try { + int offset = xmlDocument.offsetAt(position); + DOMNode node = xmlDocument.findNodeAt(offset); + + if (node.isElement()) { + DOMElement element = (DOMElement) node; + + if (!element.hasEndTag() || element.isSelfClosed() || !element.hasStartTag()) { + return null; + } + int tagNameLength = element.getTagName().length(); + int startTagNameStart = element.getStartTagOpenOffset() + 1; + int startTagNameEnd = startTagNameStart + tagNameLength; + int endTagNameStart = element.getEndTagOpenOffset() + 2; + int endTagNameEnd = endTagNameStart + tagNameLength; + + if (offset <= startTagNameEnd && offset >= startTagNameStart) { + int mirroredCursorOffset = endTagNameStart + (offset - startTagNameStart); + return xmlDocument.positionAt(mirroredCursorOffset); + } else { + if (offset >= endTagNameStart && offset <= endTagNameEnd) { + int mirroredCursorOffset = startTagNameStart + (offset - endTagNameStart); + return xmlDocument.positionAt(mirroredCursorOffset); + } + } + } + } catch (BadLocationException e) { + return null; + } + return null; + } + + /** + * Select the value from the start/end node without quote. + * + * For the given attr value: + * + *

+ * + *

+ * + * it will return range without ". + * + * @param node the DOM node. + * + * @return the value from the start/end node without quote. + */ + public static Range selectValueWithoutQuote(DOMRange node) { + DOMDocument document = node.getOwnerDocument(); + return createRange(node.getStart() + 1, node.getEnd() - 1, document); + } + } \ No newline at end of file diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/resources/DefaultResourceTableRegistry.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/resources/DefaultResourceTableRegistry.kt similarity index 91% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/resources/DefaultResourceTableRegistry.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/resources/DefaultResourceTableRegistry.kt index 6cbc5d00b9..972d4050e3 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/resources/DefaultResourceTableRegistry.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/resources/DefaultResourceTableRegistry.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.internal.resources +package org.appdevforall.codeonthego.xml.internal.resources import com.android.SdkConstants import com.android.SdkConstants.FN_INTENT_ACTIONS_ACTIVITY @@ -33,15 +33,15 @@ import com.android.aaptcompiler.TableExtractor import com.android.aaptcompiler.TableExtractorOptions import com.android.aaptcompiler.extractPathData import com.google.auto.service.AutoService -import com.itsaky.androidide.aapt.logging.IDELogger +import org.appdevforall.codeonthego.aapt.logging.IDELogger import com.itsaky.androidide.layoutlib.resources.ResourceVisibility.PUBLIC -import com.itsaky.androidide.xml.internal.resources.DefaultResourceTableRegistry.SingleLineValueEntryType.ACTIVITY_ACTIONS -import com.itsaky.androidide.xml.internal.resources.DefaultResourceTableRegistry.SingleLineValueEntryType.BROADCAST_ACTIONS -import com.itsaky.androidide.xml.internal.resources.DefaultResourceTableRegistry.SingleLineValueEntryType.CATEGORIES -import com.itsaky.androidide.xml.internal.resources.DefaultResourceTableRegistry.SingleLineValueEntryType.FEATURES -import com.itsaky.androidide.xml.internal.resources.DefaultResourceTableRegistry.SingleLineValueEntryType.SERVICE_ACTIONS -import com.itsaky.androidide.xml.resources.ResourceTableRegistry -import com.itsaky.androidide.xml.resources.ResourceTableRegistry.Companion.PCK_ANDROID +import org.appdevforall.codeonthego.xml.internal.resources.DefaultResourceTableRegistry.SingleLineValueEntryType.ACTIVITY_ACTIONS +import org.appdevforall.codeonthego.xml.internal.resources.DefaultResourceTableRegistry.SingleLineValueEntryType.BROADCAST_ACTIONS +import org.appdevforall.codeonthego.xml.internal.resources.DefaultResourceTableRegistry.SingleLineValueEntryType.CATEGORIES +import org.appdevforall.codeonthego.xml.internal.resources.DefaultResourceTableRegistry.SingleLineValueEntryType.FEATURES +import org.appdevforall.codeonthego.xml.internal.resources.DefaultResourceTableRegistry.SingleLineValueEntryType.SERVICE_ACTIONS +import org.appdevforall.codeonthego.xml.resources.ResourceTableRegistry +import org.appdevforall.codeonthego.xml.resources.ResourceTableRegistry.Companion.PCK_ANDROID import org.slf4j.LoggerFactory import java.io.File import java.util.concurrent.ConcurrentHashMap diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/versions/DefaultApiVersions.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/versions/DefaultApiVersions.kt similarity index 85% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/versions/DefaultApiVersions.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/versions/DefaultApiVersions.kt index b3047c694f..0c55bd0931 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/versions/DefaultApiVersions.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/versions/DefaultApiVersions.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.internal.versions +package org.appdevforall.codeonthego.xml.internal.versions -import com.itsaky.androidide.xml.versions.ApiVersions -import com.itsaky.androidide.xml.versions.ClassInfo +import org.appdevforall.codeonthego.xml.versions.ApiVersions +import org.appdevforall.codeonthego.xml.versions.ClassInfo import java.util.concurrent.ConcurrentHashMap /** @author Akash Yadav */ diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/versions/DefaultApiVersionsRegistry.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/versions/DefaultApiVersionsRegistry.kt similarity index 94% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/versions/DefaultApiVersionsRegistry.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/versions/DefaultApiVersionsRegistry.kt index caf45d3550..11310de6c7 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/versions/DefaultApiVersionsRegistry.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/versions/DefaultApiVersionsRegistry.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.internal.versions +package org.appdevforall.codeonthego.xml.internal.versions import com.google.auto.service.AutoService -import com.itsaky.androidide.xml.versions.ApiVersion -import com.itsaky.androidide.xml.versions.ApiVersions -import com.itsaky.androidide.xml.versions.ApiVersionsRegistry -import com.itsaky.androidide.xml.versions.ClassInfo -import com.itsaky.androidide.xml.versions.FieldInfo -import com.itsaky.androidide.xml.versions.Info -import com.itsaky.androidide.xml.versions.MethodInfo +import org.appdevforall.codeonthego.xml.versions.ApiVersion +import org.appdevforall.codeonthego.xml.versions.ApiVersions +import org.appdevforall.codeonthego.xml.versions.ApiVersionsRegistry +import org.appdevforall.codeonthego.xml.versions.ClassInfo +import org.appdevforall.codeonthego.xml.versions.FieldInfo +import org.appdevforall.codeonthego.xml.versions.Info +import org.appdevforall.codeonthego.xml.versions.MethodInfo import org.slf4j.LoggerFactory import org.xmlpull.v1.XmlPullParser import org.xmlpull.v1.XmlPullParserFactory diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/versions/DefaultClassInfo.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/versions/DefaultClassInfo.kt similarity index 85% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/versions/DefaultClassInfo.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/versions/DefaultClassInfo.kt index 2e63930496..c1ca88a971 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/versions/DefaultClassInfo.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/versions/DefaultClassInfo.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.internal.versions +package org.appdevforall.codeonthego.xml.internal.versions -import com.itsaky.androidide.xml.versions.ApiVersion -import com.itsaky.androidide.xml.versions.ClassInfo -import com.itsaky.androidide.xml.versions.FieldInfo -import com.itsaky.androidide.xml.versions.MethodInfo +import org.appdevforall.codeonthego.xml.versions.ApiVersion +import org.appdevforall.codeonthego.xml.versions.ClassInfo +import org.appdevforall.codeonthego.xml.versions.FieldInfo +import org.appdevforall.codeonthego.xml.versions.MethodInfo import org.eclipse.jdt.core.Signature import java.util.concurrent.ConcurrentHashMap diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/versions/DefaultFieldInfo.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/versions/DefaultFieldInfo.kt similarity index 83% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/versions/DefaultFieldInfo.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/versions/DefaultFieldInfo.kt index cb1881ab60..68c4fc773a 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/versions/DefaultFieldInfo.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/versions/DefaultFieldInfo.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.internal.versions +package org.appdevforall.codeonthego.xml.internal.versions -import com.itsaky.androidide.xml.versions.ApiVersion -import com.itsaky.androidide.xml.versions.FieldInfo +import org.appdevforall.codeonthego.xml.versions.ApiVersion +import org.appdevforall.codeonthego.xml.versions.FieldInfo /** @author Akash Yadav */ class DefaultFieldInfo( diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/versions/DefaultInfo.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/versions/DefaultInfo.kt similarity index 89% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/versions/DefaultInfo.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/versions/DefaultInfo.kt index 4f6ae0ca90..dba9973fcd 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/versions/DefaultInfo.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/versions/DefaultInfo.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.internal.versions +package org.appdevforall.codeonthego.xml.internal.versions -import com.itsaky.androidide.xml.versions.ApiVersion -import com.itsaky.androidide.xml.versions.Info +import org.appdevforall.codeonthego.xml.versions.ApiVersion +import org.appdevforall.codeonthego.xml.versions.Info /** @author Akash Yadav */ open class DefaultInfo( diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/versions/DefaultMethodInfo.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/versions/DefaultMethodInfo.kt similarity index 88% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/versions/DefaultMethodInfo.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/versions/DefaultMethodInfo.kt index eb56c58b66..969ba4ff30 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/versions/DefaultMethodInfo.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/versions/DefaultMethodInfo.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.internal.versions +package org.appdevforall.codeonthego.xml.internal.versions -import com.itsaky.androidide.xml.versions.ApiVersion -import com.itsaky.androidide.xml.versions.MethodInfo +import org.appdevforall.codeonthego.xml.versions.ApiVersion +import org.appdevforall.codeonthego.xml.versions.MethodInfo /** @author Akash Yadav */ internal class DefaultMethodInfo( diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/widgets/DefaultWidgetTable.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/widgets/DefaultWidgetTable.kt similarity index 93% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/widgets/DefaultWidgetTable.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/widgets/DefaultWidgetTable.kt index a69c326448..7ab5235d40 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/widgets/DefaultWidgetTable.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/widgets/DefaultWidgetTable.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.internal.widgets +package org.appdevforall.codeonthego.xml.internal.widgets -import com.itsaky.androidide.xml.internal.widgets.util.DefaultWidget -import com.itsaky.androidide.xml.internal.widgets.util.WidgetParser -import com.itsaky.androidide.xml.widgets.Widget -import com.itsaky.androidide.xml.widgets.WidgetTable +import org.appdevforall.codeonthego.xml.internal.widgets.util.DefaultWidget +import org.appdevforall.codeonthego.xml.internal.widgets.util.WidgetParser +import org.appdevforall.codeonthego.xml.widgets.Widget +import org.appdevforall.codeonthego.xml.widgets.WidgetTable import org.slf4j.LoggerFactory /** diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/widgets/DefaultWidgetTableRegistry.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/widgets/DefaultWidgetTableRegistry.kt similarity index 93% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/widgets/DefaultWidgetTableRegistry.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/widgets/DefaultWidgetTableRegistry.kt index b965d5e9f1..06e6f2aa55 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/widgets/DefaultWidgetTableRegistry.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/widgets/DefaultWidgetTableRegistry.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.internal.widgets +package org.appdevforall.codeonthego.xml.internal.widgets import com.google.auto.service.AutoService -import com.itsaky.androidide.xml.widgets.WidgetTable -import com.itsaky.androidide.xml.widgets.WidgetTableRegistry +import org.appdevforall.codeonthego.xml.widgets.WidgetTable +import org.appdevforall.codeonthego.xml.widgets.WidgetTableRegistry import org.slf4j.LoggerFactory import java.io.File import java.util.concurrent.ConcurrentHashMap diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/widgets/util/DefaultWidget.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/widgets/util/DefaultWidget.kt similarity index 84% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/widgets/util/DefaultWidget.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/widgets/util/DefaultWidget.kt index c675ea8ff1..cd1987bb65 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/widgets/util/DefaultWidget.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/widgets/util/DefaultWidget.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.internal.widgets.util +package org.appdevforall.codeonthego.xml.internal.widgets.util -import com.itsaky.androidide.xml.widgets.Widget -import com.itsaky.androidide.xml.widgets.WidgetType +import org.appdevforall.codeonthego.xml.widgets.Widget +import org.appdevforall.codeonthego.xml.widgets.WidgetType /** * Default implementation of [Widget]. diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/widgets/util/WidgetParser.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/widgets/util/WidgetParser.kt similarity index 91% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/widgets/util/WidgetParser.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/widgets/util/WidgetParser.kt index 29365b366b..1a9c8b584f 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/internal/widgets/util/WidgetParser.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/internal/widgets/util/WidgetParser.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.internal.widgets.util +package org.appdevforall.codeonthego.xml.internal.widgets.util -import com.itsaky.androidide.xml.widgets.WidgetType +import org.appdevforall.codeonthego.xml.widgets.WidgetType /** * Parses widget information from the string representation. diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/permissions/ManifestPermissionConstants.java b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/permissions/ManifestPermissionConstants.java similarity index 99% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/permissions/ManifestPermissionConstants.java rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/permissions/ManifestPermissionConstants.java index 32531405aa..81e1d4e0c7 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/permissions/ManifestPermissionConstants.java +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/permissions/ManifestPermissionConstants.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.permissions; +package org.appdevforall.codeonthego.xml.permissions; /** * Manifest permissions extracted from `android/Manifest$permission.class` android diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/permissions/Permission.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/permissions/Permission.kt similarity index 99% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/permissions/Permission.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/permissions/Permission.kt index 2074df2c1f..11d7943ba6 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/permissions/Permission.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/permissions/Permission.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.permissions +package org.appdevforall.codeonthego.xml.permissions /** * Model for a permission entry. diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/permissions/PermissionGroup.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/permissions/PermissionGroup.kt similarity index 97% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/permissions/PermissionGroup.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/permissions/PermissionGroup.kt index e1d2781356..d2867d7d41 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/permissions/PermissionGroup.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/permissions/PermissionGroup.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.permissions +package org.appdevforall.codeonthego.xml.permissions /** * Model for a permission group entry. diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/registry/XmlRegistry.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/registry/XmlRegistry.kt similarity index 95% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/registry/XmlRegistry.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/registry/XmlRegistry.kt index e31e27a2ba..278df7719b 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/registry/XmlRegistry.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/registry/XmlRegistry.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.registry +package org.appdevforall.codeonthego.xml.registry import java.io.File diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/resources/ResourceTableRegistry.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/resources/ResourceTableRegistry.kt similarity index 93% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/resources/ResourceTableRegistry.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/resources/ResourceTableRegistry.kt index 27265ed160..24a23bad97 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/resources/ResourceTableRegistry.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/resources/ResourceTableRegistry.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.resources +package org.appdevforall.codeonthego.xml.resources import com.android.aaptcompiler.ResourceGroup import com.android.aaptcompiler.ResourceTable -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.utils.ServiceLoader -import com.itsaky.androidide.xml.registry.XmlRegistry +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.utils.ServiceLoader +import org.appdevforall.codeonthego.xml.registry.XmlRegistry import java.io.File /** diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/utils/patterns.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/utils/patterns.kt similarity index 95% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/utils/patterns.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/utils/patterns.kt index dc89aa792a..83e33a2d8b 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/utils/patterns.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/utils/patterns.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.utils +package org.appdevforall.codeonthego.xml.utils import java.util.regex.Pattern diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/ApiVersion.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/ApiVersion.kt similarity index 98% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/ApiVersion.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/ApiVersion.kt index 99f433153d..06af5e34bd 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/ApiVersion.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/ApiVersion.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.versions +package org.appdevforall.codeonthego.xml.versions /** * An Android API version, which since SDK 36.1 has a minor component. diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/ApiVersions.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/ApiVersions.kt similarity index 91% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/ApiVersions.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/ApiVersions.kt index b649493559..163ca3f0f0 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/ApiVersions.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/ApiVersions.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.versions +package org.appdevforall.codeonthego.xml.versions -import com.itsaky.androidide.lookup.Lookup +import org.appdevforall.codeonthego.lookup.Lookup /** * API information about classes. diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/ApiVersionsRegistry.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/ApiVersionsRegistry.kt similarity index 88% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/ApiVersionsRegistry.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/ApiVersionsRegistry.kt index 2279674f77..94f086211c 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/ApiVersionsRegistry.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/ApiVersionsRegistry.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.versions +package org.appdevforall.codeonthego.xml.versions -import com.itsaky.androidide.utils.ServiceLoader -import com.itsaky.androidide.xml.registry.XmlRegistry +import org.appdevforall.codeonthego.utils.ServiceLoader +import org.appdevforall.codeonthego.xml.registry.XmlRegistry /** * Registry that reads information about the API versions of classes, their fields and methods. diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/ClassInfo.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/ClassInfo.kt similarity index 95% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/ClassInfo.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/ClassInfo.kt index c8c58fa3b4..b63b252c2d 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/ClassInfo.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/ClassInfo.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.versions +package org.appdevforall.codeonthego.xml.versions /** * Info about a class. diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/FieldInfo.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/FieldInfo.kt similarity index 94% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/FieldInfo.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/FieldInfo.kt index aaa71f55bd..e5653eaf43 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/FieldInfo.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/FieldInfo.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.versions +package org.appdevforall.codeonthego.xml.versions /** * Info about a field. diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/Info.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/Info.kt similarity index 95% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/Info.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/Info.kt index 6c7472f8b8..3faf7d7117 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/Info.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/Info.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.versions +package org.appdevforall.codeonthego.xml.versions /** * Base class for info about class, fields and methods. diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/MethodInfo.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/MethodInfo.kt similarity index 95% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/MethodInfo.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/MethodInfo.kt index 05778e5f75..a0f430770d 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/versions/MethodInfo.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/versions/MethodInfo.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.versions +package org.appdevforall.codeonthego.xml.versions /** * Info about a method. diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/widgets/Widget.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/widgets/Widget.kt similarity index 96% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/widgets/Widget.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/widgets/Widget.kt index 6a89c4514f..281cdc9e67 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/widgets/Widget.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/widgets/Widget.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.widgets +package org.appdevforall.codeonthego.xml.widgets /** * A widget defined in the `widgets.txt` file in the Android SDK. diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/widgets/WidgetTable.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/widgets/WidgetTable.kt similarity index 93% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/widgets/WidgetTable.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/widgets/WidgetTable.kt index 1d735a3de1..62ba3c73b6 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/widgets/WidgetTable.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/widgets/WidgetTable.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.widgets +package org.appdevforall.codeonthego.xml.widgets -import com.itsaky.androidide.lookup.Lookup +import org.appdevforall.codeonthego.lookup.Lookup /** * A widget table holds information about all widgets defined in the `widgets.txt`. diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/widgets/WidgetTableRegistry.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/widgets/WidgetTableRegistry.kt similarity index 88% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/widgets/WidgetTableRegistry.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/widgets/WidgetTableRegistry.kt index 4b5196cc8f..4b3d64b3c9 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/widgets/WidgetTableRegistry.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/widgets/WidgetTableRegistry.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.widgets +package org.appdevforall.codeonthego.xml.widgets -import com.itsaky.androidide.utils.ServiceLoader -import com.itsaky.androidide.xml.registry.XmlRegistry +import org.appdevforall.codeonthego.utils.ServiceLoader +import org.appdevforall.codeonthego.xml.registry.XmlRegistry /** * Information about widgets, layouts and layout params extracted from `widgets.txt` from the diff --git a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/widgets/WidgetType.kt b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/widgets/WidgetType.kt similarity index 96% rename from subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/widgets/WidgetType.kt rename to subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/widgets/WidgetType.kt index 717db75430..590eb6aedd 100644 --- a/subprojects/xml-utils/src/main/java/com/itsaky/androidide/xml/widgets/WidgetType.kt +++ b/subprojects/xml-utils/src/main/java/org/appdevforall/codeonthego/xml/widgets/WidgetType.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.widgets +package org.appdevforall.codeonthego.xml.widgets /** * The type of [Widget]. diff --git a/subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/registry/PlatformDirDegradationTest.kt b/subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/registry/PlatformDirDegradationTest.kt similarity index 92% rename from subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/registry/PlatformDirDegradationTest.kt rename to subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/registry/PlatformDirDegradationTest.kt index 101bb34548..329bbf7388 100644 --- a/subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/registry/PlatformDirDegradationTest.kt +++ b/subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/registry/PlatformDirDegradationTest.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.registry +package org.appdevforall.codeonthego.xml.registry import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.xml.resources.ResourceTableRegistry -import com.itsaky.androidide.xml.widgets.WidgetTableRegistry +import org.appdevforall.codeonthego.xml.resources.ResourceTableRegistry +import org.appdevforall.codeonthego.xml.widgets.WidgetTableRegistry import org.junit.Assume.assumeFalse import org.junit.Rule import org.junit.Test diff --git a/subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/resources/ResourceTableRegistryTest.kt b/subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/resources/ResourceTableRegistryTest.kt similarity index 96% rename from subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/resources/ResourceTableRegistryTest.kt rename to subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/resources/ResourceTableRegistryTest.kt index c5af924d30..4eff9efb6f 100644 --- a/subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/resources/ResourceTableRegistryTest.kt +++ b/subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/resources/ResourceTableRegistryTest.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.resources +package org.appdevforall.codeonthego.xml.resources import android.graphics.Color import com.android.aaptcompiler.AaptResourceType.ATTR @@ -26,9 +26,9 @@ import com.android.aaptcompiler.BinaryPrimitive import com.android.aaptcompiler.ResourceName import com.android.aaptcompiler.android.ResValue.DataType import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.xml.findAndroidJar -import com.itsaky.androidide.xml.internal.resources.DefaultResourceTableRegistry -import com.itsaky.androidide.xml.resources.ResourceTableRegistry.Companion.PCK_ANDROID +import org.appdevforall.codeonthego.xml.findAndroidJar +import org.appdevforall.codeonthego.xml.internal.resources.DefaultResourceTableRegistry +import org.appdevforall.codeonthego.xml.resources.ResourceTableRegistry.Companion.PCK_ANDROID import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner diff --git a/subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/utils.kt b/subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/utils.kt similarity index 94% rename from subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/utils.kt rename to subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/utils.kt index 2029f2a190..2605dd9d7d 100644 --- a/subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/utils.kt +++ b/subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/utils.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml +package org.appdevforall.codeonthego.xml -import com.itsaky.androidide.xml.versions.ApiVersion +import org.appdevforall.codeonthego.xml.versions.ApiVersion import java.io.File fun findAndroidJar(): File { diff --git a/subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/versions/ApiVersionTest.kt b/subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/versions/ApiVersionTest.kt similarity index 98% rename from subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/versions/ApiVersionTest.kt rename to subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/versions/ApiVersionTest.kt index eac8725f3c..b74bf33854 100644 --- a/subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/versions/ApiVersionTest.kt +++ b/subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/versions/ApiVersionTest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.versions +package org.appdevforall.codeonthego.xml.versions import com.google.common.truth.Truth.assertThat import org.junit.Assert.assertThrows diff --git a/subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/versions/ApiVersionsMinorSdkTest.kt b/subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/versions/ApiVersionsMinorSdkTest.kt similarity index 98% rename from subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/versions/ApiVersionsMinorSdkTest.kt rename to subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/versions/ApiVersionsMinorSdkTest.kt index 498c628389..895837e4b9 100644 --- a/subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/versions/ApiVersionsMinorSdkTest.kt +++ b/subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/versions/ApiVersionsMinorSdkTest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.versions +package org.appdevforall.codeonthego.xml.versions import com.google.common.truth.Truth.assertThat import org.junit.Before diff --git a/subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/versions/ApiVersionsRegistryTest.kt b/subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/versions/ApiVersionsRegistryTest.kt similarity index 96% rename from subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/versions/ApiVersionsRegistryTest.kt rename to subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/versions/ApiVersionsRegistryTest.kt index d946dae342..55346ac8c0 100644 --- a/subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/versions/ApiVersionsRegistryTest.kt +++ b/subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/versions/ApiVersionsRegistryTest.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.versions +package org.appdevforall.codeonthego.xml.versions import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.xml.findAndroidJar +import org.appdevforall.codeonthego.xml.findAndroidJar import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner diff --git a/subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/widgets/WidgetTableRegistryTest.kt b/subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/widgets/WidgetTableRegistryTest.kt similarity index 96% rename from subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/widgets/WidgetTableRegistryTest.kt rename to subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/widgets/WidgetTableRegistryTest.kt index 26e9da0d64..ef637878c4 100644 --- a/subprojects/xml-utils/src/test/java/com/itsaky/androidide/xml/widgets/WidgetTableRegistryTest.kt +++ b/subprojects/xml-utils/src/test/java/org/appdevforall/codeonthego/xml/widgets/WidgetTableRegistryTest.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.xml.widgets +package org.appdevforall.codeonthego.xml.widgets import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.xml.findAndroidJar +import org.appdevforall.codeonthego.xml.findAndroidJar import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner diff --git a/templates-api/src/main/java/com/itsaky/androidide/templates/ITemplateProvider.kt b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/ITemplateProvider.kt similarity index 95% rename from templates-api/src/main/java/com/itsaky/androidide/templates/ITemplateProvider.kt rename to templates-api/src/main/java/org/appdevforall/codeonthego/templates/ITemplateProvider.kt index 56c1f4faf9..af3a02d115 100644 --- a/templates-api/src/main/java/com/itsaky/androidide/templates/ITemplateProvider.kt +++ b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/ITemplateProvider.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates +package org.appdevforall.codeonthego.templates -import com.itsaky.androidide.utils.ServiceLoader +import org.appdevforall.codeonthego.utils.ServiceLoader /** * An [ITemplateProvider] provides templates to the IDE. diff --git a/templates-api/src/main/java/com/itsaky/androidide/templates/ITemplateWidgetViewProvider.kt b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/ITemplateWidgetViewProvider.kt similarity index 94% rename from templates-api/src/main/java/com/itsaky/androidide/templates/ITemplateWidgetViewProvider.kt rename to templates-api/src/main/java/org/appdevforall/codeonthego/templates/ITemplateWidgetViewProvider.kt index c43bf2c195..dcba840fc1 100644 --- a/templates-api/src/main/java/com/itsaky/androidide/templates/ITemplateWidgetViewProvider.kt +++ b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/ITemplateWidgetViewProvider.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates +package org.appdevforall.codeonthego.templates import android.content.Context import android.view.View -import com.itsaky.androidide.utils.ServiceLoader +import org.appdevforall.codeonthego.utils.ServiceLoader /** * [ITemplateWidgetViewProvider] creates [views][View] for various type of [widgets][Widget]. diff --git a/templates-api/src/main/java/com/itsaky/androidide/templates/RecipeExecutor.kt b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/RecipeExecutor.kt similarity index 97% rename from templates-api/src/main/java/com/itsaky/androidide/templates/RecipeExecutor.kt rename to templates-api/src/main/java/org/appdevforall/codeonthego/templates/RecipeExecutor.kt index ef505a8abd..d2322c6ce4 100644 --- a/templates-api/src/main/java/com/itsaky/androidide/templates/RecipeExecutor.kt +++ b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/RecipeExecutor.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates +package org.appdevforall.codeonthego.templates import android.content.Context import java.io.File diff --git a/templates-api/src/main/java/com/itsaky/androidide/templates/base/ProjectTemplateBuilder.kt b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/ProjectTemplateBuilder.kt similarity index 80% rename from templates-api/src/main/java/com/itsaky/androidide/templates/base/ProjectTemplateBuilder.kt rename to templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/ProjectTemplateBuilder.kt index 5fa4ecbb01..5cf6ca6f02 100644 --- a/templates-api/src/main/java/com/itsaky/androidide/templates/base/ProjectTemplateBuilder.kt +++ b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/ProjectTemplateBuilder.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates.base +package org.appdevforall.codeonthego.templates.base -import com.itsaky.androidide.templates.ModuleTemplate -import com.itsaky.androidide.templates.ModuleTemplateData -import com.itsaky.androidide.templates.ProjectTemplate -import com.itsaky.androidide.templates.ProjectTemplateData -import com.itsaky.androidide.templates.ProjectTemplateRecipeResult +import org.appdevforall.codeonthego.templates.ModuleTemplate +import org.appdevforall.codeonthego.templates.ModuleTemplateData +import org.appdevforall.codeonthego.templates.ProjectTemplate +import org.appdevforall.codeonthego.templates.ProjectTemplateData +import org.appdevforall.codeonthego.templates.ProjectTemplateRecipeResult /** diff --git a/templates-api/src/main/java/com/itsaky/androidide/templates/base/base.kt b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/base.kt similarity index 70% rename from templates-api/src/main/java/com/itsaky/androidide/templates/base/base.kt rename to templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/base.kt index 6764e60ef3..de79fc29bf 100644 --- a/templates-api/src/main/java/com/itsaky/androidide/templates/base/base.kt +++ b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/base.kt @@ -15,35 +15,35 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates.base - -import com.itsaky.androidide.templates.BooleanParameter -import com.itsaky.androidide.templates.CheckBoxWidget -import com.itsaky.androidide.templates.EnumParameter -import com.itsaky.androidide.templates.Language -import com.itsaky.androidide.templates.ModuleTemplateData -import com.itsaky.androidide.templates.ModuleType.AndroidApp -import com.itsaky.androidide.templates.ParameterConstraint.DIRECTORY -import com.itsaky.androidide.templates.ParameterConstraint.EXISTS -import com.itsaky.androidide.templates.ParameterConstraint.NONEMPTY -import com.itsaky.androidide.templates.ProjectTemplate -import com.itsaky.androidide.templates.ProjectTemplateData -import com.itsaky.androidide.templates.ProjectVersionData +package org.appdevforall.codeonthego.templates.base + +import org.appdevforall.codeonthego.templates.BooleanParameter +import org.appdevforall.codeonthego.templates.CheckBoxWidget +import org.appdevforall.codeonthego.templates.EnumParameter +import org.appdevforall.codeonthego.templates.Language +import org.appdevforall.codeonthego.templates.ModuleTemplateData +import org.appdevforall.codeonthego.templates.ModuleType.AndroidApp +import org.appdevforall.codeonthego.templates.ParameterConstraint.DIRECTORY +import org.appdevforall.codeonthego.templates.ParameterConstraint.EXISTS +import org.appdevforall.codeonthego.templates.ParameterConstraint.NONEMPTY +import org.appdevforall.codeonthego.templates.ProjectTemplate +import org.appdevforall.codeonthego.templates.ProjectTemplateData +import org.appdevforall.codeonthego.templates.ProjectVersionData import com.itsaky.androidide.templates.R -import com.itsaky.androidide.templates.SpinnerWidget -import com.itsaky.androidide.templates.StringParameter -import com.itsaky.androidide.templates.TextFieldWidget -import com.itsaky.androidide.templates.base.util.getNewProjectName -import com.itsaky.androidide.templates.base.util.moduleNameToDir -import com.itsaky.androidide.templates.initGitParameter -import com.itsaky.androidide.templates.minSdkParameter -import com.itsaky.androidide.templates.packageNameParameter -import com.itsaky.androidide.templates.projectLanguageParameter -import com.itsaky.androidide.templates.projectNameParameter -import com.itsaky.androidide.templates.stringParameter -import com.itsaky.androidide.templates.useKtsParameter -import com.itsaky.androidide.utils.AndroidUtils -import com.itsaky.androidide.utils.Environment +import org.appdevforall.codeonthego.templates.SpinnerWidget +import org.appdevforall.codeonthego.templates.StringParameter +import org.appdevforall.codeonthego.templates.TextFieldWidget +import org.appdevforall.codeonthego.templates.base.util.getNewProjectName +import org.appdevforall.codeonthego.templates.base.util.moduleNameToDir +import org.appdevforall.codeonthego.templates.initGitParameter +import org.appdevforall.codeonthego.templates.minSdkParameter +import org.appdevforall.codeonthego.templates.packageNameParameter +import org.appdevforall.codeonthego.templates.projectLanguageParameter +import org.appdevforall.codeonthego.templates.projectNameParameter +import org.appdevforall.codeonthego.templates.stringParameter +import org.appdevforall.codeonthego.templates.useKtsParameter +import org.appdevforall.codeonthego.utils.AndroidUtils +import org.appdevforall.codeonthego.utils.Environment import org.adfa.constants.Sdk import java.io.File diff --git a/templates-api/src/main/java/com/itsaky/androidide/templates/base/models/Dependency.kt b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/models/Dependency.kt similarity index 97% rename from templates-api/src/main/java/com/itsaky/androidide/templates/base/models/Dependency.kt rename to templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/models/Dependency.kt index da0ace6cfa..9daa880fb8 100644 --- a/templates-api/src/main/java/com/itsaky/androidide/templates/base/models/Dependency.kt +++ b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/models/Dependency.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates.base.models +package org.appdevforall.codeonthego.templates.base.models -import com.itsaky.androidide.templates.base.models.DependencyConfiguration.DebugImplementation +import org.appdevforall.codeonthego.templates.base.models.DependencyConfiguration.DebugImplementation data class Dependency(val configuration: DependencyConfiguration, val group: String, val artifact: String, diff --git a/templates-api/src/main/java/com/itsaky/androidide/templates/base/models/DependencyConfiguration.kt b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/models/DependencyConfiguration.kt similarity index 94% rename from templates-api/src/main/java/com/itsaky/androidide/templates/base/models/DependencyConfiguration.kt rename to templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/models/DependencyConfiguration.kt index 013695f86c..d7dbb3cebf 100644 --- a/templates-api/src/main/java/com/itsaky/androidide/templates/base/models/DependencyConfiguration.kt +++ b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/models/DependencyConfiguration.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates.base.models +package org.appdevforall.codeonthego.templates.base.models enum class DependencyConfiguration(val configName: String) { Api("api"), ApiOnly("apiOnly"), diff --git a/templates-api/src/main/java/com/itsaky/androidide/templates/base/models/models.kt b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/models/models.kt similarity index 92% rename from templates-api/src/main/java/com/itsaky/androidide/templates/base/models/models.kt rename to templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/models/models.kt index 95ac9d6184..123273383e 100644 --- a/templates-api/src/main/java/com/itsaky/androidide/templates/base/models/models.kt +++ b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/models/models.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates.base.models +package org.appdevforall.codeonthego.templates.base.models -import com.itsaky.androidide.templates.base.models.DependencyConfiguration.Implementation +import org.appdevforall.codeonthego.templates.base.models.DependencyConfiguration.Implementation /** * Creates a [Dependency] object from the given maven coordinates. diff --git a/templates-api/src/main/java/com/itsaky/androidide/templates/base/templateBuilders.kt b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/templateBuilders.kt similarity index 76% rename from templates-api/src/main/java/com/itsaky/androidide/templates/base/templateBuilders.kt rename to templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/templateBuilders.kt index dbde89aa34..aa0c4dd6a3 100644 --- a/templates-api/src/main/java/com/itsaky/androidide/templates/base/templateBuilders.kt +++ b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/templateBuilders.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates.base +package org.appdevforall.codeonthego.templates.base -import com.itsaky.androidide.templates.EMPTY_RECIPE -import com.itsaky.androidide.templates.RecipeExecutor -import com.itsaky.androidide.templates.TemplateBuilder -import com.itsaky.androidide.templates.TemplateData -import com.itsaky.androidide.templates.TemplateRecipe -import com.itsaky.androidide.templates.TemplateRecipeConfigurator -import com.itsaky.androidide.templates.TemplateRecipeFinalizer -import com.itsaky.androidide.templates.TemplateRecipeResult +import org.appdevforall.codeonthego.templates.EMPTY_RECIPE +import org.appdevforall.codeonthego.templates.RecipeExecutor +import org.appdevforall.codeonthego.templates.TemplateBuilder +import org.appdevforall.codeonthego.templates.TemplateData +import org.appdevforall.codeonthego.templates.TemplateRecipe +import org.appdevforall.codeonthego.templates.TemplateRecipeConfigurator +import org.appdevforall.codeonthego.templates.TemplateRecipeFinalizer +import org.appdevforall.codeonthego.templates.TemplateRecipeResult sealed class PrePostRecipeTemplateBuilder : TemplateBuilder() { diff --git a/templates-api/src/main/java/com/itsaky/androidide/templates/base/util/utils.kt b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/util/utils.kt similarity index 92% rename from templates-api/src/main/java/com/itsaky/androidide/templates/base/util/utils.kt rename to templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/util/utils.kt index ec400c75c0..f1dca38e6c 100644 --- a/templates-api/src/main/java/com/itsaky/androidide/templates/base/util/utils.kt +++ b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/util/utils.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates.base.util +package org.appdevforall.codeonthego.templates.base.util -import com.itsaky.androidide.templates.BaseTemplateData -import com.itsaky.androidide.templates.ProjectTemplateData +import org.appdevforall.codeonthego.templates.BaseTemplateData +import org.appdevforall.codeonthego.templates.ProjectTemplateData import java.io.File internal fun BaseTemplateData.optonallyKts(file: String): String { diff --git a/templates-api/src/main/java/com/itsaky/androidide/templates/base/util/xmlBuilder.kt b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/util/xmlBuilder.kt similarity index 97% rename from templates-api/src/main/java/com/itsaky/androidide/templates/base/util/xmlBuilder.kt rename to templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/util/xmlBuilder.kt index de81d5526b..d6d8a726b1 100644 --- a/templates-api/src/main/java/com/itsaky/androidide/templates/base/util/xmlBuilder.kt +++ b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/base/util/xmlBuilder.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates.base.util +package org.appdevforall.codeonthego.templates.base.util import org.eclipse.lemminx.dom.builder.IndentedXmlBuilder import org.eclipse.lemminx.dom.builder.XmlBuilder diff --git a/templates-api/src/main/java/com/itsaky/androidide/templates/parameters.kt b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/parameters.kt similarity index 97% rename from templates-api/src/main/java/com/itsaky/androidide/templates/parameters.kt rename to templates-api/src/main/java/org/appdevforall/codeonthego/templates/parameters.kt index 2c814ddb10..650ed2584d 100644 --- a/templates-api/src/main/java/com/itsaky/androidide/templates/parameters.kt +++ b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/parameters.kt @@ -15,16 +15,18 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates +package org.appdevforall.codeonthego.templates + +import com.itsaky.androidide.templates.R import android.view.View import androidx.annotation.StringRes import androidx.annotation.StyleableRes -import com.itsaky.androidide.idetooltips.TooltipTag -import com.itsaky.androidide.templates.Language.Java -import com.itsaky.androidide.templates.Language.Kotlin -import com.itsaky.androidide.templates.ParameterConstraint.NONEMPTY -import com.itsaky.androidide.templates.ParameterConstraint.PACKAGE +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.templates.Language.Java +import org.appdevforall.codeonthego.templates.Language.Kotlin +import org.appdevforall.codeonthego.templates.ParameterConstraint.NONEMPTY +import org.appdevforall.codeonthego.templates.ParameterConstraint.PACKAGE import com.itsaky.androidide.templates.R.string import org.adfa.constants.Sdk import java.util.concurrent.atomic.AtomicBoolean diff --git a/templates-api/src/main/java/com/itsaky/androidide/templates/template.kt b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/template.kt similarity index 98% rename from templates-api/src/main/java/com/itsaky/androidide/templates/template.kt rename to templates-api/src/main/java/org/appdevforall/codeonthego/templates/template.kt index baf42ca77b..e3c0f52163 100644 --- a/templates-api/src/main/java/com/itsaky/androidide/templates/template.kt +++ b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/template.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates +package org.appdevforall.codeonthego.templates import androidx.annotation.DrawableRes import androidx.annotation.StringRes @@ -28,7 +28,7 @@ import org.adfa.constants.JAVA_TARGET_VERSION import org.adfa.constants.KOTLIN_VERSION import org.adfa.constants.Sdk import org.adfa.constants.TARGET_SDK_VERSION -import com.itsaky.androidide.templates.base.util.optonallyKts +import org.appdevforall.codeonthego.templates.base.util.optonallyKts import java.io.File import java.util.UUID diff --git a/templates-api/src/main/java/com/itsaky/androidide/templates/widget.kt b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/widget.kt similarity index 97% rename from templates-api/src/main/java/com/itsaky/androidide/templates/widget.kt rename to templates-api/src/main/java/org/appdevforall/codeonthego/templates/widget.kt index 11f25b360a..c5090af32d 100644 --- a/templates-api/src/main/java/com/itsaky/androidide/templates/widget.kt +++ b/templates-api/src/main/java/org/appdevforall/codeonthego/templates/widget.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates +package org.appdevforall.codeonthego.templates import android.graphics.Color import android.view.View diff --git a/templates-impl/proguard-rules.pro b/templates-impl/proguard-rules.pro index 518cb9ec1d..d0b6410e17 100644 --- a/templates-impl/proguard-rules.pro +++ b/templates-impl/proguard-rules.pro @@ -20,7 +20,7 @@ # hide the original source file name. #-renamesourcefileattribute SourceFile --keep class com.itsaky.androidide.templates.impl.zip.** { *; } +-keep class org.appdevforall.codeonthego.templates.impl.zip.** { *; } -keepattributes Signature -keepattributes *Annotation* diff --git a/templates-impl/src/main/java/com/itsaky/androidide/templates/impl/ConstraintVerifier.kt b/templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/ConstraintVerifier.kt similarity index 82% rename from templates-impl/src/main/java/com/itsaky/androidide/templates/impl/ConstraintVerifier.kt rename to templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/ConstraintVerifier.kt index 88d4867380..67af9c13b2 100644 --- a/templates-impl/src/main/java/com/itsaky/androidide/templates/impl/ConstraintVerifier.kt +++ b/templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/ConstraintVerifier.kt @@ -15,22 +15,24 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates.impl - -import com.itsaky.androidide.app.BaseApplication -import com.itsaky.androidide.templates.ParameterConstraint -import com.itsaky.androidide.templates.ParameterConstraint.CLASS -import com.itsaky.androidide.templates.ParameterConstraint.CLASS_NAME -import com.itsaky.androidide.templates.ParameterConstraint.DIRECTORY -import com.itsaky.androidide.templates.ParameterConstraint.EXISTS -import com.itsaky.androidide.templates.ParameterConstraint.FILE -import com.itsaky.androidide.templates.ParameterConstraint.LAYOUT -import com.itsaky.androidide.templates.ParameterConstraint.MODULE_NAME -import com.itsaky.androidide.templates.ParameterConstraint.NONEMPTY -import com.itsaky.androidide.templates.ParameterConstraint.PACKAGE -import com.itsaky.androidide.templates.base.util.isValidModuleName +package org.appdevforall.codeonthego.templates.impl + + +import com.itsaky.androidide.templates.impl.R +import org.appdevforall.codeonthego.app.BaseApplication +import org.appdevforall.codeonthego.templates.ParameterConstraint +import org.appdevforall.codeonthego.templates.ParameterConstraint.CLASS +import org.appdevforall.codeonthego.templates.ParameterConstraint.CLASS_NAME +import org.appdevforall.codeonthego.templates.ParameterConstraint.DIRECTORY +import org.appdevforall.codeonthego.templates.ParameterConstraint.EXISTS +import org.appdevforall.codeonthego.templates.ParameterConstraint.FILE +import org.appdevforall.codeonthego.templates.ParameterConstraint.LAYOUT +import org.appdevforall.codeonthego.templates.ParameterConstraint.MODULE_NAME +import org.appdevforall.codeonthego.templates.ParameterConstraint.NONEMPTY +import org.appdevforall.codeonthego.templates.ParameterConstraint.PACKAGE +import org.appdevforall.codeonthego.templates.base.util.isValidModuleName import com.itsaky.androidide.templates.impl.R.string -import com.itsaky.androidide.utils.AndroidUtils +import org.appdevforall.codeonthego.utils.AndroidUtils import jdkx.lang.model.SourceVersion import java.io.File diff --git a/templates-impl/src/main/java/com/itsaky/androidide/templates/impl/TemplateProviderImpl.kt b/templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/TemplateProviderImpl.kt similarity index 86% rename from templates-impl/src/main/java/com/itsaky/androidide/templates/impl/TemplateProviderImpl.kt rename to templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/TemplateProviderImpl.kt index 2ba4aa2d76..7f31bfdf3c 100644 --- a/templates-impl/src/main/java/com/itsaky/androidide/templates/impl/TemplateProviderImpl.kt +++ b/templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/TemplateProviderImpl.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates.impl +package org.appdevforall.codeonthego.templates.impl import com.google.auto.service.AutoService import com.google.common.collect.ImmutableList -import com.itsaky.androidide.templates.ITemplateProvider +import org.appdevforall.codeonthego.templates.ITemplateProvider import com.itsaky.androidide.templates.R -import com.itsaky.androidide.templates.Template -import com.itsaky.androidide.templates.impl.zip.ZipRecipeExecutor -import com.itsaky.androidide.templates.impl.zip.ZipTemplateReader -import com.itsaky.androidide.utils.Environment.TEMPLATES_DIR +import org.appdevforall.codeonthego.templates.Template +import org.appdevforall.codeonthego.templates.impl.zip.ZipRecipeExecutor +import org.appdevforall.codeonthego.templates.impl.zip.ZipTemplateReader +import org.appdevforall.codeonthego.utils.Environment.TEMPLATES_DIR import org.adfa.constants.TEMPLATE_ARCHIVE_EXTENSION import org.slf4j.LoggerFactory import java.util.zip.ZipFile diff --git a/templates-impl/src/main/java/com/itsaky/androidide/templates/impl/TemplateWarning.kt b/templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/TemplateWarning.kt similarity index 59% rename from templates-impl/src/main/java/com/itsaky/androidide/templates/impl/TemplateWarning.kt rename to templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/TemplateWarning.kt index d93e17a12a..472ce61d00 100644 --- a/templates-impl/src/main/java/com/itsaky/androidide/templates/impl/TemplateWarning.kt +++ b/templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/TemplateWarning.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.templates.impl +package org.appdevforall.codeonthego.templates.impl data class TemplateWarning( val resId: Int, diff --git a/templates-impl/src/main/java/com/itsaky/androidide/templates/impl/TemplateWidgetViewProviderImpl.kt b/templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/TemplateWidgetViewProviderImpl.kt similarity index 92% rename from templates-impl/src/main/java/com/itsaky/androidide/templates/impl/TemplateWidgetViewProviderImpl.kt rename to templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/TemplateWidgetViewProviderImpl.kt index fd1adbf51c..41e96611e6 100644 --- a/templates-impl/src/main/java/com/itsaky/androidide/templates/impl/TemplateWidgetViewProviderImpl.kt +++ b/templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/TemplateWidgetViewProviderImpl.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates.impl +package org.appdevforall.codeonthego.templates.impl import android.annotation.SuppressLint import android.content.Context @@ -32,24 +32,24 @@ import android.view.HapticFeedbackConstants import androidx.core.content.ContextCompat import com.google.android.material.textfield.TextInputLayout import com.google.auto.service.AutoService -import com.itsaky.androidide.resources.ITooltipView +import org.appdevforall.codeonthego.resources.ITooltipView import com.itsaky.androidide.resources.databinding.LayoutSpinnerBinding -import com.itsaky.androidide.templates.BooleanParameter -import com.itsaky.androidide.templates.CheckBoxWidget -import com.itsaky.androidide.templates.EnumParameter -import com.itsaky.androidide.templates.ITemplateWidgetViewProvider -import com.itsaky.androidide.templates.Parameter -import com.itsaky.androidide.templates.Parameter.DefaultObserver -import com.itsaky.androidide.templates.ParameterWidget -import com.itsaky.androidide.templates.SpinnerWidget -import com.itsaky.androidide.templates.StringParameter -import com.itsaky.androidide.templates.TextFieldParameter -import com.itsaky.androidide.templates.TextFieldWidget -import com.itsaky.androidide.templates.Widget +import org.appdevforall.codeonthego.templates.BooleanParameter +import org.appdevforall.codeonthego.templates.CheckBoxWidget +import org.appdevforall.codeonthego.templates.EnumParameter +import org.appdevforall.codeonthego.templates.ITemplateWidgetViewProvider +import org.appdevforall.codeonthego.templates.Parameter +import org.appdevforall.codeonthego.templates.Parameter.DefaultObserver +import org.appdevforall.codeonthego.templates.ParameterWidget +import org.appdevforall.codeonthego.templates.SpinnerWidget +import org.appdevforall.codeonthego.templates.StringParameter +import org.appdevforall.codeonthego.templates.TextFieldParameter +import org.appdevforall.codeonthego.templates.TextFieldWidget +import org.appdevforall.codeonthego.templates.Widget import com.itsaky.androidide.templates.impl.databinding.LayoutCheckboxBinding import com.itsaky.androidide.templates.impl.databinding.LayoutTextfieldBinding -import com.itsaky.androidide.utils.ServiceLoader -import com.itsaky.androidide.utils.SingleTextWatcher +import org.appdevforall.codeonthego.utils.ServiceLoader +import org.appdevforall.codeonthego.utils.SingleTextWatcher import androidx.core.graphics.drawable.toDrawable import androidx.lifecycle.findViewTreeLifecycleOwner import androidx.lifecycle.lifecycleScope diff --git a/templates-impl/src/main/java/com/itsaky/androidide/templates/impl/base/results.kt b/templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/base/results.kt similarity index 81% rename from templates-impl/src/main/java/com/itsaky/androidide/templates/impl/base/results.kt rename to templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/base/results.kt index 4c0c0db059..897b3d8fdf 100644 --- a/templates-impl/src/main/java/com/itsaky/androidide/templates/impl/base/results.kt +++ b/templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/base/results.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates.impl.base +package org.appdevforall.codeonthego.templates.impl.base -import com.itsaky.androidide.templates.ProjectTemplateData -import com.itsaky.androidide.templates.ProjectTemplateRecipeResult +import org.appdevforall.codeonthego.templates.ProjectTemplateData +import org.appdevforall.codeonthego.templates.ProjectTemplateRecipeResult data class ProjectTemplateRecipeResultImpl( override val data: ProjectTemplateData, diff --git a/templates-impl/src/main/java/com/itsaky/androidide/templates/impl/zip/ZipJson.kt b/templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/zip/ZipJson.kt similarity index 96% rename from templates-impl/src/main/java/com/itsaky/androidide/templates/impl/zip/ZipJson.kt rename to templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/zip/ZipJson.kt index ec55aa7c2e..d896b9f419 100644 --- a/templates-impl/src/main/java/com/itsaky/androidide/templates/impl/zip/ZipJson.kt +++ b/templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/zip/ZipJson.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.templates.impl.zip +package org.appdevforall.codeonthego.templates.impl.zip data class TemplatesIndex(val templates: List) diff --git a/templates-impl/src/main/java/com/itsaky/androidide/templates/impl/zip/ZipRecipeExecutor.kt b/templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/zip/ZipRecipeExecutor.kt similarity index 96% rename from templates-impl/src/main/java/com/itsaky/androidide/templates/impl/zip/ZipRecipeExecutor.kt rename to templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/zip/ZipRecipeExecutor.kt index 859fd452a8..66ce65a911 100644 --- a/templates-impl/src/main/java/com/itsaky/androidide/templates/impl/zip/ZipRecipeExecutor.kt +++ b/templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/zip/ZipRecipeExecutor.kt @@ -1,18 +1,18 @@ -package com.itsaky.androidide.templates.impl.zip +package org.appdevforall.codeonthego.templates.impl.zip import android.annotation.SuppressLint import android.content.Context import androidx.annotation.StringRes -import com.itsaky.androidide.templates.Language -import com.itsaky.androidide.templates.ModuleTemplateData -import com.itsaky.androidide.templates.Parameter -import com.itsaky.androidide.templates.ProjectTemplateData -import com.itsaky.androidide.templates.ProjectTemplateRecipeResult -import com.itsaky.androidide.templates.RecipeExecutor -import com.itsaky.androidide.templates.TemplateRecipe +import org.appdevforall.codeonthego.templates.Language +import org.appdevforall.codeonthego.templates.ModuleTemplateData +import org.appdevforall.codeonthego.templates.Parameter +import org.appdevforall.codeonthego.templates.ProjectTemplateData +import org.appdevforall.codeonthego.templates.ProjectTemplateRecipeResult +import org.appdevforall.codeonthego.templates.RecipeExecutor +import org.appdevforall.codeonthego.templates.TemplateRecipe import com.itsaky.androidide.templates.impl.R -import com.itsaky.androidide.templates.impl.base.ProjectTemplateRecipeResultImpl -import com.itsaky.androidide.utils.Environment +import org.appdevforall.codeonthego.templates.impl.base.ProjectTemplateRecipeResultImpl +import org.appdevforall.codeonthego.utils.Environment import dalvik.system.DexClassLoader import io.pebbletemplates.pebble.PebbleEngine import io.pebbletemplates.pebble.error.PebbleException diff --git a/templates-impl/src/main/java/com/itsaky/androidide/templates/impl/zip/ZipTemplateConstants.kt b/templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/zip/ZipTemplateConstants.kt similarity index 96% rename from templates-impl/src/main/java/com/itsaky/androidide/templates/impl/zip/ZipTemplateConstants.kt rename to templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/zip/ZipTemplateConstants.kt index b73ec63c28..90667123f3 100644 --- a/templates-impl/src/main/java/com/itsaky/androidide/templates/impl/zip/ZipTemplateConstants.kt +++ b/templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/zip/ZipTemplateConstants.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.templates.impl.zip +package org.appdevforall.codeonthego.templates.impl.zip const val ARCHIVE_JSON = "templates.json" diff --git a/templates-impl/src/main/java/com/itsaky/androidide/templates/impl/zip/ZipTemplateReader.kt b/templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/zip/ZipTemplateReader.kt similarity index 84% rename from templates-impl/src/main/java/com/itsaky/androidide/templates/impl/zip/ZipTemplateReader.kt rename to templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/zip/ZipTemplateReader.kt index 183413645c..bf3e91537a 100644 --- a/templates-impl/src/main/java/com/itsaky/androidide/templates/impl/zip/ZipTemplateReader.kt +++ b/templates-impl/src/main/java/org/appdevforall/codeonthego/templates/impl/zip/ZipTemplateReader.kt @@ -1,22 +1,22 @@ -package com.itsaky.androidide.templates.impl.zip +package org.appdevforall.codeonthego.templates.impl.zip import com.google.gson.Gson -import com.itsaky.androidide.templates.CheckBoxWidget -import com.itsaky.androidide.templates.ModuleTemplateData -import com.itsaky.androidide.templates.Parameter -import com.itsaky.androidide.templates.ProjectTemplate -import com.itsaky.androidide.templates.ProjectTemplateData -import com.itsaky.androidide.templates.ProjectTemplateRecipeResult +import org.appdevforall.codeonthego.templates.CheckBoxWidget +import org.appdevforall.codeonthego.templates.ModuleTemplateData +import org.appdevforall.codeonthego.templates.Parameter +import org.appdevforall.codeonthego.templates.ProjectTemplate +import org.appdevforall.codeonthego.templates.ProjectTemplateData +import org.appdevforall.codeonthego.templates.ProjectTemplateRecipeResult import com.itsaky.androidide.templates.R -import com.itsaky.androidide.templates.TemplateRecipe -import com.itsaky.androidide.templates.TextFieldWidget -import com.itsaky.androidide.templates.Widget -import com.itsaky.androidide.templates.base.baseZipProject -import com.itsaky.androidide.templates.booleanParameter -import com.itsaky.androidide.templates.impl.TemplateWarning -import com.itsaky.androidide.templates.projectNameParameter -import com.itsaky.androidide.templates.stringParameter -import com.itsaky.androidide.utils.FeatureFlags +import org.appdevforall.codeonthego.templates.TemplateRecipe +import org.appdevforall.codeonthego.templates.TextFieldWidget +import org.appdevforall.codeonthego.templates.Widget +import org.appdevforall.codeonthego.templates.base.baseZipProject +import org.appdevforall.codeonthego.templates.booleanParameter +import org.appdevforall.codeonthego.templates.impl.TemplateWarning +import org.appdevforall.codeonthego.templates.projectNameParameter +import org.appdevforall.codeonthego.templates.stringParameter +import org.appdevforall.codeonthego.utils.FeatureFlags import org.slf4j.LoggerFactory import java.io.File import java.util.zip.ZipFile diff --git a/templates-impl/src/main/res/layout/layout_checkbox.xml b/templates-impl/src/main/res/layout/layout_checkbox.xml index dcf74409be..03aa7138b5 100644 --- a/templates-impl/src/main/res/layout/layout_checkbox.xml +++ b/templates-impl/src/main/res/layout/layout_checkbox.xml @@ -15,7 +15,7 @@ ~ along with AndroidIDE. If not, see . --> -. --> - - \ No newline at end of file + \ No newline at end of file diff --git a/templates-impl/src/test/java/com/itsaky/androidide/templates/TestRecipeExecutor.kt b/templates-impl/src/test/java/org/appdevforall/codeonthego/templates/TestRecipeExecutor.kt similarity index 96% rename from templates-impl/src/test/java/com/itsaky/androidide/templates/TestRecipeExecutor.kt rename to templates-impl/src/test/java/org/appdevforall/codeonthego/templates/TestRecipeExecutor.kt index 3094dd6bc8..e1be0e7605 100644 --- a/templates-impl/src/test/java/com/itsaky/androidide/templates/TestRecipeExecutor.kt +++ b/templates-impl/src/test/java/org/appdevforall/codeonthego/templates/TestRecipeExecutor.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates +package org.appdevforall.codeonthego.templates -import com.itsaky.androidide.utils.FileProvider +import org.appdevforall.codeonthego.utils.FileProvider import java.io.File import java.io.FileNotFoundException import java.io.InputStream diff --git a/templates-impl/src/test/java/com/itsaky/androidide/templates/UtilTest.kt b/templates-impl/src/test/java/org/appdevforall/codeonthego/templates/UtilTest.kt similarity index 86% rename from templates-impl/src/test/java/com/itsaky/androidide/templates/UtilTest.kt rename to templates-impl/src/test/java/org/appdevforall/codeonthego/templates/UtilTest.kt index 7d93debbcc..3c84d4b95f 100644 --- a/templates-impl/src/test/java/com/itsaky/androidide/templates/UtilTest.kt +++ b/templates-impl/src/test/java/org/appdevforall/codeonthego/templates/UtilTest.kt @@ -15,23 +15,23 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates +package org.appdevforall.codeonthego.templates import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.app.BaseApplication -import com.itsaky.androidide.templates.ParameterConstraint.CLASS -import com.itsaky.androidide.templates.ParameterConstraint.CLASS_NAME -import com.itsaky.androidide.templates.ParameterConstraint.DIRECTORY -import com.itsaky.androidide.templates.ParameterConstraint.EXISTS -import com.itsaky.androidide.templates.ParameterConstraint.FILE -import com.itsaky.androidide.templates.ParameterConstraint.LAYOUT -import com.itsaky.androidide.templates.ParameterConstraint.MODULE_NAME -import com.itsaky.androidide.templates.ParameterConstraint.NONEMPTY -import com.itsaky.androidide.templates.ParameterConstraint.PACKAGE -import com.itsaky.androidide.templates.base.util.isValidModuleName -import com.itsaky.androidide.templates.base.util.moduleNameToDirName -import com.itsaky.androidide.templates.impl.ConstraintVerifier -import com.itsaky.androidide.utils.FileProvider +import org.appdevforall.codeonthego.app.BaseApplication +import org.appdevforall.codeonthego.templates.ParameterConstraint.CLASS +import org.appdevforall.codeonthego.templates.ParameterConstraint.CLASS_NAME +import org.appdevforall.codeonthego.templates.ParameterConstraint.DIRECTORY +import org.appdevforall.codeonthego.templates.ParameterConstraint.EXISTS +import org.appdevforall.codeonthego.templates.ParameterConstraint.FILE +import org.appdevforall.codeonthego.templates.ParameterConstraint.LAYOUT +import org.appdevforall.codeonthego.templates.ParameterConstraint.MODULE_NAME +import org.appdevforall.codeonthego.templates.ParameterConstraint.NONEMPTY +import org.appdevforall.codeonthego.templates.ParameterConstraint.PACKAGE +import org.appdevforall.codeonthego.templates.base.util.isValidModuleName +import org.appdevforall.codeonthego.templates.base.util.moduleNameToDirName +import org.appdevforall.codeonthego.templates.impl.ConstraintVerifier +import org.appdevforall.codeonthego.utils.FileProvider import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner diff --git a/templates-impl/src/test/java/com/itsaky/androidide/templates/impl/zip/ZipRecipeExecutorTest.kt b/templates-impl/src/test/java/org/appdevforall/codeonthego/templates/impl/zip/ZipRecipeExecutorTest.kt similarity index 92% rename from templates-impl/src/test/java/com/itsaky/androidide/templates/impl/zip/ZipRecipeExecutorTest.kt rename to templates-impl/src/test/java/org/appdevforall/codeonthego/templates/impl/zip/ZipRecipeExecutorTest.kt index 2cc6a415bd..0de32d3b52 100644 --- a/templates-impl/src/test/java/com/itsaky/androidide/templates/impl/zip/ZipRecipeExecutorTest.kt +++ b/templates-impl/src/test/java/org/appdevforall/codeonthego/templates/impl/zip/ZipRecipeExecutorTest.kt @@ -1,17 +1,17 @@ -package com.itsaky.androidide.templates.impl.zip +package org.appdevforall.codeonthego.templates.impl.zip import android.content.Context import androidx.test.core.app.ApplicationProvider import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.app.BaseApplication -import com.itsaky.androidide.templates.Language -import com.itsaky.androidide.templates.ModuleTemplateData -import com.itsaky.androidide.templates.ModuleType -import com.itsaky.androidide.templates.ProjectTemplateData -import com.itsaky.androidide.templates.ProjectVersionData -import com.itsaky.androidide.templates.RecipeExecutor -import com.itsaky.androidide.templates.TestRecipeExecutor -import com.itsaky.androidide.utils.Environment +import org.appdevforall.codeonthego.app.BaseApplication +import org.appdevforall.codeonthego.templates.Language +import org.appdevforall.codeonthego.templates.ModuleTemplateData +import org.appdevforall.codeonthego.templates.ModuleType +import org.appdevforall.codeonthego.templates.ProjectTemplateData +import org.appdevforall.codeonthego.templates.ProjectVersionData +import org.appdevforall.codeonthego.templates.RecipeExecutor +import org.appdevforall.codeonthego.templates.TestRecipeExecutor +import org.appdevforall.codeonthego.utils.Environment import org.adfa.constants.Sdk import org.junit.Assert.assertThrows import org.junit.Before diff --git a/templates-impl/src/test/java/com/itsaky/androidide/templates/utils.kt b/templates-impl/src/test/java/org/appdevforall/codeonthego/templates/utils.kt similarity index 91% rename from templates-impl/src/test/java/com/itsaky/androidide/templates/utils.kt rename to templates-impl/src/test/java/org/appdevforall/codeonthego/templates/utils.kt index 71cf639dd8..b4ba0a346a 100644 --- a/templates-impl/src/test/java/com/itsaky/androidide/templates/utils.kt +++ b/templates-impl/src/test/java/org/appdevforall/codeonthego/templates/utils.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.templates +package org.appdevforall.codeonthego.templates import androidx.test.core.app.ApplicationProvider import org.adfa.constants.Sdk import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.managers.PreferenceManager -import com.itsaky.androidide.preferences.internal.prefManager -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.FileProvider +import org.appdevforall.codeonthego.managers.PreferenceManager +import org.appdevforall.codeonthego.preferences.internal.prefManager +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.FileProvider import io.mockk.every import io.mockk.mockkConstructor import io.mockk.mockkStatic @@ -92,7 +92,7 @@ private fun generateTemplateProject(name: String, languages: Array, template: Template<*> ) { for (language in languages) { - val packageName = "com.itsaky.androidide.template.${language.lang}" + val packageName = "org.appdevforall.codeonthego.template.${language.lang}" run { val projectName = "${name}GradleProject${language.name}WithoutKts" @@ -126,7 +126,7 @@ private fun generateTemplateProject(name: String, languages: Array, } fun Template<*>.setupRootProjectParams(name: String = "TestTemplate", - packageName: String = "com.itsaky.androidide.template", + packageName: String = "org.appdevforall.codeonthego.template", language: Language = Language.Kotlin, minSdk: Sdk = Sdk.Lollipop ) { diff --git a/termux/termux-app/src/main/java/com/termux/app/TermuxActivity.java b/termux/termux-app/src/main/java/com/termux/app/TermuxActivity.java index 780b746190..72ad35f4f9 100644 --- a/termux/termux-app/src/main/java/com/termux/app/TermuxActivity.java +++ b/termux/termux-app/src/main/java/com/termux/app/TermuxActivity.java @@ -27,7 +27,7 @@ import androidx.annotation.Nullable; import androidx.drawerlayout.widget.DrawerLayout; import androidx.viewpager.widget.ViewPager; -import com.itsaky.androidide.app.BaseIDEActivity; +import org.appdevforall.codeonthego.app.BaseIDEActivity; import com.termux.R; import com.termux.app.activities.HelpActivity; import com.termux.app.api.file.FileReceiverActivity; @@ -61,7 +61,7 @@ import com.termux.terminal.TerminalSessionClient; import com.termux.view.TerminalView; import com.termux.view.TerminalViewClient; -import com.itsaky.androidide.FeedbackButtonManager; +import org.appdevforall.codeonthego.FeedbackButtonManager; import java.util.Arrays; import java.util.Objects; import java.util.Optional; diff --git a/termux/termux-app/src/main/java/com/termux/app/terminal/TermuxTerminalSessionActivityClient.java b/termux/termux-app/src/main/java/com/termux/app/terminal/TermuxTerminalSessionActivityClient.java index cb6552fa93..3c7585b6de 100644 --- a/termux/termux-app/src/main/java/com/termux/app/terminal/TermuxTerminalSessionActivityClient.java +++ b/termux/termux-app/src/main/java/com/termux/app/terminal/TermuxTerminalSessionActivityClient.java @@ -268,7 +268,7 @@ private synchronized void loadBellSoundPool() { try { mBellSoundId = mBellSoundPool.load(mActivity, R.raw.bell, 1); } catch (Exception e){ - // Catch java.lang.RuntimeException: Unable to resume activity {com.termux/com.itsaky.androidide.activities.TermuxActivity}: android.content.res.Resources$NotFoundException: File res/raw/bell.ogg from drawable resource ID + // Catch java.lang.RuntimeException: Unable to resume activity {com.termux/org.appdevforall.codeonthego.activities.TermuxActivity}: android.content.res.Resources$NotFoundException: File res/raw/bell.ogg from drawable resource ID Logger.logStackTraceWithMessage(LOG_TAG, "Failed to load bell sound pool", e); } } diff --git a/termux/termux-app/src/main/java/com/itsaky/androidide/activities/TerminalActivity.kt b/termux/termux-app/src/main/java/org/appdevforall/codeonthego/activities/TerminalActivity.kt similarity index 97% rename from termux/termux-app/src/main/java/com/itsaky/androidide/activities/TerminalActivity.kt rename to termux/termux-app/src/main/java/org/appdevforall/codeonthego/activities/TerminalActivity.kt index 66e1608bcc..25ae3478a1 100644 --- a/termux/termux-app/src/main/java/com/itsaky/androidide/activities/TerminalActivity.kt +++ b/termux/termux-app/src/main/java/org/appdevforall/codeonthego/activities/TerminalActivity.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.activities +package org.appdevforall.codeonthego.activities import android.content.ComponentName import android.content.Intent @@ -24,7 +24,7 @@ import android.os.IBinder import androidx.core.content.ContextCompat import androidx.core.view.WindowCompat import androidx.lifecycle.lifecycleScope -import com.itsaky.androidide.utils.Environment +import org.appdevforall.codeonthego.utils.Environment import com.termux.app.TermuxActivity import com.termux.app.TermuxService import com.termux.shared.termux.TermuxConstants diff --git a/termux/termux-shared/src/main/java/com/termux/shared/activities/ReportActivity.java b/termux/termux-shared/src/main/java/com/termux/shared/activities/ReportActivity.java index b9d9a95697..be35bdb49e 100644 --- a/termux/termux-shared/src/main/java/com/termux/shared/activities/ReportActivity.java +++ b/termux/termux-shared/src/main/java/com/termux/shared/activities/ReportActivity.java @@ -14,7 +14,7 @@ import androidx.appcompat.widget.Toolbar; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.itsaky.androidide.app.BaseIDEActivity; +import org.appdevforall.codeonthego.app.BaseIDEActivity; import com.termux.shared.R; import com.termux.shared.data.DataUtils; import com.termux.shared.databinding.ActivityReportBinding; diff --git a/termux/termux-shared/src/main/java/com/termux/shared/interact/ShareUtils.java b/termux/termux-shared/src/main/java/com/termux/shared/interact/ShareUtils.java index 03afca3083..19bbfe1529 100644 --- a/termux/termux-shared/src/main/java/com/termux/shared/interact/ShareUtils.java +++ b/termux/termux-shared/src/main/java/com/termux/shared/interact/ShareUtils.java @@ -20,7 +20,7 @@ import com.termux.shared.logger.Logger; import com.termux.shared.errors.Error; import com.termux.shared.android.PermissionUtils; -import com.itsaky.androidide.utils.UrlManager; +import org.appdevforall.codeonthego.utils.UrlManager; import java.nio.charset.Charset; diff --git a/termux/termux-shared/src/main/java/com/termux/shared/shell/command/environment/AndroidShellEnvironment.java b/termux/termux-shared/src/main/java/com/termux/shared/shell/command/environment/AndroidShellEnvironment.java index 4692639645..45df34f4e3 100644 --- a/termux/termux-shared/src/main/java/com/termux/shared/shell/command/environment/AndroidShellEnvironment.java +++ b/termux/termux-shared/src/main/java/com/termux/shared/shell/command/environment/AndroidShellEnvironment.java @@ -4,7 +4,7 @@ import androidx.annotation.NonNull; -import com.itsaky.androidide.utils.Environment; +import org.appdevforall.codeonthego.utils.Environment; import com.termux.shared.shell.command.ExecutionCommand; import java.io.File; diff --git a/termux/termux-shared/src/main/java/com/termux/shared/termux/shell/TermuxShellUtils.java b/termux/termux-shared/src/main/java/com/termux/shared/termux/shell/TermuxShellUtils.java index fcd1387f90..b419821f29 100644 --- a/termux/termux-shared/src/main/java/com/termux/shared/termux/shell/TermuxShellUtils.java +++ b/termux/termux-shared/src/main/java/com/termux/shared/termux/shell/TermuxShellUtils.java @@ -3,7 +3,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.itsaky.androidide.utils.Environment; +import org.appdevforall.codeonthego.utils.Environment; import com.termux.shared.errors.Error; import com.termux.shared.file.filesystem.FileTypes; import com.termux.shared.shell.command.environment.UnixShellEnvironment; diff --git a/termux/termux-shared/src/main/java/com/termux/shared/termux/shell/command/environment/TermuxShellEnvironment.java b/termux/termux-shared/src/main/java/com/termux/shared/termux/shell/command/environment/TermuxShellEnvironment.java index 91b8fbbb99..3a6c081ae5 100644 --- a/termux/termux-shared/src/main/java/com/termux/shared/termux/shell/command/environment/TermuxShellEnvironment.java +++ b/termux/termux-shared/src/main/java/com/termux/shared/termux/shell/command/environment/TermuxShellEnvironment.java @@ -1,6 +1,6 @@ package com.termux.shared.termux.shell.command.environment; -import static com.itsaky.androidide.utils.Environment.ANDROID_HOME; +import static org.appdevforall.codeonthego.utils.Environment.ANDROID_HOME; import android.content.Context; diff --git a/termux/termux-shared/src/main/java/com/termux/shared/theme/ThemeUtils.java b/termux/termux-shared/src/main/java/com/termux/shared/theme/ThemeUtils.java index 830123f842..b4fe909700 100644 --- a/termux/termux-shared/src/main/java/com/termux/shared/theme/ThemeUtils.java +++ b/termux/termux-shared/src/main/java/com/termux/shared/theme/ThemeUtils.java @@ -5,8 +5,8 @@ import android.content.res.TypedArray; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatDelegate; -import com.itsaky.androidide.preferences.internal.GeneralPreferences; -import com.itsaky.androidide.utils.ContextUtilsKt; +import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences; +import org.appdevforall.codeonthego.utils.ContextUtilsKt; public class ThemeUtils { diff --git a/termux/termux-shared/src/main/java/com/termux/shared/view/ViewUtils.java b/termux/termux-shared/src/main/java/com/termux/shared/view/ViewUtils.java index be00bdc0fe..bc653d9c99 100644 --- a/termux/termux-shared/src/main/java/com/termux/shared/view/ViewUtils.java +++ b/termux/termux-shared/src/main/java/com/termux/shared/view/ViewUtils.java @@ -15,8 +15,8 @@ import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AppCompatActivity; -import com.itsaky.androidide.window.WindowManager; -import com.itsaky.androidide.window.WindowMetrics; +import org.appdevforall.codeonthego.window.WindowManager; +import org.appdevforall.codeonthego.window.WindowMetrics; import com.termux.shared.logger.Logger; public class ViewUtils { diff --git a/testing/android/src/main/AndroidManifest.xml b/testing/android/src/main/AndroidManifest.xml index fa97a4cb92..daa40e7ebc 100644 --- a/testing/android/src/main/AndroidManifest.xml +++ b/testing/android/src/main/AndroidManifest.xml @@ -2,7 +2,7 @@ @@ -10,7 +10,7 @@ @@ -18,7 +18,7 @@ diff --git a/testing/android/src/main/java/com/itsaky/androidide/testing/android/Activities.kt b/testing/android/src/main/java/org/appdevforall/codeonthego/testing/android/Activities.kt similarity index 92% rename from testing/android/src/main/java/com/itsaky/androidide/testing/android/Activities.kt rename to testing/android/src/main/java/org/appdevforall/codeonthego/testing/android/Activities.kt index 0ac473e670..b1449962d9 100644 --- a/testing/android/src/main/java/com/itsaky/androidide/testing/android/Activities.kt +++ b/testing/android/src/main/java/org/appdevforall/codeonthego/testing/android/Activities.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.testing.android +package org.appdevforall.codeonthego.testing.android import android.app.Activity import androidx.appcompat.app.AppCompatActivity diff --git a/testing/android/src/main/java/com/itsaky/androidide/testing/android/TestInstrumentationRunner.kt b/testing/android/src/main/java/org/appdevforall/codeonthego/testing/android/TestInstrumentationRunner.kt similarity index 86% rename from testing/android/src/main/java/com/itsaky/androidide/testing/android/TestInstrumentationRunner.kt rename to testing/android/src/main/java/org/appdevforall/codeonthego/testing/android/TestInstrumentationRunner.kt index 8308785a0c..effb522172 100644 --- a/testing/android/src/main/java/com/itsaky/androidide/testing/android/TestInstrumentationRunner.kt +++ b/testing/android/src/main/java/org/appdevforall/codeonthego/testing/android/TestInstrumentationRunner.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.testing.android +package org.appdevforall.codeonthego.testing.android import android.os.Bundle import androidx.test.runner.AndroidJUnitRunner diff --git a/testing/android/src/main/java/com/itsaky/androidide/testing/android/contextUtils.kt b/testing/android/src/main/java/org/appdevforall/codeonthego/testing/android/contextUtils.kt similarity index 95% rename from testing/android/src/main/java/com/itsaky/androidide/testing/android/contextUtils.kt rename to testing/android/src/main/java/org/appdevforall/codeonthego/testing/android/contextUtils.kt index bd5d0c53f9..417d293a37 100644 --- a/testing/android/src/main/java/com/itsaky/androidide/testing/android/contextUtils.kt +++ b/testing/android/src/main/java/org/appdevforall/codeonthego/testing/android/contextUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.testing.android +package org.appdevforall.codeonthego.testing.android import android.content.Context import androidx.annotation.StringRes diff --git a/testing/android/src/main/java/com/itsaky/androidide/testing/android/uiAutomatorUtils.kt b/testing/android/src/main/java/org/appdevforall/codeonthego/testing/android/uiAutomatorUtils.kt similarity index 96% rename from testing/android/src/main/java/com/itsaky/androidide/testing/android/uiAutomatorUtils.kt rename to testing/android/src/main/java/org/appdevforall/codeonthego/testing/android/uiAutomatorUtils.kt index 470decde85..bbe27b6c0b 100644 --- a/testing/android/src/main/java/com/itsaky/androidide/testing/android/uiAutomatorUtils.kt +++ b/testing/android/src/main/java/org/appdevforall/codeonthego/testing/android/uiAutomatorUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.testing.android +package org.appdevforall.codeonthego.testing.android import android.app.Activity import android.app.UiAutomation @@ -31,7 +31,7 @@ import androidx.test.uiautomator.UiDeviceAccessor import androidx.test.uiautomator.Until import com.google.common.truth.Truth.assertThat import com.itsaky.androidide.buildinfo.BuildInfo -import com.itsaky.androidide.utils.uncheckedCast +import org.appdevforall.codeonthego.utils.uncheckedCast const val LAUNCH_TIMEOUT = 5000L diff --git a/testing/android/src/main/java/com/itsaky/androidide/testing/android/uiDeviceUtils.kt b/testing/android/src/main/java/org/appdevforall/codeonthego/testing/android/uiDeviceUtils.kt similarity index 97% rename from testing/android/src/main/java/com/itsaky/androidide/testing/android/uiDeviceUtils.kt rename to testing/android/src/main/java/org/appdevforall/codeonthego/testing/android/uiDeviceUtils.kt index 30b3620fcf..585cd6cf87 100644 --- a/testing/android/src/main/java/com/itsaky/androidide/testing/android/uiDeviceUtils.kt +++ b/testing/android/src/main/java/org/appdevforall/codeonthego/testing/android/uiDeviceUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.testing.android +package org.appdevforall.codeonthego.testing.android import android.view.KeyCharacterMap import androidx.annotation.StringRes diff --git a/testing/android/src/main/java/com/itsaky/androidide/testing/android/uiObjectUtils.kt b/testing/android/src/main/java/org/appdevforall/codeonthego/testing/android/uiObjectUtils.kt similarity index 97% rename from testing/android/src/main/java/com/itsaky/androidide/testing/android/uiObjectUtils.kt rename to testing/android/src/main/java/org/appdevforall/codeonthego/testing/android/uiObjectUtils.kt index 9bb9bb9143..3b835254d0 100644 --- a/testing/android/src/main/java/com/itsaky/androidide/testing/android/uiObjectUtils.kt +++ b/testing/android/src/main/java/org/appdevforall/codeonthego/testing/android/uiObjectUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.testing.android +package org.appdevforall.codeonthego.testing.android import androidx.annotation.StringRes import androidx.test.uiautomator.By diff --git a/testing/common/src/main/java/com/itsaky/androidide/testing/common/CIOnlyTestRule.kt b/testing/common/src/main/java/org/appdevforall/codeonthego/testing/common/CIOnlyTestRule.kt similarity index 91% rename from testing/common/src/main/java/com/itsaky/androidide/testing/common/CIOnlyTestRule.kt rename to testing/common/src/main/java/org/appdevforall/codeonthego/testing/common/CIOnlyTestRule.kt index 87e2920c17..082113bb08 100644 --- a/testing/common/src/main/java/com/itsaky/androidide/testing/common/CIOnlyTestRule.kt +++ b/testing/common/src/main/java/org/appdevforall/codeonthego/testing/common/CIOnlyTestRule.kt @@ -1,4 +1,4 @@ -package com.itsaky.androidide.testing.common +package org.appdevforall.codeonthego.testing.common import org.junit.rules.TestRule import org.junit.runner.Description diff --git a/testing/common/src/main/java/com/itsaky/androidide/testing/common/NoOpStatement.kt b/testing/common/src/main/java/org/appdevforall/codeonthego/testing/common/NoOpStatement.kt similarity index 94% rename from testing/common/src/main/java/com/itsaky/androidide/testing/common/NoOpStatement.kt rename to testing/common/src/main/java/org/appdevforall/codeonthego/testing/common/NoOpStatement.kt index 517fd47484..387428b67c 100644 --- a/testing/common/src/main/java/com/itsaky/androidide/testing/common/NoOpStatement.kt +++ b/testing/common/src/main/java/org/appdevforall/codeonthego/testing/common/NoOpStatement.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.testing.common +package org.appdevforall.codeonthego.testing.common import org.junit.runners.model.Statement diff --git a/testing/lsp/src/main/java/com/itsaky/androidide/lsp/api/LSPTest.kt b/testing/lsp/src/main/java/org/appdevforall/codeonthego/lsp/api/LSPTest.kt similarity index 78% rename from testing/lsp/src/main/java/com/itsaky/androidide/lsp/api/LSPTest.kt rename to testing/lsp/src/main/java/org/appdevforall/codeonthego/lsp/api/LSPTest.kt index 4ed56af2ab..af5aaff35b 100644 --- a/testing/lsp/src/main/java/com/itsaky/androidide/lsp/api/LSPTest.kt +++ b/testing/lsp/src/main/java/org/appdevforall/codeonthego/lsp/api/LSPTest.kt @@ -15,29 +15,29 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.lsp.api +package org.appdevforall.codeonthego.lsp.api import com.google.common.truth.Truth.assertThat import com.google.common.truth.Truth.assertWithMessage -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.eventbus.events.editor.ChangeType.DELETE -import com.itsaky.androidide.eventbus.events.editor.DocumentChangeEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentCloseEvent -import com.itsaky.androidide.eventbus.events.editor.DocumentOpenEvent -import com.itsaky.androidide.eventbus.events.file.FileDeletionEvent -import com.itsaky.androidide.eventbus.events.file.FileRenameEvent -import com.itsaky.androidide.managers.PreferenceManager -import com.itsaky.androidide.models.Position -import com.itsaky.androidide.models.Range -import com.itsaky.androidide.preferences.internal.EditorPreferences -import com.itsaky.androidide.preferences.internal.prefManager -import com.itsaky.androidide.projects.FileManager -import com.itsaky.androidide.projects.ProjectManagerImpl -import com.itsaky.androidide.testing.tooling.ToolingApiTestLauncher -import com.itsaky.androidide.tooling.api.IToolingApiServer -import com.itsaky.androidide.tooling.api.messages.result.InitializeResult -import com.itsaky.androidide.utils.Environment -import com.itsaky.androidide.utils.FileProvider +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.eventbus.events.editor.ChangeType.DELETE +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentCloseEvent +import org.appdevforall.codeonthego.eventbus.events.editor.DocumentOpenEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileDeletionEvent +import org.appdevforall.codeonthego.eventbus.events.file.FileRenameEvent +import org.appdevforall.codeonthego.managers.PreferenceManager +import org.appdevforall.codeonthego.models.Position +import org.appdevforall.codeonthego.models.Range +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.preferences.internal.prefManager +import org.appdevforall.codeonthego.projects.FileManager +import org.appdevforall.codeonthego.projects.ProjectManagerImpl +import org.appdevforall.codeonthego.testing.tooling.ToolingApiTestLauncher +import org.appdevforall.codeonthego.tooling.api.IToolingApiServer +import org.appdevforall.codeonthego.tooling.api.messages.result.InitializeResult +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.FileProvider import io.github.rosemoe.sora.text.Content import io.mockk.every import io.mockk.mockkStatic diff --git a/testing/lsp/src/main/java/com/itsaky/androidide/lsp/api/util/ReflectiveLogListener.kt b/testing/lsp/src/main/java/org/appdevforall/codeonthego/lsp/api/util/ReflectiveLogListener.kt similarity index 86% rename from testing/lsp/src/main/java/com/itsaky/androidide/lsp/api/util/ReflectiveLogListener.kt rename to testing/lsp/src/main/java/org/appdevforall/codeonthego/lsp/api/util/ReflectiveLogListener.kt index 72099f158b..8a5ea74128 100644 --- a/testing/lsp/src/main/java/com/itsaky/androidide/lsp/api/util/ReflectiveLogListener.kt +++ b/testing/lsp/src/main/java/org/appdevforall/codeonthego/lsp/api/util/ReflectiveLogListener.kt @@ -1,35 +1,35 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.lsp.api.util - -import com.itsaky.androidide.utils.ILogger -import com.itsaky.androidide.utils.ILogger.Level - -/** @author Akash Yadav */ -class ReflectiveLogListener(private val receiver: Class) : ILogger.LogListener { - override fun log(level: Level, tag: String, message: String) { - val method = - receiver.getDeclaredMethod( - "log", - Level::class.java, - String::class.java, - String::class.java - ) - method.isAccessible = true - method.invoke(null, level, tag, message) - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.lsp.api.util + +import org.appdevforall.codeonthego.utils.ILogger +import org.appdevforall.codeonthego.utils.ILogger.Level + +/** @author Akash Yadav */ +class ReflectiveLogListener(private val receiver: Class) : ILogger.LogListener { + override fun log(level: Level, tag: String, message: String) { + val method = + receiver.getDeclaredMethod( + "log", + Level::class.java, + String::class.java, + String::class.java + ) + method.isAccessible = true + method.invoke(null, level, tag, message) + } +} diff --git a/testing/resources/test-project/android-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java b/testing/resources/test-project/android-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java similarity index 56% rename from testing/resources/test-project/android-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java rename to testing/resources/test-project/android-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java index 2a00c845f2..11aa0ae737 100644 --- a/testing/resources/test-project/android-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java +++ b/testing/resources/test-project/android-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java @@ -1,5 +1,5 @@ -package com.itsaky.androidide.tooling.test; - -public class Main { - public static void main(String[] args) {} -} +package org.appdevforall.codeonthego.tooling.test; + +public class Main { + public static void main(String[] args) {} +} diff --git a/testing/resources/test-project/another-android-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java b/testing/resources/test-project/another-android-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java similarity index 56% rename from testing/resources/test-project/another-android-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java rename to testing/resources/test-project/another-android-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java index 2a00c845f2..11aa0ae737 100644 --- a/testing/resources/test-project/another-android-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java +++ b/testing/resources/test-project/another-android-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java @@ -1,5 +1,5 @@ -package com.itsaky.androidide.tooling.test; - -public class Main { - public static void main(String[] args) {} -} +package org.appdevforall.codeonthego.tooling.test; + +public class Main { + public static void main(String[] args) {} +} diff --git a/testing/resources/test-project/another-java-library/nested-java-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java b/testing/resources/test-project/another-java-library/nested-java-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java similarity index 56% rename from testing/resources/test-project/another-java-library/nested-java-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java rename to testing/resources/test-project/another-java-library/nested-java-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java index 2a00c845f2..11aa0ae737 100644 --- a/testing/resources/test-project/another-java-library/nested-java-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java +++ b/testing/resources/test-project/another-java-library/nested-java-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java @@ -1,5 +1,5 @@ -package com.itsaky.androidide.tooling.test; - -public class Main { - public static void main(String[] args) {} -} +package org.appdevforall.codeonthego.tooling.test; + +public class Main { + public static void main(String[] args) {} +} diff --git a/testing/resources/test-project/another-java-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java b/testing/resources/test-project/another-java-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java similarity index 56% rename from testing/resources/test-project/another-java-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java rename to testing/resources/test-project/another-java-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java index 2a00c845f2..11aa0ae737 100644 --- a/testing/resources/test-project/another-java-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java +++ b/testing/resources/test-project/another-java-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java @@ -1,5 +1,5 @@ -package com.itsaky.androidide.tooling.test; - -public class Main { - public static void main(String[] args) {} -} +package org.appdevforall.codeonthego.tooling.test; + +public class Main { + public static void main(String[] args) {} +} diff --git a/testing/resources/test-project/app/src/main/res/layout/unsupported_views.xml b/testing/resources/test-project/app/src/main/res/layout/unsupported_views.xml index c391c603ab..2989ee55c0 100644 --- a/testing/resources/test-project/app/src/main/res/layout/unsupported_views.xml +++ b/testing/resources/test-project/app/src/main/res/layout/unsupported_views.xml @@ -5,18 +5,18 @@ android:layout_height="match_parent" tools:context=".MainActivity"> - - - @@ -33,25 +33,25 @@ android:layout_height="match_parent" /> - + - - - - + diff --git a/testing/resources/test-project/app/src/main/resources/SourceFileTest_template.java b/testing/resources/test-project/app/src/main/resources/SourceFileTest_template.java index 26f944a7f4..d12118ca31 100644 --- a/testing/resources/test-project/app/src/main/resources/SourceFileTest_template.java +++ b/testing/resources/test-project/app/src/main/resources/SourceFileTest_template.java @@ -1,7 +1,7 @@ -package com.itsaky.androidide.test; - -public class Main { - public static void main(String[] args) { - System.out.println("Hello World!"); - } -} +package org.appdevforall.codeonthego.test; + +public class Main { + public static void main(String[] args) { + System.out.println("Hello World!"); + } +} diff --git a/testing/resources/test-project/app/src/main/resources/actions/AddImportAction_template.java b/testing/resources/test-project/app/src/main/resources/actions/AddImportAction_template.java index a1e0b1285a..ad473a2482 100644 --- a/testing/resources/test-project/app/src/main/resources/actions/AddImportAction_template.java +++ b/testing/resources/test-project/app/src/main/resources/actions/AddImportAction_template.java @@ -1,7 +1,7 @@ -package com.itsaky.androidide.test; - -public class AddImportAction_template { - public static void main(String[] args) { - Stream stream = null; - } -} +package org.appdevforall.codeonthego.test; + +public class AddImportAction_template { + public static void main(String[] args) { + Stream stream = null; + } +} diff --git a/testing/resources/test-project/app/src/main/resources/actions/GenerateSettersAndGettersTest_template.java b/testing/resources/test-project/app/src/main/resources/actions/GenerateSettersAndGettersTest_template.java index ea05a17d10..f2b736718d 100644 --- a/testing/resources/test-project/app/src/main/resources/actions/GenerateSettersAndGettersTest_template.java +++ b/testing/resources/test-project/app/src/main/resources/actions/GenerateSettersAndGettersTest_template.java @@ -1,11 +1,11 @@ -package com.itsaky.androidide.test; - -public class GenerateSettersAndGettersTest_template { - - private String myString; - private int myInt; - - private boolean myBoolean; - - public static void main(String[] args) {} -} +package org.appdevforall.codeonthego.test; + +public class GenerateSettersAndGettersTest_template { + + private String myString; + private int myInt; + + private boolean myBoolean; + + public static void main(String[] args) {} +} diff --git a/testing/resources/test-project/app/src/main/resources/completion/LambdaMembersCompletionTest_template.java b/testing/resources/test-project/app/src/main/resources/completion/LambdaMembersCompletionTest_template.java index 75c9d3a594..f22eebb121 100644 --- a/testing/resources/test-project/app/src/main/resources/completion/LambdaMembersCompletionTest_template.java +++ b/testing/resources/test-project/app/src/main/resources/completion/LambdaMembersCompletionTest_template.java @@ -1,16 +1,16 @@ -package com.itsaky.androidide.test; - -import java.util.function.Consumer; - -public class Main { - - private void testLambda () { - consume (e -> { - e.@@cursor@@ - }); - } - - private void consume (Consumer consumer) { - consumer.accept (new RuntimeException ("Hello world!")); - } -} +package org.appdevforall.codeonthego.test; + +import java.util.function.Consumer; + +public class Main { + + private void testLambda () { + consume (e -> { + e.@@cursor@@ + }); + } + + private void consume (Consumer consumer) { + consumer.accept (new RuntimeException ("Hello world!")); + } +} diff --git a/testing/resources/test-project/app/src/main/resources/completion/LocalsCompletionTest_template.java b/testing/resources/test-project/app/src/main/resources/completion/LocalsCompletionTest_template.java index c8edc53829..d69b199a64 100644 --- a/testing/resources/test-project/app/src/main/resources/completion/LocalsCompletionTest_template.java +++ b/testing/resources/test-project/app/src/main/resources/completion/LocalsCompletionTest_template.java @@ -1,11 +1,11 @@ -package com.itsaky.androidide.test; - -public class Main { - public static void main(String[] args) { - final String aaString = args[0]; - final int aaInt = 0; - final float aaFloat = 0f; - final double aaDouble = 0.0; - a@@cursor@@ - } -} +package org.appdevforall.codeonthego.test; + +public class Main { + public static void main(String[] args) { + final String aaString = args[0]; + final int aaInt = 0; + final float aaFloat = 0f; + final double aaDouble = 0.0; + a@@cursor@@ + } +} diff --git a/testing/resources/test-project/app/src/main/resources/completion/MembersCompletionTest_template.java b/testing/resources/test-project/app/src/main/resources/completion/MembersCompletionTest_template.java index a1b779d20c..df4b926dd8 100644 --- a/testing/resources/test-project/app/src/main/resources/completion/MembersCompletionTest_template.java +++ b/testing/resources/test-project/app/src/main/resources/completion/MembersCompletionTest_template.java @@ -1,8 +1,8 @@ -package com.itsaky.androidide.test; - -public class Main { - public static void main(String[] args) { - String str = new String (); - str.@@cursor@@ - } -} +package org.appdevforall.codeonthego.test; + +public class Main { + public static void main(String[] args) { + String str = new String (); + str.@@cursor@@ + } +} diff --git a/testing/resources/test-project/app/src/main/resources/completion/StaticMembersCompletionTest_template.java b/testing/resources/test-project/app/src/main/resources/completion/StaticMembersCompletionTest_template.java index 05e9e4ec32..6e42144eca 100644 --- a/testing/resources/test-project/app/src/main/resources/completion/StaticMembersCompletionTest_template.java +++ b/testing/resources/test-project/app/src/main/resources/completion/StaticMembersCompletionTest_template.java @@ -1,7 +1,7 @@ -package com.itsaky.androidide.test; - -public class Main { - public static void main(String[] args) { - String.@@cursor@@ - } -} +package org.appdevforall.codeonthego.test; + +public class Main { + public static void main(String[] args) { + String.@@cursor@@ + } +} diff --git a/testing/resources/test-project/app/src/main/resources/package/SourceFileTest_template.java b/testing/resources/test-project/app/src/main/resources/package/SourceFileTest_template.java index 26f944a7f4..d12118ca31 100644 --- a/testing/resources/test-project/app/src/main/resources/package/SourceFileTest_template.java +++ b/testing/resources/test-project/app/src/main/resources/package/SourceFileTest_template.java @@ -1,7 +1,7 @@ -package com.itsaky.androidide.test; - -public class Main { - public static void main(String[] args) { - System.out.println("Hello World!"); - } -} +package org.appdevforall.codeonthego.test; + +public class Main { + public static void main(String[] args) { + System.out.println("Hello World!"); + } +} diff --git a/testing/resources/test-project/app/src/main/resources/partial/PartialErrReparserTest_template.java b/testing/resources/test-project/app/src/main/resources/partial/PartialErrReparserTest_template.java index 5e2b62580e..5aaa3c146e 100644 --- a/testing/resources/test-project/app/src/main/resources/partial/PartialErrReparserTest_template.java +++ b/testing/resources/test-project/app/src/main/resources/partial/PartialErrReparserTest_template.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.partial; +package org.appdevforall.codeonthego.lsp.java.partial; public class PartialReparserTest_template { public static void main(String[] args) { diff --git a/testing/resources/test-project/app/src/main/resources/partial/PartialReparserTest_template.java b/testing/resources/test-project/app/src/main/resources/partial/PartialReparserTest_template.java index 52dd8e92db..964ca9a9f3 100644 --- a/testing/resources/test-project/app/src/main/resources/partial/PartialReparserTest_template.java +++ b/testing/resources/test-project/app/src/main/resources/partial/PartialReparserTest_template.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.partial; +package org.appdevforall.codeonthego.lsp.java.partial; public class PartialReparserTest_template { public static void main(String[] args) { diff --git a/testing/resources/test-project/app/src/main/resources/selection/MethodBodySelectionExpansionTest_template.java b/testing/resources/test-project/app/src/main/resources/selection/MethodBodySelectionExpansionTest_template.java index 26f944a7f4..d12118ca31 100644 --- a/testing/resources/test-project/app/src/main/resources/selection/MethodBodySelectionExpansionTest_template.java +++ b/testing/resources/test-project/app/src/main/resources/selection/MethodBodySelectionExpansionTest_template.java @@ -1,7 +1,7 @@ -package com.itsaky.androidide.test; - -public class Main { - public static void main(String[] args) { - System.out.println("Hello World!"); - } -} +package org.appdevforall.codeonthego.test; + +public class Main { + public static void main(String[] args) { + System.out.println("Hello World!"); + } +} diff --git a/testing/resources/test-project/app/src/main/resources/selection/SimpleSelectionExpansionTest_template.java b/testing/resources/test-project/app/src/main/resources/selection/SimpleSelectionExpansionTest_template.java index e41cae2534..ffed0c296b 100644 --- a/testing/resources/test-project/app/src/main/resources/selection/SimpleSelectionExpansionTest_template.java +++ b/testing/resources/test-project/app/src/main/resources/selection/SimpleSelectionExpansionTest_template.java @@ -1,7 +1,7 @@ -package com.itsaky.androidide.test; - -public class Main { - public static void main(String[] args) { - System.out.println(@@cursor@@"Hello World!"); - } +package org.appdevforall.codeonthego.test; + +public class Main { + public static void main(String[] args) { + System.out.println(@@cursor@@"Hello World!"); + } } \ No newline at end of file diff --git a/testing/resources/test-project/app/src/main/resources/selection/TrySelectionExpansionTest_template.java b/testing/resources/test-project/app/src/main/resources/selection/TrySelectionExpansionTest_template.java index a0aff05a8d..50e6583f0d 100644 --- a/testing/resources/test-project/app/src/main/resources/selection/TrySelectionExpansionTest_template.java +++ b/testing/resources/test-project/app/src/main/resources/selection/TrySelectionExpansionTest_template.java @@ -1,13 +1,13 @@ -package com.itsaky.androidide.test; - -public class Main { - public static void main(String[] args) { - try { - // something - } catch (Throwable th) { - // handle error - } finally { - // do something else - } - } -} +package org.appdevforall.codeonthego.test; + +public class Main { + public static void main(String[] args) { + try { + // something + } catch (Throwable th) { + // handle error + } finally { + // do something else + } + } +} diff --git a/testing/resources/test-project/app/src/main/resources/utils/FindHelperRegexElements_template.java b/testing/resources/test-project/app/src/main/resources/utils/FindHelperRegexElements_template.java index 492f144266..0a4ae3d284 100644 --- a/testing/resources/test-project/app/src/main/resources/utils/FindHelperRegexElements_template.java +++ b/testing/resources/test-project/app/src/main/resources/utils/FindHelperRegexElements_template.java @@ -1,4 +1,4 @@ -package com.itsaky.androidide.lsp.java.test; +package org.appdevforall.codeonthego.lsp.java.test; import java.util.*; diff --git a/testing/resources/test-project/java-library/nested-java-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java b/testing/resources/test-project/java-library/nested-java-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java deleted file mode 100644 index 2a00c845f2..0000000000 --- a/testing/resources/test-project/java-library/nested-java-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.itsaky.androidide.tooling.test; - -public class Main { - public static void main(String[] args) {} -} diff --git a/testing/resources/test-project/java-library/nested-java-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java b/testing/resources/test-project/java-library/nested-java-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java new file mode 100644 index 0000000000..11aa0ae737 --- /dev/null +++ b/testing/resources/test-project/java-library/nested-java-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java @@ -0,0 +1,5 @@ +package org.appdevforall.codeonthego.tooling.test; + +public class Main { + public static void main(String[] args) {} +} diff --git a/testing/resources/test-project/java-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java b/testing/resources/test-project/java-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java deleted file mode 100644 index 2a00c845f2..0000000000 --- a/testing/resources/test-project/java-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.itsaky.androidide.tooling.test; - -public class Main { - public static void main(String[] args) {} -} diff --git a/testing/resources/test-project/java-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java b/testing/resources/test-project/java-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java new file mode 100644 index 0000000000..11aa0ae737 --- /dev/null +++ b/testing/resources/test-project/java-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java @@ -0,0 +1,5 @@ +package org.appdevforall.codeonthego.tooling.test; + +public class Main { + public static void main(String[] args) {} +} diff --git a/testing/resources/test-project/other-java-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java b/testing/resources/test-project/other-java-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java deleted file mode 100644 index 2a00c845f2..0000000000 --- a/testing/resources/test-project/other-java-library/src/main/java/com/itsaky/androidide/tooling/test/Main.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.itsaky.androidide.tooling.test; - -public class Main { - public static void main(String[] args) {} -} diff --git a/testing/resources/test-project/other-java-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java b/testing/resources/test-project/other-java-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java new file mode 100644 index 0000000000..11aa0ae737 --- /dev/null +++ b/testing/resources/test-project/other-java-library/src/main/java/org/appdevforall/codeonthego/tooling/test/Main.java @@ -0,0 +1,5 @@ +package org.appdevforall.codeonthego.tooling.test; + +public class Main { + public static void main(String[] args) {} +} diff --git a/testing/tooling/src/main/java/com/itsaky/androidide/testing/tooling/ToolingApiTestLauncher.kt b/testing/tooling/src/main/java/org/appdevforall/codeonthego/testing/tooling/ToolingApiTestLauncher.kt similarity index 87% rename from testing/tooling/src/main/java/com/itsaky/androidide/testing/tooling/ToolingApiTestLauncher.kt rename to testing/tooling/src/main/java/org/appdevforall/codeonthego/testing/tooling/ToolingApiTestLauncher.kt index b4cfc26b78..aa0a667846 100644 --- a/testing/tooling/src/main/java/com/itsaky/androidide/testing/tooling/ToolingApiTestLauncher.kt +++ b/testing/tooling/src/main/java/org/appdevforall/codeonthego/testing/tooling/ToolingApiTestLauncher.kt @@ -15,30 +15,30 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.testing.tooling - -import com.itsaky.androidide.testing.tooling.models.ToolingApiTestLauncherParams -import com.itsaky.androidide.testing.tooling.models.ToolingApiTestScope -import com.itsaky.androidide.tooling.api.IToolingApiClient -import com.itsaky.androidide.tooling.api.IToolingApiServer -import com.itsaky.androidide.tooling.api.messages.BuildId -import com.itsaky.androidide.tooling.api.messages.BuildRunType -import com.itsaky.androidide.tooling.api.messages.ClientGradleBuildConfig -import com.itsaky.androidide.tooling.api.messages.GradleBuildParams -import com.itsaky.androidide.tooling.api.messages.GradleDistributionParams -import com.itsaky.androidide.tooling.api.messages.InitializeProjectParams -import com.itsaky.androidide.tooling.api.messages.LogMessageParams -import com.itsaky.androidide.tooling.api.messages.result.BuildInfo -import com.itsaky.androidide.tooling.api.messages.result.BuildResult -import com.itsaky.androidide.tooling.api.messages.result.GradleWrapperCheckResult -import com.itsaky.androidide.tooling.api.messages.result.InitializeResult -import com.itsaky.androidide.tooling.api.messages.toLogLine -import com.itsaky.androidide.tooling.api.sync.ProjectSyncHelper -import com.itsaky.androidide.tooling.api.util.ToolingApiLauncher -import com.itsaky.androidide.tooling.api.util.ToolingProps -import com.itsaky.androidide.tooling.events.ProgressEvent -import com.itsaky.androidide.utils.FileProvider -import com.itsaky.androidide.utils.ILogger +package org.appdevforall.codeonthego.testing.tooling + +import org.appdevforall.codeonthego.testing.tooling.models.ToolingApiTestLauncherParams +import org.appdevforall.codeonthego.testing.tooling.models.ToolingApiTestScope +import org.appdevforall.codeonthego.tooling.api.IToolingApiClient +import org.appdevforall.codeonthego.tooling.api.IToolingApiServer +import org.appdevforall.codeonthego.tooling.api.messages.BuildId +import org.appdevforall.codeonthego.tooling.api.messages.BuildRunType +import org.appdevforall.codeonthego.tooling.api.messages.ClientGradleBuildConfig +import org.appdevforall.codeonthego.tooling.api.messages.GradleBuildParams +import org.appdevforall.codeonthego.tooling.api.messages.GradleDistributionParams +import org.appdevforall.codeonthego.tooling.api.messages.InitializeProjectParams +import org.appdevforall.codeonthego.tooling.api.messages.LogMessageParams +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildInfo +import org.appdevforall.codeonthego.tooling.api.messages.result.BuildResult +import org.appdevforall.codeonthego.tooling.api.messages.result.GradleWrapperCheckResult +import org.appdevforall.codeonthego.tooling.api.messages.result.InitializeResult +import org.appdevforall.codeonthego.tooling.api.messages.toLogLine +import org.appdevforall.codeonthego.tooling.api.sync.ProjectSyncHelper +import org.appdevforall.codeonthego.tooling.api.util.ToolingApiLauncher +import org.appdevforall.codeonthego.tooling.api.util.ToolingProps +import org.appdevforall.codeonthego.tooling.events.ProgressEvent +import org.appdevforall.codeonthego.utils.FileProvider +import org.appdevforall.codeonthego.utils.ILogger import kotlinx.coroutines.runBlocking import org.slf4j.Logger import org.slf4j.LoggerFactory diff --git a/testing/tooling/src/main/java/com/itsaky/androidide/testing/tooling/models/ToolingApiTestLauncherParams.kt b/testing/tooling/src/main/java/org/appdevforall/codeonthego/testing/tooling/models/ToolingApiTestLauncherParams.kt similarity index 81% rename from testing/tooling/src/main/java/com/itsaky/androidide/testing/tooling/models/ToolingApiTestLauncherParams.kt rename to testing/tooling/src/main/java/org/appdevforall/codeonthego/testing/tooling/models/ToolingApiTestLauncherParams.kt index 03b1b56faf..9343615bec 100644 --- a/testing/tooling/src/main/java/com/itsaky/androidide/testing/tooling/models/ToolingApiTestLauncherParams.kt +++ b/testing/tooling/src/main/java/org/appdevforall/codeonthego/testing/tooling/models/ToolingApiTestLauncherParams.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.testing.tooling.models +package org.appdevforall.codeonthego.testing.tooling.models -import com.itsaky.androidide.testing.tooling.ToolingApiTestLauncher -import com.itsaky.androidide.tooling.api.messages.BuildId -import com.itsaky.androidide.tooling.api.messages.InitializeProjectParams -import com.itsaky.androidide.utils.FileProvider +import org.appdevforall.codeonthego.testing.tooling.ToolingApiTestLauncher +import org.appdevforall.codeonthego.tooling.api.messages.BuildId +import org.appdevforall.codeonthego.tooling.api.messages.InitializeProjectParams +import org.appdevforall.codeonthego.utils.FileProvider import org.slf4j.Logger import org.slf4j.LoggerFactory import java.nio.file.Path diff --git a/testing/tooling/src/main/java/com/itsaky/androidide/testing/tooling/models/ToolingApiTestScope.kt b/testing/tooling/src/main/java/org/appdevforall/codeonthego/testing/tooling/models/ToolingApiTestScope.kt similarity index 82% rename from testing/tooling/src/main/java/com/itsaky/androidide/testing/tooling/models/ToolingApiTestScope.kt rename to testing/tooling/src/main/java/org/appdevforall/codeonthego/testing/tooling/models/ToolingApiTestScope.kt index ef1ec90b40..281003e52f 100644 --- a/testing/tooling/src/main/java/com/itsaky/androidide/testing/tooling/models/ToolingApiTestScope.kt +++ b/testing/tooling/src/main/java/org/appdevforall/codeonthego/testing/tooling/models/ToolingApiTestScope.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.testing.tooling.models +package org.appdevforall.codeonthego.testing.tooling.models -import com.itsaky.androidide.project.GradleModels -import com.itsaky.androidide.tooling.api.IToolingApiServer -import com.itsaky.androidide.tooling.api.messages.result.InitializeResult +import org.appdevforall.codeonthego.project.GradleModels +import org.appdevforall.codeonthego.tooling.api.IToolingApiServer +import org.appdevforall.codeonthego.tooling.api.messages.result.InitializeResult import java.util.concurrent.CompletableFuture /** diff --git a/testing/tooling/src/main/java/com/itsaky/androidide/testing/tooling/utils.kt b/testing/tooling/src/main/java/org/appdevforall/codeonthego/testing/tooling/utils.kt similarity index 95% rename from testing/tooling/src/main/java/com/itsaky/androidide/testing/tooling/utils.kt rename to testing/tooling/src/main/java/org/appdevforall/codeonthego/testing/tooling/utils.kt index 68b5a7faf1..246ae0a143 100644 --- a/testing/tooling/src/main/java/com/itsaky/androidide/testing/tooling/utils.kt +++ b/testing/tooling/src/main/java/org/appdevforall/codeonthego/testing/tooling/utils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.testing.tooling +package org.appdevforall.codeonthego.testing.tooling fun findAndroidHome(): String { var androidHome = System.getenv("ANDROID_HOME") diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/ShowXmlActivity.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/ShowXmlActivity.kt similarity index 83% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/ShowXmlActivity.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/ShowXmlActivity.kt index 77a72ae381..15b427c48e 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/ShowXmlActivity.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/ShowXmlActivity.kt @@ -15,21 +15,23 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner +package org.appdevforall.codeonthego.uidesigner + +import com.itsaky.androidide.uidesigner.R import android.os.Bundle import android.view.View import android.view.ViewGroup import android.view.ViewGroup.LayoutParams.MATCH_PARENT -import com.itsaky.androidide.app.BaseIDEActivity -import com.itsaky.androidide.editor.language.treesitter.XMLLanguage -import com.itsaky.androidide.editor.schemes.IDEColorSchemeProvider -import com.itsaky.androidide.editor.ui.IDEEditor -import com.itsaky.androidide.preferences.internal.EditorPreferences -import com.itsaky.androidide.syntax.colorschemes.SchemeAndroidIDE +import org.appdevforall.codeonthego.app.BaseIDEActivity +import org.appdevforall.codeonthego.editor.language.treesitter.XMLLanguage +import org.appdevforall.codeonthego.editor.schemes.IDEColorSchemeProvider +import org.appdevforall.codeonthego.editor.ui.IDEEditor +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE import com.itsaky.androidide.uidesigner.databinding.ActivityShowXmlBinding -import com.itsaky.androidide.utils.flashInfo -import com.itsaky.androidide.utils.jetbrainsMono +import org.appdevforall.codeonthego.utils.flashInfo +import org.appdevforall.codeonthego.utils.jetbrainsMono import io.github.rosemoe.sora.event.Unsubscribe import io.github.rosemoe.sora.widget.CodeEditor import org.slf4j.LoggerFactory diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/UIDesignerActivity.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/UIDesignerActivity.kt similarity index 87% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/UIDesignerActivity.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/UIDesignerActivity.kt index daaaffeda2..17510588e4 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/UIDesignerActivity.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/UIDesignerActivity.kt @@ -15,8 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner +package org.appdevforall.codeonthego.uidesigner + +import com.itsaky.androidide.uidesigner.R import android.annotation.SuppressLint import android.content.Context import android.content.Intent @@ -29,18 +31,18 @@ import androidx.appcompat.app.ActionBarDrawerToggle import androidx.appcompat.view.menu.MenuBuilder import androidx.core.view.GravityCompat import androidx.fragment.app.Fragment -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem.Location.UI_DESIGNER_TOOLBAR -import com.itsaky.androidide.actions.ActionsRegistry -import com.itsaky.androidide.actions.FillMenuParams -import com.itsaky.androidide.app.BaseIDEActivity -import com.itsaky.androidide.uidesigner.actions.clearUiDesignerActions -import com.itsaky.androidide.uidesigner.actions.registerUiDesignerActions +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem.Location.UI_DESIGNER_TOOLBAR +import org.appdevforall.codeonthego.actions.ActionsRegistry +import org.appdevforall.codeonthego.actions.FillMenuParams +import org.appdevforall.codeonthego.app.BaseIDEActivity +import org.appdevforall.codeonthego.uidesigner.actions.clearUiDesignerActions +import org.appdevforall.codeonthego.uidesigner.actions.registerUiDesignerActions import com.itsaky.androidide.uidesigner.databinding.ActivityUiDesignerBinding -import com.itsaky.androidide.uidesigner.fragments.DesignerWorkspaceFragment -import com.itsaky.androidide.uidesigner.utils.ViewToXml -import com.itsaky.androidide.uidesigner.viewmodel.WorkspaceViewModel -import com.itsaky.androidide.utils.flashError +import org.appdevforall.codeonthego.uidesigner.fragments.DesignerWorkspaceFragment +import org.appdevforall.codeonthego.uidesigner.utils.ViewToXml +import org.appdevforall.codeonthego.uidesigner.viewmodel.WorkspaceViewModel +import org.appdevforall.codeonthego.utils.flashError import org.slf4j.LoggerFactory import java.io.File @@ -224,7 +226,7 @@ class UIDesignerActivity : BaseIDEActivity() { return workspace } - fun setupHierarchy(view: com.itsaky.androidide.inflater.IView) { + fun setupHierarchy(view: org.appdevforall.codeonthego.inflater.IView) { binding?.hierarchy?.setupWithView(view) { workspace()?.showViewInfo(it) } } diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/actions/RedoAction.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/actions/RedoAction.kt similarity index 92% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/actions/RedoAction.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/actions/RedoAction.kt index 879cc1baf8..cf94544e7c 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/actions/RedoAction.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/actions/RedoAction.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.actions +package org.appdevforall.codeonthego.uidesigner.actions import android.content.Context import androidx.core.content.ContextCompat -import com.itsaky.androidide.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionData import com.itsaky.androidide.uidesigner.R /** diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/actions/ShowHierarchyAction.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/actions/ShowHierarchyAction.kt similarity index 87% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/actions/ShowHierarchyAction.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/actions/ShowHierarchyAction.kt index ed1b2dbf34..c4b9cc4dfd 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/actions/ShowHierarchyAction.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/actions/ShowHierarchyAction.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.actions +package org.appdevforall.codeonthego.uidesigner.actions import android.content.Context import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible import com.itsaky.androidide.uidesigner.R import com.itsaky.androidide.uidesigner.R.string diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/actions/ShowXmlAction.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/actions/ShowXmlAction.kt similarity index 84% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/actions/ShowXmlAction.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/actions/ShowXmlAction.kt index ac0eb37858..edc9da56d5 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/actions/ShowXmlAction.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/actions/ShowXmlAction.kt @@ -15,19 +15,19 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.actions +package org.appdevforall.codeonthego.uidesigner.actions import android.content.Context import android.content.Intent import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible import com.itsaky.androidide.uidesigner.R -import com.itsaky.androidide.uidesigner.ShowXmlActivity -import com.itsaky.androidide.uidesigner.utils.ViewToXml -import com.itsaky.androidide.utils.flashError +import org.appdevforall.codeonthego.uidesigner.ShowXmlActivity +import org.appdevforall.codeonthego.uidesigner.utils.ViewToXml +import org.appdevforall.codeonthego.utils.flashError /** * Navigates the user to [ShowXmlActivity]. diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/actions/UiDesignerAction.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/actions/UiDesignerAction.kt similarity index 76% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/actions/UiDesignerAction.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/actions/UiDesignerAction.kt index dcbd46400c..52c05a25e9 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/actions/UiDesignerAction.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/actions/UiDesignerAction.kt @@ -15,19 +15,19 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.actions +package org.appdevforall.codeonthego.uidesigner.actions import android.content.Context import android.graphics.drawable.Drawable import androidx.fragment.app.Fragment -import com.itsaky.androidide.actions.ActionData -import com.itsaky.androidide.actions.ActionItem -import com.itsaky.androidide.actions.ActionItem.Location -import com.itsaky.androidide.actions.ActionItem.Location.UI_DESIGNER_TOOLBAR -import com.itsaky.androidide.actions.hasRequiredData -import com.itsaky.androidide.actions.markInvisible -import com.itsaky.androidide.uidesigner.UIDesignerActivity -import com.itsaky.androidide.uidesigner.fragments.DesignerWorkspaceFragment +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionItem.Location +import org.appdevforall.codeonthego.actions.ActionItem.Location.UI_DESIGNER_TOOLBAR +import org.appdevforall.codeonthego.actions.hasRequiredData +import org.appdevforall.codeonthego.actions.markInvisible +import org.appdevforall.codeonthego.uidesigner.UIDesignerActivity +import org.appdevforall.codeonthego.uidesigner.fragments.DesignerWorkspaceFragment /** * Base class for actions that are shown in the UI Designer activity. diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/actions/UndoAction.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/actions/UndoAction.kt similarity index 92% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/actions/UndoAction.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/actions/UndoAction.kt index cbb8903543..bf00fb3f1c 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/actions/UndoAction.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/actions/UndoAction.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.actions +package org.appdevforall.codeonthego.uidesigner.actions import android.content.Context import androidx.core.content.ContextCompat -import com.itsaky.androidide.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionData import com.itsaky.androidide.uidesigner.R /** diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/actions/uiDesignerActions.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/actions/uiDesignerActions.kt similarity index 84% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/actions/uiDesignerActions.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/actions/uiDesignerActions.kt index 189883dbba..c2bd62e842 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/actions/uiDesignerActions.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/actions/uiDesignerActions.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.actions +package org.appdevforall.codeonthego.uidesigner.actions import android.content.Context -import com.itsaky.androidide.actions.ActionItem.Location.UI_DESIGNER_TOOLBAR -import com.itsaky.androidide.actions.ActionsRegistry +import org.appdevforall.codeonthego.actions.ActionItem.Location.UI_DESIGNER_TOOLBAR +import org.appdevforall.codeonthego.actions.ActionsRegistry fun registerUiDesignerActions(context: Context) { ActionsRegistry.getInstance().apply { diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/adapters/AddAttrListAdapter.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/adapters/AddAttrListAdapter.kt similarity index 85% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/adapters/AddAttrListAdapter.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/adapters/AddAttrListAdapter.kt index 1583222c13..2607ec1a14 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/adapters/AddAttrListAdapter.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/adapters/AddAttrListAdapter.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.adapters +package org.appdevforall.codeonthego.uidesigner.adapters import android.annotation.SuppressLint import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import com.itsaky.androidide.uidesigner.adapters.AddAttrListAdapter.VH +import org.appdevforall.codeonthego.uidesigner.adapters.AddAttrListAdapter.VH import com.itsaky.androidide.uidesigner.databinding.LayoutAddAttrItemBinding /** @@ -30,8 +30,8 @@ import com.itsaky.androidide.uidesigner.databinding.LayoutAddAttrItemBinding * @author Akash Yadav */ class AddAttrListAdapter( - private val attributes: List, - private val onClick: (com.itsaky.androidide.inflater.IAttribute) -> Unit = {} + private val attributes: List, + private val onClick: (org.appdevforall.codeonthego.inflater.IAttribute) -> Unit = {} ) : RecyclerView.Adapter() { class VH(val binding: LayoutAddAttrItemBinding) : RecyclerView.ViewHolder(binding.root) diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/adapters/ViewAttrListAdapter.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/adapters/ViewAttrListAdapter.kt similarity index 79% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/adapters/ViewAttrListAdapter.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/adapters/ViewAttrListAdapter.kt index 384795c975..3f5d24c29c 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/adapters/ViewAttrListAdapter.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/adapters/ViewAttrListAdapter.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.adapters +package org.appdevforall.codeonthego.uidesigner.adapters import android.annotation.SuppressLint import android.content.Context @@ -23,13 +23,13 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import com.itsaky.androidide.inflater.IView.SingleAttributeChangeListener +import org.appdevforall.codeonthego.inflater.IView.SingleAttributeChangeListener import com.itsaky.androidide.uidesigner.R -import com.itsaky.androidide.uidesigner.adapters.ViewAttrListAdapter.VH +import org.appdevforall.codeonthego.uidesigner.adapters.ViewAttrListAdapter.VH import com.itsaky.androidide.uidesigner.databinding.LayoutViewattrItemBinding -import com.itsaky.androidide.uidesigner.models.UiAttribute -import com.itsaky.androidide.uidesigner.viewmodel.WorkspaceViewModel -import com.itsaky.androidide.utils.DialogUtils +import org.appdevforall.codeonthego.uidesigner.models.UiAttribute +import org.appdevforall.codeonthego.uidesigner.viewmodel.WorkspaceViewModel +import org.appdevforall.codeonthego.utils.DialogUtils /** * A [RecyclerView.Adapter] which shows the list of attributes of the selected view in the UI @@ -38,10 +38,10 @@ import com.itsaky.androidide.utils.DialogUtils * @author Akash Yadav */ internal class ViewAttrListAdapter( - attributes: List, + attributes: List, private val viewModel: WorkspaceViewModel?, - private val onDeleteAttr: (com.itsaky.androidide.inflater.IAttribute) -> Boolean, - private val onClick: (com.itsaky.androidide.inflater.IAttribute) -> Unit + private val onDeleteAttr: (org.appdevforall.codeonthego.inflater.IAttribute) -> Boolean, + private val onClick: (org.appdevforall.codeonthego.inflater.IAttribute) -> Unit ) : RecyclerView.Adapter() { private val attributes = attributes.sortedBy { it.name }.toMutableList() @@ -77,7 +77,7 @@ internal class ViewAttrListAdapter( val viewModel = this.viewModel ?: return@setOnClickListener val attrUpdateListener = object : SingleAttributeChangeListener() { - override fun onAttributeUpdated(view: com.itsaky.androidide.inflater.IView, attribute: com.itsaky.androidide.inflater.IAttribute, oldValue: String) { + override fun onAttributeUpdated(view: org.appdevforall.codeonthego.inflater.IView, attribute: org.appdevforall.codeonthego.inflater.IAttribute, oldValue: String) { binding.attrValue.text = attribute.value } } diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/adapters/WidgetsCategoryAdapter.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/adapters/WidgetsCategoryAdapter.kt similarity index 89% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/adapters/WidgetsCategoryAdapter.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/adapters/WidgetsCategoryAdapter.kt index da29195874..948a700b95 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/adapters/WidgetsCategoryAdapter.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/adapters/WidgetsCategoryAdapter.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.adapters +package org.appdevforall.codeonthego.uidesigner.adapters import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import com.itsaky.androidide.uidesigner.adapters.WidgetsCategoryAdapter.VH +import org.appdevforall.codeonthego.uidesigner.adapters.WidgetsCategoryAdapter.VH import com.itsaky.androidide.uidesigner.databinding.LayoutUiWidgetsCategoryBinding -import com.itsaky.androidide.uidesigner.models.UiWidgetCategory -import com.itsaky.androidide.uidesigner.viewmodel.WorkspaceViewModel +import org.appdevforall.codeonthego.uidesigner.models.UiWidgetCategory +import org.appdevforall.codeonthego.uidesigner.viewmodel.WorkspaceViewModel /** @author Akash Yadav */ internal class WidgetsCategoryAdapter( diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/adapters/WidgetsItemAdapter.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/adapters/WidgetsItemAdapter.kt similarity index 83% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/adapters/WidgetsItemAdapter.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/adapters/WidgetsItemAdapter.kt index 0a4bafa136..bc91f4a054 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/adapters/WidgetsItemAdapter.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/adapters/WidgetsItemAdapter.kt @@ -15,18 +15,18 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.adapters +package org.appdevforall.codeonthego.uidesigner.adapters import android.content.ClipData import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import com.itsaky.androidide.inflater.models.UiWidget -import com.itsaky.androidide.uidesigner.adapters.WidgetsItemAdapter.VH +import org.appdevforall.codeonthego.inflater.models.UiWidget +import org.appdevforall.codeonthego.uidesigner.adapters.WidgetsItemAdapter.VH import com.itsaky.androidide.uidesigner.databinding.LayoutUiWidgetsItemBinding -import com.itsaky.androidide.uidesigner.drag.WidgetDragShadowBuilder -import com.itsaky.androidide.uidesigner.fragments.DesignerWorkspaceFragment -import com.itsaky.androidide.uidesigner.viewmodel.WorkspaceViewModel +import org.appdevforall.codeonthego.uidesigner.drag.WidgetDragShadowBuilder +import org.appdevforall.codeonthego.uidesigner.fragments.DesignerWorkspaceFragment +import org.appdevforall.codeonthego.uidesigner.viewmodel.WorkspaceViewModel /** @author Akash Yadav */ internal class WidgetsItemAdapter( diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/drag/WidgetDragListener.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/drag/WidgetDragListener.kt similarity index 88% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/drag/WidgetDragListener.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/drag/WidgetDragListener.kt index 3b88e25a36..72d57657a4 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/drag/WidgetDragListener.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/drag/WidgetDragListener.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.drag +package org.appdevforall.codeonthego.uidesigner.drag import android.view.DragEvent import android.view.View -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.models.UiWidget -import com.itsaky.androidide.inflater.viewGroup -import com.itsaky.androidide.uidesigner.fragments.DesignerWorkspaceFragment.Companion.DRAGGING_WIDGET_MIME -import com.itsaky.androidide.uidesigner.models.UiView -import com.itsaky.androidide.uidesigner.models.UiViewGroup +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.viewGroup +import org.appdevforall.codeonthego.uidesigner.fragments.DesignerWorkspaceFragment.Companion.DRAGGING_WIDGET_MIME +import org.appdevforall.codeonthego.uidesigner.models.UiView +import org.appdevforall.codeonthego.uidesigner.models.UiViewGroup import kotlin.math.absoluteValue import kotlin.math.max import kotlin.math.min diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/drag/WidgetDragShadowBuilder.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/drag/WidgetDragShadowBuilder.kt similarity index 96% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/drag/WidgetDragShadowBuilder.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/drag/WidgetDragShadowBuilder.kt index 54ca8796f9..fbe1ac839a 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/drag/WidgetDragShadowBuilder.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/drag/WidgetDragShadowBuilder.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.drag +package org.appdevforall.codeonthego.uidesigner.drag import android.graphics.Point import android.view.View diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/drag/WidgetTouchListener.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/drag/WidgetTouchListener.kt similarity index 89% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/drag/WidgetTouchListener.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/drag/WidgetTouchListener.kt index 8b9d58192f..8b5742f098 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/drag/WidgetTouchListener.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/drag/WidgetTouchListener.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.drag +package org.appdevforall.codeonthego.uidesigner.drag import android.annotation.SuppressLint import android.content.ClipData @@ -25,7 +25,7 @@ import android.view.MotionEvent import android.view.View import android.view.View.OnTouchListener import androidx.core.view.ViewCompat -import com.itsaky.androidide.uidesigner.fragments.DesignerWorkspaceFragment +import org.appdevforall.codeonthego.uidesigner.fragments.DesignerWorkspaceFragment /** * Touch listener for inflated widgets. @@ -33,9 +33,9 @@ import com.itsaky.androidide.uidesigner.fragments.DesignerWorkspaceFragment * @author Akash Yadav */ internal class WidgetTouchListener( - private val view: com.itsaky.androidide.inflater.IView, + private val view: org.appdevforall.codeonthego.inflater.IView, context: Context, - private val onClick: (com.itsaky.androidide.inflater.IView) -> Boolean = { false } + private val onClick: (org.appdevforall.codeonthego.inflater.IView) -> Boolean = { false } ) : OnTouchListener { private var touchedView: View? = null diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/drawable/UiViewLayeredForeground.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/drawable/UiViewLayeredForeground.kt similarity index 87% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/drawable/UiViewLayeredForeground.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/drawable/UiViewLayeredForeground.kt index 181d2573f3..c96f3f164d 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/drawable/UiViewLayeredForeground.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/drawable/UiViewLayeredForeground.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.drawable +package org.appdevforall.codeonthego.uidesigner.drawable import android.content.Context import android.graphics.drawable.Drawable import android.graphics.drawable.LayerDrawable -import com.itsaky.androidide.uidesigner.utils.bgDesignerView -import com.itsaky.androidide.utils.dpToPx +import org.appdevforall.codeonthego.uidesigner.utils.bgDesignerView +import org.appdevforall.codeonthego.utils.dpToPx /** * Marker class to be able to differentiate between normal foregrounds and already layered diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/AddAttrFragment.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/AddAttrFragment.kt similarity index 88% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/AddAttrFragment.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/AddAttrFragment.kt index 9c219e0a0d..6f37c2d9ab 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/AddAttrFragment.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/AddAttrFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.fragments +package org.appdevforall.codeonthego.uidesigner.fragments import android.os.Bundle import android.view.LayoutInflater @@ -24,15 +24,15 @@ import android.view.ViewGroup import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels import androidx.navigation.fragment.findNavController -import com.itsaky.androidide.inflater.utils.newAttribute -import com.itsaky.androidide.inflater.viewAdapter +import org.appdevforall.codeonthego.inflater.utils.newAttribute +import org.appdevforall.codeonthego.inflater.viewAdapter import com.itsaky.androidide.uidesigner.R import com.itsaky.androidide.uidesigner.R.string -import com.itsaky.androidide.uidesigner.adapters.AddAttrListAdapter +import org.appdevforall.codeonthego.uidesigner.adapters.AddAttrListAdapter import com.itsaky.androidide.uidesigner.databinding.LayoutAddAttrBinding import com.itsaky.androidide.uidesigner.databinding.LayoutViewInfoHeaderBinding -import com.itsaky.androidide.uidesigner.models.UiAttribute -import com.itsaky.androidide.uidesigner.viewmodel.WorkspaceViewModel +import org.appdevforall.codeonthego.uidesigner.models.UiAttribute +import org.appdevforall.codeonthego.uidesigner.viewmodel.WorkspaceViewModel /** * A fragment that shows a list of attributes that can be added to the selected attribute in the UI diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/AttrValueEditorFragment.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/AttrValueEditorFragment.kt similarity index 93% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/AttrValueEditorFragment.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/AttrValueEditorFragment.kt index a59116a24f..a16bdb0f59 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/AttrValueEditorFragment.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/AttrValueEditorFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.fragments +package org.appdevforall.codeonthego.uidesigner.fragments import android.annotation.SuppressLint import android.os.Bundle @@ -26,11 +26,11 @@ import android.view.ViewGroup import android.widget.ArrayAdapter import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels -import com.itsaky.androidide.inflater.internal.ViewImpl +import org.appdevforall.codeonthego.inflater.internal.ViewImpl import com.itsaky.androidide.uidesigner.databinding.LayoutAttrValueEditorBinding import com.itsaky.androidide.uidesigner.databinding.LayoutViewInfoHeaderBinding -import com.itsaky.androidide.uidesigner.utils.ValueCompletionProvider -import com.itsaky.androidide.uidesigner.viewmodel.WorkspaceViewModel +import org.appdevforall.codeonthego.uidesigner.utils.ValueCompletionProvider +import org.appdevforall.codeonthego.uidesigner.viewmodel.WorkspaceViewModel /** * Fragment to allow the user to edit the value of the selected fragment. diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/DesignerWorkspaceFragment.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/DesignerWorkspaceFragment.kt similarity index 81% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/DesignerWorkspaceFragment.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/DesignerWorkspaceFragment.kt index 9501f5f936..83c2722089 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/DesignerWorkspaceFragment.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/DesignerWorkspaceFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.fragments +package org.appdevforall.codeonthego.uidesigner.fragments import android.os.Bundle import android.view.LayoutInflater @@ -24,27 +24,27 @@ import android.view.ViewConfiguration.get import android.view.ViewGroup import android.widget.LinearLayout import androidx.fragment.app.viewModels -import com.itsaky.androidide.fragments.BaseFragment -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.internal.LayoutFile -import com.itsaky.androidide.inflater.utils.endParse -import com.itsaky.androidide.inflater.utils.startParse +import org.appdevforall.codeonthego.fragments.BaseFragment +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.internal.LayoutFile +import org.appdevforall.codeonthego.inflater.utils.endParse +import org.appdevforall.codeonthego.inflater.utils.startParse import com.itsaky.androidide.uidesigner.R -import com.itsaky.androidide.uidesigner.UIDesignerActivity +import org.appdevforall.codeonthego.uidesigner.UIDesignerActivity import com.itsaky.androidide.uidesigner.databinding.FragmentDesignerWorkspaceBinding -import com.itsaky.androidide.uidesigner.drag.WidgetDragListener -import com.itsaky.androidide.uidesigner.drag.WidgetTouchListener -import com.itsaky.androidide.uidesigner.drawable.UiViewLayeredForeground -import com.itsaky.androidide.uidesigner.models.CommonUiView -import com.itsaky.androidide.uidesigner.models.PlaceholderView -import com.itsaky.androidide.uidesigner.models.RootWorkspaceView -import com.itsaky.androidide.uidesigner.models.UiViewGroup -import com.itsaky.androidide.uidesigner.undo.UndoManager -import com.itsaky.androidide.uidesigner.utils.UiLayoutInflater -import com.itsaky.androidide.uidesigner.utils.bgDesignerView -import com.itsaky.androidide.uidesigner.utils.layeredForeground -import com.itsaky.androidide.uidesigner.viewmodel.WorkspaceViewModel -import com.itsaky.androidide.utils.dpToPx +import org.appdevforall.codeonthego.uidesigner.drag.WidgetDragListener +import org.appdevforall.codeonthego.uidesigner.drag.WidgetTouchListener +import org.appdevforall.codeonthego.uidesigner.drawable.UiViewLayeredForeground +import org.appdevforall.codeonthego.uidesigner.models.CommonUiView +import org.appdevforall.codeonthego.uidesigner.models.PlaceholderView +import org.appdevforall.codeonthego.uidesigner.models.RootWorkspaceView +import org.appdevforall.codeonthego.uidesigner.models.UiViewGroup +import org.appdevforall.codeonthego.uidesigner.undo.UndoManager +import org.appdevforall.codeonthego.uidesigner.utils.UiLayoutInflater +import org.appdevforall.codeonthego.uidesigner.utils.bgDesignerView +import org.appdevforall.codeonthego.uidesigner.utils.layeredForeground +import org.appdevforall.codeonthego.uidesigner.viewmodel.WorkspaceViewModel +import org.appdevforall.codeonthego.utils.dpToPx import org.slf4j.LoggerFactory import java.io.File diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/ViewInfoFragment.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/ViewInfoFragment.kt similarity index 88% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/ViewInfoFragment.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/ViewInfoFragment.kt index cc2b49ef1f..a85f3f313e 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/ViewInfoFragment.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/ViewInfoFragment.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.fragments +package org.appdevforall.codeonthego.uidesigner.fragments import android.os.Bundle import android.view.LayoutInflater @@ -25,15 +25,15 @@ import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels import androidx.navigation.fragment.findNavController import com.google.android.material.bottomsheet.BottomSheetDialogFragment -import com.itsaky.androidide.inflater.internal.NamespaceImpl -import com.itsaky.androidide.inflater.internal.ViewImpl -import com.itsaky.androidide.inflater.utils.newAttribute +import org.appdevforall.codeonthego.inflater.internal.NamespaceImpl +import org.appdevforall.codeonthego.inflater.internal.ViewImpl +import org.appdevforall.codeonthego.inflater.utils.newAttribute import com.itsaky.androidide.uidesigner.R -import com.itsaky.androidide.uidesigner.adapters.ViewAttrListAdapter +import org.appdevforall.codeonthego.uidesigner.adapters.ViewAttrListAdapter import com.itsaky.androidide.uidesigner.databinding.LayoutViewInfoBinding import com.itsaky.androidide.uidesigner.databinding.LayoutViewInfoHeaderBinding -import com.itsaky.androidide.uidesigner.models.UiAttribute -import com.itsaky.androidide.uidesigner.viewmodel.WorkspaceViewModel +import org.appdevforall.codeonthego.uidesigner.models.UiAttribute +import org.appdevforall.codeonthego.uidesigner.viewmodel.WorkspaceViewModel /** * A [BottomSheetDialogFragment] which shows information about a clicked view. diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/ViewInfoSheet.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/ViewInfoSheet.kt similarity index 96% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/ViewInfoSheet.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/ViewInfoSheet.kt index c2ba132a5b..97564606fe 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/ViewInfoSheet.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/ViewInfoSheet.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.fragments +package org.appdevforall.codeonthego.uidesigner.fragments import android.content.DialogInterface import android.os.Bundle @@ -31,7 +31,7 @@ import androidx.navigation.fragment.NavHostFragment import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.itsaky.androidide.uidesigner.R import com.itsaky.androidide.uidesigner.databinding.LayoutViewInfoSheetBinding -import com.itsaky.androidide.uidesigner.viewmodel.WorkspaceViewModel +import org.appdevforall.codeonthego.uidesigner.viewmodel.WorkspaceViewModel /** @author Akash Yadav */ class ViewInfoSheet : BottomSheetDialogFragment() { diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/WidgetsListFragment.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/WidgetsListFragment.kt similarity index 84% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/WidgetsListFragment.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/WidgetsListFragment.kt index e9afdb92d5..fc619ea2ef 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/WidgetsListFragment.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/WidgetsListFragment.kt @@ -15,18 +15,18 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.fragments +package org.appdevforall.codeonthego.uidesigner.fragments import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.fragment.app.viewModels -import com.itsaky.androidide.fragments.BaseFragment -import com.itsaky.androidide.uidesigner.adapters.WidgetsCategoryAdapter +import org.appdevforall.codeonthego.fragments.BaseFragment +import org.appdevforall.codeonthego.uidesigner.adapters.WidgetsCategoryAdapter import com.itsaky.androidide.uidesigner.databinding.FragmentUiWidgetsBinding -import com.itsaky.androidide.uidesigner.utils.Widgets -import com.itsaky.androidide.uidesigner.viewmodel.WorkspaceViewModel +import org.appdevforall.codeonthego.uidesigner.utils.Widgets +import org.appdevforall.codeonthego.uidesigner.viewmodel.WorkspaceViewModel /** * A fragment that shows the list of widgets available to use in the UI designer. diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/WorkspaceLayoutInflationHandler.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/WorkspaceLayoutInflationHandler.kt similarity index 77% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/WorkspaceLayoutInflationHandler.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/WorkspaceLayoutInflationHandler.kt index 3494e22480..efcc1c8bfa 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/WorkspaceLayoutInflationHandler.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/WorkspaceLayoutInflationHandler.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.fragments +package org.appdevforall.codeonthego.uidesigner.fragments -import com.itsaky.androidide.inflater.events.IInflateEventsListener -import com.itsaky.androidide.inflater.events.IInflationEvent -import com.itsaky.androidide.inflater.events.InflationFinishEvent -import com.itsaky.androidide.inflater.events.InflationStartEvent -import com.itsaky.androidide.inflater.events.OnInflateViewEvent -import com.itsaky.androidide.inflater.internal.ViewImpl +import org.appdevforall.codeonthego.inflater.events.IInflateEventsListener +import org.appdevforall.codeonthego.inflater.events.IInflationEvent +import org.appdevforall.codeonthego.inflater.events.InflationFinishEvent +import org.appdevforall.codeonthego.inflater.events.InflationStartEvent +import org.appdevforall.codeonthego.inflater.events.OnInflateViewEvent +import org.appdevforall.codeonthego.inflater.internal.ViewImpl /** * Handles layout inflation events in [DesignerWorkspaceFragment]. diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/WorkspaceViewAttrHandler.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/WorkspaceViewAttrHandler.kt similarity index 62% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/WorkspaceViewAttrHandler.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/WorkspaceViewAttrHandler.kt index 5b85008007..0d6a480d9c 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/WorkspaceViewAttrHandler.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/WorkspaceViewAttrHandler.kt @@ -15,19 +15,19 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.fragments +package org.appdevforall.codeonthego.uidesigner.fragments -import com.itsaky.androidide.uidesigner.models.UiAttribute -import com.itsaky.androidide.uidesigner.undo.AttrAddedAction -import com.itsaky.androidide.uidesigner.undo.AttrRemovedAction -import com.itsaky.androidide.uidesigner.undo.AttrUpdatedAction +import org.appdevforall.codeonthego.uidesigner.models.UiAttribute +import org.appdevforall.codeonthego.uidesigner.undo.AttrAddedAction +import org.appdevforall.codeonthego.uidesigner.undo.AttrRemovedAction +import org.appdevforall.codeonthego.uidesigner.undo.AttrUpdatedAction /** * Handles view attribute changes in [DesignerWorkspaceFragment]. * * @author Akash Yadav */ -internal class WorkspaceViewAttrHandler : com.itsaky.androidide.inflater.IView.AttributeChangeListener { +internal class WorkspaceViewAttrHandler : org.appdevforall.codeonthego.inflater.IView.AttributeChangeListener { private var fragment: DesignerWorkspaceFragment? = null @@ -39,17 +39,17 @@ internal class WorkspaceViewAttrHandler : com.itsaky.androidide.inflater.IView.A this.fragment = null } - override fun onAttributeAdded(view: com.itsaky.androidide.inflater.IView, attribute: com.itsaky.androidide.inflater.IAttribute) { + override fun onAttributeAdded(view: org.appdevforall.codeonthego.inflater.IView, attribute: org.appdevforall.codeonthego.inflater.IAttribute) { val frag = this.fragment ?: return frag.undoManager.push(AttrAddedAction(view = view, attr = attribute as UiAttribute)) } - override fun onAttributeRemoved(view: com.itsaky.androidide.inflater.IView, attribute: com.itsaky.androidide.inflater.IAttribute) { + override fun onAttributeRemoved(view: org.appdevforall.codeonthego.inflater.IView, attribute: org.appdevforall.codeonthego.inflater.IAttribute) { val frag = this.fragment ?: return frag.undoManager.push(AttrRemovedAction(view = view, attr = attribute as UiAttribute)) } - override fun onAttributeUpdated(view: com.itsaky.androidide.inflater.IView, attribute: com.itsaky.androidide.inflater.IAttribute, oldValue: String) { + override fun onAttributeUpdated(view: org.appdevforall.codeonthego.inflater.IView, attribute: org.appdevforall.codeonthego.inflater.IAttribute, oldValue: String) { val frag = this.fragment ?: return frag.undoManager.push( AttrUpdatedAction( diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/WorkspaceViewHierarchyHandler.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/WorkspaceViewHierarchyHandler.kt similarity index 78% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/WorkspaceViewHierarchyHandler.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/WorkspaceViewHierarchyHandler.kt index f9c368805a..db4c271415 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/fragments/WorkspaceViewHierarchyHandler.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/fragments/WorkspaceViewHierarchyHandler.kt @@ -15,18 +15,18 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.fragments +package org.appdevforall.codeonthego.uidesigner.fragments import androidx.transition.ChangeBounds import androidx.transition.TransitionManager -import com.itsaky.androidide.inflater.IViewGroup -import com.itsaky.androidide.inflater.viewGroup +import org.appdevforall.codeonthego.inflater.IViewGroup +import org.appdevforall.codeonthego.inflater.viewGroup import com.itsaky.androidide.uidesigner.R -import com.itsaky.androidide.uidesigner.models.PlaceholderView -import com.itsaky.androidide.uidesigner.undo.ViewAddedAction -import com.itsaky.androidide.uidesigner.undo.ViewMovedAction -import com.itsaky.androidide.uidesigner.undo.ViewRemovedAction -import com.itsaky.androidide.uidesigner.viewmodel.WorkspaceViewModel +import org.appdevforall.codeonthego.uidesigner.models.PlaceholderView +import org.appdevforall.codeonthego.uidesigner.undo.ViewAddedAction +import org.appdevforall.codeonthego.uidesigner.undo.ViewMovedAction +import org.appdevforall.codeonthego.uidesigner.undo.ViewRemovedAction +import org.appdevforall.codeonthego.uidesigner.viewmodel.WorkspaceViewModel /** * Handles hierarchy changes in [DesignerWorkspaceFragment]. @@ -53,7 +53,7 @@ internal class WorkspaceViewHierarchyHandler : DesignerWorkspaceFragment.HIERARCHY_CHANGE_TRANSITION_DURATION)) } - private fun pushAction(view: com.itsaky.androidide.inflater.IView, + private fun pushAction(view: org.appdevforall.codeonthego.inflater.IView, parent: IViewGroup, index: Int, added: Boolean ) { val frag = this.fragment ?: return @@ -80,21 +80,21 @@ internal class WorkspaceViewHierarchyHandler : } override fun beforeViewAdded(group: IViewGroup, - view: com.itsaky.androidide.inflater.IView, + view: org.appdevforall.codeonthego.inflater.IView, index: Int ) { animateLayoutChange() } override fun beforeViewRemoved(group: IViewGroup, - view: com.itsaky.androidide.inflater.IView, + view: org.appdevforall.codeonthego.inflater.IView, index: Int ) { animateLayoutChange() } override fun onViewAdded(group: IViewGroup, - view: com.itsaky.androidide.inflater.IView, + view: org.appdevforall.codeonthego.inflater.IView, index: Int ) { val frag = this.fragment ?: return @@ -112,7 +112,7 @@ internal class WorkspaceViewHierarchyHandler : } override fun onViewRemoved(group: IViewGroup, - view: com.itsaky.androidide.inflater.IView, + view: org.appdevforall.codeonthego.inflater.IView, index: Int ) { val frag = this.fragment ?: return diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/CommonUiView.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/CommonUiView.kt similarity index 94% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/CommonUiView.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/CommonUiView.kt index b7848855f1..82ae3da684 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/CommonUiView.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/CommonUiView.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.models +package org.appdevforall.codeonthego.uidesigner.models /** * Extension properties for [UiView] and [UiViewGroup] diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/CommonUiViewImpl.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/CommonUiViewImpl.kt similarity index 94% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/CommonUiViewImpl.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/CommonUiViewImpl.kt index fd51e83a14..0f7661b0b3 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/CommonUiViewImpl.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/CommonUiViewImpl.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.models +package org.appdevforall.codeonthego.uidesigner.models /** * Implementation of [CommonUiView]. diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/PlaceholderView.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/PlaceholderView.kt similarity index 89% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/PlaceholderView.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/PlaceholderView.kt index 1a423e365c..dce5c4e94f 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/PlaceholderView.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/PlaceholderView.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.models +package org.appdevforall.codeonthego.uidesigner.models import android.view.View -import com.itsaky.androidide.inflater.internal.LayoutFile +import org.appdevforall.codeonthego.inflater.internal.LayoutFile import java.io.File /** diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/RootWorkspaceView.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/RootWorkspaceView.kt similarity index 86% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/RootWorkspaceView.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/RootWorkspaceView.kt index b3bd64b4e4..9c2308c8ff 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/RootWorkspaceView.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/RootWorkspaceView.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.models +package org.appdevforall.codeonthego.uidesigner.models import android.view.ViewGroup -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.internal.LayoutFile +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.internal.LayoutFile /** * [UiViewGroup] implementation that is used for the root workspace view. diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/UiAttribute.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/UiAttribute.kt similarity index 85% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/UiAttribute.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/UiAttribute.kt index 8a2b798385..86e5275816 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/UiAttribute.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/UiAttribute.kt @@ -15,17 +15,17 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.models +package org.appdevforall.codeonthego.uidesigner.models import android.os.Parcel import android.os.Parcelable import android.os.Parcelable.Creator -import com.itsaky.androidide.inflater.IAttribute -import com.itsaky.androidide.inflater.INamespace -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.internal.AttributeImpl -import com.itsaky.androidide.inflater.internal.NamespaceImpl -import com.itsaky.androidide.inflater.viewAdapter +import org.appdevforall.codeonthego.inflater.IAttribute +import org.appdevforall.codeonthego.inflater.INamespace +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.internal.AttributeImpl +import org.appdevforall.codeonthego.inflater.internal.NamespaceImpl +import org.appdevforall.codeonthego.inflater.viewAdapter /** * UI Designer specific implementation of [IAttribute]. diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/UiView.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/UiView.kt similarity index 80% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/UiView.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/UiView.kt index 2c7d4a4b17..469d3dbd50 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/UiView.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/UiView.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.models +package org.appdevforall.codeonthego.uidesigner.models import android.view.View -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.internal.LayoutFile -import com.itsaky.androidide.inflater.internal.ViewImpl +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.internal.LayoutFile +import org.appdevforall.codeonthego.inflater.internal.ViewImpl /** * Extension of [IView] for the UI Designer. diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/UiViewGroup.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/UiViewGroup.kt similarity index 84% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/UiViewGroup.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/UiViewGroup.kt index cf504b73a6..09a1564346 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/UiViewGroup.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/UiViewGroup.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.models +package org.appdevforall.codeonthego.uidesigner.models import android.view.ViewGroup -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.IViewGroupAdapter -import com.itsaky.androidide.inflater.internal.LayoutFile -import com.itsaky.androidide.inflater.internal.ViewGroupImpl -import com.itsaky.androidide.inflater.viewAdapter +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.IViewGroupAdapter +import org.appdevforall.codeonthego.inflater.internal.LayoutFile +import org.appdevforall.codeonthego.inflater.internal.ViewGroupImpl +import org.appdevforall.codeonthego.inflater.viewAdapter /** * Extension of [IView] for the UI Designer. diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/UiWidgetCategory.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/UiWidgetCategory.kt similarity index 88% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/UiWidgetCategory.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/UiWidgetCategory.kt index 2df8029440..9079d8f398 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/models/UiWidgetCategory.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/models/UiWidgetCategory.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.models +package org.appdevforall.codeonthego.uidesigner.models import androidx.annotation.StringRes -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.models.UiWidget data class UiWidgetCategory(@StringRes val label: Int, var widgets: List = emptyList(), var isExpanded: Boolean = false) \ No newline at end of file diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/AttrAction.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/AttrAction.kt similarity index 78% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/AttrAction.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/AttrAction.kt index 80f5ec58f1..e6159a12f0 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/AttrAction.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/AttrAction.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.undo +package org.appdevforall.codeonthego.uidesigner.undo -import com.itsaky.androidide.uidesigner.models.UiAttribute +import org.appdevforall.codeonthego.uidesigner.models.UiAttribute /** * [UndoManager] action related to view attributes. * * @author Akash Yadav */ -internal abstract class AttrAction(protected val view: com.itsaky.androidide.inflater.IView, protected val attr: UiAttribute) : +internal abstract class AttrAction(protected val view: org.appdevforall.codeonthego.inflater.IView, protected val attr: UiAttribute) : IUiAction { override fun toString(): String { diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/AttrAddedAction.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/AttrAddedAction.kt similarity index 78% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/AttrAddedAction.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/AttrAddedAction.kt index 8ef22db754..bfcbc12e65 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/AttrAddedAction.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/AttrAddedAction.kt @@ -15,17 +15,17 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.undo +package org.appdevforall.codeonthego.uidesigner.undo -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.uidesigner.models.UiAttribute +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.uidesigner.models.UiAttribute /** * Represents the action when the user adds an attribute to an [IView]. * * @author Akash Yadav */ -internal class AttrAddedAction(view: com.itsaky.androidide.inflater.IView, attr: UiAttribute) : +internal class AttrAddedAction(view: org.appdevforall.codeonthego.inflater.IView, attr: UiAttribute) : AttrAction(view, attr.copyAttr(view = view) as UiAttribute) { override fun undo() { diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/AttrRemovedAction.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/AttrRemovedAction.kt similarity index 78% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/AttrRemovedAction.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/AttrRemovedAction.kt index 083b8c96e0..94cb6d2271 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/AttrRemovedAction.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/AttrRemovedAction.kt @@ -15,17 +15,17 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.undo +package org.appdevforall.codeonthego.uidesigner.undo -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.uidesigner.models.UiAttribute +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.uidesigner.models.UiAttribute /** * Represents the action when the user removes an attribute from an [IView]. * * @author Akash Yadav */ -internal class AttrRemovedAction(view: com.itsaky.androidide.inflater.IView, attr: UiAttribute) : +internal class AttrRemovedAction(view: org.appdevforall.codeonthego.inflater.IView, attr: UiAttribute) : AttrAction(view, attr.copyAttr(view = view) as UiAttribute) { override fun undo() { diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/AttrUpdatedAction.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/AttrUpdatedAction.kt similarity index 78% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/AttrUpdatedAction.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/AttrUpdatedAction.kt index 954e5f2137..a2971107a8 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/AttrUpdatedAction.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/AttrUpdatedAction.kt @@ -15,17 +15,17 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.undo +package org.appdevforall.codeonthego.uidesigner.undo -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.uidesigner.models.UiAttribute +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.uidesigner.models.UiAttribute /** * Represents the action when the user updates an attribute in an [IView]. * * @author Akash Yadav */ -internal class AttrUpdatedAction(view: com.itsaky.androidide.inflater.IView, attr: UiAttribute, private val oldValue: String) : +internal class AttrUpdatedAction(view: org.appdevforall.codeonthego.inflater.IView, attr: UiAttribute, private val oldValue: String) : AttrAction(view, attr) { override fun undo() { diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/IUiAction.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/IUiAction.kt similarity index 94% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/IUiAction.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/IUiAction.kt index 98f92494eb..6793f632ab 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/IUiAction.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/IUiAction.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.undo +package org.appdevforall.codeonthego.uidesigner.undo /** * An action performed in the UI Designer. diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/UndoManager.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/UndoManager.kt similarity index 97% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/UndoManager.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/UndoManager.kt index 87ee516238..ec398917a5 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/UndoManager.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/UndoManager.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.undo +package org.appdevforall.codeonthego.uidesigner.undo /** * Handles undo and redo actions in the UI designer. diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/ViewAction.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/ViewAction.kt similarity index 85% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/ViewAction.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/ViewAction.kt index d179df8308..8a0dab424b 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/ViewAction.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/ViewAction.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.undo +package org.appdevforall.codeonthego.uidesigner.undo /** * An action related to a view. @@ -28,7 +28,7 @@ package com.itsaky.androidide.uidesigner.undo abstract class ViewAction @JvmOverloads constructor( - val child: com.itsaky.androidide.inflater.IView, - val parent: com.itsaky.androidide.inflater.IViewGroup, + val child: org.appdevforall.codeonthego.inflater.IView, + val parent: org.appdevforall.codeonthego.inflater.IViewGroup, var index: Int = parent.indexOfChild(child) ) : IUiAction diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/ViewAddedAction.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/ViewAddedAction.kt similarity index 82% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/ViewAddedAction.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/ViewAddedAction.kt index a0d0a3b55d..41130c9aff 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/ViewAddedAction.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/ViewAddedAction.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.undo +package org.appdevforall.codeonthego.uidesigner.undo /** * Represents the action when the user adds a view to a view group. @@ -24,7 +24,7 @@ package com.itsaky.androidide.uidesigner.undo */ class ViewAddedAction @JvmOverloads -constructor(view: com.itsaky.androidide.inflater.IView, parent: com.itsaky.androidide.inflater.IViewGroup, index: Int = parent.indexOfChild(view)) : +constructor(view: org.appdevforall.codeonthego.inflater.IView, parent: org.appdevforall.codeonthego.inflater.IViewGroup, index: Int = parent.indexOfChild(view)) : ViewAction(view, parent, index) { override fun undo() { diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/ViewMovedAction.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/ViewMovedAction.kt similarity index 81% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/ViewMovedAction.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/ViewMovedAction.kt index a282401d26..1cdc70b090 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/ViewMovedAction.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/ViewMovedAction.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.undo +package org.appdevforall.codeonthego.uidesigner.undo /** * Represents the action when the user moves a view from one view group to another. @@ -23,9 +23,9 @@ package com.itsaky.androidide.uidesigner.undo * @author Akash Yadav */ class ViewMovedAction( - private val child: com.itsaky.androidide.inflater.IView, - private val fromParent: com.itsaky.androidide.inflater.IViewGroup, - private val toParent: com.itsaky.androidide.inflater.IViewGroup, + private val child: org.appdevforall.codeonthego.inflater.IView, + private val fromParent: org.appdevforall.codeonthego.inflater.IViewGroup, + private val toParent: org.appdevforall.codeonthego.inflater.IViewGroup, private val fromIndex: Int, private val toIndex: Int ) : IUiAction { diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/ViewRemovedAction.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/ViewRemovedAction.kt similarity index 83% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/ViewRemovedAction.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/ViewRemovedAction.kt index 21e5ba4edb..bf0c04628e 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/ViewRemovedAction.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/ViewRemovedAction.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.undo +package org.appdevforall.codeonthego.uidesigner.undo /** * Represents the action when the user removes a view from a view group. * * @author Akash Yadav */ -class ViewRemovedAction(child: com.itsaky.androidide.inflater.IView, parent: com.itsaky.androidide.inflater.IViewGroup, index: Int) : +class ViewRemovedAction(child: org.appdevforall.codeonthego.inflater.IView, parent: org.appdevforall.codeonthego.inflater.IViewGroup, index: Int) : ViewAction(child, parent, index) { override fun undo() { diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/undoUtils.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/undoUtils.kt similarity index 84% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/undoUtils.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/undoUtils.kt index 636be9a3fe..fab47eac4a 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/undo/undoUtils.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/undo/undoUtils.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.undo +package org.appdevforall.codeonthego.uidesigner.undo import kotlin.math.max import kotlin.math.min -internal fun com.itsaky.androidide.inflater.IViewGroup.validateIndex(index: Int) : Int { +internal fun org.appdevforall.codeonthego.inflater.IViewGroup.validateIndex(index: Int) : Int { return min(max(0, index), childCount) } \ No newline at end of file diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/UiInflaterComponentFactory.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/UiInflaterComponentFactory.kt similarity index 65% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/UiInflaterComponentFactory.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/UiInflaterComponentFactory.kt index d9235e8aba..866c5e2d20 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/UiInflaterComponentFactory.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/UiInflaterComponentFactory.kt @@ -15,26 +15,26 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.utils +package org.appdevforall.codeonthego.uidesigner.utils import android.view.View import android.view.ViewGroup -import com.itsaky.androidide.inflater.INamespace -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.internal.LayoutFile -import com.itsaky.androidide.inflater.internal.NamespaceImpl -import com.itsaky.androidide.uidesigner.models.UiAttribute -import com.itsaky.androidide.uidesigner.models.UiView -import com.itsaky.androidide.uidesigner.models.UiViewGroup +import org.appdevforall.codeonthego.inflater.INamespace +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.internal.LayoutFile +import org.appdevforall.codeonthego.inflater.internal.NamespaceImpl +import org.appdevforall.codeonthego.uidesigner.models.UiAttribute +import org.appdevforall.codeonthego.uidesigner.models.UiView +import org.appdevforall.codeonthego.uidesigner.models.UiViewGroup /** * Creates layout inflater components for UI Designer. * * @author Akash Yadav */ -open class UiInflaterComponentFactory : com.itsaky.androidide.inflater.IComponentFactory { +open class UiInflaterComponentFactory : org.appdevforall.codeonthego.inflater.IComponentFactory { - override fun createView(file: LayoutFile, name: String, view: View): com.itsaky.androidide.inflater.IView { + override fun createView(file: LayoutFile, name: String, view: View): org.appdevforall.codeonthego.inflater.IView { if (view is ViewGroup) { return UiViewGroup(file, name, view) } @@ -46,7 +46,7 @@ open class UiInflaterComponentFactory : com.itsaky.androidide.inflater.IComponen namespace: INamespace?, name: String, value: String - ): com.itsaky.androidide.inflater.IAttribute { + ): org.appdevforall.codeonthego.inflater.IAttribute { return UiAttribute(namespace = namespace as NamespaceImpl?, name = name, value = value).apply { isRequired = UiAttribute.isRequired(view, this) } diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/UiLayoutInflater.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/UiLayoutInflater.kt similarity index 80% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/UiLayoutInflater.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/UiLayoutInflater.kt index a0d9183d8e..a5d0f62b19 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/UiLayoutInflater.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/UiLayoutInflater.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.utils +package org.appdevforall.codeonthego.uidesigner.utils -import com.itsaky.androidide.inflater.ILayoutInflater -import com.itsaky.androidide.inflater.internal.LayoutInflaterImpl -import com.itsaky.androidide.lookup.Lookup +import org.appdevforall.codeonthego.inflater.ILayoutInflater +import org.appdevforall.codeonthego.inflater.internal.LayoutInflaterImpl +import org.appdevforall.codeonthego.lookup.Lookup /** * Layout inflater implmentation for the UI designer. diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/ValueCompletionProvider.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/ValueCompletionProvider.kt similarity index 79% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/ValueCompletionProvider.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/ValueCompletionProvider.kt index 3747ae9e6f..5d48db4393 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/ValueCompletionProvider.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/ValueCompletionProvider.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.utils +package org.appdevforall.codeonthego.uidesigner.utils import android.text.Editable -import com.itsaky.androidide.inflater.internal.ViewImpl -import com.itsaky.androidide.lsp.util.setupLookupForCompletion -import com.itsaky.androidide.lsp.xml.models.XMLServerSettings -import com.itsaky.androidide.lsp.xml.providers.XmlCompletionProvider -import com.itsaky.androidide.lsp.xml.providers.completion.AttrValueCompletionProvider -import com.itsaky.androidide.tasks.runOnUiThread -import com.itsaky.androidide.utils.SingleTextWatcher +import org.appdevforall.codeonthego.inflater.internal.ViewImpl +import org.appdevforall.codeonthego.lsp.util.setupLookupForCompletion +import org.appdevforall.codeonthego.lsp.xml.models.XMLServerSettings +import org.appdevforall.codeonthego.lsp.xml.providers.XmlCompletionProvider +import org.appdevforall.codeonthego.lsp.xml.providers.completion.AttrValueCompletionProvider +import org.appdevforall.codeonthego.tasks.runOnUiThread +import org.appdevforall.codeonthego.utils.SingleTextWatcher import org.slf4j.LoggerFactory import java.io.File @@ -36,7 +36,7 @@ import java.io.File internal class ValueCompletionProvider( private val file: File, private val view: ViewImpl, - private val attribute: com.itsaky.androidide.inflater.IAttribute, + private val attribute: org.appdevforall.codeonthego.inflater.IAttribute, private val onComplete: (List) -> Unit, ) : SingleTextWatcher() { private val completionProvider = @@ -68,7 +68,7 @@ internal class ValueCompletionProvider( private val onComplete: (List) -> Unit, ) : Thread("AttributeValueCompletionThread") { var prefix: String = "" - var attribute: com.itsaky.androidide.inflater.IAttribute? = null + var attribute: org.appdevforall.codeonthego.inflater.IAttribute? = null companion object { private val log = LoggerFactory.getLogger(CompletionThread::class.java) diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/ViewToXml.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/ViewToXml.kt similarity index 86% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/ViewToXml.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/ViewToXml.kt index aa8e0a772c..af887e5283 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/ViewToXml.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/ViewToXml.kt @@ -15,18 +15,18 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.utils +package org.appdevforall.codeonthego.uidesigner.utils import android.content.Context -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.IViewGroup -import com.itsaky.androidide.inflater.internal.ViewGroupImpl -import com.itsaky.androidide.inflater.internal.ViewImpl -import com.itsaky.androidide.lsp.xml.utils.XMLBuilder -import com.itsaky.androidide.tasks.executeAsyncProvideError -import com.itsaky.androidide.tasks.runOnUiThread +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.IViewGroup +import org.appdevforall.codeonthego.inflater.internal.ViewGroupImpl +import org.appdevforall.codeonthego.inflater.internal.ViewImpl +import org.appdevforall.codeonthego.lsp.xml.utils.XMLBuilder +import org.appdevforall.codeonthego.tasks.executeAsyncProvideError +import org.appdevforall.codeonthego.tasks.runOnUiThread import com.itsaky.androidide.uidesigner.R -import com.itsaky.androidide.utils.DialogUtils +import org.appdevforall.codeonthego.utils.DialogUtils import org.slf4j.LoggerFactory import java.util.concurrent.CompletableFuture import java.util.concurrent.CompletionException diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/Widgets.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/Widgets.kt similarity index 88% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/Widgets.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/Widgets.kt index b79eb8d27e..ac0d4d290e 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/Widgets.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/Widgets.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.utils +package org.appdevforall.codeonthego.uidesigner.utils import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.IViewAdapterIndex -import com.itsaky.androidide.inflater.internal.utils.simpleName +import org.appdevforall.codeonthego.inflater.IViewAdapterIndex +import org.appdevforall.codeonthego.inflater.internal.utils.simpleName import com.itsaky.androidide.uidesigner.R.string -import com.itsaky.androidide.uidesigner.models.UiWidgetCategory +import org.appdevforall.codeonthego.uidesigner.models.UiWidgetCategory internal object Widgets { diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/WorkspaceHierarchyChangeListener.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/WorkspaceHierarchyChangeListener.kt similarity index 76% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/WorkspaceHierarchyChangeListener.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/WorkspaceHierarchyChangeListener.kt index 5260f66d59..aaf8b1c5f2 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/WorkspaceHierarchyChangeListener.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/WorkspaceHierarchyChangeListener.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.utils +package org.appdevforall.codeonthego.uidesigner.utils -import com.itsaky.androidide.uidesigner.models.UiViewGroup -import com.itsaky.androidide.uidesigner.viewmodel.WorkspaceViewModel +import org.appdevforall.codeonthego.uidesigner.models.UiViewGroup +import org.appdevforall.codeonthego.uidesigner.viewmodel.WorkspaceViewModel /** * Handles hierarchy changes in the UI Designer's workspace. @@ -28,7 +28,7 @@ import com.itsaky.androidide.uidesigner.viewmodel.WorkspaceViewModel internal class WorkspaceHierarchyChangeListener( private val viewModel: WorkspaceViewModel, private val workspaceView: UiViewGroup -) : com.itsaky.androidide.inflater.IViewGroup.SingleOnHierarchyChangeListener() { +) : org.appdevforall.codeonthego.inflater.IViewGroup.SingleOnHierarchyChangeListener() { } diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/designerUtils.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/designerUtils.kt similarity index 87% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/designerUtils.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/designerUtils.kt index 89589796a4..a1b1eb3e35 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/utils/designerUtils.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/utils/designerUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.utils +package org.appdevforall.codeonthego.uidesigner.utils import android.content.Context import android.graphics.PorterDuff.Mode.SRC_ATOP @@ -23,8 +23,8 @@ import android.graphics.PorterDuffColorFilter import android.graphics.drawable.Drawable import androidx.core.content.ContextCompat.getDrawable import com.itsaky.androidide.uidesigner.R -import com.itsaky.androidide.uidesigner.drawable.UiViewLayeredForeground -import com.itsaky.androidide.utils.resolveAttr +import org.appdevforall.codeonthego.uidesigner.drawable.UiViewLayeredForeground +import org.appdevforall.codeonthego.utils.resolveAttr fun layeredForeground(context: Context, drawable: Drawable): Drawable { return UiViewLayeredForeground(context, drawable) diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/viewmodel/WorkspaceViewModel.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/viewmodel/WorkspaceViewModel.kt similarity index 91% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/viewmodel/WorkspaceViewModel.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/viewmodel/WorkspaceViewModel.kt index fe7d8257ea..c306dc2648 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/viewmodel/WorkspaceViewModel.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/viewmodel/WorkspaceViewModel.kt @@ -15,19 +15,19 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.viewmodel +package org.appdevforall.codeonthego.uidesigner.viewmodel import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel -import com.itsaky.androidide.uidesigner.models.UiAttribute -import com.itsaky.androidide.uidesigner.undo.UndoManager +import org.appdevforall.codeonthego.uidesigner.models.UiAttribute +import org.appdevforall.codeonthego.uidesigner.undo.UndoManager import java.io.File internal class WorkspaceViewModel : ViewModel() { internal val _drawerOpened = MutableLiveData(false) internal val _errText = MutableLiveData("") internal val _workspaceScreen = MutableLiveData(SCREEN_WORKSPACE) - internal val _view = MutableLiveData(null) + internal val _view = MutableLiveData(null) internal val _selectedAttr = MutableLiveData(null) internal val _addAttrMode = MutableLiveData(false) internal val _undoManager = MutableLiveData(UndoManager()) @@ -68,7 +68,7 @@ internal class WorkspaceViewModel : ViewModel() { _workspaceScreen.value = value } - var view: com.itsaky.androidide.inflater.IView? + var view: org.appdevforall.codeonthego.inflater.IView? get() = this._view.value set(value) { this._view.value = value diff --git a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/views/LayoutHierarchyView.kt b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/views/LayoutHierarchyView.kt similarity index 90% rename from uidesigner/src/main/java/com/itsaky/androidide/uidesigner/views/LayoutHierarchyView.kt rename to uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/views/LayoutHierarchyView.kt index 4a04793a9e..0aa41639a1 100644 --- a/uidesigner/src/main/java/com/itsaky/androidide/uidesigner/views/LayoutHierarchyView.kt +++ b/uidesigner/src/main/java/org/appdevforall/codeonthego/uidesigner/views/LayoutHierarchyView.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.views +package org.appdevforall.codeonthego.uidesigner.views import android.annotation.SuppressLint import android.content.Context @@ -30,10 +30,10 @@ import android.widget.LinearLayout import androidx.core.view.updateMarginsRelative import androidx.core.view.updatePaddingRelative import com.google.android.material.textview.MaterialTextView -import com.itsaky.androidide.inflater.IView +import org.appdevforall.codeonthego.inflater.IView import com.itsaky.androidide.uidesigner.R -import com.itsaky.androidide.utils.dpToPx -import com.itsaky.androidide.utils.resolveAttr +import org.appdevforall.codeonthego.utils.dpToPx +import org.appdevforall.codeonthego.utils.resolveAttr /** * A view that shows component hierarchy in the UI Designer. @@ -91,7 +91,7 @@ class LayoutHierarchyView } addView(text) - if (view is com.itsaky.androidide.inflater.IViewGroup) { + if (view is org.appdevforall.codeonthego.inflater.IViewGroup) { text.childCount = computeChildCount(view) view.forEach { addViews(it, depth + 1) } } @@ -99,10 +99,10 @@ class LayoutHierarchyView textToIView[text] = view } - private fun computeChildCount(view: com.itsaky.androidide.inflater.IViewGroup): Int { + private fun computeChildCount(view: org.appdevforall.codeonthego.inflater.IViewGroup): Int { var count = view.childCount view.forEachIndexed { index, child -> - if (index != view.childCount - 1 && child is com.itsaky.androidide.inflater.IViewGroup) { + if (index != view.childCount - 1 && child is org.appdevforall.codeonthego.inflater.IViewGroup) { count += computeChildCount(child) } } diff --git a/uidesigner/src/main/res/layout/activity_ui_designer.xml b/uidesigner/src/main/res/layout/activity_ui_designer.xml index c4019b3475..6f38b0ade8 100644 --- a/uidesigner/src/main/res/layout/activity_ui_designer.xml +++ b/uidesigner/src/main/res/layout/activity_ui_designer.xml @@ -15,7 +15,7 @@ ~ along with AndroidIDE. If not, see . --> - @@ -84,7 +84,7 @@ android:layout_height="match_parent" android:fillViewport="true"> - - + diff --git a/uidesigner/src/main/res/navigation/nav_viewinfo.xml b/uidesigner/src/main/res/navigation/nav_viewinfo.xml index 4fba4f1b70..20a4a833a9 100644 --- a/uidesigner/src/main/res/navigation/nav_viewinfo.xml +++ b/uidesigner/src/main/res/navigation/nav_viewinfo.xml @@ -23,7 +23,7 @@ + app:argType="org.appdevforall.codeonthego.uidesigner.models.UiAttribute" /> \ No newline at end of file diff --git a/uidesigner/src/test/java/com/itsaky/androidide/uidesigner/UiDesignerTest.kt b/uidesigner/src/test/java/org/appdevforall/codeonthego/uidesigner/UiDesignerTest.kt similarity index 65% rename from uidesigner/src/test/java/com/itsaky/androidide/uidesigner/UiDesignerTest.kt rename to uidesigner/src/test/java/org/appdevforall/codeonthego/uidesigner/UiDesignerTest.kt index e5ff0b36da..3cc45e964c 100644 --- a/uidesigner/src/test/java/com/itsaky/androidide/uidesigner/UiDesignerTest.kt +++ b/uidesigner/src/test/java/org/appdevforall/codeonthego/uidesigner/UiDesignerTest.kt @@ -15,20 +15,20 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner +package org.appdevforall.codeonthego.uidesigner import android.content.Context import android.view.View import android.widget.LinearLayout import androidx.appcompat.app.AppCompatActivity -import com.itsaky.androidide.inflater.IComponentFactory.Companion.LAYOUT_INFLATER_COMPONENT_FACTORY_KEY -import com.itsaky.androidide.inflater.internal.LayoutFile -import com.itsaky.androidide.inflater.internal.ViewGroupImpl -import com.itsaky.androidide.inflater.internal.ViewImpl -import com.itsaky.androidide.inflater.internal.utils.ViewFactory -import com.itsaky.androidide.inflater.viewGroup -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.uidesigner.utils.UiInflaterComponentFactory +import org.appdevforall.codeonthego.inflater.IComponentFactory.Companion.LAYOUT_INFLATER_COMPONENT_FACTORY_KEY +import org.appdevforall.codeonthego.inflater.internal.LayoutFile +import org.appdevforall.codeonthego.inflater.internal.ViewGroupImpl +import org.appdevforall.codeonthego.inflater.internal.ViewImpl +import org.appdevforall.codeonthego.inflater.internal.utils.ViewFactory +import org.appdevforall.codeonthego.inflater.viewGroup +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.uidesigner.utils.UiInflaterComponentFactory import org.robolectric.Robolectric import java.io.File @@ -44,7 +44,7 @@ fun requiresActivity(initComponentFactory: Boolean = true, block: AppCompatActiv activity.block() } -fun Context.createLayout(parent: com.itsaky.androidide.inflater.IViewGroup? = null): ViewGroupImpl { +fun Context.createLayout(parent: org.appdevforall.codeonthego.inflater.IViewGroup? = null): ViewGroupImpl { return ViewGroupImpl( LayoutFile(File(""), ""), LinearLayout::class.qualifiedName!!, @@ -53,12 +53,12 @@ fun Context.createLayout(parent: com.itsaky.androidide.inflater.IViewGroup? = nu .apply { parent?.let { applyLayoutParams(it) } } } -fun Context.createView(parent: com.itsaky.androidide.inflater.IViewGroup? = null): ViewImpl { +fun Context.createView(parent: org.appdevforall.codeonthego.inflater.IViewGroup? = null): ViewImpl { return ViewImpl(LayoutFile(File(""), ""), View::class.qualifiedName!!, View(this)).apply { parent?.let { applyLayoutParams(it) } } } -fun ViewImpl.applyLayoutParams(parent: com.itsaky.androidide.inflater.IViewGroup) { +fun ViewImpl.applyLayoutParams(parent: org.appdevforall.codeonthego.inflater.IViewGroup) { view.layoutParams = ViewFactory.generateLayoutParams(parent.viewGroup) } diff --git a/uidesigner/src/test/java/com/itsaky/androidide/uidesigner/undo/UndoManagerTest.kt b/uidesigner/src/test/java/org/appdevforall/codeonthego/uidesigner/undo/UndoManagerTest.kt similarity index 97% rename from uidesigner/src/test/java/com/itsaky/androidide/uidesigner/undo/UndoManagerTest.kt rename to uidesigner/src/test/java/org/appdevforall/codeonthego/uidesigner/undo/UndoManagerTest.kt index 8e4ac60ca3..1e670e28ee 100644 --- a/uidesigner/src/test/java/com/itsaky/androidide/uidesigner/undo/UndoManagerTest.kt +++ b/uidesigner/src/test/java/org/appdevforall/codeonthego/uidesigner/undo/UndoManagerTest.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.uidesigner.undo +package org.appdevforall.codeonthego.uidesigner.undo import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.uidesigner.createLayout -import com.itsaky.androidide.uidesigner.createView -import com.itsaky.androidide.uidesigner.models.UiAttribute -import com.itsaky.androidide.uidesigner.requiresActivity +import org.appdevforall.codeonthego.uidesigner.createLayout +import org.appdevforall.codeonthego.uidesigner.createView +import org.appdevforall.codeonthego.uidesigner.models.UiAttribute +import org.appdevforall.codeonthego.uidesigner.requiresActivity import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/AbstractParser.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/AbstractParser.kt similarity index 81% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/AbstractParser.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/AbstractParser.kt index d3cc603532..6c031530e4 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/AbstractParser.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/AbstractParser.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater import android.content.Context import android.content.res.ColorStateList import android.graphics.Color import android.graphics.drawable.Drawable -import com.itsaky.androidide.inflater.internal.utils.defaultGravity -import com.itsaky.androidide.inflater.internal.utils.unknownDrawable +import org.appdevforall.codeonthego.inflater.internal.utils.defaultGravity +import org.appdevforall.codeonthego.inflater.internal.utils.unknownDrawable /** * Abstract class which provides access to the internal parsing utility methods to its subclasses. @@ -39,7 +39,7 @@ abstract class AbstractParser { */ @JvmOverloads protected open fun parseId(resName: String, value: String, def: Int = 0): Int { - return com.itsaky.androidide.inflater.internal.utils.parseId(resName, value, def) + return org.appdevforall.codeonthego.inflater.internal.utils.parseId(resName, value, def) } /** @@ -50,7 +50,7 @@ abstract class AbstractParser { */ @JvmOverloads protected open fun parseFloat(value: String, def: Float = 0f): Float { - return com.itsaky.androidide.inflater.internal.utils.parseFloat(value = value, def = def) + return org.appdevforall.codeonthego.inflater.internal.utils.parseFloat(value = value, def = def) } /** @@ -61,7 +61,7 @@ abstract class AbstractParser { */ @JvmOverloads protected open fun parseLong(value: String, def: Long = 0L): Long { - return com.itsaky.androidide.inflater.internal.utils.parseLong(value = value, def = def) + return org.appdevforall.codeonthego.inflater.internal.utils.parseLong(value = value, def = def) } /** @@ -73,7 +73,7 @@ abstract class AbstractParser { */ @JvmOverloads protected open fun parseInteger(value: String, def: Int = 0): Int { - return com.itsaky.androidide.inflater.internal.utils.parseInteger(value = value, def = def) + return org.appdevforall.codeonthego.inflater.internal.utils.parseInteger(value = value, def = def) } /** @@ -83,7 +83,7 @@ abstract class AbstractParser { * @param value The string value. Usually value from attributes. */ protected open fun parseIntegerArray(value: String): IntArray { - return com.itsaky.androidide.inflater.internal.utils.parseIntegerArray(value) ?: intArrayOf() + return org.appdevforall.codeonthego.inflater.internal.utils.parseIntegerArray(value) ?: intArrayOf() } /** @@ -95,7 +95,7 @@ abstract class AbstractParser { */ @JvmOverloads protected open fun parseBoolean(value: String, def: Boolean = false): Boolean { - return com.itsaky.androidide.inflater.internal.utils.parseBoolean(value = value, def = def) + return org.appdevforall.codeonthego.inflater.internal.utils.parseBoolean(value = value, def = def) } /** @@ -105,7 +105,7 @@ abstract class AbstractParser { * @param value The string value. Usually value from attributes. */ protected open fun parseString(value: String): String { - return com.itsaky.androidide.inflater.internal.utils.parseString(value) + return org.appdevforall.codeonthego.inflater.internal.utils.parseString(value) } /** @@ -115,7 +115,7 @@ abstract class AbstractParser { * @param value The string value. Usually value from attributes. */ protected open fun parseStringArray(value: String): Array { - return com.itsaky.androidide.inflater.internal.utils.parseStringArray(value) ?: emptyArray() + return org.appdevforall.codeonthego.inflater.internal.utils.parseStringArray(value) ?: emptyArray() } /** @@ -131,7 +131,7 @@ abstract class AbstractParser { value: String, def: Drawable = unknownDrawable() ): Drawable { - return com.itsaky.androidide.inflater.internal.utils.parseDrawable( + return org.appdevforall.codeonthego.inflater.internal.utils.parseDrawable( context = context, value = value, def = def @@ -147,7 +147,7 @@ abstract class AbstractParser { */ @JvmOverloads protected open fun parseGravity(value: String, def: Int = defaultGravity()): Int { - return com.itsaky.androidide.inflater.internal.utils.parseGravity(value = value, def = def) + return org.appdevforall.codeonthego.inflater.internal.utils.parseGravity(value = value, def = def) } /** @@ -171,7 +171,7 @@ abstract class AbstractParser { */ @JvmOverloads protected open fun parseDimensionF(context: Context, value: String, def: Float = 0f): Float { - return com.itsaky.androidide.inflater.internal.utils.parseDimension( + return org.appdevforall.codeonthego.inflater.internal.utils.parseDimension( context = context, value = value, def = def @@ -191,7 +191,7 @@ abstract class AbstractParser { value: String, def: Int = Color.TRANSPARENT ): Int { - return com.itsaky.androidide.inflater.internal.utils.parseColor( + return org.appdevforall.codeonthego.inflater.internal.utils.parseColor( context = context, value = value, def = def @@ -211,7 +211,7 @@ abstract class AbstractParser { value: String, def: ColorStateList = ColorStateList.valueOf(Color.TRANSPARENT) ): ColorStateList { - return com.itsaky.androidide.inflater.internal.utils.parseColorStateList( + return org.appdevforall.codeonthego.inflater.internal.utils.parseColorStateList( context = context, value = value, def = def @@ -227,7 +227,7 @@ abstract class AbstractParser { */ @JvmOverloads fun parseDate(value: String, format: String = "MM/dd/yyyy", def: Long = 0L): Long { - return com.itsaky.androidide.inflater.internal.utils.parseDate( + return org.appdevforall.codeonthego.inflater.internal.utils.parseDate( value = value, format = format, def = def diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/AttributeHandlerScope.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/AttributeHandlerScope.kt similarity index 90% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/AttributeHandlerScope.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/AttributeHandlerScope.kt index 9f0b8104d6..dbb1261779 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/AttributeHandlerScope.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/AttributeHandlerScope.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater import android.content.Context import android.view.View import android.view.ViewGroup -import com.itsaky.androidide.inflater.internal.LayoutFile +import org.appdevforall.codeonthego.inflater.internal.LayoutFile /** * @author Akash Yadav diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/DefaultComponentFactory.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/DefaultComponentFactory.kt similarity index 80% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/DefaultComponentFactory.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/DefaultComponentFactory.kt index 83ae5fdf07..48a6ddbada 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/DefaultComponentFactory.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/DefaultComponentFactory.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater import android.view.View import android.view.ViewGroup -import com.itsaky.androidide.inflater.internal.AttributeImpl -import com.itsaky.androidide.inflater.internal.LayoutFile -import com.itsaky.androidide.inflater.internal.ViewGroupImpl -import com.itsaky.androidide.inflater.internal.ViewImpl +import org.appdevforall.codeonthego.inflater.internal.AttributeImpl +import org.appdevforall.codeonthego.inflater.internal.LayoutFile +import org.appdevforall.codeonthego.inflater.internal.ViewGroupImpl +import org.appdevforall.codeonthego.inflater.internal.ViewImpl /** Default implementation of [IComponentFactory]. */ open class DefaultComponentFactory : IComponentFactory { diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/ForwardingViewGroup.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/ForwardingViewGroup.kt similarity index 95% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/ForwardingViewGroup.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/ForwardingViewGroup.kt index 4ffc5329b3..aa9fd97f5c 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/ForwardingViewGroup.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/ForwardingViewGroup.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater /** * An [IViewGroup] implementation that forwards all calls to [src]. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IAttribute.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IAttribute.kt similarity index 96% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/IAttribute.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IAttribute.kt index b44ebee94f..ab47cddc6f 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IAttribute.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IAttribute.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater /** * Model for an XML attribute. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IComponentFactory.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IComponentFactory.kt similarity index 90% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/IComponentFactory.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IComponentFactory.kt index 11a54c0975..acd4c2b035 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IComponentFactory.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IComponentFactory.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater import android.view.View -import com.itsaky.androidide.inflater.internal.LayoutFile -import com.itsaky.androidide.lookup.Lookup.Key +import org.appdevforall.codeonthego.inflater.internal.LayoutFile +import org.appdevforall.codeonthego.lookup.Lookup.Key /** Creates instances of views and attributes. */ interface IComponentFactory { diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/ILayoutInflater.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/ILayoutInflater.kt similarity index 75% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/ILayoutInflater.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/ILayoutInflater.kt index 144dfbb7a8..4bb426ffe3 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/ILayoutInflater.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/ILayoutInflater.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater import android.view.ViewGroup -import com.itsaky.androidide.inflater.events.IInflateEventsListener -import com.itsaky.androidide.inflater.internal.LayoutInflaterImpl -import com.itsaky.androidide.lookup.Lookup.Key -import com.itsaky.androidide.projects.api.AndroidModule +import org.appdevforall.codeonthego.inflater.events.IInflateEventsListener +import org.appdevforall.codeonthego.inflater.internal.LayoutInflaterImpl +import org.appdevforall.codeonthego.lookup.Lookup.Key +import org.appdevforall.codeonthego.projects.api.AndroidModule import java.io.Closeable import java.io.File @@ -44,11 +44,11 @@ interface ILayoutInflater : Closeable { /** * Inflate the given raw XML file. * - * **NOTE** : The [startParse][com.itsaky.androidide.inflater.utils.startParse] method is called + * **NOTE** : The [startParse][org.appdevforall.codeonthego.inflater.utils.startParse] method is called * if it hasn't been called yet. However, the [endParse] - * [com.itsaky.androidide.inflater.utils.endParse] method is not called after the parse is done. + * [org.appdevforall.codeonthego.inflater.utils.endParse] method is not called after the parse is done. * The caller is expected to call [close] when this inflater instance is no longer needed. The - * [close] method calls the [endParse] [com.itsaky.androidide.inflater.utils.endParse]. + * [close] method calls the [endParse] [org.appdevforall.codeonthego.inflater.utils.endParse]. * * @param file The file to inflate. * @param parent The parent view. @@ -58,11 +58,11 @@ interface ILayoutInflater : Closeable { /** * Inflate the given raw XML file. * - * **NOTE** : The [startParse][com.itsaky.androidide.inflater.utils.startParse] method is called + * **NOTE** : The [startParse][org.appdevforall.codeonthego.inflater.utils.startParse] method is called * if it hasn't been called yet. However, the [endParse] - * [com.itsaky.androidide.inflater.utils.endParse] method is not called after the parse is done. + * [org.appdevforall.codeonthego.inflater.utils.endParse] method is not called after the parse is done. * The caller is expected to call [close] when this inflater instance is no longer needed. The - * [close] method calls the [endParse] [com.itsaky.androidide.inflater.utils.endParse]. + * [close] method calls the [endParse] [org.appdevforall.codeonthego.inflater.utils.endParse]. * * @param file The file to inflate. * @param parent The parent view. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/INamespace.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/INamespace.kt similarity index 90% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/INamespace.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/INamespace.kt index b955f3240e..bd4ee74660 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/INamespace.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/INamespace.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater import com.android.SdkConstants.ANDROID_NS_NAME import com.android.SdkConstants.ANDROID_URI -import com.itsaky.androidide.inflater.internal.NamespaceImpl +import org.appdevforall.codeonthego.inflater.internal.NamespaceImpl /** * An XML namespace declaration. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IView.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IView.kt similarity index 99% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/IView.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IView.kt index b50ff31f7f..c47944b077 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IView.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IView.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater import android.graphics.RectF import android.view.View diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IViewAdapter.kt similarity index 96% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IViewAdapter.kt index 73eadef383..91146fe768 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IViewAdapter.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater import android.content.Context import android.view.View import com.android.SdkConstants -import com.itsaky.androidide.inflater.internal.AttributeImpl -import com.itsaky.androidide.inflater.internal.ViewImpl -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.internal.AttributeImpl +import org.appdevforall.codeonthego.inflater.internal.ViewImpl +import org.appdevforall.codeonthego.inflater.models.UiWidget /** * A view adapter provides support for a specific view to the layout inflater and the UI designer. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewAdapterIndex.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IViewAdapterIndex.kt similarity index 95% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewAdapterIndex.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IViewAdapterIndex.kt index 510be5ab35..40496d66a6 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewAdapterIndex.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IViewAdapterIndex.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater import android.view.View import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner -import com.itsaky.androidide.inflater.internal.ViewAdapterIndexImpl +import org.appdevforall.codeonthego.inflater.internal.ViewAdapterIndexImpl /** * Provides access to all view adapters. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewGroup.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IViewGroup.kt similarity index 99% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewGroup.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IViewGroup.kt index a866c0295c..ac49f71bb1 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewGroup.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IViewGroup.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater /** * Inflated model for a [ViewGroup][android.view.ViewGroup]. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewGroupAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IViewGroupAdapter.kt similarity index 98% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewGroupAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IViewGroupAdapter.kt index 833187dd57..00c7e68662 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/IViewGroupAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/IViewGroupAdapter.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater /** * Handles logic for things related to [IViewGroup]. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/InflateException.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/InflateException.kt similarity index 96% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/InflateException.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/InflateException.kt index f6ee664354..c53df99752 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/InflateException.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/InflateException.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater /** * Exception thrown by the layout inflater. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/LayoutStrategy.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/LayoutStrategy.kt similarity index 98% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/LayoutStrategy.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/LayoutStrategy.kt index 618b5fe6dc..513214ddf6 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/LayoutStrategy.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/LayoutStrategy.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater import android.graphics.RectF diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/BitmapDrawableParser.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/BitmapDrawableParser.kt similarity index 96% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/BitmapDrawableParser.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/BitmapDrawableParser.kt index a7c958ddbd..a571b14bca 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/BitmapDrawableParser.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/BitmapDrawableParser.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.drawable +package org.appdevforall.codeonthego.inflater.drawable import android.content.Context import android.graphics.Bitmap @@ -26,7 +26,7 @@ import android.graphics.Shader.TileMode.MIRROR import android.graphics.Shader.TileMode.REPEAT import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.Drawable -import com.itsaky.androidide.inflater.InflateException +import org.appdevforall.codeonthego.inflater.InflateException import org.jetbrains.annotations.Contract import org.xmlpull.v1.XmlPullParser diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/ClipDrawableParser.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/ClipDrawableParser.kt similarity index 97% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/ClipDrawableParser.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/ClipDrawableParser.kt index 0865bf6687..b0b48b4fec 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/ClipDrawableParser.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/ClipDrawableParser.kt @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.drawable +package org.appdevforall.codeonthego.inflater.drawable import android.content.Context import android.graphics.drawable.ClipDrawable diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/DrawableParserFactory.java b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/DrawableParserFactory.java similarity index 96% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/DrawableParserFactory.java rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/DrawableParserFactory.java index 985ade1a7b..f185ec4bd9 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/DrawableParserFactory.java +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/DrawableParserFactory.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.drawable; +package org.appdevforall.codeonthego.inflater.drawable; import android.content.Context; import android.graphics.NinePatch; @@ -24,9 +24,9 @@ import android.graphics.drawable.NinePatchDrawable; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.itsaky.androidide.inflater.vectormaster.VectorMasterDrawable; -import com.itsaky.androidide.utils.FileIOUtils; -import com.itsaky.androidide.utils.ImageUtils; +import org.appdevforall.codeonthego.inflater.vectormaster.VectorMasterDrawable; +import org.appdevforall.codeonthego.utils.FileIOUtils; +import org.appdevforall.codeonthego.utils.ImageUtils; import java.io.File; import java.io.IOException; import java.io.Reader; diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/IDrawableParser.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/IDrawableParser.kt similarity index 94% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/IDrawableParser.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/IDrawableParser.kt index a77b89f150..d2181e2bea 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/IDrawableParser.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/IDrawableParser.kt @@ -1,121 +1,121 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.inflater.drawable - -import android.content.Context -import android.graphics.drawable.Drawable -import android.os.Build.VERSION -import android.os.Build.VERSION_CODES -import androidx.annotation.ChecksSdkIntAtLeast -import com.itsaky.androidide.inflater.AbstractParser -import org.xmlpull.v1.XmlPullParser - -/** - * Base class for drawable parsers. - * - * @author Akash Yadav - */ -abstract class IDrawableParser -protected constructor(protected open val parser: XmlPullParser?, open var minDepth: Int) : AbstractParser() { - /** - * Parse the drawable using the already provided parser and data. - * - * @return The parsed [Drawable] or `null` if the parse was unsuccessful. - * @throws Exception If any fatal error occurred while parsing the drawable. - */ - @Throws(Exception::class) - open fun parse(context: Context): Drawable? { - var index = attrIndex("visible") - var visible = true - if (index != -1) { - visible = parseBoolean(value(index)) - } - var autoMirrored = false - index = attrIndex("autoMirrored") - if (index != -1) { - autoMirrored = parseBoolean(value(index)) - } - var level = 0 - index = attrIndex("level") - if (index != -1) { - level = parseInteger(value(index), 0) - } - val drawable = parseDrawable(context) - if (drawable != null) { - drawable.setVisible(visible, false) - drawable.isAutoMirrored = autoMirrored - drawable.level = level - } - return drawable - } - - /** - * Actual implementation of the parse logic. - * - * @return The parsed drawable. Maybe `null`. - * @throws Exception If any fatal error occurs while parsing the drawable. - */ - @Throws(Exception::class) protected abstract fun parseDrawable(context: Context): Drawable? - - /** - * Find the index of the attribute with the given name. - * - * @param name The name of the attribute to look for. - * @return The index of the attribute or `-1`. - */ - protected fun attrIndex(name: String): Int { - for (i in 0 until parser!!.attributeCount) { - if (parser!!.getAttributeName(i) == name) { - return i - } - } - return -1 - } - - /** - * Get the value of the attribute at the given index. - * - * @param index The index of the attribute. - * @return The value of the attribute. - */ - protected fun value(index: Int): String { - return parser!!.getAttributeValue(index) - } - - /** - * Checks if the drawable parser is allowed to parse at the current depth. This must be checked if - * the drawable parser keeps looking for [XmlPullParser.START_TAG] or [ ][XmlPullParser.END_TAG]. - * - * The [LayerListParser] can contain tags which are expected to be parsed by other parsers. So, if - * the nesting parser does not check if this method if `true`, it might consume all the events and - * the [LayerListParser] will have invalid data to parse. In some cases, the nested parser might - * consume all the events until [XmlPullParser.END_DOCUMENT]. - * - * @return `true` if the parser can keep parsing, `false` otherwise. - */ - protected fun canParse(): Boolean { - return parser!!.depth >= minDepth - } - - @get:ChecksSdkIntAtLeast(api = VERSION_CODES.Q) - protected val isApi29: Boolean - get() = VERSION.SDK_INT >= 29 - - companion object { - const val ANY_DEPTH = -1 - } -} +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.inflater.drawable + +import android.content.Context +import android.graphics.drawable.Drawable +import android.os.Build.VERSION +import android.os.Build.VERSION_CODES +import androidx.annotation.ChecksSdkIntAtLeast +import org.appdevforall.codeonthego.inflater.AbstractParser +import org.xmlpull.v1.XmlPullParser + +/** + * Base class for drawable parsers. + * + * @author Akash Yadav + */ +abstract class IDrawableParser +protected constructor(protected open val parser: XmlPullParser?, open var minDepth: Int) : AbstractParser() { + /** + * Parse the drawable using the already provided parser and data. + * + * @return The parsed [Drawable] or `null` if the parse was unsuccessful. + * @throws Exception If any fatal error occurred while parsing the drawable. + */ + @Throws(Exception::class) + open fun parse(context: Context): Drawable? { + var index = attrIndex("visible") + var visible = true + if (index != -1) { + visible = parseBoolean(value(index)) + } + var autoMirrored = false + index = attrIndex("autoMirrored") + if (index != -1) { + autoMirrored = parseBoolean(value(index)) + } + var level = 0 + index = attrIndex("level") + if (index != -1) { + level = parseInteger(value(index), 0) + } + val drawable = parseDrawable(context) + if (drawable != null) { + drawable.setVisible(visible, false) + drawable.isAutoMirrored = autoMirrored + drawable.level = level + } + return drawable + } + + /** + * Actual implementation of the parse logic. + * + * @return The parsed drawable. Maybe `null`. + * @throws Exception If any fatal error occurs while parsing the drawable. + */ + @Throws(Exception::class) protected abstract fun parseDrawable(context: Context): Drawable? + + /** + * Find the index of the attribute with the given name. + * + * @param name The name of the attribute to look for. + * @return The index of the attribute or `-1`. + */ + protected fun attrIndex(name: String): Int { + for (i in 0 until parser!!.attributeCount) { + if (parser!!.getAttributeName(i) == name) { + return i + } + } + return -1 + } + + /** + * Get the value of the attribute at the given index. + * + * @param index The index of the attribute. + * @return The value of the attribute. + */ + protected fun value(index: Int): String { + return parser!!.getAttributeValue(index) + } + + /** + * Checks if the drawable parser is allowed to parse at the current depth. This must be checked if + * the drawable parser keeps looking for [XmlPullParser.START_TAG] or [ ][XmlPullParser.END_TAG]. + * + * The [LayerListParser] can contain tags which are expected to be parsed by other parsers. So, if + * the nesting parser does not check if this method if `true`, it might consume all the events and + * the [LayerListParser] will have invalid data to parse. In some cases, the nested parser might + * consume all the events until [XmlPullParser.END_DOCUMENT]. + * + * @return `true` if the parser can keep parsing, `false` otherwise. + */ + protected fun canParse(): Boolean { + return parser!!.depth >= minDepth + } + + @get:ChecksSdkIntAtLeast(api = VERSION_CODES.Q) + protected val isApi29: Boolean + get() = VERSION.SDK_INT >= 29 + + companion object { + const val ANY_DEPTH = -1 + } +} diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/InsetDrawableParser.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/InsetDrawableParser.kt similarity index 94% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/InsetDrawableParser.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/InsetDrawableParser.kt index 16879fb967..778da58031 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/InsetDrawableParser.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/InsetDrawableParser.kt @@ -14,12 +14,12 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.drawable +package org.appdevforall.codeonthego.inflater.drawable import android.content.Context import android.graphics.drawable.Drawable import android.graphics.drawable.InsetDrawable -import com.itsaky.androidide.inflater.InflateException +import org.appdevforall.codeonthego.inflater.InflateException import org.xmlpull.v1.XmlPullParser /** diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/LayerListParser.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/LayerListParser.kt similarity index 96% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/LayerListParser.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/LayerListParser.kt index 03e3ff870c..53d588e073 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/LayerListParser.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/LayerListParser.kt @@ -14,12 +14,12 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.drawable +package org.appdevforall.codeonthego.inflater.drawable import android.content.Context import android.graphics.drawable.Drawable import android.graphics.drawable.LayerDrawable -import com.itsaky.androidide.inflater.internal.utils.TextDrawable +import org.appdevforall.codeonthego.inflater.internal.utils.TextDrawable import org.jetbrains.annotations.Contract import org.xmlpull.v1.XmlPullParser diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/ScaleDrawableParser.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/ScaleDrawableParser.kt similarity index 95% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/ScaleDrawableParser.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/ScaleDrawableParser.kt index 8ace275e85..1dcf4094e2 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/ScaleDrawableParser.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/ScaleDrawableParser.kt @@ -14,13 +14,13 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.drawable +package org.appdevforall.codeonthego.inflater.drawable import android.content.Context import android.graphics.drawable.Drawable import android.graphics.drawable.ScaleDrawable import android.view.Gravity -import com.itsaky.androidide.inflater.InflateException +import org.appdevforall.codeonthego.inflater.InflateException import org.xmlpull.v1.XmlPullParser /** diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/ShapeDrawableParser.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/ShapeDrawableParser.kt similarity index 96% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/ShapeDrawableParser.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/ShapeDrawableParser.kt index 69e634a4d5..af85e3ae5b 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/ShapeDrawableParser.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/ShapeDrawableParser.kt @@ -1,279 +1,279 @@ -/* - * This file is part of AndroidIDE. - * - * AndroidIDE is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * AndroidIDE is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with AndroidIDE. If not, see . - */ -package com.itsaky.androidide.inflater.drawable - -import android.content.Context -import android.graphics.Color -import android.graphics.Rect -import android.graphics.drawable.Drawable -import android.graphics.drawable.GradientDrawable -import android.graphics.drawable.GradientDrawable.Orientation -import android.graphics.drawable.GradientDrawable.Orientation.BL_TR -import android.graphics.drawable.GradientDrawable.Orientation.BOTTOM_TOP -import android.graphics.drawable.GradientDrawable.Orientation.BR_TL -import android.graphics.drawable.GradientDrawable.Orientation.LEFT_RIGHT -import android.graphics.drawable.GradientDrawable.Orientation.RIGHT_LEFT -import android.graphics.drawable.GradientDrawable.Orientation.TL_BR -import android.graphics.drawable.GradientDrawable.Orientation.TOP_BOTTOM -import android.graphics.drawable.GradientDrawable.Orientation.TR_BL -import org.jetbrains.annotations.Contract -import org.xmlpull.v1.XmlPullParser -import java.util.Arrays - -/** - * Parses a drawable whose root element is ``. If the parse was successful, returns a - * [GradientDrawable], otherwise `null`. - * - * @author Akash Yadav - */ -class ShapeDrawableParser protected constructor(parser: XmlPullParser?, minDepth: Int) : IDrawableParser(parser, minDepth) { - @Throws(Exception::class) - public override fun parseDrawable(context: Context): Drawable { - val drawable = GradientDrawable() - var index = attrIndex("shape") - drawable.shape = if (index == -1) GradientDrawable.RECTANGLE else parseShape(parser!!.getAttributeValue(index)) - if (isApi29) { - index = attrIndex("innerRadius") - drawable.innerRadius = if (index == -1) 0 else parseDimension(context, value(index)) - index = attrIndex("innerRadiusRatio") - drawable.innerRadiusRatio = if (index == -1) 1f else value(index).toFloat() - index = attrIndex("thickness") - drawable.thickness = if (index == -1) 0 else parseDimension(context, value(index)) - index = attrIndex("thicknessRatio") - drawable.thicknessRatio = if (index == -1) 1f else value(index).toFloat() - } - index = attrIndex("useLevel") - drawable.useLevel = index != -1 && parseBoolean(value(index)) - var event = parser!!.eventType - while (event != XmlPullParser.END_DOCUMENT && canParse()) { - val name = parser.name - if (event == XmlPullParser.START_TAG) { - when (name) { - "corners" -> parseCorners(context, drawable) - "gradient" -> parseGradient(context, drawable) - "padding" -> parsePadding(context, drawable) - "size" -> parseSize(context, drawable) - "solid" -> parseSolid(context, drawable) - "stroke" -> parseStroke(context, drawable) - } - } - event = parser.next() - } - return drawable - } - - private fun parseStroke(context: Context, drawable: GradientDrawable) { - var index = attrIndex("width") - var strokeWidth = 0 - if (index != -1) { - drawable.setStroke(parseDimension(context, value(index)).also { strokeWidth = it }, Color.TRANSPARENT) - } - index = attrIndex("color") - var strokeColor = Color.TRANSPARENT - if (index != -1) { - drawable.setStroke(strokeWidth, parseColor(context, value(index)).also { strokeColor = it }) - } - index = attrIndex("dashWidth") - var dashWidth = 0 - if (index != -1) { - drawable.setStroke( - strokeWidth, strokeColor, parseDimension(context, value(index)).also { dashWidth = it }.toFloat(), 0f) - } - index = attrIndex("dashGap") - if (index != -1) { - drawable.setStroke( - strokeWidth, strokeColor, dashWidth.toFloat(), parseDimension(context, value(index)).toFloat()) - } - } - - private fun parseSolid(context: Context, drawable: GradientDrawable) { - val index = attrIndex("color") - if (index != -1) { - drawable.setColor(parseColor(context, value(index))) - } - } - - private fun parseSize(context: Context, drawable: GradientDrawable) { - var index = attrIndex("width") - if (index != -1) { - drawable.setSize(parseDimension(context, value(index)), drawable.intrinsicHeight) - } - index = attrIndex("height") - if (index != -1) { - drawable.setSize(drawable.intrinsicWidth, parseDimension(context, value(index))) - } - } - - private fun parsePadding(context: Context, drawable: GradientDrawable) { - - // Padding is available from API 29 only - if (!isApi29) { - return - } - val rect = Rect() - if (!drawable.getPadding(rect)) { - rect[0, 0, 0] = 0 - } - var changed = false - var index = attrIndex("left") - if (index != -1) { - rect.left = parseDimension(context, value(index)) - changed = true - } - index = attrIndex("top") - if (index != -1) { - rect.top = parseDimension(context, value(index)) - changed = true - } - index = attrIndex("right") - if (index != -1) { - rect.right = parseDimension(context, value(index)) - changed = true - } - index = attrIndex("bottom") - if (index != -1) { - rect.bottom = parseDimension(context, value(index)) - changed = true - } - if (changed) { - drawable.setPadding(rect.left, rect.top, rect.right, rect.bottom) - } - } - - private fun parseGradient(context: Context, drawable: GradientDrawable) { - var index = attrIndex("angle") - drawable.orientation = if (index == -1) LEFT_RIGHT else parseGradientOrientation(value(index)) - index = attrIndex("centerX") - var center = if (index == -1) drawable.gradientCenterX else value(index).toFloat() - drawable.setGradientCenter(center, drawable.gradientCenterY) - index = attrIndex("centerY") - center = if (index == -1) drawable.gradientCenterX else value(index).toFloat() - drawable.setGradientCenter(drawable.gradientCenterX, center) - val colors = IntArray(3) - var changed = false - Arrays.fill(colors, -1) - index = attrIndex("centerColor") - if (index != -1) { - colors[1] = parseColor(context, value(index)) - changed = true - } - index = attrIndex("endColor") - if (index != -1) { - colors[2] = parseColor(context, value(index)) - changed = true - } - index = attrIndex("gradientRadius") - drawable.gradientRadius = if (index == -1) drawable.gradientRadius else value(index).toFloat() - index = attrIndex("startColor") - if (index != -1) { - colors[0] = parseColor(context, value(index)) - changed = true - } - if (changed) { - drawable.colors = colors - } - index = attrIndex("type") - drawable.gradientType = if (index == -1) GradientDrawable.LINEAR_GRADIENT else parseGradientType(value(index)) - index = attrIndex("useLevel") - drawable.useLevel = index != -1 && parseBoolean(value(index)) - } - - private fun parseGradientType(value: String): Int { - return when (value) { - "radial" -> GradientDrawable.RADIAL_GRADIENT - "sweep" -> GradientDrawable.SWEEP_GRADIENT - "linear" -> GradientDrawable.LINEAR_GRADIENT - else -> GradientDrawable.LINEAR_GRADIENT - } - } - - private fun parseGradientOrientation(value: String): Orientation { - val angle = value.toInt() - - // Angle must be between 0-315 and a multiple of 45 - // Angle moves in anti-clockwise direction - if (angle == 45) { - return BL_TR - } - if (angle == 90) { - return BOTTOM_TOP - } - if (angle == 135) { - return BR_TL - } - if (angle == 180) { - return RIGHT_LEFT - } - if (angle == 225) { - return TR_BL - } - if (angle == 270) { - return TOP_BOTTOM - } - return if (angle == 315) { - TL_BR - } else LEFT_RIGHT - - // Angle 0 or any invalid valid should make the orientation left to right - } - - private fun parseCorners(context: Context, drawable: GradientDrawable) { - var index = attrIndex("radius") - drawable.cornerRadius = if (index == -1) 0f else parseDimension(context, value(index)).toFloat() - var changed = false - val radii = FloatArray(8) - Arrays.fill(radii, 0f) - index = attrIndex("topLeftRadius") - if (index != -1) { - radii[1] = parseDimension(context, value(index)).toFloat() - radii[0] = radii[1] - changed = true - } - index = attrIndex("topRightRadius") - if (index != -1) { - radii[3] = parseDimension(context, value(index)).toFloat() - radii[2] = radii[3] - changed = true - } - index = attrIndex("bottomLeftRadius") - if (index != -1) { - radii[5] = parseDimension(context, value(index)).toFloat() - radii[4] = radii[5] - changed = true - } - index = attrIndex("bottomRightRadius") - if (index != -1) { - radii[7] = parseDimension(context, value(index)).toFloat() - radii[6] = radii[7] - changed = true - } - if (changed) { - drawable.cornerRadii = radii - } - } - - @Contract(pure = true) - private fun parseShape(value: String): Int { - return when (value) { - "oval" -> GradientDrawable.OVAL - "line" -> GradientDrawable.LINE - "ring" -> GradientDrawable.RING - "rectangle" -> GradientDrawable.RECTANGLE - else -> GradientDrawable.RECTANGLE - } - } +/* + * This file is part of AndroidIDE. + * + * AndroidIDE is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AndroidIDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with AndroidIDE. If not, see . + */ +package org.appdevforall.codeonthego.inflater.drawable + +import android.content.Context +import android.graphics.Color +import android.graphics.Rect +import android.graphics.drawable.Drawable +import android.graphics.drawable.GradientDrawable +import android.graphics.drawable.GradientDrawable.Orientation +import android.graphics.drawable.GradientDrawable.Orientation.BL_TR +import android.graphics.drawable.GradientDrawable.Orientation.BOTTOM_TOP +import android.graphics.drawable.GradientDrawable.Orientation.BR_TL +import android.graphics.drawable.GradientDrawable.Orientation.LEFT_RIGHT +import android.graphics.drawable.GradientDrawable.Orientation.RIGHT_LEFT +import android.graphics.drawable.GradientDrawable.Orientation.TL_BR +import android.graphics.drawable.GradientDrawable.Orientation.TOP_BOTTOM +import android.graphics.drawable.GradientDrawable.Orientation.TR_BL +import org.jetbrains.annotations.Contract +import org.xmlpull.v1.XmlPullParser +import java.util.Arrays + +/** + * Parses a drawable whose root element is ``. If the parse was successful, returns a + * [GradientDrawable], otherwise `null`. + * + * @author Akash Yadav + */ +class ShapeDrawableParser protected constructor(parser: XmlPullParser?, minDepth: Int) : IDrawableParser(parser, minDepth) { + @Throws(Exception::class) + public override fun parseDrawable(context: Context): Drawable { + val drawable = GradientDrawable() + var index = attrIndex("shape") + drawable.shape = if (index == -1) GradientDrawable.RECTANGLE else parseShape(parser!!.getAttributeValue(index)) + if (isApi29) { + index = attrIndex("innerRadius") + drawable.innerRadius = if (index == -1) 0 else parseDimension(context, value(index)) + index = attrIndex("innerRadiusRatio") + drawable.innerRadiusRatio = if (index == -1) 1f else value(index).toFloat() + index = attrIndex("thickness") + drawable.thickness = if (index == -1) 0 else parseDimension(context, value(index)) + index = attrIndex("thicknessRatio") + drawable.thicknessRatio = if (index == -1) 1f else value(index).toFloat() + } + index = attrIndex("useLevel") + drawable.useLevel = index != -1 && parseBoolean(value(index)) + var event = parser!!.eventType + while (event != XmlPullParser.END_DOCUMENT && canParse()) { + val name = parser.name + if (event == XmlPullParser.START_TAG) { + when (name) { + "corners" -> parseCorners(context, drawable) + "gradient" -> parseGradient(context, drawable) + "padding" -> parsePadding(context, drawable) + "size" -> parseSize(context, drawable) + "solid" -> parseSolid(context, drawable) + "stroke" -> parseStroke(context, drawable) + } + } + event = parser.next() + } + return drawable + } + + private fun parseStroke(context: Context, drawable: GradientDrawable) { + var index = attrIndex("width") + var strokeWidth = 0 + if (index != -1) { + drawable.setStroke(parseDimension(context, value(index)).also { strokeWidth = it }, Color.TRANSPARENT) + } + index = attrIndex("color") + var strokeColor = Color.TRANSPARENT + if (index != -1) { + drawable.setStroke(strokeWidth, parseColor(context, value(index)).also { strokeColor = it }) + } + index = attrIndex("dashWidth") + var dashWidth = 0 + if (index != -1) { + drawable.setStroke( + strokeWidth, strokeColor, parseDimension(context, value(index)).also { dashWidth = it }.toFloat(), 0f) + } + index = attrIndex("dashGap") + if (index != -1) { + drawable.setStroke( + strokeWidth, strokeColor, dashWidth.toFloat(), parseDimension(context, value(index)).toFloat()) + } + } + + private fun parseSolid(context: Context, drawable: GradientDrawable) { + val index = attrIndex("color") + if (index != -1) { + drawable.setColor(parseColor(context, value(index))) + } + } + + private fun parseSize(context: Context, drawable: GradientDrawable) { + var index = attrIndex("width") + if (index != -1) { + drawable.setSize(parseDimension(context, value(index)), drawable.intrinsicHeight) + } + index = attrIndex("height") + if (index != -1) { + drawable.setSize(drawable.intrinsicWidth, parseDimension(context, value(index))) + } + } + + private fun parsePadding(context: Context, drawable: GradientDrawable) { + + // Padding is available from API 29 only + if (!isApi29) { + return + } + val rect = Rect() + if (!drawable.getPadding(rect)) { + rect[0, 0, 0] = 0 + } + var changed = false + var index = attrIndex("left") + if (index != -1) { + rect.left = parseDimension(context, value(index)) + changed = true + } + index = attrIndex("top") + if (index != -1) { + rect.top = parseDimension(context, value(index)) + changed = true + } + index = attrIndex("right") + if (index != -1) { + rect.right = parseDimension(context, value(index)) + changed = true + } + index = attrIndex("bottom") + if (index != -1) { + rect.bottom = parseDimension(context, value(index)) + changed = true + } + if (changed) { + drawable.setPadding(rect.left, rect.top, rect.right, rect.bottom) + } + } + + private fun parseGradient(context: Context, drawable: GradientDrawable) { + var index = attrIndex("angle") + drawable.orientation = if (index == -1) LEFT_RIGHT else parseGradientOrientation(value(index)) + index = attrIndex("centerX") + var center = if (index == -1) drawable.gradientCenterX else value(index).toFloat() + drawable.setGradientCenter(center, drawable.gradientCenterY) + index = attrIndex("centerY") + center = if (index == -1) drawable.gradientCenterX else value(index).toFloat() + drawable.setGradientCenter(drawable.gradientCenterX, center) + val colors = IntArray(3) + var changed = false + Arrays.fill(colors, -1) + index = attrIndex("centerColor") + if (index != -1) { + colors[1] = parseColor(context, value(index)) + changed = true + } + index = attrIndex("endColor") + if (index != -1) { + colors[2] = parseColor(context, value(index)) + changed = true + } + index = attrIndex("gradientRadius") + drawable.gradientRadius = if (index == -1) drawable.gradientRadius else value(index).toFloat() + index = attrIndex("startColor") + if (index != -1) { + colors[0] = parseColor(context, value(index)) + changed = true + } + if (changed) { + drawable.colors = colors + } + index = attrIndex("type") + drawable.gradientType = if (index == -1) GradientDrawable.LINEAR_GRADIENT else parseGradientType(value(index)) + index = attrIndex("useLevel") + drawable.useLevel = index != -1 && parseBoolean(value(index)) + } + + private fun parseGradientType(value: String): Int { + return when (value) { + "radial" -> GradientDrawable.RADIAL_GRADIENT + "sweep" -> GradientDrawable.SWEEP_GRADIENT + "linear" -> GradientDrawable.LINEAR_GRADIENT + else -> GradientDrawable.LINEAR_GRADIENT + } + } + + private fun parseGradientOrientation(value: String): Orientation { + val angle = value.toInt() + + // Angle must be between 0-315 and a multiple of 45 + // Angle moves in anti-clockwise direction + if (angle == 45) { + return BL_TR + } + if (angle == 90) { + return BOTTOM_TOP + } + if (angle == 135) { + return BR_TL + } + if (angle == 180) { + return RIGHT_LEFT + } + if (angle == 225) { + return TR_BL + } + if (angle == 270) { + return TOP_BOTTOM + } + return if (angle == 315) { + TL_BR + } else LEFT_RIGHT + + // Angle 0 or any invalid valid should make the orientation left to right + } + + private fun parseCorners(context: Context, drawable: GradientDrawable) { + var index = attrIndex("radius") + drawable.cornerRadius = if (index == -1) 0f else parseDimension(context, value(index)).toFloat() + var changed = false + val radii = FloatArray(8) + Arrays.fill(radii, 0f) + index = attrIndex("topLeftRadius") + if (index != -1) { + radii[1] = parseDimension(context, value(index)).toFloat() + radii[0] = radii[1] + changed = true + } + index = attrIndex("topRightRadius") + if (index != -1) { + radii[3] = parseDimension(context, value(index)).toFloat() + radii[2] = radii[3] + changed = true + } + index = attrIndex("bottomLeftRadius") + if (index != -1) { + radii[5] = parseDimension(context, value(index)).toFloat() + radii[4] = radii[5] + changed = true + } + index = attrIndex("bottomRightRadius") + if (index != -1) { + radii[7] = parseDimension(context, value(index)).toFloat() + radii[6] = radii[7] + changed = true + } + if (changed) { + drawable.cornerRadii = radii + } + } + + @Contract(pure = true) + private fun parseShape(value: String): Int { + return when (value) { + "oval" -> GradientDrawable.OVAL + "line" -> GradientDrawable.LINE + "ring" -> GradientDrawable.RING + "rectangle" -> GradientDrawable.RECTANGLE + else -> GradientDrawable.RECTANGLE + } + } } \ No newline at end of file diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/StateListParser.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/StateListParser.kt similarity index 96% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/StateListParser.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/StateListParser.kt index 8d48159297..2bcc6de5da 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/drawable/StateListParser.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/drawable/StateListParser.kt @@ -14,13 +14,13 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.drawable +package org.appdevforall.codeonthego.inflater.drawable import android.R.attr import android.content.Context import android.graphics.drawable.Drawable import android.graphics.drawable.StateListDrawable -import com.itsaky.androidide.inflater.InflateException +import org.appdevforall.codeonthego.inflater.InflateException import org.slf4j.LoggerFactory import org.xmlpull.v1.XmlPullParser diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/events/IInflateEventsListener.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/events/IInflateEventsListener.kt similarity index 95% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/events/IInflateEventsListener.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/events/IInflateEventsListener.kt index ea8b20333a..c486837c24 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/events/IInflateEventsListener.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/events/IInflateEventsListener.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.events +package org.appdevforall.codeonthego.inflater.events /** * A listener which listens for XML layout inflation events. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/events/IInflationEvent.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/events/IInflationEvent.kt similarity index 93% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/events/IInflationEvent.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/events/IInflationEvent.kt index ed30465a51..5b42b70262 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/events/IInflationEvent.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/events/IInflationEvent.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.events +package org.appdevforall.codeonthego.inflater.events /** * An inflation event. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/events/inflationEvents.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/events/inflationEvents.kt similarity index 90% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/events/inflationEvents.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/events/inflationEvents.kt index 7a3912c4af..c190f25e5c 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/events/inflationEvents.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/events/inflationEvents.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.events +package org.appdevforall.codeonthego.inflater.events -import com.itsaky.androidide.inflater.IAttribute -import com.itsaky.androidide.inflater.IView +import org.appdevforall.codeonthego.inflater.IAttribute +import org.appdevforall.codeonthego.inflater.IView /** Indicates start of layout inflation. */ class InflationStartEvent : IInflationEvent(Unit) diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/AttributeImpl.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/AttributeImpl.kt similarity index 86% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/AttributeImpl.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/AttributeImpl.kt index bc58636533..207b4149b8 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/AttributeImpl.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/AttributeImpl.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal +package org.appdevforall.codeonthego.inflater.internal -import com.itsaky.androidide.inflater.IAttribute -import com.itsaky.androidide.inflater.INamespace -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.utils.newAttribute +import org.appdevforall.codeonthego.inflater.IAttribute +import org.appdevforall.codeonthego.inflater.INamespace +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.utils.newAttribute open class AttributeImpl @JvmOverloads diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ErrorView.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ErrorView.kt similarity index 94% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ErrorView.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ErrorView.kt index 60c8102129..c455081d9f 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ErrorView.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ErrorView.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal +package org.appdevforall.codeonthego.inflater.internal import android.content.Context import android.graphics.Color @@ -25,7 +25,7 @@ import android.view.ViewGroup import android.widget.FrameLayout import android.widget.TextView import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.resolveAttr +import org.appdevforall.codeonthego.utils.resolveAttr /** * View used to show views that cannot be inflated. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ForwardingView.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ForwardingView.kt similarity index 89% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ForwardingView.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ForwardingView.kt index ed1977936b..67a09add4a 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ForwardingView.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ForwardingView.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal +package org.appdevforall.codeonthego.inflater.internal -import com.itsaky.androidide.inflater.IView +import org.appdevforall.codeonthego.inflater.IView /** * An [IView] implementation that forwards all calls to [src]. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ImmutableAttributeImpl.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ImmutableAttributeImpl.kt similarity index 90% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ImmutableAttributeImpl.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ImmutableAttributeImpl.kt index e0a2613729..1bf62590cc 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ImmutableAttributeImpl.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ImmutableAttributeImpl.kt @@ -15,9 +15,9 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal +package org.appdevforall.codeonthego.inflater.internal -import com.itsaky.androidide.inflater.IAttribute +import org.appdevforall.codeonthego.inflater.IAttribute /** * Immutable implementation of [IAttribute]. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ImmutableViewGroupImpl.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ImmutableViewGroupImpl.kt similarity index 87% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ImmutableViewGroupImpl.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ImmutableViewGroupImpl.kt index fba86e4585..d4a6146b3f 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ImmutableViewGroupImpl.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ImmutableViewGroupImpl.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal +package org.appdevforall.codeonthego.inflater.internal -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.IViewGroup -import com.itsaky.androidide.inflater.IViewGroup.OnHierarchyChangeListener +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.IViewGroup +import org.appdevforall.codeonthego.inflater.IViewGroup.OnHierarchyChangeListener /** * Immutable implementation of [IViewGroup]. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ImmutableViewImpl.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ImmutableViewImpl.kt similarity index 87% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ImmutableViewImpl.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ImmutableViewImpl.kt index 9510a8eb92..18cbc63e53 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ImmutableViewImpl.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ImmutableViewImpl.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal +package org.appdevforall.codeonthego.inflater.internal -import com.itsaky.androidide.inflater.IAttribute -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.IView.AttributeChangeListener +import org.appdevforall.codeonthego.inflater.IAttribute +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.IView.AttributeChangeListener /** * An immutable implementation of [IView]. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/IncludeView.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/IncludeView.kt similarity index 85% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/IncludeView.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/IncludeView.kt index 014e536344..b476553a9d 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/IncludeView.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/IncludeView.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal +package org.appdevforall.codeonthego.inflater.internal -import com.itsaky.androidide.inflater.IAttribute -import com.itsaky.androidide.inflater.IViewGroup +import org.appdevforall.codeonthego.inflater.IAttribute +import org.appdevforall.codeonthego.inflater.IViewGroup /** - * [IView][com.itsaky.androidide.inflater.IView] implementation for `` tags. + * [IView][org.appdevforall.codeonthego.inflater.IView] implementation for `` tags. * * @author Akash Yadav */ diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/LayoutFile.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/LayoutFile.kt similarity index 94% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/LayoutFile.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/LayoutFile.kt index f0d4b78520..2b0ad16295 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/LayoutFile.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/LayoutFile.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal +package org.appdevforall.codeonthego.inflater.internal import java.io.File diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/LayoutInflaterImpl.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/LayoutInflaterImpl.kt similarity index 85% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/LayoutInflaterImpl.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/LayoutInflaterImpl.kt index 50a2d92692..2e66e3427c 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/LayoutInflaterImpl.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/LayoutInflaterImpl.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal +package org.appdevforall.codeonthego.inflater.internal import android.view.View import android.view.ViewGroup @@ -27,33 +27,33 @@ import com.android.aapt.Resources.XmlNode.NodeCase.ELEMENT import com.android.aaptcompiler.AaptResourceType.ID import com.android.aaptcompiler.AaptResourceType.LAYOUT import com.android.aaptcompiler.XmlProcessor -import com.itsaky.androidide.inflater.DefaultComponentFactory -import com.itsaky.androidide.inflater.IAttribute -import com.itsaky.androidide.inflater.IComponentFactory -import com.itsaky.androidide.inflater.IComponentFactory.Companion.LAYOUT_INFLATER_COMPONENT_FACTORY_KEY -import com.itsaky.androidide.inflater.ILayoutInflater -import com.itsaky.androidide.inflater.INamespace -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.IViewGroup -import com.itsaky.androidide.inflater.InflateException -import com.itsaky.androidide.inflater.events.IInflateEventsListener -import com.itsaky.androidide.inflater.events.InflationFinishEvent -import com.itsaky.androidide.inflater.events.InflationStartEvent -import com.itsaky.androidide.inflater.events.OnApplyAttributeEvent -import com.itsaky.androidide.inflater.events.OnInflateViewEvent -import com.itsaky.androidide.inflater.internal.utils.IDTable -import com.itsaky.androidide.inflater.internal.utils.ViewFactory.createViewInstance -import com.itsaky.androidide.inflater.internal.utils.ViewFactory.generateLayoutParams -import com.itsaky.androidide.inflater.internal.utils.parseLayoutReference -import com.itsaky.androidide.inflater.utils.endParse -import com.itsaky.androidide.inflater.utils.isParsing -import com.itsaky.androidide.inflater.utils.startParse -import com.itsaky.androidide.inflater.viewAdapter -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.projects.api.AndroidModule -import com.itsaky.androidide.xml.widgets.Widget -import com.itsaky.androidide.xml.widgets.WidgetTable -import com.itsaky.androidide.xml.widgets.WidgetType +import org.appdevforall.codeonthego.inflater.DefaultComponentFactory +import org.appdevforall.codeonthego.inflater.IAttribute +import org.appdevforall.codeonthego.inflater.IComponentFactory +import org.appdevforall.codeonthego.inflater.IComponentFactory.Companion.LAYOUT_INFLATER_COMPONENT_FACTORY_KEY +import org.appdevforall.codeonthego.inflater.ILayoutInflater +import org.appdevforall.codeonthego.inflater.INamespace +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.IViewGroup +import org.appdevforall.codeonthego.inflater.InflateException +import org.appdevforall.codeonthego.inflater.events.IInflateEventsListener +import org.appdevforall.codeonthego.inflater.events.InflationFinishEvent +import org.appdevforall.codeonthego.inflater.events.InflationStartEvent +import org.appdevforall.codeonthego.inflater.events.OnApplyAttributeEvent +import org.appdevforall.codeonthego.inflater.events.OnInflateViewEvent +import org.appdevforall.codeonthego.inflater.internal.utils.IDTable +import org.appdevforall.codeonthego.inflater.internal.utils.ViewFactory.createViewInstance +import org.appdevforall.codeonthego.inflater.internal.utils.ViewFactory.generateLayoutParams +import org.appdevforall.codeonthego.inflater.internal.utils.parseLayoutReference +import org.appdevforall.codeonthego.inflater.utils.endParse +import org.appdevforall.codeonthego.inflater.utils.isParsing +import org.appdevforall.codeonthego.inflater.utils.startParse +import org.appdevforall.codeonthego.inflater.viewAdapter +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.projects.api.AndroidModule +import org.appdevforall.codeonthego.xml.widgets.Widget +import org.appdevforall.codeonthego.xml.widgets.WidgetTable +import org.appdevforall.codeonthego.xml.widgets.WidgetType import java.io.File /** @@ -348,7 +348,7 @@ open class LayoutInflaterImpl : ILayoutInflater { } protected open fun processXmlFile(file: File): Pair { - return com.itsaky.androidide.inflater.utils.processXmlFile(file, LAYOUT) + return org.appdevforall.codeonthego.inflater.utils.processXmlFile(file, LAYOUT) } private fun onCreateUnsupportedView( @@ -375,7 +375,7 @@ open class LayoutInflaterImpl : ILayoutInflater { if (!isParsing) { if (this.module == null) { startParse(file) - this.module = com.itsaky.androidide.inflater.utils.module + this.module = org.appdevforall.codeonthego.inflater.utils.module } else { startParse(this.module!!) } diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/NamespaceImpl.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/NamespaceImpl.kt similarity index 88% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/NamespaceImpl.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/NamespaceImpl.kt index 27f4618b2d..b4609914f0 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/NamespaceImpl.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/NamespaceImpl.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal +package org.appdevforall.codeonthego.inflater.internal import android.os.Parcelable -import com.itsaky.androidide.inflater.INamespace +import org.appdevforall.codeonthego.inflater.INamespace import kotlinx.parcelize.Parcelize @Parcelize diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/SingleChildViewGroup.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/SingleChildViewGroup.kt similarity index 91% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/SingleChildViewGroup.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/SingleChildViewGroup.kt index 20017d7ce4..95f908ec9b 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/SingleChildViewGroup.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/SingleChildViewGroup.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal +package org.appdevforall.codeonthego.inflater.internal import android.view.ViewGroup -import com.itsaky.androidide.inflater.IView +import org.appdevforall.codeonthego.inflater.IView /** * A view group which can have only one child view. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ViewGroupImpl.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ViewGroupImpl.kt similarity index 94% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ViewGroupImpl.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ViewGroupImpl.kt index bec77f6989..df47fbf911 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ViewGroupImpl.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ViewGroupImpl.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal +package org.appdevforall.codeonthego.inflater.internal import android.view.ViewGroup -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.IViewGroup -import com.itsaky.androidide.inflater.IViewGroup.OnHierarchyChangeListener +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.IViewGroup +import org.appdevforall.codeonthego.inflater.IViewGroup.OnHierarchyChangeListener open class ViewGroupImpl(file: LayoutFile, name: String, view: ViewGroup) : ViewImpl(file = file, name = name, view = view), IViewGroup { diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ViewImpl.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ViewImpl.kt similarity index 90% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ViewImpl.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ViewImpl.kt index 5ff2bd872e..77bfb3cae1 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ViewImpl.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ViewImpl.kt @@ -15,20 +15,20 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal +package org.appdevforall.codeonthego.inflater.internal import android.graphics.drawable.Drawable import android.view.View import androidx.core.content.ContextCompat.getDrawable -import com.itsaky.androidide.inflater.IAttribute -import com.itsaky.androidide.inflater.INamespace -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.IView.AttributeChangeListener -import com.itsaky.androidide.inflater.IViewGroup -import com.itsaky.androidide.inflater.internal.utils.simpleName -import com.itsaky.androidide.inflater.internal.utils.tagName -import com.itsaky.androidide.inflater.utils.newAttribute -import com.itsaky.androidide.inflater.viewAdapter +import org.appdevforall.codeonthego.inflater.IAttribute +import org.appdevforall.codeonthego.inflater.INamespace +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.IView.AttributeChangeListener +import org.appdevforall.codeonthego.inflater.IViewGroup +import org.appdevforall.codeonthego.inflater.internal.utils.simpleName +import org.appdevforall.codeonthego.inflater.internal.utils.tagName +import org.appdevforall.codeonthego.inflater.utils.newAttribute +import org.appdevforall.codeonthego.inflater.viewAdapter import com.itsaky.androidide.resources.R.drawable import org.slf4j.LoggerFactory diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AbsListViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AbsListViewAdapter.kt similarity index 94% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AbsListViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AbsListViewAdapter.kt index 7a44e6dcd3..9acbc05640 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AbsListViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AbsListViewAdapter.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.AbsListView -import com.itsaky.androidide.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope /** * Attribute adapter for [AbsListView]. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AbsSeekBarAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AbsSeekBarAdapter.kt similarity index 91% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AbsSeekBarAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AbsSeekBarAdapter.kt index 8d763dbe81..768560556d 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AbsSeekBarAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AbsSeekBarAdapter.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.AbsSeekBar -import com.itsaky.androidide.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope /** * Attribute adapter for [AbsSeekBar]. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AbsSpinnerAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AbsSpinnerAdapter.kt similarity index 90% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AbsSpinnerAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AbsSpinnerAdapter.kt index 9da0e8d602..74eefc360f 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AbsSpinnerAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AbsSpinnerAdapter.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.R.layout import android.widget.AbsSpinner -import com.itsaky.androidide.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope /** * Attribute adapter for [AbsSpinner]. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AbsoluteLayoutAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AbsoluteLayoutAdapter.kt similarity index 94% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AbsoluteLayoutAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AbsoluteLayoutAdapter.kt index 67b3ddfba9..33fe3e509b 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AbsoluteLayoutAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AbsoluteLayoutAdapter.kt @@ -17,7 +17,7 @@ @file:Suppress("DEPRECATION") -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.AbsoluteLayout import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AdapterViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AdapterViewAdapter.kt similarity index 90% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AdapterViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AdapterViewAdapter.kt index 44ac2e514f..e199c7ec18 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AdapterViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AdapterViewAdapter.kt @@ -14,15 +14,15 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.R.layout import android.content.Context import android.widget.Adapter import android.widget.AdapterView import android.widget.ArrayAdapter -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.internal.ViewGroupImpl +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.internal.ViewGroupImpl /** * Attribute adapter for [AdapterView][android.widget.AdapterView] diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AnalogClockAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AnalogClockAdapter.kt similarity index 93% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AnalogClockAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AnalogClockAdapter.kt index 06bb486bcd..53f2a2e35b 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AnalogClockAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AnalogClockAdapter.kt @@ -17,7 +17,7 @@ @file:Suppress("DEPRECATION") -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.graphics.BlendMode import android.os.Build.VERSION_CODES @@ -25,8 +25,8 @@ import android.widget.AnalogClock import androidx.annotation.RequiresApi import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AutoCompleteTextViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AutoCompleteTextViewAdapter.kt similarity index 91% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AutoCompleteTextViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AutoCompleteTextViewAdapter.kt index 0304d81de4..195c7ca9b3 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/AutoCompleteTextViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/AutoCompleteTextViewAdapter.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.AutoCompleteTextView import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ButtonAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ButtonAdapter.kt similarity index 91% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ButtonAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ButtonAdapter.kt index 1b2cdd28de..c1915b5202 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ButtonAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ButtonAdapter.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.Button import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CalendarViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/CalendarViewAdapter.kt similarity index 93% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CalendarViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/CalendarViewAdapter.kt index c41005bfca..7417b68e82 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CalendarViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/CalendarViewAdapter.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.CalendarView import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CheckBoxAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/CheckBoxAdapter.kt similarity index 92% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CheckBoxAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/CheckBoxAdapter.kt index fc51262166..9ca6e767a2 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CheckBoxAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/CheckBoxAdapter.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.CheckBox import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CheckedTextViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/CheckedTextViewAdapter.kt similarity index 90% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CheckedTextViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/CheckedTextViewAdapter.kt index 992b4cd7d1..1ed0a2c2b5 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CheckedTextViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/CheckedTextViewAdapter.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.CheckedTextView import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ChronometerAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ChronometerAdapter.kt similarity index 90% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ChronometerAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ChronometerAdapter.kt index 548909c432..a0b65ac638 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ChronometerAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ChronometerAdapter.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.Chronometer import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CompoundButtonAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/CompoundButtonAdapter.kt similarity index 89% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CompoundButtonAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/CompoundButtonAdapter.kt index eca985a7f8..7da5ee7920 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/CompoundButtonAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/CompoundButtonAdapter.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.CompoundButton -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.IView +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.IView /** * Attribute adapter for [CompoundButton]. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/DigitalClockAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/DigitalClockAdapter.kt similarity index 92% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/DigitalClockAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/DigitalClockAdapter.kt index fe6b49b32d..3483d725ba 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/DigitalClockAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/DigitalClockAdapter.kt @@ -17,13 +17,13 @@ @file:Suppress("DEPRECATION") -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.DigitalClock import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/EditTextAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/EditTextAdapter.kt similarity index 92% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/EditTextAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/EditTextAdapter.kt index 2fa625ae3c..a4f735a830 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/EditTextAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/EditTextAdapter.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.EditText import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/FrameLayoutAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/FrameLayoutAdapter.kt similarity index 90% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/FrameLayoutAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/FrameLayoutAdapter.kt index 5061ae7aba..0f4469d47e 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/FrameLayoutAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/FrameLayoutAdapter.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.FrameLayout import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GestureOverlayViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/GestureOverlayViewAdapter.kt similarity index 93% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GestureOverlayViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/GestureOverlayViewAdapter.kt index 5da139813f..7c6460f286 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GestureOverlayViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/GestureOverlayViewAdapter.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.gesture.GestureOverlayView import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.utils.ReflectUtils +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.utils.ReflectUtils /** * Attribute adapter for [GestureOverlayView]. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GridLayoutAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/GridLayoutAdapter.kt similarity index 90% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GridLayoutAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/GridLayoutAdapter.kt index 21b39a3e7f..20cf79aaba 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GridLayoutAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/GridLayoutAdapter.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.GridLayout import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.IViewGroup -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.IViewGroup +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GridViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/GridViewAdapter.kt similarity index 92% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GridViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/GridViewAdapter.kt index f47ba46093..5ed62e86cd 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/GridViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/GridViewAdapter.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.GridView import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/HorizontalScrollViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/HorizontalScrollViewAdapter.kt similarity index 86% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/HorizontalScrollViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/HorizontalScrollViewAdapter.kt index d83756f9de..47a433c575 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/HorizontalScrollViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/HorizontalScrollViewAdapter.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.HorizontalScrollView import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.IViewGroup -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.IViewGroup +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R /** diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageButtonAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ImageButtonAdapter.kt similarity index 92% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageButtonAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ImageButtonAdapter.kt index b83aa83260..efb08934b1 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageButtonAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ImageButtonAdapter.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.ImageButton import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageSwitcherAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ImageSwitcherAdapter.kt similarity index 92% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageSwitcherAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ImageSwitcherAdapter.kt index e636b471a3..d0a9d4900a 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageSwitcherAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ImageSwitcherAdapter.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.ImageSwitcher import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ImageViewAdapter.kt similarity index 93% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ImageViewAdapter.kt index a49f43be78..f146ddd6ad 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ImageViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ImageViewAdapter.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.ImageView import android.widget.ImageView.ScaleType @@ -29,9 +29,9 @@ import android.widget.ImageView.ScaleType.FIT_XY import android.widget.ImageView.ScaleType.MATRIX import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/LinearLayoutAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/LinearLayoutAdapter.kt similarity index 87% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/LinearLayoutAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/LinearLayoutAdapter.kt index 0db86b4a24..b7d80c3c51 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/LinearLayoutAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/LinearLayoutAdapter.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.content.Context import android.view.ViewGroup @@ -25,14 +25,14 @@ import androidx.annotation.StringRes import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.INamespace -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.IViewGroup -import com.itsaky.androidide.inflater.LayoutStrategy -import com.itsaky.androidide.inflater.internal.LayoutFile -import com.itsaky.androidide.inflater.models.UiWidget -import com.itsaky.androidide.inflater.utils.newAttribute +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.INamespace +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.IViewGroup +import org.appdevforall.codeonthego.inflater.LayoutStrategy +import org.appdevforall.codeonthego.inflater.internal.LayoutFile +import org.appdevforall.codeonthego.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.utils.newAttribute import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ListViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ListViewAdapter.kt similarity index 89% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ListViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ListViewAdapter.kt index 631d136712..6164cca766 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ListViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ListViewAdapter.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.R.layout import android.widget.ArrayAdapter @@ -23,11 +23,11 @@ import android.widget.ListView import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string -import com.itsaky.androidide.utils.dpToPx +import org.appdevforall.codeonthego.utils.dpToPx /** * Attribute adapter for [ListView]. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/MultiAutoCompleteTextViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/MultiAutoCompleteTextViewAdapter.kt similarity index 92% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/MultiAutoCompleteTextViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/MultiAutoCompleteTextViewAdapter.kt index ce030dc51c..a63a6570ab 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/MultiAutoCompleteTextViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/MultiAutoCompleteTextViewAdapter.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.MultiAutoCompleteTextView import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R /** diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/NumberPickerAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/NumberPickerAdapter.kt similarity index 92% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/NumberPickerAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/NumberPickerAdapter.kt index 1568be7cdc..81a5b7f93a 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/NumberPickerAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/NumberPickerAdapter.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.NumberPicker import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ProgressBarAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ProgressBarAdapter.kt similarity index 94% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ProgressBarAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ProgressBarAdapter.kt index f6707267a4..bda9e69236 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ProgressBarAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ProgressBarAdapter.kt @@ -15,11 +15,11 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.ProgressBar -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/QuickContactBadgeAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/QuickContactBadgeAdapter.kt similarity index 92% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/QuickContactBadgeAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/QuickContactBadgeAdapter.kt index 1e8a35490a..c08e96aacc 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/QuickContactBadgeAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/QuickContactBadgeAdapter.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.QuickContactBadge import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RadioButtonAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/RadioButtonAdapter.kt similarity index 92% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RadioButtonAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/RadioButtonAdapter.kt index 4971724ed9..cc1a077360 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RadioButtonAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/RadioButtonAdapter.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.RadioButton import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RadioGroupAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/RadioGroupAdapter.kt similarity index 86% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RadioGroupAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/RadioGroupAdapter.kt index acfbcb51ed..9dfb8cd999 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RadioGroupAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/RadioGroupAdapter.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.RadioButton import android.widget.RadioGroup import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.IViewGroup -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.IViewGroup +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RatingBarAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/RatingBarAdapter.kt similarity index 90% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RatingBarAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/RatingBarAdapter.kt index 3152bd6f99..b522a1e519 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RatingBarAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/RatingBarAdapter.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.RatingBar import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RelativeLayoutAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/RelativeLayoutAdapter.kt similarity index 90% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RelativeLayoutAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/RelativeLayoutAdapter.kt index a17a7d1772..69bd277058 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/RelativeLayoutAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/RelativeLayoutAdapter.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.RelativeLayout import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ScrollViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ScrollViewAdapter.kt similarity index 85% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ScrollViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ScrollViewAdapter.kt index 3facdc1c77..49188c3a47 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ScrollViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ScrollViewAdapter.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.ScrollView import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.IViewGroup -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.IViewGroup +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R /** diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SeekBarAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/SeekBarAdapter.kt similarity index 89% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SeekBarAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/SeekBarAdapter.kt index d417b762d2..440e929eca 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SeekBarAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/SeekBarAdapter.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.SeekBar import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SpaceAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/SpaceAdapter.kt similarity index 91% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SpaceAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/SpaceAdapter.kt index 4e379ef7e0..50a9697cd2 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SpaceAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/SpaceAdapter.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.Space import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SpinnerAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/SpinnerAdapter.kt similarity index 91% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SpinnerAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/SpinnerAdapter.kt index 58a6ff53f0..ab8389f3cd 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SpinnerAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/SpinnerAdapter.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.Spinner import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R /** diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SurfaceViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/SurfaceViewAdapter.kt similarity index 92% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SurfaceViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/SurfaceViewAdapter.kt index 19e2d87118..aa3c2f8c37 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SurfaceViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/SurfaceViewAdapter.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.view.SurfaceView import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SwitchAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/SwitchAdapter.kt similarity index 93% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SwitchAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/SwitchAdapter.kt index d7c2187274..531561e5d7 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/SwitchAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/SwitchAdapter.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.graphics.Typeface.DEFAULT import android.widget.Switch import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextClockAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/TextClockAdapter.kt similarity index 90% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextClockAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/TextClockAdapter.kt index a71c5e60d9..fe7c66e81f 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextClockAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/TextClockAdapter.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.TextClock import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextSwitcherAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/TextSwitcherAdapter.kt similarity index 92% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextSwitcherAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/TextSwitcherAdapter.kt index 8130f95f49..65affc6984 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextSwitcherAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/TextSwitcherAdapter.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.TextSwitcher import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/TextViewAdapter.kt similarity index 95% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/TextViewAdapter.kt index 1fd668d816..e1bf9cb13e 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/TextViewAdapter.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.annotation.SuppressLint import android.graphics.Typeface @@ -25,11 +25,11 @@ import android.util.TypedValue import android.widget.TextView import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R -import com.itsaky.androidide.utils.spToPx +import org.appdevforall.codeonthego.utils.spToPx import java.util.regex.Pattern /** diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextureViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/TextureViewAdapter.kt similarity index 87% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextureViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/TextureViewAdapter.kt index 4d261c260a..1f12e31863 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/TextureViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/TextureViewAdapter.kt @@ -15,16 +15,16 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.content.Context import android.view.TextureView import android.view.View import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.internal.ui.DesignerTextureView -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.internal.ui.DesignerTextureView +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ToggleButtonAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ToggleButtonAdapter.kt similarity index 85% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ToggleButtonAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ToggleButtonAdapter.kt index 6c0f71f4ff..a0015dd111 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ToggleButtonAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ToggleButtonAdapter.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.ToggleButton import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string -import com.itsaky.androidide.utils.ReflectUtils.Companion.reflect +import org.appdevforall.codeonthego.utils.ReflectUtils.Companion.reflect /** * Attribute adapter for [ToggleButton]. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/VideoViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/VideoViewAdapter.kt similarity index 92% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/VideoViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/VideoViewAdapter.kt index 6972e3e4ee..a49e777947 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/VideoViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/VideoViewAdapter.kt @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.VideoView import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ViewAdapter.kt similarity index 92% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ViewAdapter.kt index 84b72aa269..8f0eab71a0 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ViewAdapter.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.content.Context import android.graphics.PorterDuff @@ -54,14 +54,14 @@ import androidx.core.view.updatePaddingRelative import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.IAttribute -import com.itsaky.androidide.inflater.INamespace -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.IViewAdapter -import com.itsaky.androidide.inflater.internal.IncludeView -import com.itsaky.androidide.inflater.models.UiWidget -import com.itsaky.androidide.inflater.utils.newAttribute +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.IAttribute +import org.appdevforall.codeonthego.inflater.INamespace +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.IViewAdapter +import org.appdevforall.codeonthego.inflater.internal.IncludeView +import org.appdevforall.codeonthego.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.utils.newAttribute import com.itsaky.androidide.resources.R /** @@ -288,23 +288,23 @@ open class ViewAdapter : IViewAdapter() { } protected open fun parseDrawingCacheQuality(value: String): Int { - return com.itsaky.androidide.inflater.internal.utils.parseDrawingCacheQuality(value) + return org.appdevforall.codeonthego.inflater.internal.utils.parseDrawingCacheQuality(value) } protected open fun parseVisibility(value: String): Int { - return com.itsaky.androidide.inflater.internal.utils.parseVisibility(value) + return org.appdevforall.codeonthego.inflater.internal.utils.parseVisibility(value) } protected open fun parseTextAlignment(value: String): Int { - return com.itsaky.androidide.inflater.internal.utils.parseTextAlignment(value) + return org.appdevforall.codeonthego.inflater.internal.utils.parseTextAlignment(value) } protected open fun parseTextDirection(value: String): Int { - return com.itsaky.androidide.inflater.internal.utils.parseTextDirection(value) + return org.appdevforall.codeonthego.inflater.internal.utils.parseTextDirection(value) } protected open fun parsePorterDuffMode(mode: String): PorterDuff.Mode { - return com.itsaky.androidide.inflater.internal.utils.parsePorterDuffMode(mode) + return org.appdevforall.codeonthego.inflater.internal.utils.parsePorterDuffMode(mode) } @ChecksSdkIntAtLeast(api = Build.VERSION_CODES.Q) diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewAnimatorAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ViewAnimatorAdapter.kt similarity index 89% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewAnimatorAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ViewAnimatorAdapter.kt index ad2ee57bfd..38cfeabcfc 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewAnimatorAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ViewAnimatorAdapter.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.ViewAnimator import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R /** diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewFlipperAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ViewFlipperAdapter.kt similarity index 90% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewFlipperAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ViewFlipperAdapter.kt index 8ddee8d0dc..ddc7a034fe 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewFlipperAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ViewFlipperAdapter.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.ViewFlipper import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewGroupAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ViewGroupAdapter.kt similarity index 85% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewGroupAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ViewGroupAdapter.kt index d6f8afad77..3e40fb8cc5 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewGroupAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ViewGroupAdapter.kt @@ -15,15 +15,15 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.animation.LayoutTransition import android.view.ViewGroup -import com.itsaky.androidide.inflater.AttributeHandlerScope -import com.itsaky.androidide.inflater.IViewGroup -import com.itsaky.androidide.inflater.IViewGroupAdapter -import com.itsaky.androidide.inflater.LayoutStrategy -import com.itsaky.androidide.inflater.LayoutStrategy.Companion.TOP_LEFT +import org.appdevforall.codeonthego.inflater.AttributeHandlerScope +import org.appdevforall.codeonthego.inflater.IViewGroup +import org.appdevforall.codeonthego.inflater.IViewGroupAdapter +import org.appdevforall.codeonthego.inflater.LayoutStrategy +import org.appdevforall.codeonthego.inflater.LayoutStrategy.Companion.TOP_LEFT /** * Base attribute adapter for all [ViewGroup]. diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewSwitcherAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ViewSwitcherAdapter.kt similarity index 92% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewSwitcherAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ViewSwitcherAdapter.kt index a0432b32a6..2dd3f62728 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/ViewSwitcherAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/ViewSwitcherAdapter.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.widget.ViewSwitcher import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.LAYOUTS -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/WebViewAdapter.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/WebViewAdapter.kt similarity index 91% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/WebViewAdapter.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/WebViewAdapter.kt index 1110a7b45a..7b96d3c3b2 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/WebViewAdapter.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/WebViewAdapter.kt @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters +package org.appdevforall.codeonthego.inflater.internal.adapters import android.webkit.WebView import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner.Group.WIDGETS -import com.itsaky.androidide.inflater.models.UiWidget +import org.appdevforall.codeonthego.inflater.models.UiWidget import com.itsaky.androidide.resources.R.drawable import com.itsaky.androidide.resources.R.string diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/appcompat/AppCompatTextView.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/appcompat/AppCompatTextView.kt similarity index 91% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/appcompat/AppCompatTextView.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/appcompat/AppCompatTextView.kt index 096b73dc58..bccb500d60 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/adapters/appcompat/AppCompatTextView.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/adapters/appcompat/AppCompatTextView.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.adapters.appcompat +package org.appdevforall.codeonthego.inflater.internal.adapters.appcompat /** * @author Akash Yadav diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ui/DesignerTextureView.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ui/DesignerTextureView.kt similarity index 96% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ui/DesignerTextureView.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ui/DesignerTextureView.kt index 0a5ff5c938..4982798bcf 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/ui/DesignerTextureView.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/ui/DesignerTextureView.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.ui +package org.appdevforall.codeonthego.inflater.internal.ui import android.content.Context import android.graphics.drawable.Drawable diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/IDTable.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/IDTable.kt similarity index 94% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/IDTable.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/IDTable.kt index 43f75df0ef..7684583698 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/IDTable.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/IDTable.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.utils +package org.appdevforall.codeonthego.inflater.internal.utils internal object IDTable { diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/TextDrawable.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/TextDrawable.kt similarity index 97% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/TextDrawable.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/TextDrawable.kt index 8130aea8a1..77d3424e84 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/TextDrawable.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/TextDrawable.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.utils +package org.appdevforall.codeonthego.inflater.internal.utils import android.graphics.Canvas import android.graphics.Color diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/ViewFactory.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/ViewFactory.kt similarity index 92% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/ViewFactory.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/ViewFactory.kt index 64025d7fbb..29b828a24d 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/ViewFactory.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/ViewFactory.kt @@ -15,14 +15,14 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.utils +package org.appdevforall.codeonthego.inflater.internal.utils import android.content.Context import android.view.View import android.view.ViewGroup import android.view.ViewGroup.LayoutParams -import com.itsaky.androidide.inflater.InflateException -import com.itsaky.androidide.inflater.internal.ViewAdapterIndexImpl +import org.appdevforall.codeonthego.inflater.InflateException +import org.appdevforall.codeonthego.inflater.internal.ViewAdapterIndexImpl import org.slf4j.LoggerFactory import java.lang.reflect.Method diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/ViewUtils.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/ViewUtils.kt similarity index 95% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/ViewUtils.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/ViewUtils.kt index a0ca740c70..2b5a703522 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/ViewUtils.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/ViewUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.utils +package org.appdevforall.codeonthego.inflater.internal.utils import com.android.SdkConstants.ANDROID_PKG diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/basicParseUtils.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/basicParseUtils.kt similarity index 98% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/basicParseUtils.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/basicParseUtils.kt index 3feeba09b6..865d0aaf05 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/basicParseUtils.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/basicParseUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.utils +package org.appdevforall.codeonthego.inflater.internal.utils import android.annotation.SuppressLint import android.content.Context @@ -58,8 +58,8 @@ import com.android.aaptcompiler.tryParseBool import com.android.aaptcompiler.tryParseFlagSymbol import com.android.aaptcompiler.tryParseInt import com.android.aaptcompiler.tryParseReference -import com.itsaky.androidide.inflater.drawable.DrawableParserFactory -import com.itsaky.androidide.inflater.utils.module +import org.appdevforall.codeonthego.inflater.drawable.DrawableParserFactory +import org.appdevforall.codeonthego.inflater.utils.module import org.slf4j.LoggerFactory import java.io.File import java.text.SimpleDateFormat diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/lookup.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/lookup.kt similarity index 96% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/lookup.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/lookup.kt index 8805cd4751..7adb62b63e 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/lookup.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/lookup.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.utils +package org.appdevforall.codeonthego.inflater.internal.utils import com.android.SdkConstants import com.android.aaptcompiler.AaptResourceType @@ -26,7 +26,7 @@ import com.android.aaptcompiler.ResourceGroup import com.android.aaptcompiler.ResourceName import com.android.aaptcompiler.ResourceTable import com.android.aaptcompiler.ResourceTablePackage -import com.itsaky.androidide.inflater.utils.module +import org.appdevforall.codeonthego.inflater.utils.module import org.slf4j.LoggerFactory private val log = LoggerFactory.getLogger("ParseLookupUtils") diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/viewParseUtils.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/viewParseUtils.kt similarity index 97% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/viewParseUtils.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/viewParseUtils.kt index 5a463d0288..d35d8df6a7 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/internal/utils/viewParseUtils.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/internal/utils/viewParseUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.internal.utils +package org.appdevforall.codeonthego.inflater.internal.utils import android.graphics.PorterDuff import android.view.View diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/models/UiWidget.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/models/UiWidget.kt similarity index 79% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/models/UiWidget.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/models/UiWidget.kt index 1ed4fb9a11..30fbbab30f 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/models/UiWidget.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/models/UiWidget.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.models +package org.appdevforall.codeonthego.inflater.models import android.content.Context import android.view.View @@ -23,16 +23,16 @@ import android.view.ViewGroup import androidx.annotation.DrawableRes import androidx.annotation.StringRes import androidx.core.view.updatePaddingRelative -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.IViewGroup -import com.itsaky.androidide.inflater.internal.LayoutFile -import com.itsaky.androidide.inflater.internal.ViewGroupImpl -import com.itsaky.androidide.inflater.internal.ViewImpl -import com.itsaky.androidide.inflater.internal.utils.ViewFactory -import com.itsaky.androidide.inflater.internal.utils.ViewFactory.generateLayoutParams -import com.itsaky.androidide.inflater.utils.lookupComponentFactory -import com.itsaky.androidide.inflater.viewAdapter -import com.itsaky.androidide.utils.dpToPx +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.IViewGroup +import org.appdevforall.codeonthego.inflater.internal.LayoutFile +import org.appdevforall.codeonthego.inflater.internal.ViewGroupImpl +import org.appdevforall.codeonthego.inflater.internal.ViewImpl +import org.appdevforall.codeonthego.inflater.internal.utils.ViewFactory +import org.appdevforall.codeonthego.inflater.internal.utils.ViewFactory.generateLayoutParams +import org.appdevforall.codeonthego.inflater.utils.lookupComponentFactory +import org.appdevforall.codeonthego.inflater.viewAdapter +import org.appdevforall.codeonthego.utils.dpToPx open class UiWidget( val name: String, diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/utils/inflaterUtils.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/utils/inflaterUtils.kt similarity index 80% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/utils/inflaterUtils.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/utils/inflaterUtils.kt index ff0257bd93..62ba4dec4d 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/utils/inflaterUtils.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/utils/inflaterUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.utils +package org.appdevforall.codeonthego.inflater.utils import com.android.aaptcompiler.AaptResourceType import com.android.aaptcompiler.BlameLogger @@ -24,18 +24,18 @@ import com.android.aaptcompiler.ResourceFile.Type.ProtoXml import com.android.aaptcompiler.ResourceName import com.android.aaptcompiler.XmlProcessor import com.android.aaptcompiler.extractPathData -import com.itsaky.androidide.aapt.logging.IDELogger -import com.itsaky.androidide.inflater.IAttribute -import com.itsaky.androidide.inflater.IComponentFactory -import com.itsaky.androidide.inflater.ILayoutInflater -import com.itsaky.androidide.inflater.ILayoutInflater.Companion -import com.itsaky.androidide.inflater.INamespace -import com.itsaky.androidide.inflater.IView -import com.itsaky.androidide.inflater.InflateException -import com.itsaky.androidide.inflater.internal.AttributeImpl -import com.itsaky.androidide.lookup.Lookup -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.api.AndroidModule +import org.appdevforall.codeonthego.aapt.logging.IDELogger +import org.appdevforall.codeonthego.inflater.IAttribute +import org.appdevforall.codeonthego.inflater.IComponentFactory +import org.appdevforall.codeonthego.inflater.ILayoutInflater +import org.appdevforall.codeonthego.inflater.ILayoutInflater.Companion +import org.appdevforall.codeonthego.inflater.INamespace +import org.appdevforall.codeonthego.inflater.IView +import org.appdevforall.codeonthego.inflater.InflateException +import org.appdevforall.codeonthego.inflater.internal.AttributeImpl +import org.appdevforall.codeonthego.lookup.Lookup +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.api.AndroidModule import java.io.File /** Get the [ILayoutInflater] registered with [Lookup]. */ diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/utils/module.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/utils/module.kt similarity index 87% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/utils/module.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/utils/module.kt index 7546c215b4..23fdeb404b 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/utils/module.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/utils/module.kt @@ -15,10 +15,10 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.utils +package org.appdevforall.codeonthego.inflater.utils -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.api.AndroidModule +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.api.AndroidModule import java.io.File private var currentModule: AndroidModule? = null diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/utils/viewUtils.kt b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/utils/viewUtils.kt similarity index 95% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/utils/viewUtils.kt rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/utils/viewUtils.kt index c5a1c7078d..e03253809a 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/utils/viewUtils.kt +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/utils/viewUtils.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater import android.view.ViewGroup diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/DefaultValues.java b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/DefaultValues.java similarity index 97% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/DefaultValues.java rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/DefaultValues.java index d9a00151d0..e53f3f571a 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/DefaultValues.java +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/DefaultValues.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.vectormaster; +package org.appdevforall.codeonthego.inflater.vectormaster; import android.graphics.Color; import android.graphics.Paint; diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/VectorMasterDrawable.java b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/VectorMasterDrawable.java similarity index 97% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/VectorMasterDrawable.java rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/VectorMasterDrawable.java index 18cb3345cb..a699c487be 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/VectorMasterDrawable.java +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/VectorMasterDrawable.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.vectormaster; +package org.appdevforall.codeonthego.inflater.vectormaster; import android.content.Context; import android.graphics.Canvas; @@ -26,12 +26,12 @@ import android.graphics.Rect; import android.graphics.drawable.Drawable; import androidx.annotation.NonNull; -import com.itsaky.androidide.inflater.vectormaster.models.ClipPathModel; -import com.itsaky.androidide.inflater.vectormaster.models.GroupModel; -import com.itsaky.androidide.inflater.vectormaster.models.PathModel; -import com.itsaky.androidide.inflater.vectormaster.models.VectorModel; -import com.itsaky.androidide.inflater.vectormaster.utilities.Utils; -import com.itsaky.androidide.utils.FileIOUtils; +import org.appdevforall.codeonthego.inflater.vectormaster.models.ClipPathModel; +import org.appdevforall.codeonthego.inflater.vectormaster.models.GroupModel; +import org.appdevforall.codeonthego.inflater.vectormaster.models.PathModel; +import org.appdevforall.codeonthego.inflater.vectormaster.models.VectorModel; +import org.appdevforall.codeonthego.inflater.vectormaster.utilities.Utils; +import org.appdevforall.codeonthego.utils.FileIOUtils; import java.io.File; import java.io.IOException; import java.io.StringReader; diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/VectorMasterView.java b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/VectorMasterView.java similarity index 97% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/VectorMasterView.java rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/VectorMasterView.java index d99b727bbc..325fbc2db1 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/VectorMasterView.java +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/VectorMasterView.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.vectormaster; +package org.appdevforall.codeonthego.inflater.vectormaster; import android.annotation.SuppressLint; import android.content.Context; @@ -26,11 +26,11 @@ import android.graphics.Path; import android.util.AttributeSet; import android.view.View; -import com.itsaky.androidide.inflater.vectormaster.models.ClipPathModel; -import com.itsaky.androidide.inflater.vectormaster.models.GroupModel; -import com.itsaky.androidide.inflater.vectormaster.models.PathModel; -import com.itsaky.androidide.inflater.vectormaster.models.VectorModel; -import com.itsaky.androidide.inflater.vectormaster.utilities.Utils; +import org.appdevforall.codeonthego.inflater.vectormaster.models.ClipPathModel; +import org.appdevforall.codeonthego.inflater.vectormaster.models.GroupModel; +import org.appdevforall.codeonthego.inflater.vectormaster.models.PathModel; +import org.appdevforall.codeonthego.inflater.vectormaster.models.VectorModel; +import org.appdevforall.codeonthego.inflater.vectormaster.utilities.Utils; import com.itsaky.androidide.resources.R; import java.io.IOException; import java.util.Stack; diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/enums/TintMode.java b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/enums/TintMode.java similarity index 92% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/enums/TintMode.java rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/enums/TintMode.java index b32f4b1358..0b5937d493 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/enums/TintMode.java +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/enums/TintMode.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.vectormaster.enums; +package org.appdevforall.codeonthego.inflater.vectormaster.enums; /** Created by Harjot on 20-Jun-17. */ public enum TintMode { diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/models/ClipPathModel.java b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/models/ClipPathModel.java similarity index 90% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/models/ClipPathModel.java rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/models/ClipPathModel.java index 2657ac1d4b..67d0415126 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/models/ClipPathModel.java +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/models/ClipPathModel.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.vectormaster.models; +package org.appdevforall.codeonthego.inflater.vectormaster.models; import android.graphics.Matrix; import android.graphics.Paint; @@ -23,7 +23,7 @@ import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; import android.graphics.RectF; -import com.itsaky.androidide.inflater.vectormaster.utilities.parser.PathParser; +import org.appdevforall.codeonthego.inflater.vectormaster.utilities.parser.PathParser; public class ClipPathModel { private String name; @@ -45,7 +45,7 @@ public ClipPathModel() { public void buildPath(boolean useLegacyParser) { if (useLegacyParser) { originalPath = - com.itsaky.androidide.inflater.vectormaster.utilities.legacyparser.PathParser.createPathFromPathData( + org.appdevforall.codeonthego.inflater.vectormaster.utilities.legacyparser.PathParser.createPathFromPathData( pathData); } else { originalPath = PathParser.doPath(pathData); diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/models/GroupModel.java b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/models/GroupModel.java similarity index 97% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/models/GroupModel.java rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/models/GroupModel.java index 6117e2026a..39cb55e0aa 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/models/GroupModel.java +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/models/GroupModel.java @@ -15,12 +15,12 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.vectormaster.models; +package org.appdevforall.codeonthego.inflater.vectormaster.models; import android.graphics.Canvas; import android.graphics.Matrix; -import com.itsaky.androidide.inflater.vectormaster.DefaultValues; -import com.itsaky.androidide.inflater.vectormaster.utilities.Utils; +import org.appdevforall.codeonthego.inflater.vectormaster.DefaultValues; +import org.appdevforall.codeonthego.inflater.vectormaster.utilities.Utils; import java.util.ArrayList; public class GroupModel { diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/models/PathModel.java b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/models/PathModel.java similarity index 95% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/models/PathModel.java rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/models/PathModel.java index 925f954a02..b2d7886c74 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/models/PathModel.java +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/models/PathModel.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.vectormaster.models; +package org.appdevforall.codeonthego.inflater.vectormaster.models; import android.graphics.Color; import android.graphics.Matrix; @@ -23,9 +23,9 @@ import android.graphics.Path; import android.graphics.PathMeasure; import android.graphics.RectF; -import com.itsaky.androidide.inflater.vectormaster.DefaultValues; -import com.itsaky.androidide.inflater.vectormaster.utilities.Utils; -import com.itsaky.androidide.inflater.vectormaster.utilities.parser.PathParser; +import org.appdevforall.codeonthego.inflater.vectormaster.DefaultValues; +import org.appdevforall.codeonthego.inflater.vectormaster.utilities.Utils; +import org.appdevforall.codeonthego.inflater.vectormaster.utilities.parser.PathParser; public class PathModel { @@ -107,7 +107,7 @@ public void updatePaint() { public void buildPath(boolean useLegacyParser) { if (useLegacyParser) { originalPath = - com.itsaky.androidide.inflater.vectormaster.utilities.legacyparser.PathParser.createPathFromPathData( + org.appdevforall.codeonthego.inflater.vectormaster.utilities.legacyparser.PathParser.createPathFromPathData( pathData); } else { originalPath = PathParser.doPath(pathData); diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/models/VectorModel.java b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/models/VectorModel.java similarity index 97% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/models/VectorModel.java rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/models/VectorModel.java index cd364d8408..181bec9acd 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/models/VectorModel.java +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/models/VectorModel.java @@ -15,13 +15,13 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.vectormaster.models; +package org.appdevforall.codeonthego.inflater.vectormaster.models; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Matrix; import android.graphics.Path; -import com.itsaky.androidide.inflater.vectormaster.enums.TintMode; +import org.appdevforall.codeonthego.inflater.vectormaster.enums.TintMode; import java.util.ArrayList; public class VectorModel { diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/utilities/Utils.java b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/utilities/Utils.java similarity index 97% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/utilities/Utils.java rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/utilities/Utils.java index b37e23f620..bca3d03faa 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/utilities/Utils.java +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/utilities/Utils.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.vectormaster.utilities; +package org.appdevforall.codeonthego.inflater.vectormaster.utilities; import android.content.res.Resources; import android.graphics.Color; diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/utilities/legacyparser/PathParser.java b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/utilities/legacyparser/PathParser.java similarity index 99% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/utilities/legacyparser/PathParser.java rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/utilities/legacyparser/PathParser.java index 60e5396625..ce0c3fc729 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/utilities/legacyparser/PathParser.java +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/utilities/legacyparser/PathParser.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.vectormaster.utilities.legacyparser; +package org.appdevforall.codeonthego.inflater.vectormaster.utilities.legacyparser; import android.graphics.Path; import androidx.annotation.Nullable; diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/utilities/parser/ParserHelper.java b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/utilities/parser/ParserHelper.java similarity index 99% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/utilities/parser/ParserHelper.java rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/utilities/parser/ParserHelper.java index 811a4b2788..8c1edf31e8 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/utilities/parser/ParserHelper.java +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/utilities/parser/ParserHelper.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.vectormaster.utilities.parser; +package org.appdevforall.codeonthego.inflater.vectormaster.utilities.parser; /* diff --git a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/utilities/parser/PathParser.java b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/utilities/parser/PathParser.java similarity index 99% rename from xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/utilities/parser/PathParser.java rename to xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/utilities/parser/PathParser.java index 7a03f649de..d02d93cd64 100644 --- a/xml-inflater/src/main/java/com/itsaky/androidide/inflater/vectormaster/utilities/parser/PathParser.java +++ b/xml-inflater/src/main/java/org/appdevforall/codeonthego/inflater/vectormaster/utilities/parser/PathParser.java @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater.vectormaster.utilities.parser; +package org.appdevforall.codeonthego.inflater.vectormaster.utilities.parser; import android.graphics.Path; import android.graphics.RectF; diff --git a/xml-inflater/src/test/java/com/itsaky/androidide/inflater/AdapterIndexTest.kt b/xml-inflater/src/test/java/org/appdevforall/codeonthego/inflater/AdapterIndexTest.kt similarity index 96% rename from xml-inflater/src/test/java/com/itsaky/androidide/inflater/AdapterIndexTest.kt rename to xml-inflater/src/test/java/org/appdevforall/codeonthego/inflater/AdapterIndexTest.kt index 7e03d88df0..cf643fb76c 100644 --- a/xml-inflater/src/test/java/com/itsaky/androidide/inflater/AdapterIndexTest.kt +++ b/xml-inflater/src/test/java/org/appdevforall/codeonthego/inflater/AdapterIndexTest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater import com.google.common.truth.Truth.assertThat import org.junit.Test diff --git a/xml-inflater/src/test/java/com/itsaky/androidide/inflater/ExampleUnitTest.kt b/xml-inflater/src/test/java/org/appdevforall/codeonthego/inflater/ExampleUnitTest.kt similarity index 95% rename from xml-inflater/src/test/java/com/itsaky/androidide/inflater/ExampleUnitTest.kt rename to xml-inflater/src/test/java/org/appdevforall/codeonthego/inflater/ExampleUnitTest.kt index abadf90ac4..ef8ff4c77d 100644 --- a/xml-inflater/src/test/java/com/itsaky/androidide/inflater/ExampleUnitTest.kt +++ b/xml-inflater/src/test/java/org/appdevforall/codeonthego/inflater/ExampleUnitTest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater import org.junit.Assert.assertEquals import org.junit.Test diff --git a/xml-inflater/src/test/java/com/itsaky/androidide/inflater/LayoutInflaterTest.kt b/xml-inflater/src/test/java/org/appdevforall/codeonthego/inflater/LayoutInflaterTest.kt similarity index 88% rename from xml-inflater/src/test/java/com/itsaky/androidide/inflater/LayoutInflaterTest.kt rename to xml-inflater/src/test/java/org/appdevforall/codeonthego/inflater/LayoutInflaterTest.kt index e488da4426..e0e537a8bb 100644 --- a/xml-inflater/src/test/java/com/itsaky/androidide/inflater/LayoutInflaterTest.kt +++ b/xml-inflater/src/test/java/org/appdevforall/codeonthego/inflater/LayoutInflaterTest.kt @@ -15,7 +15,7 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater import android.view.View import android.widget.FrameLayout @@ -23,15 +23,15 @@ import android.widget.ImageView import android.widget.LinearLayout import android.widget.TextView import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.inflater.internal.IncludeView -import com.itsaky.androidide.inflater.internal.LayoutInflaterImpl -import com.itsaky.androidide.inflater.internal.ViewGroupImpl -import com.itsaky.androidide.inflater.internal.ViewImpl -import com.itsaky.androidide.inflater.internal.utils.IDTable -import com.itsaky.androidide.inflater.utils.newAttribute -import com.itsaky.androidide.projects.api.AndroidModule -import com.itsaky.androidide.projects.models.projectDir -import com.itsaky.androidide.projects.util.findAppModule +import org.appdevforall.codeonthego.inflater.internal.IncludeView +import org.appdevforall.codeonthego.inflater.internal.LayoutInflaterImpl +import org.appdevforall.codeonthego.inflater.internal.ViewGroupImpl +import org.appdevforall.codeonthego.inflater.internal.ViewImpl +import org.appdevforall.codeonthego.inflater.internal.utils.IDTable +import org.appdevforall.codeonthego.inflater.utils.newAttribute +import org.appdevforall.codeonthego.projects.api.AndroidModule +import org.appdevforall.codeonthego.projects.models.projectDir +import org.appdevforall.codeonthego.projects.util.findAppModule import org.junit.Before import org.junit.Test import org.junit.runner.RunWith @@ -185,14 +185,14 @@ class LayoutInflaterTest { assertThat(root.printHierarchy()) .isEqualTo( "android.widget.LinearLayout\n" + - " com.itsaky.androidide.inflater.unsupported.UnsupportedView\n" + - " com.itsaky.androidide.inflater.unsupported.UnsupportedLayout\n" + - " com.itsaky.androidide.inflater.unsupported.UnsupportedLayout\n" + + " org.appdevforall.codeonthego.inflater.unsupported.UnsupportedView\n" + + " org.appdevforall.codeonthego.inflater.unsupported.UnsupportedLayout\n" + + " org.appdevforall.codeonthego.inflater.unsupported.UnsupportedLayout\n" + " android.widget.ImageView\n" + " android.widget.ImageView\n" + - " com.itsaky.androidide.inflater.unsupported.UnsupportedLayout\n" + - " com.itsaky.androidide.inflater.unsupported.UnsupportedView\n" + - " com.itsaky.androidide.inflater.unsupported.UnsupportedView\n" + " org.appdevforall.codeonthego.inflater.unsupported.UnsupportedLayout\n" + + " org.appdevforall.codeonthego.inflater.unsupported.UnsupportedView\n" + + " org.appdevforall.codeonthego.inflater.unsupported.UnsupportedView\n" ) // TextView is used to inflate unsupported views diff --git a/xml-inflater/src/test/java/com/itsaky/androidide/inflater/ValueParsersTest.kt b/xml-inflater/src/test/java/org/appdevforall/codeonthego/inflater/ValueParsersTest.kt similarity index 91% rename from xml-inflater/src/test/java/com/itsaky/androidide/inflater/ValueParsersTest.kt rename to xml-inflater/src/test/java/org/appdevforall/codeonthego/inflater/ValueParsersTest.kt index 5013f55f80..1f67f6cfb8 100644 --- a/xml-inflater/src/test/java/com/itsaky/androidide/inflater/ValueParsersTest.kt +++ b/xml-inflater/src/test/java/org/appdevforall/codeonthego/inflater/ValueParsersTest.kt @@ -15,21 +15,21 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater import android.graphics.Color import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.ColorDrawable import android.graphics.drawable.GradientDrawable import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.inflater.internal.utils.parseBoolean -import com.itsaky.androidide.inflater.internal.utils.parseColor -import com.itsaky.androidide.inflater.internal.utils.parseDimension -import com.itsaky.androidide.inflater.internal.utils.parseDrawable -import com.itsaky.androidide.inflater.internal.utils.parseInteger -import com.itsaky.androidide.inflater.internal.utils.parseIntegerArray -import com.itsaky.androidide.inflater.internal.utils.parseString -import com.itsaky.androidide.inflater.internal.utils.parseStringArray +import org.appdevforall.codeonthego.inflater.internal.utils.parseBoolean +import org.appdevforall.codeonthego.inflater.internal.utils.parseColor +import org.appdevforall.codeonthego.inflater.internal.utils.parseDimension +import org.appdevforall.codeonthego.inflater.internal.utils.parseDrawable +import org.appdevforall.codeonthego.inflater.internal.utils.parseInteger +import org.appdevforall.codeonthego.inflater.internal.utils.parseIntegerArray +import org.appdevforall.codeonthego.inflater.internal.utils.parseString +import org.appdevforall.codeonthego.inflater.internal.utils.parseStringArray import org.junit.Before import org.junit.Test import org.junit.runner.RunWith diff --git a/xml-inflater/src/test/java/com/itsaky/androidide/inflater/XmlInflaterTest.kt b/xml-inflater/src/test/java/org/appdevforall/codeonthego/inflater/XmlInflaterTest.kt similarity index 83% rename from xml-inflater/src/test/java/com/itsaky/androidide/inflater/XmlInflaterTest.kt rename to xml-inflater/src/test/java/org/appdevforall/codeonthego/inflater/XmlInflaterTest.kt index b48a4d05dc..32be112d95 100644 --- a/xml-inflater/src/test/java/com/itsaky/androidide/inflater/XmlInflaterTest.kt +++ b/xml-inflater/src/test/java/org/appdevforall/codeonthego/inflater/XmlInflaterTest.kt @@ -15,17 +15,17 @@ * along with AndroidIDE. If not, see . */ -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater import androidx.appcompat.app.AppCompatActivity import com.google.common.truth.Truth.assertThat -import com.itsaky.androidide.inflater.utils.endParse -import com.itsaky.androidide.inflater.utils.startParse -import com.itsaky.androidide.projects.IProjectManager -import com.itsaky.androidide.projects.api.AndroidModule -import com.itsaky.androidide.projects.util.findAppModule -import com.itsaky.androidide.testing.tooling.ToolingApiTestLauncher -import com.itsaky.androidide.tooling.api.messages.result.InitializeResult +import org.appdevforall.codeonthego.inflater.utils.endParse +import org.appdevforall.codeonthego.inflater.utils.startParse +import org.appdevforall.codeonthego.projects.IProjectManager +import org.appdevforall.codeonthego.projects.api.AndroidModule +import org.appdevforall.codeonthego.projects.util.findAppModule +import org.appdevforall.codeonthego.testing.tooling.ToolingApiTestLauncher +import org.appdevforall.codeonthego.tooling.api.messages.result.InitializeResult import kotlinx.coroutines.runBlocking import org.junit.Ignore import org.robolectric.Robolectric diff --git a/xml-inflater/src/test/java/com/itsaky/androidide/inflater/adapterUtils.kt b/xml-inflater/src/test/java/org/appdevforall/codeonthego/inflater/adapterUtils.kt similarity index 63% rename from xml-inflater/src/test/java/com/itsaky/androidide/inflater/adapterUtils.kt rename to xml-inflater/src/test/java/org/appdevforall/codeonthego/inflater/adapterUtils.kt index 63b50ab23e..4f1cd24c15 100644 --- a/xml-inflater/src/test/java/com/itsaky/androidide/inflater/adapterUtils.kt +++ b/xml-inflater/src/test/java/org/appdevforall/codeonthego/inflater/adapterUtils.kt @@ -17,7 +17,7 @@ @file:Suppress("DEPRECATION") -package com.itsaky.androidide.inflater +package org.appdevforall.codeonthego.inflater import android.gesture.GestureOverlayView import android.view.SurfaceView @@ -50,31 +50,31 @@ import android.widget.Spinner import android.widget.Switch import android.widget.TextView import android.widget.ToggleButton -import com.itsaky.androidide.inflater.internal.adapters.AbsoluteLayoutAdapter -import com.itsaky.androidide.inflater.internal.adapters.AutoCompleteTextViewAdapter -import com.itsaky.androidide.inflater.internal.adapters.ButtonAdapter -import com.itsaky.androidide.inflater.internal.adapters.CheckBoxAdapter -import com.itsaky.androidide.inflater.internal.adapters.CheckedTextViewAdapter -import com.itsaky.androidide.inflater.internal.adapters.EditTextAdapter -import com.itsaky.androidide.inflater.internal.adapters.FrameLayoutAdapter -import com.itsaky.androidide.inflater.internal.adapters.GestureOverlayViewAdapter -import com.itsaky.androidide.inflater.internal.adapters.GridLayoutAdapter -import com.itsaky.androidide.inflater.internal.adapters.ImageButtonAdapter -import com.itsaky.androidide.inflater.internal.adapters.ImageViewAdapter -import com.itsaky.androidide.inflater.internal.adapters.LinearLayoutAdapter -import com.itsaky.androidide.inflater.internal.adapters.ListViewAdapter -import com.itsaky.androidide.inflater.internal.adapters.ProgressBarAdapter -import com.itsaky.androidide.inflater.internal.adapters.RadioButtonAdapter -import com.itsaky.androidide.inflater.internal.adapters.RelativeLayoutAdapter -import com.itsaky.androidide.inflater.internal.adapters.SeekBarAdapter -import com.itsaky.androidide.inflater.internal.adapters.SpinnerAdapter -import com.itsaky.androidide.inflater.internal.adapters.SurfaceViewAdapter -import com.itsaky.androidide.inflater.internal.adapters.SwitchAdapter -import com.itsaky.androidide.inflater.internal.adapters.TextViewAdapter -import com.itsaky.androidide.inflater.internal.adapters.TextureViewAdapter -import com.itsaky.androidide.inflater.internal.adapters.ToggleButtonAdapter -import com.itsaky.androidide.inflater.internal.adapters.ViewAdapter -import com.itsaky.androidide.inflater.internal.adapters.WebViewAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.AbsoluteLayoutAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.AutoCompleteTextViewAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.ButtonAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.CheckBoxAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.CheckedTextViewAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.EditTextAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.FrameLayoutAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.GestureOverlayViewAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.GridLayoutAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.ImageButtonAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.ImageViewAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.LinearLayoutAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.ListViewAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.ProgressBarAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.RadioButtonAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.RelativeLayoutAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.SeekBarAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.SpinnerAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.SurfaceViewAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.SwitchAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.TextViewAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.TextureViewAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.ToggleButtonAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.ViewAdapter +import org.appdevforall.codeonthego.inflater.internal.adapters.WebViewAdapter internal fun viewDeclTemplate(name: String) : String = """ From 206059696836f27db2c1766bf9ec214f35cec752 Mon Sep 17 00:00:00 2001 From: yaturner Date: Tue, 13 Oct 2026 12:26:11 -0700 Subject: [PATCH 04/10] style: spotless reformat, no functional change The Phase 2 rename touched ~2,700 files, pulling each under the file-level spotless ratchet. This applies spotlessApply to them as-is. Compiles cleanly (main + unit-test sources, all modules). Co-Authored-By: Claude Opus 5.5 --- .../codeonthego/actions/ActionData.java | 61 +- .../codeonthego/actions/ActionItem.kt | 3 +- .../codeonthego/actions/ActionsRegistry.kt | 208 ++- .../codeonthego/actions/EditTextAdapter.kt | 150 +- .../codeonthego/actions/EditorActionItem.kt | 13 +- .../codeonthego/actions/FillMenuParams.kt | 15 +- .../actions/OnActionClickListener.kt | 26 +- .../codeonthego/actions/SidebarActionItem.kt | 23 +- .../codeonthego/actions/TextTarget.kt | 24 +- .../codeonthego/actions/actionUtils.kt | 22 +- .../internal/DefaultActionsRegistry.kt | 509 +++--- .../actions/locations/CodeActionsMenu.kt | 44 +- .../ksp/inflater/ViewAdapterIndexGenerator.kt | 465 ++--- .../inflater/ViewAdapterSymbolProcessor.kt | 143 +- .../ViewAdapterSymbolProcessorProvider.kt | 6 +- .../annotations/ksp/inflater/kspUtils.kt | 10 +- .../annotations/ksp/inflater/utils.kt | 4 +- .../EventBusAnnotationProcessor.java | 784 ++++---- .../annotations/inflater/ViewAdapter.kt | 5 +- .../uidesigner/IncludeInDesigner.kt | 19 +- apk-viewer-plugin/build.gradle.kts | 95 +- .../com/example/sampleplugin/ApkViewer.kt | 381 ++-- .../fragments/ApkAnalyzerFragment.kt | 614 +++---- .../codeonthego/AutomationEndToEndTest.kt | 5 +- .../codeonthego/AutomationTestSuite.kt | 6 +- .../appdevforall/codeonthego/CleanupTest.kt | 37 +- .../appdevforall/codeonthego/EndToEndTest.kt | 5 +- .../codeonthego/ExportCacheDirectoryTest.kt | 172 +- .../ProjectBuildTestWithGroovyGradle.kt | 391 ++-- .../ProjectBuildTestWithKtsGradle.kt | 425 +++-- .../codeonthego/QuickBuildFlagOffTest.kt | 2 +- .../codeonthego/QuickBuildPipelineTest.kt | 19 +- .../codeonthego/QuickBuildSmokeTest.kt | 13 +- .../app/strictmode/WhitelistRulesTest.kt | 6 +- .../helper/AdvancePastWelcomeScreenHelper.kt | 87 +- ...nfigureAutomationBuildPreferencesHelper.kt | 2 +- .../helper/EnsureHomeScreenHelper.kt | 12 +- .../helper/ExperimentsFlagHelper.kt | 2 +- .../GrantRequiredPermissionsUiHelper.kt | 6 +- .../helper/HandlePrivacyDisclosureHelper.kt | 2 +- .../codeonthego/helper/ProjectBuildHelper.kt | 58 +- ...izationProjectAndCancelingBuildScenario.kt | 4 +- .../scenarios/NavigateToMainScreenScenario.kt | 197 +- .../scenarios/RunAssembleTasksScenario.kt | 283 +-- .../codeonthego/screens/EditorScreen.kt | 11 +- .../codeonthego/screens/HomeScreen.kt | 2 +- .../codeonthego/screens/InstallToolsScreen.kt | 9 +- .../codeonthego/screens/OnboardingScreen.kt | 27 +- .../codeonthego/screens/PermissionScreen.kt | 43 +- .../screens/ProjectSettingsScreen.kt | 218 +-- .../codeonthego/screens/QuickBuildScreen.kt | 2 +- .../screens/SystemPermissionsScreen.kt | 28 +- .../codeonthego/screens/TemplateScreen.kt | 52 +- .../codeonthego/app/LeakCanaryConfig.kt | 2 +- .../quickbuild/QuickBuildBenchActivity.kt | 2 +- .../quickbuild/QuickBuildBenchHooks.kt | 2 +- .../codeonthego/actions/BaseBuildAction.kt | 2 +- .../codeonthego/actions/BaseEditorAction.kt | 132 +- .../actions/EditorActivityAction.kt | 65 +- .../actions/EditorRelatedAction.kt | 50 +- .../codeonthego/actions/FileActionManager.kt | 6 +- .../codeonthego/actions/PluginActionItem.kt | 86 +- .../actions/PluginSidebarActionItem.kt | 99 +- .../actions/PluginToolbarActionItem.kt | 123 +- .../appdevforall/codeonthego/actions/Util.kt | 12 +- .../build/AbstractCancellableRunAction.kt | 2 +- .../build/AbstractModuleAssemblerAction.kt | 2 +- .../codeonthego/actions/build/DebugAction.kt | 9 +- .../actions/build/PluginBuildActionItem.kt | 10 +- .../actions/build/ProjectSyncAction.kt | 4 +- .../actions/build/QuickBuildAction.kt | 8 +- .../actions/build/QuickRunAction.kt | 28 +- .../actions/build/RunTasksAction.kt | 2 +- .../actions/debug/AbstractDebuggerAction.kt | 31 +- .../actions/debug/AbstractStepAction.kt | 13 +- .../codeonthego/actions/debug/KillVmAction.kt | 16 +- .../actions/debug/RestartVmAction.kt | 8 +- .../actions/debug/StepIntoAction.kt | 16 +- .../actions/debug/StepOutAction.kt | 16 +- .../actions/debug/StepOverAction.kt | 16 +- .../actions/debug/SuspendResumeVmAction.kt | 51 +- .../codeonthego/actions/editor/CopyAction.kt | 68 +- .../codeonthego/actions/editor/CutAction.kt | 73 +- .../actions/editor/ExpandSelectionAction.kt | 26 +- .../actions/editor/LongSelectAction.kt | 41 +- .../codeonthego/actions/editor/PasteAction.kt | 59 +- .../actions/editor/SelectAllAction.kt | 66 +- .../actions/etc/DisconnectLogSendersAction.kt | 57 +- .../codeonthego/actions/etc/FindAction.kt | 56 +- .../actions/etc/FindInFileAction.kt | 38 +- .../actions/etc/FindInProjectAction.kt | 2 +- .../actions/etc/LaunchAppAction.kt | 127 +- .../actions/etc/ReplaceInProjectAction.kt | 2 +- .../actions/file/CloseAllFilesAction.kt | 28 +- .../actions/file/CloseFileAction.kt | 30 +- .../actions/file/CloseOtherFilesAction.kt | 24 +- .../actions/file/CreateLinkAction.kt | 6 +- .../codeonthego/actions/file/FileTabAction.kt | 43 +- .../actions/file/FormatCodeAction.kt | 43 +- .../actions/file/InstallFileAction.kt | 6 +- .../actions/file/SaveFileAction.kt | 2 +- .../actions/filetree/BaseDirNodeAction.kt | 37 +- .../actions/filetree/BaseFileTreeAction.kt | 80 +- .../actions/filetree/CopyPathAction.kt | 2 +- .../actions/filetree/DeleteAction.kt | 2 +- .../actions/filetree/HelpAction.kt | 47 +- .../actions/filetree/NewFileAction.kt | 14 +- .../actions/filetree/NewFolderAction.kt | 6 +- .../actions/filetree/OpenWithAction.kt | 44 +- .../actions/filetree/RenameAction.kt | 2 +- .../actions/internalActionUtils.kt | 62 +- .../actions/main/CloneRepositoryAction.kt | 61 +- .../actions/main/CreateProjectAction.kt | 61 +- .../actions/main/DeleteProjectAction.kt | 61 +- .../codeonthego/actions/main/DocsAction.kt | 77 +- .../codeonthego/actions/main/DonateAction.kt | 51 +- .../actions/main/OpenProjectAction.kt | 61 +- .../actions/main/OpenTerminalAction.kt | 66 +- .../actions/main/PreferencesAction.kt | 61 +- .../actions/observers/FileActionObserver.kt | 10 +- .../actions/profiler/ProfilerAction.kt | 6 +- .../actions/sidebar/AbstractSidebarAction.kt | 27 +- .../sidebar/BuildVariantsSidebarAction.kt | 31 +- .../sidebar/CloseProjectSidebarAction.kt | 34 +- .../actions/sidebar/FileTreeSidebarAction.kt | 28 +- .../actions/sidebar/HelpSideBarAction.kt | 34 +- .../sidebar/PreferencesSidebarAction.kt | 46 +- .../actions/sidebar/TerminalSidebarAction.kt | 33 +- .../codeonthego/actions/text/RedoAction.kt | 2 +- .../codeonthego/actions/text/UndoAction.kt | 75 +- .../codeonthego/activities/AboutActivity.kt | 6 +- .../activities/CrashHandlerActivity.java | 62 +- .../activities/DeepLinkActivity.kt | 2 +- .../codeonthego/activities/MainActivity.kt | 12 +- .../activities/OnboardingActivity.kt | 16 +- .../activities/PluginManagerActivity.kt | 4 +- .../activities/PreferencesActivity.kt | 4 +- .../activities/editor/BaseEditorActivity.kt | 20 +- .../activities/editor/EditorActivityKt.kt | 2 +- .../editor/EditorHandlerActivity.kt | 18 +- .../activities/editor/FAQActivity.kt | 4 +- .../activities/editor/IDELogcatReader.kt | 175 +- .../editor/ProjectHandlerActivity.kt | 26 +- .../adapters/BuildVariantsAdapter.kt | 130 +- .../adapters/DeleteProjectListAdapter.kt | 123 +- .../adapters/DiagnosticItemAdapter.java | 122 +- .../adapters/DiagnosticsAdapter.java | 87 +- .../adapters/EditorBottomSheetTabAdapter.kt | 2 +- .../adapters/FilterableRecyclerViewAdapter.kt | 167 +- .../adapters/MainActionsListAdapter.kt | 91 +- .../adapters/OptionsSheetAdapter.java | 119 +- .../adapters/RunTasksListAdapter.kt | 2 +- .../adapters/SymbolInputAdapter.kt | 2 +- .../adapters/TemplateListAdapter.kt | 2 +- .../adapters/TemplateWidgetsListAdapter.kt | 12 +- .../DefaultOnboardingItemAdapter.kt | 143 +- .../viewholders/FileTreeViewHolder.java | 7 +- .../MultiSelectFileTreeViewHolder.java | 250 +-- .../agent/model/ModelLoadResult.kt | 20 +- .../codeonthego/api/BuildOutputProvider.kt | 6 +- .../codeonthego/api/IDEApiFacade.kt | 101 +- .../app/DeviceProtectedApplicationLoader.kt | 32 +- .../codeonthego/app/EdgeToEdgeIDEActivity.kt | 289 +-- .../codeonthego/app/EditorEvents.kt | 99 +- .../codeonthego/app/EditorProviderImpl.kt | 8 +- .../codeonthego/app/IDEActivity.kt | 5 +- .../codeonthego/app/IDEActivityDelegate.kt | 3 +- .../codeonthego/app/IDEApplication.kt | 20 +- .../app/PluginRunAppCoordinator.kt | 8 +- .../codeonthego/app/PluginTerminalLauncher.kt | 8 +- .../JdkDistributionProviderImpl.kt | 64 +- .../app/strictmode/ViolationHandler.kt | 66 +- .../assets/AssetsInstallationHelper.kt | 10 +- .../codeonthego/assets/BaseAssetsInstaller.kt | 8 +- .../assets/BundledAssetsInstaller.kt | 16 +- .../assets/SplitAssetsInstaller.kt | 12 +- .../appdevforall/codeonthego/di/AppModule.kt | 6 +- .../codeonthego/di/QuickBuildModule.kt | 10 +- .../codeonthego/dnd/DragEventRouter.kt | 87 +- .../codeonthego/dnd/DropTargetCallback.kt | 42 +- .../codeonthego/dnd/GitUrlDropExtensions.kt | 34 +- .../codeonthego/dnd/GitUrlDropTarget.kt | 187 +- .../floating/EditorPanelDockableContent.kt | 8 +- .../floating/IdeFloatingTabController.kt | 6 +- .../MetricsCarouselDockableContent.kt | 2 +- .../codeonthego/events/FileTree.kt | 21 +- .../fragments/BasePreferenceFragment.kt | 10 +- .../fragments/CloneRepositoryFragment.kt | 454 ++--- .../fragments/CrashReportFragment.kt | 254 +-- .../fragments/DeleteProjectFragment.kt | 4 +- .../fragments/EmptyStateFragment.kt | 8 +- .../codeonthego/fragments/MainFragment.kt | 33 +- .../fragments/RecentProjectsFragment.kt | 14 +- .../fragments/RecyclerViewFragment.kt | 10 +- .../fragments/RunTasksDialogFragment.kt | 6 +- .../fragments/SearchFieldToolbar.kt | 14 +- .../fragments/SearchResultFragment.kt | 8 +- .../fragments/TemplateDetailsFragment.kt | 10 +- .../fragments/TemplateListFragment.kt | 94 +- .../fragments/debug/CallStackFragment.kt | 8 +- .../fragments/debug/DebuggerFragment.kt | 19 +- .../codeonthego/fragments/debug/Resolvable.kt | 367 ++-- .../fragments/debug/VariableIcon.kt | 84 +- .../fragments/debug/VariableListBinder.kt | 34 +- .../fragments/debug/VariableListFragment.kt | 6 +- .../debug/VariableTreeNodeGenerator.kt | 72 +- .../fragments/debug/WADBPermissionFragment.kt | 10 +- .../fragments/git/GitBottomSheetFragment.kt | 8 +- .../fragments/git/GitCommitHistoryDialog.kt | 4 +- .../fragments/git/GitDialogUtils.kt | 91 +- .../fragments/git/GitDiffViewerDialog.kt | 307 ++-- .../git/adapter/GitCommitHistoryAdapter.kt | 89 +- .../IdeSetupConfigurationFragment.kt | 488 ++--- .../onboarding/OnboardingFragment.kt | 82 +- .../onboarding/OnboardingInfoFragment.kt | 75 +- .../OnboardingMultiActionFragment.kt | 89 +- .../onboarding/PermissionsFragment.kt | 18 +- .../fragments/onboarding/ideSetupConfig.kt | 52 +- .../fragments/output/BuildOutputFragment.kt | 18 +- .../output/LogFilterBarController.kt | 4 +- .../fragments/output/LogViewFragment.kt | 24 +- .../output/NonEditableEditorFragment.java | 2 +- .../sheets/BaseBottomSheetFragment.java | 20 +- .../fragments/sheets/OptionsListFragment.java | 4 +- .../sidebar/BuildVariantsFragment.kt | 2 +- .../sidebar/EditorSidebarFragment.kt | 63 +- .../sidebar/FileTreeDropController.kt | 246 +-- .../fragments/sidebar/FileTreeFragment.kt | 14 +- .../sidebar/FileTreeSelectionFragment.kt | 190 +- .../fragments/sidebar/OutlineFragment.kt | 2 +- .../codeonthego/handlers/BaseEventHandler.kt | 20 +- .../handlers/CrashEventSubscriber.kt | 2 +- .../handlers/EditorBuildEventListener.kt | 2 +- .../handlers/FileTreeActionHandler.kt | 8 +- .../handlers/GlitchTipDiagnosticsContext.kt | 14 +- .../handlers/MetricsCrashAttachment.kt | 8 +- .../interfaces/DiagnosticClickListener.java | 6 +- .../codeonthego/lsp/BreakpointHandler.kt | 2 +- .../codeonthego/lsp/IDEDebugClientImpl.kt | 639 +++---- .../lsp/IDELanguageClientImpl.java | 28 +- .../codeonthego/lsp/SearchResultGrouping.kt | 2 +- .../codeonthego/models/ArtifactType.kt | 42 +- .../codeonthego/models/Checkable.kt | 5 +- .../codeonthego/models/ContextListItem.kt | 14 +- .../codeonthego/models/DeepLinkRequest.kt | 2 +- .../models/DefaultOnboardingItem.kt | 14 +- .../codeonthego/models/DiagnosticGroup.java | 22 +- .../codeonthego/models/FileExtension.kt | 136 +- .../models/HyperlinkedOnboardingItem.kt | 18 +- .../codeonthego/models/IdeSetupArguments.kt | 18 +- .../codeonthego/models/MetadataElement.kt | 80 +- .../codeonthego/models/NewProjectDetails.java | 118 +- .../codeonthego/models/OnboardingItem.kt | 63 +- .../models/OnboardingPermissionItem.kt | 19 +- .../codeonthego/models/OpenedFile.kt | 31 +- .../codeonthego/models/OpenedFilesCache.kt | 76 +- .../codeonthego/models/ProjectTemplate.java | 177 +- .../codeonthego/models/RunTasksCategory.kt | 5 +- .../codeonthego/models/StepResult.kt | 10 +- .../codeonthego/models/StorageInfo.kt | 6 +- .../appdevforall/codeonthego/models/Symbol.kt | 56 +- .../projects/builder/BuildResult.kt | 8 +- .../projects/builder/LaunchResult.kt | 5 +- .../provider/IDEDocumentsProvider.java | 509 +++--- .../quickbuild/GenerateSourcesDeferral.kt | 2 +- .../quickbuild/GradleQuickBuildProvisioner.kt | 12 +- .../quickbuild/QuickBuildGraphWarmUp.kt | 2 +- .../quickbuild/QuickBuildInstallAdapters.kt | 4 +- .../repositories/BreakpointRepository.kt | 2 +- .../repositories/PluginRepository.kt | 94 +- .../repositories/PluginRepositoryImpl.kt | 6 +- .../TemplateCollectionRepositoryImpl.kt | 10 +- .../repositories/TemplateRepositoryImpl.kt | 8 +- .../roomData/recentproject/RecentProject.kt | 21 +- .../search/replace/ProjectReplacer.kt | 2 +- .../search/replace/ReplaceCoordinator.kt | 2 +- .../search/replace/TextReplacement.kt | 2 +- .../ToolingServerAlreadyStartedException.java | 12 +- .../ToolingServerNotStartedException.java | 12 +- .../codeonthego/services/builder/CpuInfo.kt | 14 +- .../services/builder/GradleBuildService.kt | 22 +- .../builder/GradleBuildServiceConnnection.kt | 37 +- .../services/builder/GradleServiceBinder.kt | 15 +- .../services/builder/ThermalSafeStrategy.kt | 8 +- .../services/builder/ToolingServerRunner.kt | 16 +- .../codeonthego/services/builder/util.kt | 12 +- .../services/debug/DebugOverlayManager.kt | 88 +- .../debug/DebuggerActionsOverlayAdapter.kt | 99 +- .../services/debug/DebuggerService.kt | 14 +- .../services/debug/ForegroundAppReceiver.kt | 12 +- .../services/log/CachingLogSender.kt | 35 +- .../services/log/ConnectionObserverParams.kt | 50 +- .../services/log/LogReceiverService.kt | 235 ++- .../services/log/LogSenderHandler.kt | 92 +- .../services/log/MultiLogSenderHandler.kt | 212 +-- .../codeonthego/services/log/utils.kt | 14 +- .../shortcuts/IdeShortcutActions.kt | 5 +- .../codeonthego/shortcuts/ShortcutCatalog.kt | 1 - .../shortcuts/ShortcutGroupProvider.kt | 13 +- .../codeonthego/shortcuts/ShortcutManager.kt | 34 +- .../shortcuts/groups/FileManagementGroup.kt | 37 +- .../groups/ProjectsAndSolutionsGroup.kt | 49 +- .../shortcuts/groups/SearchAndReplaceGroup.kt | 2 +- .../groups/WindowsAndDisplayGroup.kt | 63 +- .../tasks/callables/FileTreeCallable.java | 112 +- .../callables/ListDirectoryCallable.java | 2 +- .../tasks/callables/UnzipCallable.java | 2 +- .../codeonthego/ui/CodeEditorView.kt | 46 +- .../ui/CustomDividerItemDecoration.kt | 68 +- .../codeonthego/ui/CustomSnackbar.kt | 130 +- .../codeonthego/ui/EditorBottomSheet.kt | 14 +- .../codeonthego/ui/EmptyView.java | 78 +- .../codeonthego/ui/InfoRowView.kt | 72 +- .../ui/MetricsCarouselController.kt | 18 +- .../codeonthego/ui/ProjectInfoBottomSheet.kt | 6 +- .../codeonthego/ui/ScalableTabLayout.kt | 55 +- .../codeonthego/ui/StorageDialog.kt | 38 +- .../codeonthego/ui/SymbolInputView.java | 44 +- .../codeonthego/ui/compose/ManagerScreen.kt | 12 +- .../compose/plugins/PluginManagerContent.kt | 2 +- .../templates/TemplateManagerScreen.kt | 2 +- .../ui/models/PluginManagerUiState.kt | 2 +- .../codeonthego/ui/themes/ThemeManager.kt | 53 +- .../ui/transition/ArcMotionPlus.java | 172 +- .../ui/transition/CubicBezierArc.java | 308 ++-- .../ui/transition/ProgressTransition.java | 79 +- .../codeonthego/utils/ActionMenuUtils.kt | 4 +- .../codeonthego/utils/ApkInstaller.kt | 4 +- .../codeonthego/utils/BuildCancellation.kt | 2 +- .../codeonthego/utils/BuildInfoUtils.kt | 4 +- .../codeonthego/utils/ClassBuilder.kt | 261 +-- .../codeonthego/utils/DiagnosticsFormatter.kt | 104 +- .../codeonthego/utils/DropHighlighter.kt | 45 +- .../utils/EditorDecorationBridge.kt | 127 +- .../utils/EditorRightSidebarActions.kt | 1 + .../codeonthego/utils/FileDeleteUtils.kt | 98 +- .../codeonthego/utils/FileImporter.kt | 191 +- .../codeonthego/utils/FlexboxUtils.kt | 67 +- .../codeonthego/utils/FragmentUtils.kt | 1 - .../codeonthego/utils/HtmlTextUtils.kt | 23 +- .../codeonthego/utils/InstallerIoUtils.kt | 75 +- .../codeonthego/utils/JSONUtility.java | 16 +- .../codeonthego/utils/JdkUtils.kt | 299 +-- .../codeonthego/utils/MainScreenActions.kt | 37 +- .../codeonthego/utils/MemoryUsageWatcher.kt | 2 +- .../codeonthego/utils/NetworkUsageWatcher.kt | 2 +- .../utils/NoOpServiceConnection.kt | 10 +- .../utils/OverlayPermissionGuide.kt | 13 +- .../codeonthego/utils/PermissionsHelper.kt | 91 +- .../codeonthego/utils/PowerUsageWatcher.kt | 2 +- .../codeonthego/utils/PrivilegedActions.kt | 27 +- .../utils/ProjectCreationManager.kt | 2 +- .../utils/ProjectOpenBookkeeping.kt | 6 +- .../utils/ProjectStringsXmlResolver.kt | 42 +- .../codeonthego/utils/ProjectWriter.java | 2 +- .../utils/RecursiveFileSearcher.java | 8 +- .../utils/SingleBottomSheetCallback.kt | 11 +- .../codeonthego/utils/StorageUtils.kt | 13 +- .../codeonthego/utils/StringsXmlInjector.kt | 113 +- .../appdevforall/codeonthego/utils/Symbols.kt | 202 +- .../utils/TemplateRecipeExecutor.kt | 4 +- .../codeonthego/utils/TerminalInstaller.kt | 784 ++++---- .../codeonthego/utils/TextWatcherAdapter.java | 12 +- .../codeonthego/utils/UriFileImporter.kt | 125 +- .../appdevforall/codeonthego/utils/ZipExts.kt | 19 +- .../utils/ui/TemplateScrollGateKeeper.kt | 169 +- .../viewmodel/ApkInstallationViewModel.kt | 4 +- .../viewmodel/BottomSheetViewModel.kt | 2 +- .../viewmodel/BuildOutputViewModel.kt | 2 +- .../viewmodel/BuildVariantsViewModel.kt | 2 +- .../codeonthego/viewmodel/BuildViewModel.kt | 16 +- .../viewmodel/CloneRepositoryViewModel.kt | 10 +- .../viewmodel/DebuggerViewModel.kt | 20 +- .../codeonthego/viewmodel/EditorViewModel.kt | 18 +- .../viewmodel/FileManagerViewModel.kt | 6 +- .../viewmodel/FileSearchViewModel.kt | 8 +- .../viewmodel/FileTreeViewModel.kt | 37 +- .../viewmodel/GitBottomSheetViewModel.kt | 22 +- .../viewmodel/InstallationState.kt | 16 +- .../viewmodel/InstallationViewModel.kt | 22 +- .../codeonthego/viewmodel/LogViewModel.kt | 16 +- .../codeonthego/viewmodel/MainViewModel.kt | 2 +- .../codeonthego/viewmodel/OutlineViewModel.kt | 8 +- .../viewmodel/RecentProjectsViewModel.kt | 26 +- .../viewmodel/WADBConnectionViewModel.kt | 3 +- .../ExternalFileInstallViewModel.kt | 14 +- .../viewmodels/PluginManagerViewModel.kt | 24 +- .../viewmodels/TemplateManagerViewModel.kt | 12 +- .../main/res/layout-land/activity_about.xml | 245 ++- .../res/layout-sw600dp/activity_about.xml | 245 ++- app/src/main/res/layout/activity_about.xml | 201 +- app/src/main/res/layout/activity_editor.xml | 127 +- app/src/main/res/layout/activity_main.xml | 161 +- .../main/res/layout/activity_preferences.xml | 112 +- .../main/res/layout/fragment_empty_state.xml | 43 +- .../res/layout/layout_project_info_sheet.xml | 5 +- .../actions/build/SlotBusyBuildActionsTest.kt | 14 +- .../activities/DeepLinkSetupGateTest.kt | 6 +- .../editor/DebuggerServiceUnbindTest.kt | 2 +- .../editor/EditorHandlerActivityTest.kt | 18 +- .../editor/OverlappingSaveFlagTest.kt | 2 +- .../editor/RestorePluginTabsThreadTest.kt | 163 +- .../editor/SameProjectDeepLinkMidSyncTest.kt | 8 +- .../activities/editor/SaveFileResultTest.kt | 4 +- .../AnalyticsQuickBuildMetricsSinkTest.kt | 4 +- .../api/BuildOutputProviderTest.kt | 4 +- .../app/PluginRunAppCoordinatorTest.kt | 2 +- .../app/PluginTerminalLauncherTest.kt | 4 +- .../IDEBuildConfigProviderImplTest.kt | 180 +- .../assets/AssetsInstallationHelperTest.kt | 6 +- .../FloatingWindowProjectCloseTest.kt | 10 +- .../fragments/IDEPreferencesFragmentTest.kt | 4 +- .../GlitchTipDiagnosticsContextTest.kt | 6 +- .../MetricsCrashAttachmentEnvelopeTest.kt | 12 +- .../handlers/MetricsCrashAttachmentTest.kt | 4 +- .../localWebServer/WebServerTest.kt | 2 +- .../lsp/ComputeNewBreakpointPositionTest.kt | 288 +-- .../lsp/SearchResultGroupingTest.kt | 2 +- .../preferences/PluginPrefExtsTest.kt | 4 +- ...GradleQuickBuildProvisionerBaselineTest.kt | 2 +- .../GradleQuickBuildProvisionerCancelTest.kt | 2 +- ...dleQuickBuildProvisionerFailureArmsTest.kt | 6 +- .../GradleQuickBuildProvisionerFakes.kt | 6 +- .../GradleQuickBuildProvisionerSlotTest.kt | 8 +- .../quickbuild/InstallationEventFlowTest.kt | 2 +- .../TemplateCollectionRepositoryImplTest.kt | 4 +- .../TemplateRepositoryImplTest.kt | 2 +- .../search/replace/ProjectReplacerTest.kt | 4 +- .../GradleBuildServiceServerExitTest.kt | 4 +- .../builder/GradleBuildServiceSlotTest.kt | 6 +- .../builder/ToolingServerRunnerTest.kt | 12 +- .../services/log/LogSendersRegistryTest.kt | 2 +- .../ui/MetricsAnnotationRenderingTest.kt | 2 +- .../ui/MetricsCarouselAdapterTest.kt | 2 +- .../codeonthego/utils/ClassBuilderTest.kt | 29 +- .../codeonthego/utils/FileDeleteUtilsTest.kt | 92 +- .../codeonthego/utils/JdkUtilsTest.kt | 270 ++- .../codeonthego/utils/ShiftedArrayTest.kt | 254 +-- .../ApkInstallationViewModelDestroyTest.kt | 2 +- ...pkInstallationViewModelReloadStatusTest.kt | 2 +- .../viewmodel/BuildViewModelTest.kt | 8 +- .../viewmodel/CloneRepositoryViewModelTest.kt | 8 +- .../viewmodel/EditorViewModelTest.kt | 57 +- .../viewmodel/GitBottomSheetViewModelTest.kt | 10 +- .../codeonthego/viewmodel/LogViewModelTest.kt | 6 +- .../viewmodel/OutlineViewModelTest.kt | 16 +- .../viewmodel/RecentProjectsViewModelTest.kt | 2 +- .../ExternalFileInstallViewModelTest.kt | 10 +- .../TemplateManagerViewModelTest.kt | 14 +- .../codeonthego/DraggableTouchListener.kt | 159 +- .../codeonthego/FabPositionRepository.kt | 42 +- .../codeonthego/FeedbackButtonManager.kt | 2 +- .../activities/editor/HelpActivity.kt | 8 +- .../codeonthego/adapters/IconTextAdapter.java | 170 +- .../adapters/IconTitleDescriptionAdapter.kt | 50 +- .../adapters/SimpleIconTextAdapter.java | 56 +- .../SimpleIconTitleDescriptionAdapter.kt | 13 +- .../codeonthego/app/BaseIDEActivity.kt | 106 +- .../codeonthego/app/configuration/CpuArch.kt | 65 +- .../configuration/IDEBuildConfigProvider.kt | 140 +- .../configuration/IJdkDistributionProvider.kt | 20 +- .../colorpicker/ColorPickerView.java | 360 ++-- .../DocumentationContentSource.kt | 4 +- .../fragments/FragmentWithBinding.kt | 71 +- .../codeonthego/interfaces/Filter.java | 2 +- .../interfaces/ProjectWriterCallback.java | 8 +- .../codeonthego/managers/ToolsManager.java | 18 +- .../codeonthego/models/Constants.java | 53 +- .../codeonthego/models/IconTextListItem.java | 28 +- .../models/IconTitleDescriptionItem.kt | 8 +- .../codeonthego/models/JdkDistribution.kt | 4 +- .../codeonthego/models/SheetOption.java | 68 +- .../models/SimpleIconTitleDescriptionItem.kt | 43 +- .../codeonthego/shell/IProcessBuilder.kt | 66 +- .../codeonthego/shell/ProcessBuilderImpl.kt | 68 +- .../codeonthego/shell/shellUtils.kt | 10 +- .../syntax/colorschemes/DynamicColorScheme.kt | 118 +- .../syntax/colorschemes/SchemeAndroidIDE.java | 326 ++-- .../decoration/EditorDecorationRegistry.kt | 29 +- .../syntax/highlighters/Highlighter.java | 6 +- .../syntax/highlighters/JavaHighlighter.java | 333 ++-- .../ui/BottomInsetHeightDistributor.kt | 48 +- .../ui/ContentTranslatingDrawerLayout.kt | 122 +- .../ui/InterceptableDrawerLayout.kt | 101 +- .../codeonthego/ui/ProjectActionsToolbar.kt | 176 +- .../codeonthego/ui/themes/IDETheme.kt | 57 +- .../codeonthego/ui/themes/IThemeManager.kt | 37 +- .../codeonthego/utils/AndroidUtils.java | 196 +- .../utils/CharSequenceInputStream.java | 489 ++--- .../codeonthego/utils/CharSequenceReader.java | 476 ++--- .../codeonthego/utils/CollectionExts.kt | 2 +- .../codeonthego/utils/ColorUtil.kt | 58 +- .../codeonthego/utils/DeviceFormFactor.kt | 213 +-- .../codeonthego/utils/DialogUtils.kt | 271 ++- .../codeonthego/utils/EdgeToEdgeUtils.java | 298 ++- .../codeonthego/utils/Environment.java | 2 +- .../codeonthego/utils/FeedbackManager.kt | 2 +- .../codeonthego/utils/FileUtil.java | 1201 ++++++------ .../utils/FlashbarActivityUtils.kt | 10 +- .../utils/GetProjectBuildVersions.kt | 2 +- .../codeonthego/utils/InsetUtils.kt | 32 +- .../codeonthego/utils/IntProperty.java | 26 +- .../codeonthego/utils/IntentExtensions.kt | 28 +- .../codeonthego/utils/JavaCharacter.java | 120 +- .../utils/KeyedDebouncingAction.kt | 76 +- .../codeonthego/utils/LSPUtils.java | 211 +-- .../utils/LegacyIdeDataDirMigration.java | 20 +- .../codeonthego/utils/ManufacturerUtils.kt | 44 +- .../codeonthego/utils/NavigationBar.kt | 105 +- .../codeonthego/utils/OrientationUtilities.kt | 22 +- .../codeonthego/utils/ProjectAttrs.kt | 24 +- .../utils/SingleSessionCallback.kt | 25 +- .../codeonthego/utils/SingleTextWatcher.java | 12 +- .../codeonthego/utils/SparseArrayUtils.kt | 12 +- .../codeonthego/utils/TestModeUtils.kt | 10 +- .../utils/WindowInsetExtensions.kt | 51 +- .../codeonthego/utils/WindowUtils.kt | 24 +- .../codeonthego/utils/connectionUtilExt.kt | 82 +- .../appdevforall/codeonthego/utils/ioUtils.kt | 18 +- .../window/ActivityCompatHelper.kt | 16 +- .../appdevforall/codeonthego/window/Bounds.kt | 89 +- .../codeonthego/window/DisplayCompatHelper.kt | 31 +- .../codeonthego/window/WindowManager.kt | 169 +- .../codeonthego/window/WindowMetrics.kt | 51 +- .../window/WindowMetricsCalculator.kt | 95 +- .../window/WindowMetricsCalculatorCompat.kt | 560 +++--- .../codeonthego/utils/BasicBuildInfoTest.kt | 31 +- .../codeonthego/utils/ResourceUtilsTest.kt | 2 +- .../codeonthego/editor/api/IEditor.java | 365 ++-- .../codeonthego/editor/api/ILspEditor.kt | 106 +- .../treesitter/api/TreeSitterInputEdit.kt | 86 +- .../api/TreeSitterLookaheadIterator.kt | 45 +- .../api/TreeSitterNativeLanguage.kt | 57 +- .../treesitter/api/TreeSitterNode.kt | 78 +- .../treesitter/api/TreeSitterObjectFactory.kt | 176 +- .../api/TreeSitterObjectPoolProvider.kt | 91 +- .../treesitter/api/TreeSitterParser.kt | 46 +- .../treesitter/api/TreeSitterPoint.kt | 45 +- .../treesitter/api/TreeSitterQuery.kt | 50 +- .../treesitter/api/TreeSitterQueryCapture.kt | 55 +- .../treesitter/api/TreeSitterQueryCursor.kt | 40 +- .../treesitter/api/TreeSitterQueryMatch.kt | 54 +- .../api/TreeSitterQueryPredicateStep.kt | 47 +- .../treesitter/api/TreeSitterRange.kt | 65 +- .../treesitter/api/TreeSitterTree.kt | 60 +- .../treesitter/api/TreeSitterTreeCursor.kt | 52 +- .../api/TreeSitterTreeCursorNode.kt | 61 +- .../treesitter/api/tsRecyclableUtils.kt | 6 +- .../codeonthego/treesitter/api/tsUtils.kt | 258 +-- .../sora/editor/ts/LineSpansGenerator.kt | 4 +- .../rosemoe/sora/editor/ts/TsAnalyzeWorker.kt | 2 +- .../codeonthego/treesitter/nodeExt.kt | 6 +- .../codeonthego/treesitter/pointExt.kt | 4 +- .../treesitter/LineSpansSnapshotTest.kt | 2 +- .../treesitter/TsAnalyzeWorkerStopTest.kt | 4 +- .../editor/adapters/CompletionListAdapter.kt | 8 +- .../editor/adapters/IdeEditorAdapter.kt | 38 +- .../editor/events/FileUpdateEvent.kt | 5 +- .../editor/events/LanguageUpdateEvent.kt | 5 +- .../language/CommonCompletionProvider.kt | 18 +- .../language/CompletionCancelChecker.kt | 20 +- .../editor/language/IDELanguage.kt | 12 +- .../editor/language/LSPFormatter.kt | 10 +- .../editor/language/cpp/CppAnalyzer.java | 374 ++-- .../editor/language/cpp/CppLanguage.java | 135 +- .../editor/language/groovy/GroovyAnalyzer.kt | 361 ++-- .../language/groovy/GroovyAutoComplete.java | 6 +- .../language/groovy/GroovyLanguage.java | 176 +- .../BaseIncrementalAnalyzeManager.java | 4 +- .../language/incremental/IncrementalToken.kt | 53 +- .../editor/language/incremental/LineState.kt | 14 +- .../language/newline/BaseNewlineHandler.kt | 69 +- .../newline/BracketsNewlineHandler.kt | 67 +- .../language/newline/CStyleBracketsHandler.kt | 15 +- .../language/newline/TSBracketsHandler.kt | 50 +- .../newline/TSCStyleBracketsHandler.kt | 21 +- .../outline/TreeSitterOutlineProvider.kt | 14 +- .../language/treesitter/JavaLanguage.kt | 55 +- .../language/treesitter/JsonLanguage.kt | 23 +- .../language/treesitter/KotlinLanguage.kt | 55 +- .../editor/language/treesitter/LogLanguage.kt | 19 +- .../treesitter/PluginTreeSitterLanguage.kt | 6 +- .../treesitter/TreeSitterAnalyzeManager.kt | 44 +- .../treesitter/TreeSitterIndentProvider.kt | 991 +++++----- .../language/treesitter/TreeSitterLanguage.kt | 14 +- .../treesitter/TreeSitterSpanFactory.kt | 6 +- .../editor/language/treesitter/XMLLanguage.kt | 35 +- .../editor/language/treesitter/common.kt | 2 +- .../treesitter/predicates/AnyOfPredicate.kt | 58 +- .../treesitter/predicates/EqualPredicate.kt | 78 +- .../predicates/InvertingPredicate.kt | 47 +- .../treesitter/predicates/MatchPredicate.kt | 77 +- .../predicates/TreeSitterPredicate.kt | 86 +- .../language/utils/CommonSymbolPairs.kt | 25 +- .../editor/language/utils/CompletionHelper.kt | 46 +- .../editor/processing/SimpleMacroProcessor.kt | 113 +- .../editor/processing/TextProcessor.kt | 49 +- .../editor/processing/TextProcessorEngine.kt | 59 +- .../editor/schemes/IDEColorScheme.kt | 4 +- .../editor/schemes/IDEColorSchemeProvider.kt | 523 +++--- .../editor/schemes/LanguageSpecProvider.kt | 6 +- .../internal/parser/EditorSchemeParser.kt | 29 +- .../schemes/internal/parser/LanguageParser.kt | 175 +- .../schemes/internal/parser/ParseException.kt | 10 +- .../schemes/internal/parser/SchemeParser.kt | 224 +-- .../AbstractSnippetVariableResolver.kt | 8 +- .../editor/snippets/FileVariableResolver.kt | 66 +- .../snippets/WorkspaceVariableResolver.kt | 35 +- .../editor/ui/AbstractPopupWindow.kt | 48 +- .../editor/ui/BaseEditorWindow.java | 2 +- .../codeonthego/editor/ui/DiagnosticWindow.kt | 36 +- .../editor/ui/EditorActionsMenu.kt | 18 +- .../editor/ui/EditorCompletionLayout.kt | 52 +- .../editor/ui/EditorCompletionWindow.kt | 6 +- .../editor/ui/EditorEventDispatcher.kt | 181 +- .../codeonthego/editor/ui/EditorFeatures.kt | 2 +- .../editor/ui/EditorSearchLayout.kt | 6 +- .../editor/ui/GhostTextRenderer.kt | 207 ++- .../editor/ui/IDECompletionPublisher.kt | 27 +- .../codeonthego/editor/ui/IDEEditor.kt | 46 +- .../codeonthego/editor/ui/ReplaceAction.kt | 2 +- .../editor/ui/SignatureHelpWindow.java | 6 +- .../editor/ui/TracingEditorRenderer.kt | 750 +++++--- .../codeonthego/editor/utils/ContentExt.kt | 135 +- .../editor/utils/OperatorSelection.kt | 188 +- .../main/res/layout/layout_code_editor.xml | 71 +- .../res/layout/layout_completion_item.xml | 198 +- .../editor/language/LSPFormatterTest.kt | 2 +- .../internal/parser/SchemeParserTest.kt | 350 ++-- .../codeonthego/eventbus/events/BuildEvent.kt | 4 +- .../codeonthego/eventbus/events/Event.java | 18 +- .../eventbus/events/EventReceiver.kt | 21 +- .../eventbus/events/editor/DocumentEvents.kt | 51 +- .../eventbus/events/editor/EditorEvents.kt | 2 +- .../events/filetree/FileTreeEvents.kt | 12 +- .../events/plugin/PluginCrashedEvent.kt | 10 +- .../events/preferences/PreferenceEvents.kt | 9 +- .../floating/model/ChromeControl.kt | 1 - .../floating/model/DockableContent.kt | 2 +- .../floating/model/DockingManager.kt | 6 +- .../floating/service/FloatingTabService.kt | 6 +- .../floating/ui/FloatingWindowChrome.kt | 4 +- .../codeonthego/git/core/CryptoManager.kt | 99 +- .../git/core/GitCredentialsManager.kt | 125 +- .../codeonthego/git/core/GitRepositoryUrls.kt | 26 +- .../codeonthego/git/core/JGitRepository.kt | 8 +- .../git/core/models/CloneRepoUiState.kt | 53 +- .../git/core/models/CommitHistoryUiState.kt | 36 +- .../codeonthego/git/core/models/FileChange.kt | 18 +- .../codeonthego/git/core/models/GitBranch.kt | 10 +- .../codeonthego/git/core/models/GitCommit.kt | 16 +- .../codeonthego/git/core/models/GitStatus.kt | 37 +- .../codeonthego/git/core/GitModelsTest.kt | 90 +- .../codeonthego/gradle/COTGSettingsPlugin.kt | 2 +- .../DatabaseCorruptionException.kt | 6 +- .../codeonthego/idetooltips/IDETooltipItem.kt | 17 +- .../idetooltips/NoTooltipFoundException.kt | 6 +- .../idetooltips/TooltipCategory.kt | 10 +- .../codeonthego/lexers/BaseLexerTest.kt | 17 +- .../codeonthego/lexers/xml/XMLLexerTest.kt | 143 +- .../codeonthego/logging/utils/LogUtils.java | 3 +- .../codeonthego/utils/ILogger.java | 80 +- .../codeonthego/utils/LogTagUtils.java | 24 +- .../codeonthego/utils/StacktraceUtils.java | 132 +- .../logsender/sample/MainActivity.java | 68 +- .../codeonthego/logsender/LogSender.java | 4 +- .../logsender/LogSenderService.java | 3 +- .../socket/AbstractSocketCommand.java | 40 +- .../logsender/socket/ISocketCommand.java | 14 +- .../logsender/socket/SenderInfoCommand.java | 28 +- .../logsender/socket/SignalCommand.java | 56 +- .../logsender/socket/SocketCommandParser.java | 64 +- .../logsender/utils/LogReader.java | 131 +- .../logsender/utils/LogSenderInstaller.java | 124 +- .../codeonthego/logsender/utils/Logger.java | 192 +- .../codeonthego/lookup/ForwardingLookup.kt | 4 +- .../codeonthego/lookup/Lookup.java | 189 +- .../codeonthego/lookup/LookupProvider.java | 28 +- .../lookup/internal/DefaultLookup.java | 55 +- .../codeonthego/lookup/LookupTest.kt | 1 - .../lookup/internal/DefaultLookupTest.kt | 3 +- .../lsp/actions/CommentLineAction.kt | 4 +- .../lsp/actions/IActionsMenuProvider.kt | 5 +- .../lsp/actions/SurroundWithTryCatchAction.kt | 2 +- .../lsp/actions/UncommentLineAction.kt | 4 +- .../lsp/api/AbstractServiceProvider.java | 28 +- .../lsp/api/ConfigurableServiceProvider.java | 14 +- .../lsp/api/DefaultLanguageServerRegistry.kt | 2 +- .../lsp/api/ICompletionProvider.java | 60 +- .../codeonthego/lsp/api/ILanguageClient.java | 6 +- .../lsp/api/ILanguageServerRegistry.kt | 11 +- .../codeonthego/lsp/api/IServerSettings.java | 134 +- .../codeonthego/lsp/api/helpers.kt | 8 +- .../lsp/debug/DebugClientConnectionResult.kt | 7 +- .../codeonthego/lsp/debug/IDebugAdapter.kt | 121 +- .../codeonthego/lsp/debug/IDebugClient.kt | 27 +- .../lsp/debug/IDebugEventHandler.kt | 27 +- .../codeonthego/lsp/debug/RemoteClient.kt | 20 +- .../lsp/debug/events/BreakpointHitEvent.kt | 11 +- .../lsp/debug/events/EventOrResponse.kt | 13 +- .../codeonthego/lsp/debug/events/StepEvent.kt | 10 +- .../lsp/debug/events/StoppedEvent.kt | 29 +- .../lsp/debug/model/BreakpointRequest.kt | 153 +- .../lsp/debug/model/BreakpointResponse.kt | 55 +- .../codeonthego/lsp/debug/model/DapRequest.kt | 11 +- .../lsp/debug/model/DapResponse.kt | 2 +- .../codeonthego/lsp/debug/model/Location.kt | 17 +- .../codeonthego/lsp/debug/model/Source.kt | 4 +- .../lsp/debug/model/StepRequest.kt | 33 +- .../lsp/debug/model/StepResponse.kt | 33 +- .../codeonthego/lsp/debug/model/ThreadInfo.kt | 92 +- .../lsp/debug/model/ThreadInfoRequest.kt | 50 +- .../codeonthego/lsp/debug/model/Variables.kt | 287 ++- .../utils/BreakpointNotFoundException.kt | 6 +- .../lsp/internal/model/CachedCompletion.kt | 165 +- .../lsp/snippets/DefaultSnippet.kt | 45 +- .../codeonthego/lsp/snippets/ISnippet.kt | 19 +- .../codeonthego/lsp/snippets/ISnippetScope.kt | 11 +- .../lsp/snippets/SnippetRegistry.kt | 56 +- .../lsp/snippets/UserSnippetLoader.kt | 28 +- .../lsp/util/DefaultServerSettings.kt | 24 +- .../codeonthego/lsp/util/DiagnosticUtil.java | 6 +- .../util/DocumentationReferenceProvider.kt | 90 +- .../lsp/util/LSPEditorActions.java | 31 +- .../lsp/util/NoCompletionsProvider.kt | 4 +- .../lsp/util/PrefBasedServerSettings.java | 41 +- .../codeonthego/lsp/util/StringUtils.java | 164 +- .../lsp/util/commonCompletionUtils.kt | 62 +- .../lsp/external/ExternalLanguageServer.kt | 4 +- .../java/CompilationCancellationException.kt | 8 +- .../lsp/java/JavaCompilerProvider.java | 123 +- .../lsp/java/JavaLanguageServer.kt | 24 +- .../lsp/java/actions/BaseJavaCodeAction.kt | 2 +- .../lsp/java/actions/ExtractMethodAction.kt | 2 +- .../lsp/java/actions/ExtractVariableAction.kt | 2 +- .../lsp/java/actions/FieldBasedAction.kt | 12 +- .../actions/common/FindReferencesAction.kt | 37 +- .../actions/common/GoToDefinitionAction.kt | 37 +- .../actions/common/OrganizeImportsAction.kt | 113 +- .../common/RemoveUnusedImportsAction.kt | 97 +- .../actions/diagnostics/AddImportAction.kt | 12 +- .../actions/diagnostics/AddThrowsAction.kt | 92 +- .../diagnostics/AutoFixImportsAction.kt | 2 +- .../diagnostics/CreateMissingMethodAction.kt | 84 +- .../actions/diagnostics/FieldToBlockAction.kt | 2 +- .../ImplementAbstractMethodsAction.kt | 104 +- .../actions/diagnostics/RemoveClassAction.kt | 82 +- .../actions/diagnostics/RemoveMethodAction.kt | 92 +- .../diagnostics/RemoveUnusedThrowsAction.kt | 98 +- .../SuppressUncheckedWarningAction.kt | 92 +- .../diagnostics/VariableToStatementAction.kt | 2 +- .../generators/GenerateConstructorAction.kt | 24 +- .../GenerateMissingConstructorAction.kt | 90 +- .../GenerateSettersAndGettersAction.kt | 14 +- .../GenerateToStringMethodAction.kt | 26 +- .../OverrideSuperclassMethodsAction.kt | 22 +- .../lsp/java/compiler/ClasspathTypeLookup.kt | 4 +- .../java/compiler/CompilationTaskProcessor.kt | 12 +- .../lsp/java/compiler/CompileBatch.java | 20 +- .../lsp/java/compiler/CompileTask.java | 76 +- .../lsp/java/compiler/CompilerProvider.java | 4 +- .../DefaultCompilationTaskProcessor.kt | 24 +- .../lsp/java/compiler/JCReusableCompiler.kt | 10 +- .../lsp/java/compiler/JavaCompilerConfig.kt | 49 +- .../lsp/java/compiler/JavaCompilerImpl.kt | 109 +- .../java/compiler/JavaCompilerService.java | 44 +- .../lsp/java/compiler/SourceFileManager.java | 16 +- .../lsp/java/compiler/SourceFileObject.java | 274 +-- .../lsp/java/compiler/SynchronizedTask.kt | 166 +- .../lsp/java/debug/EventHandler.kt | 2 +- .../lsp/java/debug/JavaDebugAdapter.kt | 34 +- .../codeonthego/lsp/java/debug/JdwpOptions.kt | 52 +- .../lsp/java/debug/ListenerState.kt | 17 +- .../lsp/java/debug/LspThreadInfo.kt | 16 +- .../codeonthego/lsp/java/debug/ThreadState.kt | 504 ++--- .../codeonthego/lsp/java/debug/Variables.kt | 16 +- .../lsp/java/debug/VmConnection.kt | 53 +- .../lsp/java/debug/spec/BreakpointSpec.kt | 10 +- .../spec/ClassPatternReferenceTypeSpec.kt | 142 +- .../lsp/java/debug/spec/DebugEnv.kt | 60 +- .../java/debug/spec/EventRequestSpecList.kt | 2 +- .../lsp/java/debug/spec/Exceptions.kt | 9 +- .../debug/spec/PatternReferenceTypeSpec.kt | 38 +- .../lsp/java/debug/spec/ReferenceTypeSpec.kt | 30 +- .../debug/spec/SourceReferenceTypeSpec.kt | 6 +- .../lsp/java/debug/utils/EvaluationContext.kt | 260 ++- .../lsp/java/debug/utils/JdiTypes.kt | 127 +- .../lsp/java/debug/utils/KotlinClassNames.kt | 2 +- .../lsp/java/debug/utils/MirrorExts.kt | 11 +- .../lsp/java/debug/utils/MiscExts.kt | 26 +- .../lsp/java/debug/utils/ModelUtils.kt | 6 +- .../lsp/java/debug/utils/StringUtils.kt | 34 +- .../lsp/java/debug/utils/VariableValues.kt | 251 ++- .../lsp/java/edits/AdvancedJavaEditHandler.kt | 20 +- .../lsp/java/edits/BaseJavaEditHandler.kt | 8 +- .../lsp/java/edits/ClassImportEditHandler.kt | 10 +- .../edits/MultipleClassImportEditHandler.kt | 47 +- .../lsp/java/models/CompilationRequest.kt | 20 +- .../lsp/java/models/DiagnosticCode.kt | 60 +- .../lsp/java/models/JavaCompletionItem.kt | 79 +- .../java/models/JavaServerConfiguration.java | 78 +- .../lsp/java/models/JavaServerSettings.java | 67 +- .../lsp/java/models/PartialReparseRequest.kt | 5 +- .../lsp/java/parser/IJavaParser.kt | 15 +- .../lsp/java/parser/ParseTask.java | 14 +- .../codeonthego/lsp/java/parser/Parser.java | 394 ++-- .../lsp/java/parser/ts/TSJavaParser.kt | 162 +- .../lsp/java/parser/ts/TSMethodPruner.kt | 71 +- .../lsp/java/parser/ts/TSParseCache.kt | 23 +- .../lsp/java/parser/ts/TSParseResult.kt | 15 +- .../java/providers/BaseJavaServiceProvider.kt | 3 +- .../providers/CancelableServiceProvider.kt | 5 +- .../java/providers/CodeFormatProvider.java | 136 +- .../java/providers/CompletionProvider.java | 20 +- .../java/providers/DefinitionProvider.java | 186 +- .../lsp/java/providers/DiagnosticsProvider.kt | 580 +++--- .../java/providers/JavaDiagnosticProvider.kt | 47 +- .../java/providers/JavaSelectionProvider.java | 54 +- .../lsp/java/providers/ReferenceProvider.java | 250 +-- .../lsp/java/providers/SignatureProvider.java | 615 ++++--- .../ClassNamesCompletionProvider.kt | 6 +- .../completion/IJavaCompletionProvider.kt | 718 ++++---- .../IdentifierCompletionProvider.kt | 84 +- .../completion/ImportCompletionProvider.kt | 20 +- .../completion/ImportPathChildren.kt | 2 +- .../completion/KeywordCompletionProvider.kt | 240 ++- .../MemberReferenceCompletionProvider.kt | 273 +-- .../MemberSelectCompletionProvider.kt | 383 ++-- .../completion/ScopeCompletionProvider.kt | 264 +-- .../completion/SnippetCompletionProvider.kt | 127 +- .../StaticImportCompletionProvider.kt | 175 +- .../SwitchConstantCompletionProvider.kt | 115 +- .../definition/ErroneousDefinitionProvider.kt | 93 +- .../definition/IJavaDefinitionProvider.kt | 51 +- .../definition/LocalDefinitionProvider.kt | 46 +- .../definition/RemoteDefinitionProvider.kt | 32 +- .../providers/snippet/JavaSnippetScope.kt | 27 +- .../lsp/java/refactor/AnchorMember.kt | 2 +- .../lsp/java/refactor/CandidateExpressions.kt | 4 +- .../lsp/java/refactor/ExtractMethodPlanner.kt | 2 +- .../java/refactor/ExtractVariablePlanner.kt | 20 +- .../lsp/java/refactor/ExtractionRegion.kt | 2 +- .../java/refactor/JavaExtractVariableUi.kt | 2 +- .../lsp/java/refactor/MethodSignature.kt | 6 +- .../lsp/java/refactor/NameSuggestion.kt | 12 +- .../lsp/java/refactor/Occurrences.kt | 2 +- .../lsp/java/refactor/RegionReferences.kt | 2 +- .../lsp/java/refactor/RegionTypes.kt | 2 +- .../lsp/java/refactor/ThrownTypes.kt | 2 +- .../lsp/java/rewrite/AddException.java | 123 +- .../lsp/java/rewrite/AddImport.java | 38 +- .../rewrite/AddSuppressWarningAnnotation.java | 91 +- .../lsp/java/rewrite/ConvertFieldToBlock.java | 96 +- .../rewrite/ConvertVariableToStatement.java | 126 +- .../lsp/java/rewrite/CreateMissingMethod.java | 382 ++-- .../rewrite/GenerateRecordConstructor.java | 264 +-- .../rewrite/ImplementAbstractMethods.java | 261 ++- .../lsp/java/rewrite/RemoveClass.java | 36 +- .../lsp/java/rewrite/RemoveException.java | 321 ++-- .../lsp/java/rewrite/RemoveMethod.java | 69 +- .../codeonthego/lsp/java/rewrite/Rewrite.kt | 92 +- .../codeonthego/lsp/java/utils/ASTFixer.java | 210 ++- .../lsp/java/utils/AnalyzeTimer.java | 110 +- .../lsp/java/utils/CancelChecker.kt | 24 +- .../lsp/java/utils/CodeActionUtils.java | 315 ++-- .../lsp/java/utils/CompletableDeferredExts.kt | 22 +- .../lsp/java/utils/EditHelper.java | 316 ++-- .../lsp/java/utils/Extractors.java | 37 +- .../lsp/java/utils/FindHelper.java | 383 ++-- .../lsp/java/utils/JavaParserUtils.kt | 1409 +++++++------- .../lsp/java/utils/JavaPoetUtils.kt | 143 +- .../lsp/java/utils/MarkdownHelper.java | 347 ++-- .../codeonthego/lsp/java/utils/MethodPtr.java | 116 +- .../lsp/java/utils/NavigationHelper.java | 120 +- .../lsp/java/utils/ScopeHelper.java | 120 +- .../lsp/java/utils/ShortTypePrinter.java | 180 +- .../codeonthego/lsp/java/utils/TestUtils.kt | 21 +- .../codeonthego/lsp/java/utils/TreeUtils.kt | 61 +- .../codeonthego/lsp/java/utils/TypeUtils.java | 424 +++-- .../codeonthego/lsp/java/utils/insertUtils.kt | 48 +- .../lsp/java/visitors/DiagnosticVisitor.kt | 744 ++++---- .../FindAnonymousTypeDeclaration.java | 63 +- .../lsp/java/visitors/FindBiggerRange.java | 230 +-- .../lsp/java/visitors/FindCompletionsAt.java | 210 +-- .../lsp/java/visitors/FindInvocationAt.java | 88 +- .../lsp/java/visitors/FindMethodAt.kt | 61 +- .../lsp/java/visitors/FindMethodCallAt.java | 431 ++--- .../visitors/FindMethodDeclarationAt.java | 61 +- .../lsp/java/visitors/FindNameAt.java | 179 +- .../lsp/java/visitors/FindReferences.java | 76 +- .../java/visitors/FindTypeDeclarationAt.java | 63 +- .../visitors/FindTypeDeclarationNamed.java | 45 +- .../java/visitors/FindTypeDeclarations.java | 30 +- .../java/visitors/FindVariableAtCursor.java | 53 +- .../java/visitors/FindVariablesBetween.java | 64 +- .../lsp/java/visitors/MethodRangeScanner.kt | 108 +- .../java/visitors/PrettyPrintingVisitor.java | 215 +-- .../lsp/java/visitors/PrintingVisitor.kt | 28 +- .../lsp/java/visitors/PruneMethodBodies.java | 84 +- .../codeonthego/lsp/java/JavaLSPTest.kt | 33 +- .../lsp/java/actions/AddImportTest.kt | 8 +- .../lsp/java/compiler/CompilerTest.kt | 134 +- .../JavaCompilerServiceClassLookupTest.kt | 2 +- .../java/partial/PartialReparserImplTest.kt | 253 ++- .../providers/JavaCompletionProviderTest.kt | 103 +- .../providers/JavaSelectionProviderTest.kt | 155 +- .../completion/FakeClasspathPackages.kt | 2 +- .../ImportCompletionProviderTest.kt | 8 +- .../completion/ImportPathChildrenTest.kt | 2 +- .../refactor/ExtractVariablePrimitivesTest.kt | 2 +- .../refactor/ExtractVariableSoundnessTest.kt | 2 +- .../lsp/java/refactor/JavacFixture.kt | 2 +- .../refactor/RegionAnalysisPrimitivesTest.kt | 2 +- .../lsp/java/utils/FindHelperTest.kt | 39 +- .../indexing/jvm/JarIndexingService.kt | 8 +- .../jvm/JvmGeneratedIndexingService.kt | 4 +- .../indexing/jvm/JvmLibraryIndexingService.kt | 8 +- .../jvm/JvmModuleOutputIndexingService.kt | 6 +- .../indexing/jvm/ModuleClasspathLookup.kt | 2 +- .../jvm/ClasspathTrieDifferentialTest.kt | 2 +- .../jvm/JarIndexingServiceProgressTest.kt | 4 +- .../jvm/JarIndexingServiceSupervisorTest.kt | 2 +- ...arIndexingServiceUnreadableJarDedupTest.kt | 2 +- .../JarIndexingServiceUnreadableJarTest.kt | 2 +- ...ibraryIndexingServiceInitialRefreshTest.kt | 6 +- .../jvm/JvmLibraryIndexingServicePhaseTest.kt | 8 +- .../jvm/JvmModuleOutputIndexingServiceTest.kt | 4 +- .../ModuleClasspathLookupDifferentialTest.kt | 4 +- .../ModuleClasspathLookupModuleScopeTest.kt | 2 +- .../indexing/jvm/ModuleFixtures.kt | 4 +- .../lsp/kotlin/FileEventConsumer.kt | 13 +- .../lsp/kotlin/KotlinLanguageServer.kt | 26 +- .../lsp/kotlin/KotlinServerSettings.kt | 14 +- .../lsp/kotlin/actions/AddImportAction.kt | 14 +- .../lsp/kotlin/actions/ExtractMethodAction.kt | 2 +- .../kotlin/actions/ExtractVariableAction.kt | 2 +- .../kotlin/actions/FindReferencesAction.kt | 4 +- .../kotlin/actions/GoToDefinitionAction.kt | 4 +- .../kotlin/actions/ImplementMembersAction.kt | 2 +- .../kotlin/actions/InlineVariableAction.kt | 2 +- .../lsp/kotlin/actions/NullSafetyAction.kt | 8 +- .../kotlin/actions/OrganizeImportsAction.kt | 2 +- .../AbstractCompilationEnvironment.kt | 4 +- .../kotlin/compiler/CompilationEnvironment.kt | 28 +- .../lsp/kotlin/compiler/CompilationKind.kt | 9 +- .../IncrementalModificationTracker.kt | 14 +- .../KotlinApplicationEnvironmentPin.kt | 3 +- .../lsp/kotlin/compiler/KotlinProjectModel.kt | 4 +- .../lsp/kotlin/compiler/ReadWriteLock.kt | 2 +- .../lsp/kotlin/compiler/index/IndexWorker.kt | 14 +- .../kotlin/compiler/index/KtSymbolIndex.kt | 24 +- .../kotlin/compiler/index/ScanningWorker.kt | 6 +- .../compiler/index/SourceFileIndexer.kt | 18 +- .../lsp/kotlin/compiler/index/WorkerQueue.kt | 10 +- .../compiler/modules/AbstractKtModule.kt | 2 +- .../compiler/modules/AbstractSourceModule.kt | 5 +- .../modules/NotUnderContentRootModule.kt | 21 +- .../registrar/AnalysisApiServiceProvider.kt | 103 +- .../LspAnalysisApiServiceRegistrar.kt | 10 +- .../services/AnalysisPermissionOptions.kt | 2 +- .../JavaModuleAccessibilityChecker.kt | 15 +- .../services/JavaModuleAnnotationsProvider.kt | 9 +- .../kotlin/compiler/services/KtLspService.kt | 3 +- .../compiler/services/LanguageSettings.kt | 2 +- .../services/ModificationTrackerFactory.kt | 4 +- .../services/NoOpAsyncExecutionService.kt | 219 ++- .../compiler/services/PackageProvider.kt | 41 +- .../compiler/services/PlatformSettings.kt | 2 +- .../services/ProjectStructureProvider.kt | 39 +- .../services/ResolutionScopeProvider.kt | 2 +- .../compiler/services/WriteAccessGuard.kt | 8 +- .../lsp/kotlin/compiler/util/SLF4JLogger.kt | 51 +- .../completion/AdvancedKotlinEditHandler.kt | 4 +- .../completion/BaseKotlinEditHandler.kt | 8 +- .../kotlin/completion/CompletionContext.kt | 3 +- .../lsp/kotlin/completion/ContextKeywords.kt | 2 +- .../lsp/kotlin/completion/ContextResolver.kt | 106 +- .../kotlin/completion/DeclarationContext.kt | 19 +- .../completion/KotlinAutoImportEditHandler.kt | 9 +- .../kotlin/completion/KotlinCompletionItem.kt | 31 +- .../kotlin/completion/KotlinCompletions.kt | 16 +- .../kotlin/completion/KotlinSnippetScope.kt | 7 +- .../lsp/kotlin/completion/ModifierFilter.kt | 2 +- .../diagnostic/KotlinDiagnosticProvider.kt | 2 +- .../refactor/KotlinExtractVariableUi.kt | 2 +- .../refactor/ui/InlineVariableSheetContent.kt | 2 +- .../lsp/kotlin/utils/ContextKeywords.kt | 118 +- .../lsp/kotlin/utils/ContextResolver.kt | 102 +- .../codeonthego/lsp/kotlin/utils/EditExts.kt | 63 +- .../lsp/kotlin/utils/ImportUsageCollector.kt | 3 + .../lsp/kotlin/utils/ModifierFilter.kt | 2 +- .../lsp/kotlin/utils/SymbolExts.kt | 2 +- .../kotlin/utils/SymbolVisibilityChecker.kt | 17 +- .../lsp/kotlin/utils/VirtualFileExts.kt | 6 +- .../actions/AddImportActionPinScopeTest.kt | 8 +- .../lsp/kotlin/actions/AddImportActionTest.kt | 6 +- .../compiler/index/CurrentKtFileCacheTest.kt | 8 +- .../compiler/index/IndexWorkerDisposalTest.kt | 2 +- .../index/IndexWorkerPhaseLifecycleTest.kt | 8 +- .../compiler/index/LiveKtFilePinTest.kt | 2 +- .../compiler/index/SourceFileIndexerTest.kt | 4 +- .../StaleKtFileInstanceDiagnosticsTest.kt | 2 +- .../compiler/index/StalePinEditRefusalTest.kt | 10 +- .../modules/AnalysisSerializationTest.kt | 6 +- .../modules/ContentScopeStalenessTest.kt | 29 +- .../kotlin/compiler/util/SLF4JLoggerTest.kt | 27 +- .../kotlin/completion/MatchLevelMemoTest.kt | 1 - .../lsp/kotlin/fixtures/KtLspTest.kt | 2 +- .../kotlin/fixtures/KtLspTestEnvironment.kt | 16 +- .../fixtures/KtLspTestEnvironmentTest.kt | 92 +- .../lsp/kotlin/fixtures/TestKtSourceModule.kt | 36 +- .../navigation/FindDefinitionRequestTest.kt | 2 +- .../navigation/FindUsagesLiveDocumentTest.kt | 2 +- .../lsp/kotlin/navigation/FindUsagesTest.kt | 2 +- .../lsp/kotlin/utils/ContextKeywordsTest.kt | 315 ++-- .../utils/SymbolVisibilityCheckerTest.kt | 333 ++-- .../lsp/CancellableRequestParams.kt | 11 +- .../appdevforall/codeonthego/lsp/LspParams.kt | 2 +- .../lsp/edits/DefaultEditHandler.kt | 8 +- .../codeonthego/lsp/edits/IEditHandler.kt | 22 +- .../codeonthego/lsp/models/CodeActions.kt | 28 +- .../codeonthego/lsp/models/CodeFormatting.kt | 48 +- .../codeonthego/lsp/models/CompletionData.kt | 35 +- .../lsp/models/CompletionItemComparator.java | 12 +- .../codeonthego/lsp/models/Definitions.kt | 10 +- .../codeonthego/lsp/models/Diagnostics.kt | 10 +- .../codeonthego/lsp/models/Edits.kt | 29 +- .../lsp/models/ExpandSelectionParams.kt | 5 +- .../codeonthego/lsp/models/HighlightToken.kt | 66 +- .../codeonthego/lsp/models/Initialization.kt | 20 +- .../codeonthego/lsp/models/LSPFailure.kt | 10 +- .../codeonthego/lsp/models/Markups.kt | 11 +- .../codeonthego/lsp/models/References.kt | 12 +- .../codeonthego/lsp/models/Signatures.kt | 38 +- .../codeonthego/lsp/models/TextDocument.kt | 10 +- .../codeonthego/lsp/util/RewriteHelper.kt | 7 +- .../lsp/xml/edits/AttrValueEditHandler.kt | 5 +- .../xml/edits/QualifiedValueEditHandler.kt | 7 +- .../lsp/xml/edits/TagEditHandler.kt | 7 +- .../lsp/xml/models/XMLFormattingOptions.kt | 86 +- .../lsp/xml/models/XMLServerSettings.kt | 9 +- .../lsp/xml/providers/AdvancedEditProvider.kt | 331 ++-- .../lsp/xml/providers/CodeFormatProvider.java | 33 +- .../xml/providers/XmlCompletionProvider.kt | 286 +-- .../completion/AttrValueCompletionProvider.kt | 693 +++---- .../completion/IXmlCompletionProvider.kt | 446 ++--- .../common/CommonAttrCompletionProvider.kt | 32 +- .../etc/InheritingAttrCompletionProvider.kt | 42 +- .../completion/layout/ClasspathLookup.kt | 2 +- .../layout/LayoutAttrCompletionProvider.kt | 13 +- .../layout/LayoutTagCompletionProvider.kt | 55 +- .../completion/layout/SimpleTagCompleter.kt | 2 +- .../completion/layoutFileCompletions.kt | 4 +- .../ManifestAttrCompletionProvider.kt | 36 +- .../ManifestAttrValueCompletionProvider.kt | 292 +-- .../manifest/ManifestTagCompletionProvider.kt | 88 +- .../completion/manifestFileCompletions.kt | 16 +- .../providers/completion/xmlCompletions.kt | 124 +- .../format/DOMAttributeFormatter.java | 254 +-- .../providers/format/DOMCDATAFormatter.java | 171 +- .../providers/format/DOMCommentFormatter.java | 183 +- .../providers/format/DOMDocTypeFormatter.java | 424 ++--- .../providers/format/DOMElementFormatter.java | 1001 +++++----- .../DOMProcessingInstructionFormatter.java | 84 +- .../providers/format/DOMTextFormatter.java | 186 +- .../format/FormatElementCategory.java | 30 +- .../xml/providers/format/TextEditUtils.java | 295 +-- .../xml/providers/format/XMLFormatter.java | 37 +- .../format/XMLFormatterDocument.java | 1500 ++++++++------- .../format/XMLFormatterDocumentNew.java | 1331 +++++++------- .../format/XMLFormattingConstraints.java | 63 +- .../xml/providers/snippet/XmlSnippetScope.kt | 12 +- .../lsp/xml/utils/StringUtils.java | 927 +++++----- .../codeonthego/lsp/xml/utils/XMLBuilder.java | 13 +- .../codeonthego/lsp/xml/utils/XmlUtils.kt | 227 ++- .../lsp/xml/utils/inheritingAttrs.kt | 16 +- .../lsp/xml/utils/tagTransforms.kt | 124 +- .../lsp/xml/utils/xmlCompletionUtils.kt | 16 +- .../codeonthego/lsp/xml/CompletionHelper.kt | 5 +- .../lsp/xml/CompletionHelperImpl.kt | 40 +- .../codeonthego/lsp/xml/XMLLSPTest.kt | 85 +- .../AttributeValueCompletionTest.kt | 354 ++-- .../CommonAttrCompletionProviderTest.kt | 69 +- .../CommonAttrValueCompletionTest.kt | 61 +- .../ManifestAttrCompletionProviderTest.kt | 55 +- ...ManifestAttrValueCompletionProviderTest.kt | 294 +-- .../ManifestTagCompletionProviderTest.kt | 47 +- .../completion/XMLCompletionProviderTest.kt | 119 +- .../completion/layout/FakeClasspathLookup.kt | 2 +- .../layout/QualifiedTagCompleterTest.kt | 2 +- .../layout/SimpleTagCompleterTest.kt | 2 +- .../lsp/xml/utils/TagTransformsTest.kt | 115 +- markdown-preview-plugin/build.gradle.kts | 115 +- .../MarkdownPreviewerPlugin.kt | 357 ++-- .../fragments/MarkdownPreviewFragment.kt | 1623 +++++++++-------- .../codeonthego/plugins/PluginContext.kt | 310 ++-- .../plugins/base/PluginFragment.kt | 192 +- .../plugins/base/SafePluginLayoutInflater.kt | 128 +- .../extensions/DocumentationExtension.kt | 179 +- .../extensions/EditorDecorationProvider.kt | 46 +- .../plugins/extensions/EditorExtension.kt | 135 +- .../plugins/extensions/EditorTabExtension.kt | 165 +- .../plugins/extensions/FileOpenExtension.kt | 27 +- .../plugins/extensions/ProjectExtension.kt | 111 +- .../plugins/extensions/SnippetExtension.kt | 2 +- .../plugins/extensions/UIExtension.kt | 325 ++-- .../plugins/services/IdeArchiveService.kt | 72 +- .../plugins/services/IdeCommandService.kt | 28 +- .../plugins/services/IdeEditorTabService.kt | 55 +- .../plugins/services/IdeEnvironmentService.kt | 58 +- .../plugins/services/IdeFeatureFlagService.kt | 3 +- .../plugins/services/IdeSidebarService.kt | 11 +- .../plugins/services/IdeSnippetService.kt | 2 +- .../plugins/services/IdeTemplateService.kt | 13 +- .../plugins/services/IdeThemeService.kt | 10 +- .../plugins/services/IdeTooltipService.kt | 46 +- .../plugins/services/SharedServices.kt | 37 +- .../plugins/templates/CgtTemplateBuilder.kt | 607 +++--- .../ai/prompt/PromptConfigLoaderTest.kt | 2 +- .../ai/prompt/PromptConfigStoreTest.kt | 4 +- .../plugins/manager/PluginTooltipNaming.kt | 5 +- .../manager/build/PluginBuildActionManager.kt | 340 ++-- .../manager/context/PluginContextImpl.kt | 560 +++--- .../manager/core/PluginCrashTracker.kt | 236 ++- .../plugins/manager/core/PluginManager.kt | 22 +- .../ExtensionToContentTypeResolver.kt | 88 +- .../PluginDocumentationManager.kt | 6 +- .../manager/fragment/PluginFragmentFactory.kt | 156 +- .../manager/loaders/PluginResourceContext.kt | 470 ++--- .../manager/project/PluginProjectManager.kt | 159 +- .../manager/security/PluginSecurityManager.kt | 235 +-- .../manager/services/CogoProjectProvider.kt | 322 ++-- .../manager/services/GradleTaskExecution.kt | 8 +- .../manager/services/IdeArchiveServiceImpl.kt | 706 +++---- .../manager/services/IdeCommandServiceImpl.kt | 14 +- .../manager/services/IdeEditorServiceImpl.kt | 4 +- .../services/IdeEditorTabServiceImpl.kt | 248 +-- .../services/IdeEnvironmentServiceImpl.kt | 31 +- .../services/IdeFeatureFlagServiceImpl.kt | 3 +- .../manager/services/IdeFileServiceImpl.kt | 464 ++--- .../IdeProjectManipulationServiceImpl.kt | 96 +- .../manager/services/IdeSnippetServiceImpl.kt | 1 - .../services/IdeTemplateServiceImpl.kt | 141 +- .../services/IdeTerminalServiceImpl.kt | 10 +- .../manager/services/IdeThemeServiceImpl.kt | 83 +- .../manager/services/IdeTooltipServiceImpl.kt | 70 +- .../manager/services/IdeUIServiceImpl.kt | 71 +- .../manager/services/ModuleContextResolver.kt | 122 +- .../manager/services/PluginPathAllowlist.kt | 78 +- .../manager/snippets/PluginSnippetManager.kt | 37 +- .../manager/ui/PluginDrawableResolver.kt | 51 +- .../manager/ui/PluginEditorTabManager.kt | 642 +++---- .../plugins/manager/ui/PluginToolbarHost.kt | 13 +- .../manager/ui/PluginUiActionManager.kt | 27 +- .../IdeCommandServiceImplGradleTaskTest.kt | 6 +- .../IdeEditorServiceImplSaveFileTest.kt | 2 +- .../services/IdeTerminalServiceImplTest.kt | 4 +- .../preferences/BaseIDEPreferences.kt | 20 +- .../codeonthego/preferences/BasePreference.kt | 61 +- .../preferences/EditTextPreference.kt | 34 +- .../preferences/IPreferenceInflater.kt | 11 +- .../preferences/MultiChoicePreference.kt | 34 +- .../NumberInputEditTextPreference.kt | 73 +- .../preferences/PreferenceValueType.kt | 25 +- .../preferences/SimplePreference.kt | 8 +- .../preferences/SingleChoicePreference.kt | 83 +- .../preferences/SwitchPreference.kt | 40 +- .../preferences/internal/DevOpsPreferences.kt | 31 +- .../preferences/internal/JavaPreferences.kt | 15 +- .../preferences/utils/editorUtil.kt | 8 +- .../service/deploy/ProxyAppConnections.kt | 2 +- .../service/deploy/DeployChannelDeployTest.kt | 2 +- .../service/deploy/DeployChannelWaitsTest.kt | 2 +- .../deploy/QuickBuildHostBinderTest.kt | 2 +- .../codeonthego/resources/ITooltipView.java | 27 +- .../resources/TooltipTextInputLayout.java | 144 +- .../localization/LocaleProvider.java | 125 +- .../src/main/res/layout/layout_spinner.xml | 51 +- scripts/run_instrumentation_tests.sh | 118 +- .../codeonthego/models/LogLine.kt | 277 +-- .../codeonthego/utils/AndroidPluginVersion.kt | 436 ++--- .../appdevforall/codeonthego/utils/Cache.java | 220 +-- .../codeonthego/utils/ClassTrie.kt | 443 ++--- .../codeonthego/utils/DefaultRecyclable.kt | 23 +- .../codeonthego/utils/DocumentUtils.java | 64 +- .../appdevforall/codeonthego/utils/Either.kt | 2 +- .../codeonthego/utils/FileProvider.kt | 147 +- .../utils/InputStreamLineReader.java | 42 +- .../codeonthego/utils/IntPair.java | 72 +- .../codeonthego/utils/ReaderInputStream.java | 537 +++--- .../codeonthego/utils/RecyclableObjectPool.kt | 370 ++-- .../codeonthego/utils/ServiceLoader.java | 1080 ++++++----- .../utils/ServiceNotFoundException.java | 8 +- .../codeonthego/utils/SourceClassTrie.kt | 307 ++-- .../codeonthego/utils/StopWatch.kt | 75 +- .../codeonthego/utils/StringUtil.java | 45 +- .../codeonthego/utils/UniqueNameBuilder.java | 373 ++-- .../appdevforall/codeonthego/utils/VMUtils.kt | 4 +- .../codeonthego/utils/miscUtils.kt | 4 +- .../utils/recyclableObjectPoolExtensions.kt | 26 +- .../codeonthego/utils/stringExt.kt | 8 +- .../codeonthego/utils/FileProviderTest.kt | 51 +- .../codeonthego/aapt/Resources.kt | 34 +- .../codeonthego/aapt/logging/IDELogger.kt | 94 +- .../codeonthego/aaptcompiler/CompilerTest.kt | 65 +- .../DefaultAndroidGradlePluginProjectFlags.kt | 18 +- .../model/DefaultAndroidLibraryData.kt | 31 +- .../builder/model/DefaultApiVersion.kt | 10 +- .../model/DefaultArtifactDependencies.kt | 12 +- .../builder/model/DefaultBundleInfo.kt | 14 +- .../model/DefaultCustomSourceDirectory.kt | 9 +- .../builder/model/DefaultGraphItem.kt | 12 +- .../builder/model/DefaultJavaArtifact.kt | 27 +- .../model/DefaultJavaCompileOptions.kt | 33 +- .../builder/model/DefaultLibraryInfo.kt | 21 +- .../builder/model/DefaultProjectInfo.kt | 19 +- .../builder/model/DefaultProjectSyncIssues.kt | 8 +- .../model/DefaultSourceSetContainer.kt | 23 +- .../builder/model/DefaultSyncIssue.kt | 16 +- .../builder/model/DefaultTestInfo.kt | 14 +- .../model/DefaultTestedTargetVariant.kt | 10 +- .../model/DefaultUnresolvedDependency.kt | 9 +- .../model/DefaultViewBindingOptions.kt | 8 +- .../codeonthego/builder/model/IDESyncIssue.kt | 37 +- .../builder/model/IJavaCompilerSettings.kt | 13 +- .../javac/services/CancelAbort.java | 2 +- .../javac/services/CancelService.java | 44 +- .../codeonthego/javac/services/NBAttr.java | 210 +-- .../javac/services/NBClassFinder.java | 159 +- .../javac/services/NBClassReader.java | 193 +- .../javac/services/NBClassWriter.java | 21 +- .../codeonthego/javac/services/NBEnter.java | 77 +- .../javac/services/NBJavaCompiler.java | 93 +- .../javac/services/NBJavacTrees.java | 66 +- .../codeonthego/javac/services/NBLog.java | 142 +- .../javac/services/NBMemberEnter.java | 81 +- .../codeonthego/javac/services/NBNames.java | 54 +- .../javac/services/NBParserFactory.java | 379 ++-- .../codeonthego/javac/services/NBResolve.java | 65 +- .../javac/services/NBTreeMaker.java | 45 +- .../services/compiler/CancelServiceImpl.kt | 24 +- .../services/compiler/JavacFlowListener.java | 10 +- .../javac/services/compiler/ReusableBorrow.kt | 35 +- .../services/compiler/ReusableCompiler.kt | 124 +- .../services/compiler/ReusableContext.kt | 195 +- .../services/compiler/ReusableJavaCompiler.kt | 39 +- .../javac/services/compiler/ReusableLog.kt | 68 +- .../services/fs/AndroidFsProviderImpl.kt | 17 +- .../javac/services/fs/CacheFSInfoSingleton.kt | 67 +- .../javac/services/fs/CachedJarFileSystem.kt | 78 +- .../services/fs/JarPackageProviderImpl.kt | 8 +- .../javac/services/partial/CompilationInfo.kt | 8 +- .../partial/DiagnosticListenerImpl.java | 536 +++--- .../javac/services/partial/PartialReparser.kt | 7 +- .../services/partial/PartialReparserImpl.kt | 601 +++--- .../services/partial/RichDiagnostic.java | 139 +- .../services/util/JavaDiagnosticUtils.kt | 54 +- .../javac/services/util/ReparserUtils.java | 328 ++-- .../visitors/ErrorAwareTreeScanner.kt | 15 +- .../services/visitors/FindAnonymousVisitor.kt | 82 +- .../TranslateMethodPositionsVisitor.java | 144 +- .../javac/services/visitors/UnEnter.kt | 2 +- .../projects/serial/ProtoProject.kt | 2 +- .../codeonthego/projects/FileManager.kt | 2 +- .../codeonthego/projects/IProjectManager.kt | 5 +- .../projects/ProjectManagerImpl.kt | 21 +- .../codeonthego/projects/api/AndroidModule.kt | 16 +- .../projects/classpath/ClassInfo.kt | 92 +- .../projects/classpath/IClasspathReader.kt | 5 +- .../classpath/ZipFileClasspathReader.kt | 69 +- .../projects/models/ActiveJavaDocument.kt | 11 +- .../projects/util/BootClasspathProvider.java | 189 +- .../projects/util/StringSearch.java | 835 ++++----- .../codeonthego/projects/util/projects.kt | 4 +- .../ProjectManagerImplGenerateSourcesTest.kt | 6 +- .../ProjectManagerImplResourceChangeTest.kt | 4 +- ...ProjectManagerImplUninitializedPathTest.kt | 67 +- .../api/ModuleOutputClasspathDeltaTest.kt | 4 +- .../classpath/ZipFileClasspathReaderTest.kt | 53 +- .../projects/util/ClassTrieTest.kt | 89 +- .../moe/shizuku/manager/ShizukuSettings.kt | 2 +- .../java/moe/shizuku/manager/adb/AdbKey.kt | 2 +- .../codeonthego/tooling/events/FinishEvent.kt | 2 +- .../tooling/events/OperationDescriptor.kt | 6 +- .../tooling/events/OperationResult.kt | 6 +- .../tooling/events/ProgressEvent.kt | 8 +- .../codeonthego/tooling/events/StatusEvent.kt | 12 +- .../ProjectConfigurationFinishEvent.kt | 11 +- ...ProjectConfigurationOperationDescriptor.kt | 34 +- .../ProjectConfigurationOperationResult.kt | 13 +- .../ProjectConfigurationProgressEvent.kt | 6 +- .../ProjectConfigurationStartEvent.kt | 9 +- .../download/FileDownloadFinishEvent.kt | 11 +- .../FileDownloadOperationDescriptor.kt | 34 +- .../download/FileDownloadProgressEvent.kt | 6 +- .../events/download/FileDownloadResult.kt | 6 +- .../events/download/FileDownloadStartEvent.kt | 9 +- .../events/internal/DefaultFinishEvent.kt | 11 +- .../internal/DefaultOperationDescriptor.kt | 31 +- .../events/internal/DefaultOperationResult.kt | 6 +- .../events/internal/DefaultProgressEvent.kt | 6 +- .../events/internal/DefaultStartEvent.kt | 8 +- .../events/task/TaskExecutionResult.kt | 8 +- .../tooling/events/task/TaskFailureResult.kt | 5 +- .../tooling/events/task/TaskFinishEvent.kt | 11 +- .../events/task/TaskOperationDescriptor.kt | 46 +- .../events/task/TaskOperationResult.kt | 6 +- .../tooling/events/task/TaskProgressEvent.kt | 6 +- .../tooling/events/task/TaskSkippedResult.kt | 7 +- .../tooling/events/task/TaskStartEvent.kt | 8 +- .../tooling/events/task/TaskSuccessResult.kt | 12 +- .../tooling/events/test/TestFinishEvent.kt | 11 +- .../events/test/TestOperationDescriptor.kt | 30 +- .../events/test/TestOperationResult.kt | 6 +- .../tooling/events/test/TestProgressEvent.kt | 6 +- .../tooling/events/test/TestStartEvent.kt | 9 +- .../events/transform/TransformFinishEvent.kt | 11 +- .../transform/TransformOperationDescriptor.kt | 64 +- .../transform/TransformOperationResult.kt | 6 +- .../transform/TransformProgressEvent.kt | 6 +- .../events/transform/TransformStartEvent.kt | 9 +- .../events/work/WorkItemFinishEvent.kt | 11 +- .../work/WorkItemOperationDescriptor.kt | 34 +- .../events/work/WorkItemOperationResult.kt | 6 +- .../events/work/WorkItemProgressEvent.kt | 6 +- .../tooling/events/work/WorkItemStartEvent.kt | 9 +- .../tooling/model/BuildIdentifier.kt | 4 +- .../tooling/model/PluginIdentifier.kt | 4 +- .../tooling/model/ProjectIdentifier.kt | 5 +- .../tooling/impl/LoggingOutputStream.kt | 1 + .../codeonthego/tooling/impl/Main.kt | 4 +- .../impl/ProjectInitializationExeption.kt | 6 +- .../tooling/impl/progress/EventTransformer.kt | 798 ++++---- .../progress/ForwardingProgressListener.kt | 108 +- .../tooling/impl/sync/ISyncIssueReporter.kt | 35 +- .../impl/sync/ModelBuilderException.java | 21 +- .../sync/NotAnAndroidProjectException.java | 17 +- .../tooling/impl/sync/RootModelBuilder.kt | 2 +- .../tooling/impl/ToolingApiServerImplTest.kt | 14 +- .../impl/logging/ToolingApiAppenderTest.kt | 6 +- .../tooling/impl/util/GradleBuildExtsTest.kt | 4 +- .../codeonthego/tooling/api/IGradleProject.kt | 27 +- .../codeonthego/tooling/api/ProjectType.kt | 31 +- .../api/models/AndroidArtifactMetadata.kt | 34 +- .../api/models/AndroidProjectMetadata.kt | 96 +- .../api/models/AndroidVariantMetadata.kt | 8 +- .../api/models/BasicAndroidVariantMetadata.kt | 11 +- .../api/models/BasicProjectMetadata.kt | 15 +- .../tooling/api/models/BuildVariantInfo.kt | 40 +- .../tooling/api/models/GradleArtifact.kt | 13 +- .../tooling/api/models/GradleTask.kt | 16 +- .../tooling/api/models/IModuleMetadata.kt | 11 +- .../tooling/api/models/JavaContentRoot.kt | 6 +- .../api/models/JavaModuleCompilerSettings.kt | 22 +- .../api/models/JavaModuleDependency.kt | 10 +- .../models/JavaModuleExternalDependency.kt | 30 +- .../api/models/JavaModuleProjectDependency.kt | 22 +- .../tooling/api/models/JavaProjectMetadata.kt | 47 +- .../tooling/api/models/JavaSourceDirectory.kt | 9 +- .../tooling/api/models/Launchable.kt | 12 +- .../tooling/api/models/ProjectMetadata.kt | 16 +- .../api/models/ToolingServerMetadata.kt | 2 +- .../api/models/params/StringParameter.kt | 4 +- .../api/models/result/SelectProjectResult.kt | 4 +- .../api/util/AndroidModulePropertyCopier.kt | 374 ++-- .../messages/AndroidInitializationParams.kt | 22 +- .../tooling/api/messages/BuildId.kt | 1 - .../api/messages/GradleDistributionParams.kt | 74 +- .../tooling/api/messages/LogMessageParams.kt | 10 +- .../tooling/api/messages/ShutDownMessage.kt | 4 +- .../result/BuildCancellationRequestResult.kt | 19 +- .../result/GradleWrapperCheckResult.kt | 4 +- .../tooling/api/sync/ProjectSyncHelper.kt | 10 +- .../tooling/api/util/FileTypeAdapter.java | 41 +- .../api/util/RuntimeTypeAdapterFactory.java | 365 ++-- .../codeonthego/tooling/api/util/versions.kt | 30 +- .../resources/DefaultResourceTableRegistry.kt | 2 +- .../internal/versions/DefaultApiVersions.kt | 16 +- .../internal/widgets/DefaultWidgetTable.kt | 297 ++- .../internal/widgets/util/DefaultWidget.kt | 8 +- .../xml/internal/widgets/util/WidgetParser.kt | 29 +- .../ManifestPermissionConstants.java | 517 +++--- .../codeonthego/xml/permissions/Permission.kt | 418 ++--- .../xml/permissions/PermissionGroup.kt | 36 +- .../codeonthego/xml/registry/XmlRegistry.kt | 25 +- .../xml/resources/ResourceTableRegistry.kt | 125 +- .../codeonthego/xml/utils/patterns.kt | 2 +- .../codeonthego/xml/versions/ClassInfo.kt | 12 +- .../codeonthego/xml/versions/FieldInfo.kt | 2 +- .../codeonthego/xml/versions/MethodInfo.kt | 11 +- .../codeonthego/xml/widgets/Widget.kt | 16 +- .../codeonthego/xml/widgets/WidgetTable.kt | 41 +- .../xml/widgets/WidgetTableRegistry.kt | 24 +- .../codeonthego/xml/widgets/WidgetType.kt | 43 +- .../resources/ResourceTableRegistryTest.kt | 338 ++-- .../xml/widgets/WidgetTableRegistryTest.kt | 115 +- .../templates/ITemplateProvider.kt | 90 +- .../templates/ITemplateWidgetViewProvider.kt | 52 +- .../codeonthego/templates/RecipeExecutor.kt | 95 +- .../templates/base/ProjectTemplateBuilder.kt | 5 +- .../templates/base/models/Dependency.kt | 318 ++-- .../base/models/DependencyConfiguration.kt | 17 +- .../templates/base/models/models.kt | 38 +- .../templates/base/templateBuilders.kt | 58 +- .../codeonthego/templates/base/util/utils.kt | 76 +- .../templates/base/util/xmlBuilder.kt | 34 +- .../codeonthego/templates/widget.kt | 20 +- .../templates/impl/ConstraintVerifier.kt | 14 +- .../templates/impl/TemplateProviderImpl.kt | 4 +- .../templates/impl/TemplateWarning.kt | 6 +- .../impl/TemplateWidgetViewProviderImpl.kt | 718 ++++---- .../templates/impl/base/results.kt | 5 +- .../codeonthego/templates/impl/zip/ZipJson.kt | 76 +- .../templates/impl/zip/ZipRecipeExecutor.kt | 18 +- .../templates/impl/zip/ZipTemplateReader.kt | 251 +-- .../src/main/res/layout/layout_checkbox.xml | 33 +- .../src/main/res/layout/layout_textfield.xml | 45 +- .../templates/TestRecipeExecutor.kt | 123 +- .../impl/zip/ZipRecipeExecutorTest.kt | 2 +- .../codeonthego/templates/utils.kt | 176 +- .../testing/android/contextUtils.kt | 4 +- .../testing/android/uiAutomatorUtils.kt | 70 +- .../testing/android/uiDeviceUtils.kt | 32 +- .../testing/android/uiObjectUtils.kt | 34 +- .../testing/common/CIOnlyTestRule.kt | 34 +- .../testing/common/NoOpStatement.kt | 7 +- .../codeonthego/lsp/api/LSPTest.kt | 11 +- .../lsp/api/util/ReflectiveLogListener.kt | 30 +- .../codeonthego/tooling/test/Main.java | 2 +- .../codeonthego/tooling/test/Main.java | 2 +- .../codeonthego/tooling/test/Main.java | 2 +- .../codeonthego/tooling/test/Main.java | 2 +- .../src/main/res/layout/unsupported_views.xml | 105 +- .../codeonthego/tooling/test/Main.java | 2 +- .../codeonthego/tooling/test/Main.java | 2 +- .../codeonthego/tooling/test/Main.java | 2 +- .../testing/tooling/ToolingApiTestLauncher.kt | 2 +- .../models/ToolingApiTestLauncherParams.kt | 23 +- .../codeonthego/testing/tooling/utils.kt | 32 +- .../codeonthego/uidesigner/ShowXmlActivity.kt | 143 +- .../uidesigner/UIDesignerActivity.kt | 362 ++-- .../uidesigner/actions/RedoAction.kt | 45 +- .../uidesigner/actions/ShowHierarchyAction.kt | 53 +- .../uidesigner/actions/ShowXmlAction.kt | 73 +- .../uidesigner/actions/UiDesignerAction.kt | 45 +- .../uidesigner/actions/UndoAction.kt | 45 +- .../uidesigner/actions/uiDesignerActions.kt | 14 +- .../uidesigner/adapters/AddAttrListAdapter.kt | 49 +- .../adapters/ViewAttrListAdapter.kt | 123 +- .../adapters/WidgetsCategoryAdapter.kt | 75 +- .../uidesigner/adapters/WidgetsItemAdapter.kt | 68 +- .../uidesigner/drag/WidgetDragListener.kt | 182 +- .../drag/WidgetDragShadowBuilder.kt | 33 +- .../uidesigner/drag/WidgetTouchListener.kt | 82 +- .../uidesigner/fragments/AddAttrFragment.kt | 100 +- .../fragments/AttrValueEditorFragment.kt | 130 +- .../fragments/DesignerWorkspaceFragment.kt | 4 +- .../uidesigner/fragments/ViewInfoFragment.kt | 132 +- .../uidesigner/fragments/ViewInfoSheet.kt | 151 +- .../fragments/WidgetsListFragment.kt | 50 +- .../WorkspaceLayoutInflationHandler.kt | 55 +- .../fragments/WorkspaceViewAttrHandler.kt | 69 +- .../WorkspaceViewHierarchyHandler.kt | 191 +- .../uidesigner/models/CommonUiView.kt | 9 +- .../uidesigner/models/CommonUiViewImpl.kt | 4 +- .../uidesigner/models/PlaceholderView.kt | 7 +- .../uidesigner/models/RootWorkspaceView.kt | 19 +- .../uidesigner/models/UiAttribute.kt | 111 +- .../codeonthego/uidesigner/models/UiView.kt | 8 +- .../uidesigner/models/UiViewGroup.kt | 83 +- .../uidesigner/models/UiWidgetCategory.kt | 6 +- .../codeonthego/uidesigner/undo/AttrAction.kt | 11 +- .../uidesigner/undo/AttrAddedAction.kt | 19 +- .../uidesigner/undo/AttrRemovedAction.kt | 19 +- .../uidesigner/undo/AttrUpdatedAction.kt | 24 +- .../codeonthego/uidesigner/undo/IUiAction.kt | 9 +- .../uidesigner/undo/UndoManager.kt | 181 +- .../codeonthego/uidesigner/undo/ViewAction.kt | 12 +- .../uidesigner/undo/ViewAddedAction.kt | 24 +- .../uidesigner/undo/ViewMovedAction.kt | 27 +- .../uidesigner/undo/ViewRemovedAction.kt | 20 +- .../codeonthego/uidesigner/undo/undoUtils.kt | 4 +- .../utils/UiInflaterComponentFactory.kt | 36 +- .../uidesigner/utils/UiLayoutInflater.kt | 9 +- .../codeonthego/uidesigner/utils/ViewToXml.kt | 2 +- .../codeonthego/uidesigner/utils/Widgets.kt | 66 +- .../utils/WorkspaceHierarchyChangeListener.kt | 9 +- .../uidesigner/utils/designerUtils.kt | 12 +- .../viewmodel/WorkspaceViewModel.kt | 216 +-- .../uidesigner/views/LayoutHierarchyView.kt | 2 +- .../main/res/layout/activity_ui_designer.xml | 185 +- .../src/main/res/navigation/nav_viewinfo.xml | 97 +- .../codeonthego/uidesigner/UiDesignerTest.kt | 44 +- .../uidesigner/undo/UndoManagerTest.kt | 672 +++---- .../codeonthego/inflater/AbstractParser.kt | 427 +++-- .../inflater/AttributeHandlerScope.kt | 16 +- .../inflater/DefaultComponentFactory.kt | 32 +- .../inflater/ForwardingViewGroup.kt | 4 +- .../codeonthego/inflater/IAttribute.kt | 31 +- .../codeonthego/inflater/IComponentFactory.kt | 54 +- .../codeonthego/inflater/ILayoutInflater.kt | 129 +- .../codeonthego/inflater/INamespace.kt | 17 +- .../codeonthego/inflater/IView.kt | 355 ++-- .../codeonthego/inflater/IViewAdapter.kt | 365 ++-- .../codeonthego/inflater/IViewAdapterIndex.kt | 61 +- .../codeonthego/inflater/IViewGroup.kt | 405 ++-- .../codeonthego/inflater/IViewGroupAdapter.kt | 90 +- .../codeonthego/inflater/InflateException.kt | 18 +- .../codeonthego/inflater/LayoutStrategy.kt | 221 +-- .../inflater/drawable/BitmapDrawableParser.kt | 165 +- .../inflater/drawable/ClipDrawableParser.kt | 61 +- .../drawable/DrawableParserFactory.java | 6 +- .../inflater/drawable/IDrawableParser.kt | 168 +- .../inflater/drawable/InsetDrawableParser.kt | 42 +- .../inflater/drawable/LayerListParser.kt | 176 +- .../inflater/drawable/ScaleDrawableParser.kt | 104 +- .../inflater/drawable/ShapeDrawableParser.kt | 492 ++--- .../inflater/drawable/StateListParser.kt | 152 +- .../inflater/events/IInflateEventsListener.kt | 15 +- .../inflater/events/IInflationEvent.kt | 4 +- .../inflater/internal/AttributeImpl.kt | 79 +- .../inflater/internal/ErrorView.kt | 41 +- .../inflater/internal/ForwardingView.kt | 4 +- .../internal/ImmutableAttributeImpl.kt | 16 +- .../internal/ImmutableViewGroupImpl.kt | 40 +- .../inflater/internal/ImmutableViewImpl.kt | 50 +- .../inflater/internal/IncludeView.kt | 57 +- .../inflater/internal/LayoutFile.kt | 5 +- .../inflater/internal/LayoutInflaterImpl.kt | 662 +++---- .../inflater/internal/NamespaceImpl.kt | 8 +- .../inflater/internal/SingleChildViewGroup.kt | 23 +- .../inflater/internal/ViewGroupImpl.kt | 265 +-- .../codeonthego/inflater/internal/ViewImpl.kt | 335 ++-- .../internal/adapters/AbsListViewAdapter.kt | 53 +- .../internal/adapters/AbsSeekBarAdapter.kt | 15 +- .../internal/adapters/AbsSpinnerAdapter.kt | 18 +- .../internal/adapters/AdapterViewAdapter.kt | 37 +- .../internal/adapters/AnalogClockAdapter.kt | 59 +- .../adapters/AutoCompleteTextViewAdapter.kt | 38 +- .../internal/adapters/ButtonAdapter.kt | 8 +- .../internal/adapters/CalendarViewAdapter.kt | 60 +- .../internal/adapters/CheckBoxAdapter.kt | 13 +- .../adapters/CheckedTextViewAdapter.kt | 32 +- .../internal/adapters/ChronometerAdapter.kt | 23 +- .../adapters/CompoundButtonAdapter.kt | 23 +- .../internal/adapters/DigitalClockAdapter.kt | 13 +- .../internal/adapters/EditTextAdapter.kt | 13 +- .../internal/adapters/FrameLayoutAdapter.kt | 24 +- .../internal/adapters/GridLayoutAdapter.kt | 98 +- .../internal/adapters/GridViewAdapter.kt | 53 +- .../adapters/HorizontalScrollViewAdapter.kt | 45 +- .../internal/adapters/ImageButtonAdapter.kt | 13 +- .../internal/adapters/ImageSwitcherAdapter.kt | 21 +- .../internal/adapters/ImageViewAdapter.kt | 75 +- .../internal/adapters/LinearLayoutAdapter.kt | 120 +- .../internal/adapters/ListViewAdapter.kt | 4 +- .../MultiAutoCompleteTextViewAdapter.kt | 23 +- .../internal/adapters/NumberPickerAdapter.kt | 21 +- .../internal/adapters/ProgressBarAdapter.kt | 106 +- .../adapters/QuickContactBadgeAdapter.kt | 21 +- .../internal/adapters/RadioButtonAdapter.kt | 14 +- .../internal/adapters/RadioGroupAdapter.kt | 39 +- .../internal/adapters/RatingBarAdapter.kt | 27 +- .../adapters/RelativeLayoutAdapter.kt | 32 +- .../internal/adapters/ScrollViewAdapter.kt | 41 +- .../internal/adapters/SeekBarAdapter.kt | 14 +- .../internal/adapters/SpaceAdapter.kt | 13 +- .../internal/adapters/SpinnerAdapter.kt | 35 +- .../internal/adapters/SurfaceViewAdapter.kt | 13 +- .../internal/adapters/SwitchAdapter.kt | 44 +- .../internal/adapters/TextClockAdapter.kt | 26 +- .../internal/adapters/TextSwitcherAdapter.kt | 21 +- .../internal/adapters/TextViewAdapter.kt | 2 +- .../internal/adapters/TextureViewAdapter.kt | 50 +- .../internal/adapters/ToggleButtonAdapter.kt | 4 +- .../internal/adapters/VideoViewAdapter.kt | 13 +- .../inflater/internal/adapters/ViewAdapter.kt | 519 +++--- .../internal/adapters/ViewAnimatorAdapter.kt | 28 +- .../internal/adapters/ViewFlipperAdapter.kt | 23 +- .../internal/adapters/ViewGroupAdapter.kt | 64 +- .../internal/adapters/ViewSwitcherAdapter.kt | 21 +- .../internal/adapters/WebViewAdapter.kt | 6 +- .../adapters/appcompat/AppCompatTextView.kt | 3 +- .../internal/ui/DesignerTextureView.kt | 28 +- .../inflater/internal/utils/IDTable.kt | 26 +- .../inflater/internal/utils/TextDrawable.kt | 87 +- .../inflater/internal/utils/ViewFactory.kt | 88 +- .../inflater/internal/utils/ViewUtils.kt | 25 +- .../internal/utils/basicParseUtils.kt | 672 +++---- .../inflater/internal/utils/lookup.kt | 122 +- .../inflater/internal/utils/viewParseUtils.kt | 88 +- .../codeonthego/inflater/utils/module.kt | 26 +- .../codeonthego/inflater/utils/viewUtils.kt | 2 +- .../inflater/vectormaster/DefaultValues.java | 78 +- .../vectormaster/VectorMasterDrawable.java | 8 +- .../vectormaster/VectorMasterView.java | 857 ++++----- .../inflater/vectormaster/enums/TintMode.java | 7 +- .../vectormaster/models/ClipPathModel.java | 159 +- .../vectormaster/models/GroupModel.java | 541 +++--- .../vectormaster/models/PathModel.java | 603 +++--- .../vectormaster/models/VectorModel.java | 408 ++--- .../vectormaster/utilities/Utils.java | 160 +- .../utilities/legacyparser/PathParser.java | 1444 ++++++++------- .../utilities/parser/ParserHelper.java | 752 ++++---- .../utilities/parser/PathParser.java | 612 +++---- .../codeonthego/inflater/AdapterIndexTest.kt | 21 +- .../codeonthego/inflater/ExampleUnitTest.kt | 10 +- .../inflater/LayoutInflaterTest.kt | 381 ++-- .../codeonthego/inflater/ValueParsersTest.kt | 285 ++- .../codeonthego/inflater/XmlInflaterTest.kt | 35 +- .../codeonthego/inflater/adapterUtils.kt | 86 +- 1611 files changed, 65217 insertions(+), 62999 deletions(-) diff --git a/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionData.java b/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionData.java index b7f400af73..4c9da98626 100644 --- a/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionData.java +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionData.java @@ -31,41 +31,42 @@ */ public class ActionData { - private ActionData() {} + /** + * Creates a new {@link ActionData} instance. + * + * @param context + * The context to this instance is attached to. + * @return A new {@link ActionData} instance. + */ + @NonNull + public static ActionData create(@NonNull Context context) { + final var data = new ActionData(); + data.put(Context.class, context); + return data; + } - /** - * Creates a new {@link ActionData} instance. - * - * @param context The context to this instance is attached to. - * @return A new {@link ActionData} instance. - */ - @NonNull - public static ActionData create(@NonNull Context context) { - final var data = new ActionData(); - data.put(Context.class, context); - return data; - } + private final Map, Object> instances = new HashMap<>(); - private final Map, Object> instances = new HashMap<>(); + private ActionData() {} - public void put(@NonNull Class type, @Nullable T object) { - Objects.requireNonNull(type); - this.instances.put(type, object); - } + public void clear() { + this.instances.clear(); + } - @Nullable - public T get(@NonNull Class type) { - Objects.requireNonNull(type); + @Nullable + public T get(@NonNull Class type) { + Objects.requireNonNull(type); - final var object = this.instances.get(type); - if (object == null) { - return null; - } + final var object = this.instances.get(type); + if (object == null) { + return null; + } - return type.cast(object); - } + return type.cast(object); + } - public void clear() { - this.instances.clear(); - } + public void put(@NonNull Class type, @Nullable T object) { + Objects.requireNonNull(type); + this.instances.put(type, object); + } } diff --git a/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionItem.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionItem.kt index 5ca0d8854f..207f950792 100644 --- a/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionItem.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionItem.kt @@ -17,8 +17,6 @@ package org.appdevforall.codeonthego.actions - -import com.itsaky.androidide.actions.R import android.graphics.ColorFilter import android.graphics.PorterDuff import android.graphics.PorterDuffColorFilter @@ -26,6 +24,7 @@ import android.graphics.drawable.Drawable import android.view.Menu import android.view.View import androidx.annotation.CallSuper +import com.itsaky.androidide.actions.R import org.appdevforall.codeonthego.idetooltips.TooltipCategory import org.appdevforall.codeonthego.utils.resolveAttr diff --git a/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionsRegistry.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionsRegistry.kt index 25f0e76360..f9979e6a38 100644 --- a/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionsRegistry.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/ActionsRegistry.kt @@ -22,102 +22,114 @@ import org.appdevforall.codeonthego.utils.VMUtils /** @author Akash Yadav */ abstract class ActionsRegistry { - - companion object { - - private var instance: ActionsRegistry? = null - - @JvmStatic - fun getInstance(): ActionsRegistry { - if (instance == null) { - instance = if (VMUtils.isJvm) { - DefaultActionsRegistry() - } else ServiceLoader.load(ActionsRegistry::class.java).findFirstOrThrow() - } - - return instance as ActionsRegistry - } - } - - /** - * Register the given action. - * - * @param action The action to register. Must not be `null`. - * @return `true` if the action was registered successfully. `false` otherwise. - */ - abstract fun registerAction(action: ActionItem): Boolean - - /** - * Unregister the given action. - * - * @param action The action to unregister. Must not be `null`. - * @return `true` if the action was unregistered successfully. `false` otherwise. - */ - abstract fun unregisterAction(action: ActionItem): Boolean - - /** - * Unregister the action with the given ID. - * - * @param id The ID of action to unregister. Must not be `null`. - * @return `true` if the action was unregistered successfully. `false` otherwise. - */ - abstract fun unregisterAction(id: String): Boolean - - /** - * Find the action with the given ID. - * - * @param id The ID of the action to find. - * @return The found action or `null`. - */ - abstract fun findAction(location: ActionItem.Location, id: String): ActionItem? - - /** - * Find the action with the given unique item ID. - * - * @param itemId The ID of the action to find. - * @return The found action or `null`. - */ - abstract fun findAction(location: ActionItem.Location, itemId: Int): ActionItem? - - /** - * Fill the given menu with the registered actions. - * - * Subclasses must first call [ActionItem.prepare] to update the action. - */ - abstract fun fillMenu(params: FillMenuParams) - - /** Get all the registered actions at the given location. */ - abstract fun getActions(location: ActionItem.Location): Map - - /** Clear all the registered actions. */ - abstract fun clearActions(location: ActionItem.Location) - - /** Clear all actions at the given location except those matching the predicate. */ - abstract fun clearActionsExceptWhere(location: ActionItem.Location, predicate: (ActionItem) -> Boolean) - - /** - * Register a listener that will be called when any action is executed. The callbacks are called - * irrespective of the action's execution result. - * - * @param listener The listener to register. - */ - abstract fun registerActionExecListener(listener: ActionExecListener) - - /** - * Unregister the given listener. - * - * @param listener The listener to unregister. - */ - abstract fun unregisterActionExecListener(listener: ActionExecListener) - - /** Listener for listening to callbacks for action execution. */ - interface ActionExecListener { - - /** - * The given action was executed. - * @param action The action that was executed. - * @param result The result of the action execution. - */ - fun onExec(action: ActionItem, result: Any) - } + companion object { + private var instance: ActionsRegistry? = null + + @JvmStatic + fun getInstance(): ActionsRegistry { + if (instance == null) { + instance = + if (VMUtils.isJvm) { + DefaultActionsRegistry() + } else { + ServiceLoader.load(ActionsRegistry::class.java).findFirstOrThrow() + } + } + + return instance as ActionsRegistry + } + } + + /** + * Register the given action. + * + * @param action The action to register. Must not be `null`. + * @return `true` if the action was registered successfully. `false` otherwise. + */ + abstract fun registerAction(action: ActionItem): Boolean + + /** + * Unregister the given action. + * + * @param action The action to unregister. Must not be `null`. + * @return `true` if the action was unregistered successfully. `false` otherwise. + */ + abstract fun unregisterAction(action: ActionItem): Boolean + + /** + * Unregister the action with the given ID. + * + * @param id The ID of action to unregister. Must not be `null`. + * @return `true` if the action was unregistered successfully. `false` otherwise. + */ + abstract fun unregisterAction(id: String): Boolean + + /** + * Find the action with the given ID. + * + * @param id The ID of the action to find. + * @return The found action or `null`. + */ + abstract fun findAction( + location: ActionItem.Location, + id: String, + ): ActionItem? + + /** + * Find the action with the given unique item ID. + * + * @param itemId The ID of the action to find. + * @return The found action or `null`. + */ + abstract fun findAction( + location: ActionItem.Location, + itemId: Int, + ): ActionItem? + + /** + * Fill the given menu with the registered actions. + * + * Subclasses must first call [ActionItem.prepare] to update the action. + */ + abstract fun fillMenu(params: FillMenuParams) + + /** Get all the registered actions at the given location. */ + abstract fun getActions(location: ActionItem.Location): Map + + /** Clear all the registered actions. */ + abstract fun clearActions(location: ActionItem.Location) + + /** Clear all actions at the given location except those matching the predicate. */ + abstract fun clearActionsExceptWhere( + location: ActionItem.Location, + predicate: (ActionItem) -> Boolean, + ) + + /** + * Register a listener that will be called when any action is executed. The callbacks are called + * irrespective of the action's execution result. + * + * @param listener The listener to register. + */ + abstract fun registerActionExecListener(listener: ActionExecListener) + + /** + * Unregister the given listener. + * + * @param listener The listener to unregister. + */ + abstract fun unregisterActionExecListener(listener: ActionExecListener) + + /** Listener for listening to callbacks for action execution. */ + interface ActionExecListener { + /** + * The given action was executed. + * @param action The action that was executed. + * @param result The result of the action execution. + */ + fun onExec( + action: ActionItem, + result: Any, + ) + } } diff --git a/actions/src/main/java/org/appdevforall/codeonthego/actions/EditTextAdapter.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/EditTextAdapter.kt index a3cac8ed7f..ac05c52d67 100644 --- a/actions/src/main/java/org/appdevforall/codeonthego/actions/EditTextAdapter.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/EditTextAdapter.kt @@ -7,78 +7,78 @@ import android.view.View import android.widget.EditText class EditTextAdapter(private val view: EditText) : MutableTextTarget { - private val clipboard: ClipboardManager? - get() = view.context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager - - override fun copyText() { - val start = view.selectionStart - val end = view.selectionEnd - - if (start < 0 || end < 0) return - if (start == end) return - - val content = view.text.subSequence(minOf(start, end), maxOf(start, end)) - val clip = ClipData.newPlainText("Copied Text", content) - clipboard?.setPrimaryClip(clip) - } - - override fun cut() { - val start = view.selectionStart - val end = view.selectionEnd - if (start < 0 || end < 0) return - if (start == end) return - - copyText() - view.text.delete(minOf(start, end), maxOf(start, end)) - view.setSelection(minOf(start, end)) - } - - override fun paste() { - val clip = clipboard?.primaryClip ?: return - if (clip.itemCount <= 0) return - - val pasteText = clip.getItemAt(0).coerceToText(view.context) ?: return - var start = view.selectionStart - var end = view.selectionEnd - - if (start < 0 || end < 0) { - view.requestFocus() - val safePos = view.text?.length ?: 0 - view.setSelection(safePos) - start = view.selectionStart - end = view.selectionEnd - } - val min = minOf(start, end) - val max = maxOf(start, end) - - if (min != max) { - view.text.replace(min, max, pasteText) - view.setSelection(min + pasteText.length) - } else { - view.text.insert(min, pasteText) - view.setSelection(min + pasteText.length) - } - } - - override fun selectAll() { - view.selectAll() - } - - override fun hasSelection() = view.hasSelection() - override fun isEditable() = view.isEnabled - - override fun getSelectedText(): String? { - val start = view.selectionStart - val end = view.selectionEnd - - if (start < 0 || end < 0 || start == end) { return null } - - val min = minOf(start, end) - val max = maxOf(start, end) - - if (max > view.length()) { return null } - return view.text.subSequence(min, max).toString() - } - - override fun getAnchorView(): View = view -} \ No newline at end of file + private val clipboard: ClipboardManager? + get() = view.context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager + + override fun copyText() { + val start = view.selectionStart + val end = view.selectionEnd + + if (start < 0 || end < 0) return + if (start == end) return + + val content = view.text.subSequence(minOf(start, end), maxOf(start, end)) + val clip = ClipData.newPlainText("Copied Text", content) + clipboard?.setPrimaryClip(clip) + } + + override fun cut() { + val start = view.selectionStart + val end = view.selectionEnd + if (start < 0 || end < 0) return + if (start == end) return + + copyText() + view.text.delete(minOf(start, end), maxOf(start, end)) + view.setSelection(minOf(start, end)) + } + + override fun paste() { + val clip = clipboard?.primaryClip ?: return + if (clip.itemCount <= 0) return + + val pasteText = clip.getItemAt(0).coerceToText(view.context) ?: return + var start = view.selectionStart + var end = view.selectionEnd + + if (start < 0 || end < 0) { + view.requestFocus() + val safePos = view.text?.length ?: 0 + view.setSelection(safePos) + start = view.selectionStart + end = view.selectionEnd + } + val min = minOf(start, end) + val max = maxOf(start, end) + + if (min != max) { + view.text.replace(min, max, pasteText) + view.setSelection(min + pasteText.length) + } else { + view.text.insert(min, pasteText) + view.setSelection(min + pasteText.length) + } + } + + override fun selectAll() { + view.selectAll() + } + + override fun hasSelection() = view.hasSelection() + override fun isEditable() = view.isEnabled + + override fun getSelectedText(): String? { + val start = view.selectionStart + val end = view.selectionEnd + + if (start < 0 || end < 0 || start == end) { return null } + + val min = minOf(start, end) + val max = maxOf(start, end) + + if (max > view.length()) { return null } + return view.text.subSequence(min, max).toString() + } + + override fun getAnchorView(): View = view +} diff --git a/actions/src/main/java/org/appdevforall/codeonthego/actions/EditorActionItem.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/EditorActionItem.kt index 90d71da3e4..6b74fbfd09 100644 --- a/actions/src/main/java/org/appdevforall/codeonthego/actions/EditorActionItem.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/EditorActionItem.kt @@ -24,11 +24,10 @@ package org.appdevforall.codeonthego.actions * @author Akash Yadav */ interface EditorActionItem : ActionItem { - - /** - * Whether the actions window should be dismissed or not once this action is performed. - * - * @return `true` if the actions window must be dismissed, `false` otherwise. - */ - fun dismissOnAction(): Boolean = true + /** + * Whether the actions window should be dismissed or not once this action is performed. + * + * @return `true` if the actions window must be dismissed, `false` otherwise. + */ + fun dismissOnAction(): Boolean = true } diff --git a/actions/src/main/java/org/appdevforall/codeonthego/actions/FillMenuParams.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/FillMenuParams.kt index 3ae65926d0..6f27654e87 100644 --- a/actions/src/main/java/org/appdevforall/codeonthego/actions/FillMenuParams.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/FillMenuParams.kt @@ -26,11 +26,12 @@ import org.appdevforall.codeonthego.actions.internal.DefaultActionsRegistry * @author Akash Yadav */ data class FillMenuParams( - val data: ActionData, - val location: ActionItem.Location, - val menu: Menu, - val onMenuItemClick: OnActionClickListener = OnActionClickListener { registry, action, _, actionData -> - (registry as DefaultActionsRegistry).executeAction(action, actionData) - true - } + val data: ActionData, + val location: ActionItem.Location, + val menu: Menu, + val onMenuItemClick: OnActionClickListener = + OnActionClickListener { registry, action, _, actionData -> + (registry as DefaultActionsRegistry).executeAction(action, actionData) + true + }, ) diff --git a/actions/src/main/java/org/appdevforall/codeonthego/actions/OnActionClickListener.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/OnActionClickListener.kt index 24ddd6e2c8..990d14a0e4 100644 --- a/actions/src/main/java/org/appdevforall/codeonthego/actions/OnActionClickListener.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/OnActionClickListener.kt @@ -25,14 +25,18 @@ import android.view.MenuItem * @author Akash Yadav */ fun interface OnActionClickListener { - - /** - * Called when the given [action] is clicked. - * - * @param registry The [ActionsRegistry]. - * @param action The action that was clicked. - * @param data The action data associated with the action. - * @return Whether the click event was consumed. - */ - fun onClick(registry: ActionsRegistry, action: ActionItem, item: MenuItem, data: ActionData): Boolean -} \ No newline at end of file + /** + * Called when the given [action] is clicked. + * + * @param registry The [ActionsRegistry]. + * @param action The action that was clicked. + * @param data The action data associated with the action. + * @return Whether the click event was consumed. + */ + fun onClick( + registry: ActionsRegistry, + action: ActionItem, + item: MenuItem, + data: ActionData, + ): Boolean +} diff --git a/actions/src/main/java/org/appdevforall/codeonthego/actions/SidebarActionItem.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/SidebarActionItem.kt index 40c5d54a3d..ba002e0716 100644 --- a/actions/src/main/java/org/appdevforall/codeonthego/actions/SidebarActionItem.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/SidebarActionItem.kt @@ -30,16 +30,15 @@ import kotlin.reflect.KClass * @author Akash Yadav */ interface SidebarActionItem : ActionItem { + /** + * The fragment class for this action item. Implementations can provide a fragment class which + * will be shown when this action item is selected. + */ + val fragmentClass: KClass? - /** - * The fragment class for this action item. Implementations can provide a fragment class which - * will be shown when this action item is selected. - */ - val fragmentClass: KClass? - - /** - * Build/setup the fragment navigation for this action item. This method is called only if the [fragmentClass] property - * is non-null. - */ - fun FragmentNavigatorDestinationBuilder.buildNavigation() {} -} \ No newline at end of file + /** + * Build/setup the fragment navigation for this action item. This method is called only if the [fragmentClass] property + * is non-null. + */ + fun FragmentNavigatorDestinationBuilder.buildNavigation() {} +} diff --git a/actions/src/main/java/org/appdevforall/codeonthego/actions/TextTarget.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/TextTarget.kt index 4ff0e6d4cc..826f13bde9 100644 --- a/actions/src/main/java/org/appdevforall/codeonthego/actions/TextTarget.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/TextTarget.kt @@ -3,15 +3,21 @@ package org.appdevforall.codeonthego.actions import android.view.View interface TextTarget { - fun copyText() - fun selectAll() - fun hasSelection(): Boolean - fun getSelectedText(): String? - fun getAnchorView(): View? + fun copyText() + + fun selectAll() + + fun hasSelection(): Boolean + + fun getSelectedText(): String? + + fun getAnchorView(): View? } interface MutableTextTarget : TextTarget { - fun cut() - fun paste() - fun isEditable(): Boolean -} \ No newline at end of file + fun cut() + + fun paste() + + fun isEditable(): Boolean +} diff --git a/actions/src/main/java/org/appdevforall/codeonthego/actions/actionUtils.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/actionUtils.kt index 875947dd56..12949c725f 100644 --- a/actions/src/main/java/org/appdevforall/codeonthego/actions/actionUtils.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/actionUtils.kt @@ -43,17 +43,17 @@ fun ActionData.requireFile(): File = require() fun ActionData.requirePath(): Path { - return requireFile().toPath() +return requireFile().toPath() } fun ActionData.requireEditor(): CodeEditor { - return get(CodeEditor::class.java) - ?: throw IllegalArgumentException("An editor instance is required but none was provided") +return get(CodeEditor::class.java) + ?: throw IllegalArgumentException("An editor instance is required but none was provided") } fun newDialogBuilder(data: ActionData): MaterialAlertDialogBuilder { - val context = data.get(Context::class.java)!! - return DialogUtils.newMaterialDialogBuilder(context) +val context = data.get(Context::class.java)!! +return DialogUtils.newMaterialDialogBuilder(context) } /** @@ -63,15 +63,15 @@ fun newDialogBuilder(data: ActionData): MaterialAlertDialogBuilder { * @return `true` if this [ActionData] has the given [types], `false` otherwise. */ fun ActionData.hasRequiredData(vararg types: Class<*>): Boolean { - for (type in types) { - get(type) ?: return false - } +for (type in types) { + get(type) ?: return false +} - return true +return true } /** Marks this action item as invisible. */ fun ActionItem.markInvisible() { - visible = false - enabled = false +visible = false +enabled = false } diff --git a/actions/src/main/java/org/appdevforall/codeonthego/actions/internal/DefaultActionsRegistry.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/internal/DefaultActionsRegistry.kt index f4b518c583..78d0dd84e2 100644 --- a/actions/src/main/java/org/appdevforall/codeonthego/actions/internal/DefaultActionsRegistry.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/internal/DefaultActionsRegistry.kt @@ -19,14 +19,6 @@ package org.appdevforall.codeonthego.actions.internal import android.view.Menu import android.view.MenuItem import com.google.auto.service.AutoService -import org.appdevforall.codeonthego.actions.ActionData -import org.appdevforall.codeonthego.actions.ActionItem -import org.appdevforall.codeonthego.actions.ActionMenu -import org.appdevforall.codeonthego.actions.ActionsRegistry -import org.appdevforall.codeonthego.actions.FillMenuParams -import org.appdevforall.codeonthego.actions.OnActionClickListener -import org.appdevforall.codeonthego.actions.locations.CodeActionsMenu -import org.appdevforall.codeonthego.utils.withStopWatch import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.CoroutineScope @@ -35,6 +27,14 @@ import kotlinx.coroutines.Job import kotlinx.coroutines.launch import kotlinx.coroutines.plus import kotlinx.coroutines.withContext +import org.appdevforall.codeonthego.actions.ActionData +import org.appdevforall.codeonthego.actions.ActionItem +import org.appdevforall.codeonthego.actions.ActionMenu +import org.appdevforall.codeonthego.actions.ActionsRegistry +import org.appdevforall.codeonthego.actions.FillMenuParams +import org.appdevforall.codeonthego.actions.OnActionClickListener +import org.appdevforall.codeonthego.actions.locations.CodeActionsMenu +import org.appdevforall.codeonthego.utils.withStopWatch import org.slf4j.LoggerFactory import java.util.concurrent.ConcurrentHashMap @@ -45,242 +45,257 @@ import java.util.concurrent.ConcurrentHashMap */ @AutoService(ActionsRegistry::class) class DefaultActionsRegistry : ActionsRegistry() { - - private val actions = ConcurrentHashMap>() - private val listeners = HashSet() - - private val actionsCoroutineScope = CoroutineScope(Dispatchers.Default) + - CoroutineName("DefaultActionsRegistry") - - companion object { - private val log = LoggerFactory.getLogger(DefaultActionsRegistry::class.java) - private const val DEBUG_PREFIX = "ACTION_DEBUG: " - } - - init { - registerAction(CodeActionsMenu) - } - - override fun getActions(location: ActionItem.Location): MutableMap { - return actions.getOrPut(location.id) { LinkedHashMap() } - } - - override fun registerAction(action: ActionItem): Boolean { - val actions = getActions(action.location) - val isUpdating = actions.containsKey(action.id) - log.debug( - "$DEBUG_PREFIX ${if (isUpdating) "Updating" else "Registering"} action '${action.id}' at location '${action.location.id}'. " + - "Current count: ${actions.size}." - ) - actions.remove(action.id) - actions[action.id] = action - log.debug("$DEBUG_PREFIX Location '${action.location.id}' now has ${actions.size} actions.") - if (actions.size == 3) { - log.debug("$DEBUG_PREFIX readhed the 3 target") - } - return true - } - - override fun unregisterAction(action: ActionItem): Boolean { - val actions = getActions(action.location) - log.debug( - "$DEBUG_PREFIX Unregistering action '${action.id}' from location '${action.location.id}'. " + - "Current count: ${actions.size}." - ) - val older = actions.remove(action.id) - if (older != null) { - older.destroy() - log.debug("$DEBUG_PREFIX Unregistered '${action.id}'. Location '${action.location.id}' now has ${actions.size} actions.") - return true - } - log.debug("$DEBUG_PREFIX Action '${action.id}' not found at location '${action.location.id}'.") - return false - } - - override fun unregisterAction(id: String): Boolean { - log.debug("$DEBUG_PREFIX Attempting to unregister action with id '$id' from all locations.") - for ((locationId, locations) in this.actions) { - val older = locations.remove(id) - if (older != null) { - older.destroy() - log.debug("$DEBUG_PREFIX Removed action '$id' from location '$locationId'. New count: ${locations.size}.") - return true - } - } - log.debug("$DEBUG_PREFIX Action with id '$id' not found in any location.") - return false - } - - override fun findAction(location: ActionItem.Location, id: String): ActionItem? = - getActions(location)[id] - - override fun findAction(location: ActionItem.Location, itemId: Int): ActionItem? { - for (action in getActions(location)) { - if (action.value.itemId == itemId) { - return action.value - } - } - - return null - } - - override fun clearActions(location: ActionItem.Location) { - val actions = getActions(location) - log.debug("$DEBUG_PREFIX Clearing all ${actions.size} actions from location '${location.id}'.") - actions.forEach { it.value.destroy() } - actions.clear() - log.debug("$DEBUG_PREFIX Location '${location.id}' is now empty.") - } - - override fun clearActionsExceptWhere( - location: ActionItem.Location, - predicate: (ActionItem) -> Boolean - ) { - val actions = getActions(location) - val initialCount = actions.size - val toRemove = mutableListOf() - - log.debug("$DEBUG_PREFIX Conditionally clearing actions from location '${location.id}'. Initial count: $initialCount.") - - actions.forEach { (key, action) -> - if (!predicate(action)) { - toRemove.add(key) - } - } - - if (toRemove.isNotEmpty()) { - log.debug("$DEBUG_PREFIX Removing ${toRemove.size} actions from location '${location.id}': $toRemove") - toRemove.forEach { key -> - actions[key]?.destroy() - actions.remove(key) - } - log.debug("$DEBUG_PREFIX Location '${location.id}' now has ${actions.size} actions.") - } else { - log.debug("$DEBUG_PREFIX No actions met the removal criteria for location '${location.id}'.") - } - } - - override fun registerActionExecListener(listener: ActionExecListener) { - listeners.add(listener) - } - - override fun unregisterActionExecListener(listener: ActionExecListener) { - listeners.remove(listener) - } - - override fun fillMenu(params: FillMenuParams) { - val (data, location, menu, onClickListener) = params - val actions = getActions(location) - - val sortedActions = actions.values.sortedWith(compareBy({ it.order }, { it.id })) - - for (action in sortedActions) { - action.prepare(data) - - if (!action.visible) { - continue - } - addActionToMenu(menu, action, data, onClickListener) - } - } - - private fun addActionToMenu( - menu: Menu, - action: ActionItem, - data: ActionData, - onClickListener: OnActionClickListener - ) { - - val item: MenuItem = if (action is ActionMenu) { - val sub = menu.addSubMenu(Menu.NONE, action.itemId, action.order, action.label) - - var shouldBeEnabled = false - for (subItem in action.children) { - subItem.prepare(data) - if (subItem.visible) { - addActionToMenu(sub, subItem, data, onClickListener) - } - - if (action.enabled && subItem.enabled && !shouldBeEnabled) { - shouldBeEnabled = true - } - } - - action.enabled = shouldBeEnabled - sub.item - } else { - menu.add(Menu.NONE, action.itemId, action.order, action.label) - } - - item.isEnabled = action.enabled - - item.contentDescription = action.label - - item.icon = action.icon?.apply { - colorFilter = action.createColorFilter(data) - alpha = if (action.enabled) 255 else 76 - } - - var showAsAction = action.getShowAsActionFlags(data) - if (showAsAction == -1) { - showAsAction = if (action.icon != null) { - MenuItem.SHOW_AS_ACTION_IF_ROOM - } else { - MenuItem.SHOW_AS_ACTION_NEVER - } - } - - if (!action.enabled) { - showAsAction = MenuItem.SHOW_AS_ACTION_NEVER - } - - item.setShowAsAction(showAsAction) - - action.createActionView(data)?.let { item.actionView = it } - - if (action !is ActionMenu) { - item.setOnMenuItemClickListener { - onClickListener.onClick(this, action, it, data) - } - } - } - - /** Executes the given action item with the given */ - fun executeAction(action: ActionItem, data: ActionData): Job { - val onMainThread = action.requiresUIThread - val context = if (onMainThread) Dispatchers.Main.immediate else Dispatchers.Default - return actionsCoroutineScope.launch(context) { - val result = try { - withStopWatch("Action '${action.id}'") { action.execAction(data) } - } catch (e: IllegalArgumentException) { - log.error("An error occurred when performing action '{}'", action.id, e) - return@launch - } - - val post = fun() = run { - action.postExec(data, result) - notifyActionExec(action, result) - } - - if (onMainThread) { - post() - } else { - withContext(Dispatchers.Main.immediate) { post() } - } - }.also { job -> - job.invokeOnCompletion { cause -> - when (cause) { - null -> log.debug("Action '{}' execution completed.", action.id) - is CancellationException -> log.debug("Action '{}' execution was cancelled.", action.id) - else -> log.debug("Action '{}' execution failed.", action.id, cause) - } - } - } - } - - private fun notifyActionExec(action: ActionItem, result: Any) { - for (listener in listeners) { - listener.onExec(action, result) - } - } -} \ No newline at end of file + private val actions = ConcurrentHashMap>() + private val listeners = HashSet() + + private val actionsCoroutineScope = + CoroutineScope(Dispatchers.Default) + + CoroutineName("DefaultActionsRegistry") + + companion object { + private val log = LoggerFactory.getLogger(DefaultActionsRegistry::class.java) + private const val DEBUG_PREFIX = "ACTION_DEBUG: " + } + + init { + registerAction(CodeActionsMenu) + } + + override fun getActions(location: ActionItem.Location): MutableMap = + actions.getOrPut(location.id) { LinkedHashMap() } + + override fun registerAction(action: ActionItem): Boolean { + val actions = getActions(action.location) + val isUpdating = actions.containsKey(action.id) + log.debug( + "$DEBUG_PREFIX ${if (isUpdating) "Updating" else "Registering"} action '${action.id}' at location '${action.location.id}'. " + + "Current count: ${actions.size}.", + ) + actions.remove(action.id) + actions[action.id] = action + log.debug("$DEBUG_PREFIX Location '${action.location.id}' now has ${actions.size} actions.") + if (actions.size == 3) { + log.debug("$DEBUG_PREFIX readhed the 3 target") + } + return true + } + + override fun unregisterAction(action: ActionItem): Boolean { + val actions = getActions(action.location) + log.debug( + "$DEBUG_PREFIX Unregistering action '${action.id}' from location '${action.location.id}'. " + + "Current count: ${actions.size}.", + ) + val older = actions.remove(action.id) + if (older != null) { + older.destroy() + log.debug("$DEBUG_PREFIX Unregistered '${action.id}'. Location '${action.location.id}' now has ${actions.size} actions.") + return true + } + log.debug("$DEBUG_PREFIX Action '${action.id}' not found at location '${action.location.id}'.") + return false + } + + override fun unregisterAction(id: String): Boolean { + log.debug("$DEBUG_PREFIX Attempting to unregister action with id '$id' from all locations.") + for ((locationId, locations) in this.actions) { + val older = locations.remove(id) + if (older != null) { + older.destroy() + log.debug("$DEBUG_PREFIX Removed action '$id' from location '$locationId'. New count: ${locations.size}.") + return true + } + } + log.debug("$DEBUG_PREFIX Action with id '$id' not found in any location.") + return false + } + + override fun findAction( + location: ActionItem.Location, + id: String, + ): ActionItem? = getActions(location)[id] + + override fun findAction( + location: ActionItem.Location, + itemId: Int, + ): ActionItem? { + for (action in getActions(location)) { + if (action.value.itemId == itemId) { + return action.value + } + } + + return null + } + + override fun clearActions(location: ActionItem.Location) { + val actions = getActions(location) + log.debug("$DEBUG_PREFIX Clearing all ${actions.size} actions from location '${location.id}'.") + actions.forEach { it.value.destroy() } + actions.clear() + log.debug("$DEBUG_PREFIX Location '${location.id}' is now empty.") + } + + override fun clearActionsExceptWhere( + location: ActionItem.Location, + predicate: (ActionItem) -> Boolean, + ) { + val actions = getActions(location) + val initialCount = actions.size + val toRemove = mutableListOf() + + log.debug("$DEBUG_PREFIX Conditionally clearing actions from location '${location.id}'. Initial count: $initialCount.") + + actions.forEach { (key, action) -> + if (!predicate(action)) { + toRemove.add(key) + } + } + + if (toRemove.isNotEmpty()) { + log.debug("$DEBUG_PREFIX Removing ${toRemove.size} actions from location '${location.id}': $toRemove") + toRemove.forEach { key -> + actions[key]?.destroy() + actions.remove(key) + } + log.debug("$DEBUG_PREFIX Location '${location.id}' now has ${actions.size} actions.") + } else { + log.debug("$DEBUG_PREFIX No actions met the removal criteria for location '${location.id}'.") + } + } + + override fun registerActionExecListener(listener: ActionExecListener) { + listeners.add(listener) + } + + override fun unregisterActionExecListener(listener: ActionExecListener) { + listeners.remove(listener) + } + + override fun fillMenu(params: FillMenuParams) { + val (data, location, menu, onClickListener) = params + val actions = getActions(location) + + val sortedActions = actions.values.sortedWith(compareBy({ it.order }, { it.id })) + + for (action in sortedActions) { + action.prepare(data) + + if (!action.visible) { + continue + } + addActionToMenu(menu, action, data, onClickListener) + } + } + + private fun addActionToMenu( + menu: Menu, + action: ActionItem, + data: ActionData, + onClickListener: OnActionClickListener, + ) { + val item: MenuItem = + if (action is ActionMenu) { + val sub = menu.addSubMenu(Menu.NONE, action.itemId, action.order, action.label) + + var shouldBeEnabled = false + for (subItem in action.children) { + subItem.prepare(data) + if (subItem.visible) { + addActionToMenu(sub, subItem, data, onClickListener) + } + + if (action.enabled && subItem.enabled && !shouldBeEnabled) { + shouldBeEnabled = true + } + } + + action.enabled = shouldBeEnabled + sub.item + } else { + menu.add(Menu.NONE, action.itemId, action.order, action.label) + } + + item.isEnabled = action.enabled + + item.contentDescription = action.label + + item.icon = + action.icon?.apply { + colorFilter = action.createColorFilter(data) + alpha = if (action.enabled) 255 else 76 + } + + var showAsAction = action.getShowAsActionFlags(data) + if (showAsAction == -1) { + showAsAction = + if (action.icon != null) { + MenuItem.SHOW_AS_ACTION_IF_ROOM + } else { + MenuItem.SHOW_AS_ACTION_NEVER + } + } + + if (!action.enabled) { + showAsAction = MenuItem.SHOW_AS_ACTION_NEVER + } + + item.setShowAsAction(showAsAction) + + action.createActionView(data)?.let { item.actionView = it } + + if (action !is ActionMenu) { + item.setOnMenuItemClickListener { + onClickListener.onClick(this, action, it, data) + } + } + } + + /** Executes the given action item with the given */ + fun executeAction( + action: ActionItem, + data: ActionData, + ): Job { + val onMainThread = action.requiresUIThread + val context = if (onMainThread) Dispatchers.Main.immediate else Dispatchers.Default + return actionsCoroutineScope + .launch(context) { + val result = + try { + withStopWatch("Action '${action.id}'") { action.execAction(data) } + } catch (e: IllegalArgumentException) { + log.error("An error occurred when performing action '{}'", action.id, e) + return@launch + } + + val post = fun() = + run { + action.postExec(data, result) + notifyActionExec(action, result) + } + + if (onMainThread) { + post() + } else { + withContext(Dispatchers.Main.immediate) { post() } + } + }.also { job -> + job.invokeOnCompletion { cause -> + when (cause) { + null -> log.debug("Action '{}' execution completed.", action.id) + is CancellationException -> log.debug("Action '{}' execution was cancelled.", action.id) + else -> log.debug("Action '{}' execution failed.", action.id, cause) + } + } + } + } + + private fun notifyActionExec( + action: ActionItem, + result: Any, + ) { + for (listener in listeners) { + listener.onExec(action, result) + } + } +} diff --git a/actions/src/main/java/org/appdevforall/codeonthego/actions/locations/CodeActionsMenu.kt b/actions/src/main/java/org/appdevforall/codeonthego/actions/locations/CodeActionsMenu.kt index d9aa46a941..78d6e37536 100644 --- a/actions/src/main/java/org/appdevforall/codeonthego/actions/locations/CodeActionsMenu.kt +++ b/actions/src/main/java/org/appdevforall/codeonthego/actions/locations/CodeActionsMenu.kt @@ -20,33 +20,33 @@ package org.appdevforall.codeonthego.actions.locations import android.content.Context import android.graphics.drawable.Drawable import androidx.core.content.ContextCompat +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.ActionItem import org.appdevforall.codeonthego.actions.ActionMenu import org.appdevforall.codeonthego.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R /** @author Akash Yadav */ object CodeActionsMenu : ActionMenu { + const val ID = "ide.editor.code.actions" + + override val children: MutableSet = mutableSetOf() + override val id: String = ID + + override var label: String = "Code actions" + override var visible = true + override var enabled: Boolean = true + override var icon: Drawable? = null + + override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.EDITOR_TOOLBAR_CODE_ACTIONS + + override var requiresUIThread: Boolean = false + override var location: ActionItem.Location = ActionItem.Location.EDITOR_TEXT_ACTIONS - const val ID = "ide.editor.code.actions" - - override val children: MutableSet = mutableSetOf() - override val id: String = ID - - override var label: String = "Code actions" - override var visible = true - override var enabled: Boolean = true - override var icon: Drawable? = null - override fun retrieveTooltipTag(isAlternateContext: Boolean) = - TooltipTag.EDITOR_TOOLBAR_CODE_ACTIONS - override var requiresUIThread: Boolean = false - override var location: ActionItem.Location = ActionItem.Location.EDITOR_TEXT_ACTIONS - - override fun prepare(data: ActionData) { - super.prepare(data) - if (icon == null) { - icon = ContextCompat.getDrawable(data[Context::class.java]!!, R.drawable.ic_code) - } - } -} \ No newline at end of file + override fun prepare(data: ActionData) { + super.prepare(data) + if (icon == null) { + icon = ContextCompat.getDrawable(data[Context::class.java]!!, R.drawable.ic_code) + } + } +} diff --git a/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterIndexGenerator.kt b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterIndexGenerator.kt index f94f9738fa..ebf78e68b7 100644 --- a/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterIndexGenerator.kt +++ b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterIndexGenerator.kt @@ -26,8 +26,6 @@ import com.google.devtools.ksp.symbol.KSAnnotation import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFunctionDeclaration import com.google.devtools.ksp.symbol.KSType -import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter -import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import com.squareup.javapoet.ClassName import com.squareup.javapoet.CodeBlock import com.squareup.javapoet.FieldSpec @@ -37,6 +35,8 @@ import com.squareup.javapoet.ParameterSpec import com.squareup.javapoet.ParameterizedTypeName import com.squareup.javapoet.TypeSpec import com.squareup.javapoet.WildcardTypeName +import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter +import org.appdevforall.codeonthego.annotations.uidesigner.IncludeInDesigner import java.io.OutputStream import java.io.OutputStreamWriter import java.util.Collections @@ -50,231 +50,238 @@ import javax.lang.model.element.Modifier.STATIC * * @author Akash Yadav */ -class ViewAdapterIndexGenerator(private val logger: KSPLogger) { - - private val indexClassBuilder = - TypeSpec.classBuilder(INDEX_CLASS_NAME) - .addModifiers(PUBLIC, FINAL) - .addSuperinterface(viewAdapterInterface) - private val indexAddStatements = CodeBlock.builder() - - fun init() { - val adapterType = - ParameterizedTypeName.get( - ClassName.get(ADAPTER_BASE_CLASS_PCK, ADAPTER_BASE_CLASS_NAME), - WildcardTypeName.subtypeOf(viewClass) - ) - val mapOfStringToViewAdapter = - ParameterizedTypeName.get( - ClassName.get(Map::class.java), - ClassName.get(String::class.java), - adapterType - ) - indexClassBuilder.addField( - FieldSpec.builder(mapOfStringToViewAdapter, INDEX_MAP_FIELD, PRIVATE, STATIC, FINAL).build() - ) - - indexAddStatements.addStatement( - "final var adapters = new \$T()", - ParameterizedTypeName.get( - ClassName.get(HashMap::class.java), - ClassName.get(String::class.java), - adapterType - ) - ) - - // addPrivateConstructor(indexClassBuilder) - - val indexImpl = ClassName.get(INDEX_PACKAGE_NAME, INDEX_CLASS_NAME) - indexClassBuilder.addField( - FieldSpec.builder(indexImpl, "INSTANCE", PUBLIC, STATIC, FINAL) - .initializer("new \$T()", indexImpl) - .build() - ) - - indexClassBuilder.addMethod( - MethodSpec.methodBuilder("getAdapter") - .addAnnotation(Override::class.java) - .addAnnotation(ClassName.get("androidx.annotation", "Nullable")) - .addModifiers(PUBLIC) - .addParameter(String::class.java, "view", FINAL) - .returns(adapterType) - .addStatement("var adapter = \$L.get(\$L)", INDEX_MAP_FIELD, "view") - .beginControlFlow("if (adapter == null)") - .addStatement("adapter = \$L.get(\$S)", INDEX_MAP_FIELD, VIEW_CLASS) - .endControlFlow() - .addStatement("return adapter") - .build() - ) - - indexClassBuilder.addMethod( - MethodSpec.methodBuilder("getViewAdapter") - .addAnnotation(Override::class.java) - .addAnnotation(ClassName.get("androidx.annotation", "Nullable")) - .addModifiers(PUBLIC) - .addParameter(String::class.java, "view", FINAL) - .returns(adapterType) - .addStatement("return \$L.get(\$L)", INDEX_MAP_FIELD, "view") - .build() - ) - - val listOfViewAdapters = - ParameterizedTypeName.get(ClassName.get(java.util.List::class.java), adapterType) - val mapOfGroupToListOfViewAdapter = - ParameterizedTypeName.get( - ClassName.get(Map::class.java), - ClassName.get(IncludeInDesigner.Group::class.java), - listOfViewAdapters - ) - - indexClassBuilder.addField( - FieldSpec.builder( - mapOfGroupToListOfViewAdapter, - INDEX_PROVIDER_MAP_FIELD, - PRIVATE, - STATIC, - FINAL - ) - .build() - ) - - indexAddStatements.addStatement( - "final var providers = new \$T()", - ParameterizedTypeName.get( - ClassName.get(HashMap::class.java), - ClassName.get(IncludeInDesigner.Group::class.java), - listOfViewAdapters - ) - ) - - val nonNull = ClassName.get("androidx.annotation", "NonNull") - val groupParam = - ParameterSpec.builder(IncludeInDesigner.Group::class.java, "group", FINAL).build() - - indexClassBuilder.addMethod( - MethodSpec.methodBuilder("getWidgetProviders") - .addAnnotation(Override::class.java) - .addAnnotation(nonNull) - .addModifiers(PUBLIC) - .returns(listOfViewAdapters) - .addParameter(groupParam) - .addStatement("return \$L.get(group)", INDEX_PROVIDER_MAP_FIELD) - .build() - ) - } - - @OptIn(KspExperimental::class) - fun addViewAdapter(sym: KSClassDeclaration): Boolean { - val block = CodeBlock.builder() - - val viewAdapter = - sym.getKSAnnotationsByType(ViewAdapter::class).iterator().run { - val result = next() - if (hasNext()) { - logger.error("${ViewAdapter::class.simpleName} can only be applied once.", sym) - return false - } - result - } - - val includeInDesigner = - if (sym.isAnnotationPresent(IncludeInDesigner::class)) { - sym.getAnnotationsByType(IncludeInDesigner::class).iterator().run { - val result = next() - if (hasNext()) { - logger.error("${IncludeInDesigner::class.simpleName} can only be applied once.", sym) - return false - } - result - } - } else null - - val requiresApi = - if (sym.isAnnotationPresent(RequiresApi::class)) - sym.getAnnotationsByType(RequiresApi::class).iterator().next() - else null - - val viewName = getViewName(viewAdapter) - val moduleNs = getModuleNs(viewAdapter) - - val adapterTypeName = ClassName.get(sym.packageName.asString(), sym.simpleName.asString()) - val viewTypeName = - ClassName.get(viewName.substringBeforeLast('.'), viewName.substringAfterLast('.')) - - requiresApi?.let { annotation -> - val api = if (annotation.value == 1) annotation.api else annotation.value - val androidBuild = ClassName.get("android.os", "Build") - block.beginControlFlow("if(\$T.VERSION.SDK_INT >= \$L)", androidBuild, api) - } - - block.addStatement( - "final var adapter = new \$T()", - ParameterizedTypeName.get(adapterTypeName, viewTypeName) - ) - - block.addStatement("adapter.\$L(\$S)", METHOD_SET_MODULE, moduleNs) - block.addStatement("adapters.put(\$S, adapter)", viewName) - - if (includeInDesigner != null) { - assertOverridesCreateWidget(sym) - block.addStatement( - "providers.computeIfAbsent(\$T.\$L, g -> new \$T<>()).add(adapter)", - ClassName.get(IncludeInDesigner.Group::class.java), - includeInDesigner.group, - ClassName.get(java.util.ArrayList::class.java) - ) - } - - requiresApi?.let { block.endControlFlow() } - - indexAddStatements.add("{\n") - indexAddStatements.indent() - indexAddStatements.add(block.build()) - indexAddStatements.unindent() - indexAddStatements.add("}\n") - - return true - } - - fun generate(out: OutputStream) { - val javaCollections = ClassName.get(Collections::class.java) - - indexAddStatements.addStatement( - "\$L = \$T.unmodifiableMap(adapters)", - INDEX_MAP_FIELD, - javaCollections - ) - - indexAddStatements.addStatement( - "\$L = \$T.unmodifiableMap(providers)", - INDEX_PROVIDER_MAP_FIELD, - javaCollections - ) - - indexClassBuilder.addStaticBlock(indexAddStatements.build()) - - OutputStreamWriter(out).use { - val file = JavaFile.builder(INDEX_PACKAGE_NAME, indexClassBuilder.build()) - file.build().writeTo(it) - } - } - - private fun assertOverridesCreateWidget(sym: KSClassDeclaration): Boolean { - return sym.declarations - .filter { it is KSFunctionDeclaration } - .find { ADAPTER_FUNC_CREATE_WIDGET == it.simpleName.asString() } != null - } - - private fun getViewName(viewAdapter: KSAnnotation): String { - return getViewType(viewAdapter).declaration.qualifiedName!!.asString() - } - - private fun getViewType(viewAdapter: KSAnnotation) = - (getAnnotationArg(viewAdapter, "forView") as KSType) - - private fun getModuleNs(viewAdapter: KSAnnotation) = - (getAnnotationArg(viewAdapter, "moduleNamespace") as String) - - private fun getAnnotationArg(viewAdapter: KSAnnotation, arg: String) = - viewAdapter.arguments.first { it.name!!.asString() == arg }.value +class ViewAdapterIndexGenerator( + private val logger: KSPLogger, +) { + private val indexClassBuilder = + TypeSpec + .classBuilder(INDEX_CLASS_NAME) + .addModifiers(PUBLIC, FINAL) + .addSuperinterface(viewAdapterInterface) + private val indexAddStatements = CodeBlock.builder() + + fun init() { + val adapterType = + ParameterizedTypeName.get( + ClassName.get(ADAPTER_BASE_CLASS_PCK, ADAPTER_BASE_CLASS_NAME), + WildcardTypeName.subtypeOf(viewClass), + ) + val mapOfStringToViewAdapter = + ParameterizedTypeName.get( + ClassName.get(Map::class.java), + ClassName.get(String::class.java), + adapterType, + ) + indexClassBuilder.addField( + FieldSpec.builder(mapOfStringToViewAdapter, INDEX_MAP_FIELD, PRIVATE, STATIC, FINAL).build(), + ) + + indexAddStatements.addStatement( + "final var adapters = new \$T()", + ParameterizedTypeName.get( + ClassName.get(HashMap::class.java), + ClassName.get(String::class.java), + adapterType, + ), + ) + + // addPrivateConstructor(indexClassBuilder) + + val indexImpl = ClassName.get(INDEX_PACKAGE_NAME, INDEX_CLASS_NAME) + indexClassBuilder.addField( + FieldSpec + .builder(indexImpl, "INSTANCE", PUBLIC, STATIC, FINAL) + .initializer("new \$T()", indexImpl) + .build(), + ) + + indexClassBuilder.addMethod( + MethodSpec + .methodBuilder("getAdapter") + .addAnnotation(Override::class.java) + .addAnnotation(ClassName.get("androidx.annotation", "Nullable")) + .addModifiers(PUBLIC) + .addParameter(String::class.java, "view", FINAL) + .returns(adapterType) + .addStatement("var adapter = \$L.get(\$L)", INDEX_MAP_FIELD, "view") + .beginControlFlow("if (adapter == null)") + .addStatement("adapter = \$L.get(\$S)", INDEX_MAP_FIELD, VIEW_CLASS) + .endControlFlow() + .addStatement("return adapter") + .build(), + ) + + indexClassBuilder.addMethod( + MethodSpec + .methodBuilder("getViewAdapter") + .addAnnotation(Override::class.java) + .addAnnotation(ClassName.get("androidx.annotation", "Nullable")) + .addModifiers(PUBLIC) + .addParameter(String::class.java, "view", FINAL) + .returns(adapterType) + .addStatement("return \$L.get(\$L)", INDEX_MAP_FIELD, "view") + .build(), + ) + + val listOfViewAdapters = + ParameterizedTypeName.get(ClassName.get(java.util.List::class.java), adapterType) + val mapOfGroupToListOfViewAdapter = + ParameterizedTypeName.get( + ClassName.get(Map::class.java), + ClassName.get(IncludeInDesigner.Group::class.java), + listOfViewAdapters, + ) + + indexClassBuilder.addField( + FieldSpec + .builder( + mapOfGroupToListOfViewAdapter, + INDEX_PROVIDER_MAP_FIELD, + PRIVATE, + STATIC, + FINAL, + ).build(), + ) + + indexAddStatements.addStatement( + "final var providers = new \$T()", + ParameterizedTypeName.get( + ClassName.get(HashMap::class.java), + ClassName.get(IncludeInDesigner.Group::class.java), + listOfViewAdapters, + ), + ) + + val nonNull = ClassName.get("androidx.annotation", "NonNull") + val groupParam = + ParameterSpec.builder(IncludeInDesigner.Group::class.java, "group", FINAL).build() + + indexClassBuilder.addMethod( + MethodSpec + .methodBuilder("getWidgetProviders") + .addAnnotation(Override::class.java) + .addAnnotation(nonNull) + .addModifiers(PUBLIC) + .returns(listOfViewAdapters) + .addParameter(groupParam) + .addStatement("return \$L.get(group)", INDEX_PROVIDER_MAP_FIELD) + .build(), + ) + } + + @OptIn(KspExperimental::class) + fun addViewAdapter(sym: KSClassDeclaration): Boolean { + val block = CodeBlock.builder() + + val viewAdapter = + sym.getKSAnnotationsByType(ViewAdapter::class).iterator().run { + val result = next() + if (hasNext()) { + logger.error("${ViewAdapter::class.simpleName} can only be applied once.", sym) + return false + } + result + } + + val includeInDesigner = + if (sym.isAnnotationPresent(IncludeInDesigner::class)) { + sym.getAnnotationsByType(IncludeInDesigner::class).iterator().run { + val result = next() + if (hasNext()) { + logger.error("${IncludeInDesigner::class.simpleName} can only be applied once.", sym) + return false + } + result + } + } else { + null + } + + val requiresApi = + if (sym.isAnnotationPresent(RequiresApi::class)) { + sym.getAnnotationsByType(RequiresApi::class).iterator().next() + } else { + null + } + + val viewName = getViewName(viewAdapter) + val moduleNs = getModuleNs(viewAdapter) + + val adapterTypeName = ClassName.get(sym.packageName.asString(), sym.simpleName.asString()) + val viewTypeName = + ClassName.get(viewName.substringBeforeLast('.'), viewName.substringAfterLast('.')) + + requiresApi?.let { annotation -> + val api = if (annotation.value == 1) annotation.api else annotation.value + val androidBuild = ClassName.get("android.os", "Build") + block.beginControlFlow("if(\$T.VERSION.SDK_INT >= \$L)", androidBuild, api) + } + + block.addStatement( + "final var adapter = new \$T()", + ParameterizedTypeName.get(adapterTypeName, viewTypeName), + ) + + block.addStatement("adapter.\$L(\$S)", METHOD_SET_MODULE, moduleNs) + block.addStatement("adapters.put(\$S, adapter)", viewName) + + if (includeInDesigner != null) { + assertOverridesCreateWidget(sym) + block.addStatement( + "providers.computeIfAbsent(\$T.\$L, g -> new \$T<>()).add(adapter)", + ClassName.get(IncludeInDesigner.Group::class.java), + includeInDesigner.group, + ClassName.get(java.util.ArrayList::class.java), + ) + } + + requiresApi?.let { block.endControlFlow() } + + indexAddStatements.add("{\n") + indexAddStatements.indent() + indexAddStatements.add(block.build()) + indexAddStatements.unindent() + indexAddStatements.add("}\n") + + return true + } + + fun generate(out: OutputStream) { + val javaCollections = ClassName.get(Collections::class.java) + + indexAddStatements.addStatement( + "\$L = \$T.unmodifiableMap(adapters)", + INDEX_MAP_FIELD, + javaCollections, + ) + + indexAddStatements.addStatement( + "\$L = \$T.unmodifiableMap(providers)", + INDEX_PROVIDER_MAP_FIELD, + javaCollections, + ) + + indexClassBuilder.addStaticBlock(indexAddStatements.build()) + + OutputStreamWriter(out).use { + val file = JavaFile.builder(INDEX_PACKAGE_NAME, indexClassBuilder.build()) + file.build().writeTo(it) + } + } + + private fun assertOverridesCreateWidget(sym: KSClassDeclaration): Boolean = + sym.declarations + .filter { it is KSFunctionDeclaration } + .find { ADAPTER_FUNC_CREATE_WIDGET == it.simpleName.asString() } != null + + private fun getViewName(viewAdapter: KSAnnotation): String = getViewType(viewAdapter).declaration.qualifiedName!!.asString() + + private fun getViewType(viewAdapter: KSAnnotation) = (getAnnotationArg(viewAdapter, "forView") as KSType) + + private fun getModuleNs(viewAdapter: KSAnnotation) = (getAnnotationArg(viewAdapter, "moduleNamespace") as String) + + private fun getAnnotationArg( + viewAdapter: KSAnnotation, + arg: String, + ) = viewAdapter.arguments.first { it.name!!.asString() == arg }.value } diff --git a/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterSymbolProcessor.kt b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterSymbolProcessor.kt index ee8a4be638..24ffb5511c 100644 --- a/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterSymbolProcessor.kt +++ b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterSymbolProcessor.kt @@ -35,77 +35,76 @@ import org.appdevforall.codeonthego.annotations.inflater.ViewAdapter * @author Akash Yadav */ class ViewAdapterSymbolProcessor( - private val codeGenerator: CodeGenerator, - private val logger: KSPLogger + private val codeGenerator: CodeGenerator, + private val logger: KSPLogger, ) : SymbolProcessor { - - private val generator = ViewAdapterIndexGenerator(logger) - - init { - generator.init() - } - - override fun process(resolver: Resolver): List { - val symbols = resolver.getSymbolsWithAnnotation(ViewAdapter::class.java.name) - - if (!symbols.iterator().hasNext()) { - return emptyList() - } - - val unprocessed = mutableListOf() - val files = mutableListOf() - symbols.forEach { - it.containingFile?.also { file -> files.add(file) } - if (!process(it)) { - unprocessed.add(it) - } - } - - val file = - codeGenerator.createNewFile( - Dependencies(true, *files.toTypedArray()), - INDEX_PACKAGE_NAME, - INDEX_CLASS_NAME, - "java" - ) - - generator.generate(file) - - file.flush() - file.close() - - return unprocessed - } - - private fun process(sym: KSAnnotated): Boolean { - if (sym !is KSClassDeclaration) { - logger.error("${ViewAdapter::class} must be applied to a class.", sym) - return false - } - - if (sym.parent !is KSFile) { - logger.error( - "${ViewAdapter::class} must be applied to a top level class. (${sym.parent})", - sym - ) - return false - } - - if (sym.primaryConstructor?.parameters?.size != 0) { - logger.error("A view adapter must have a single primary constructor", sym) - return false - } - - if (sym.typeParameters.size != 1) { - logger.error("A view adapter must have exactly one type parameter", sym) - return false - } - - if (!sym.isOpen()) { - logger.error("A view adapter implementation must be open.", sym) - return false - } - - return generator.addViewAdapter(sym) - } + private val generator = ViewAdapterIndexGenerator(logger) + + init { + generator.init() + } + + override fun process(resolver: Resolver): List { + val symbols = resolver.getSymbolsWithAnnotation(ViewAdapter::class.java.name) + + if (!symbols.iterator().hasNext()) { + return emptyList() + } + + val unprocessed = mutableListOf() + val files = mutableListOf() + symbols.forEach { + it.containingFile?.also { file -> files.add(file) } + if (!process(it)) { + unprocessed.add(it) + } + } + + val file = + codeGenerator.createNewFile( + Dependencies(true, *files.toTypedArray()), + INDEX_PACKAGE_NAME, + INDEX_CLASS_NAME, + "java", + ) + + generator.generate(file) + + file.flush() + file.close() + + return unprocessed + } + + private fun process(sym: KSAnnotated): Boolean { + if (sym !is KSClassDeclaration) { + logger.error("${ViewAdapter::class} must be applied to a class.", sym) + return false + } + + if (sym.parent !is KSFile) { + logger.error( + "${ViewAdapter::class} must be applied to a top level class. (${sym.parent})", + sym, + ) + return false + } + + if (sym.primaryConstructor?.parameters?.size != 0) { + logger.error("A view adapter must have a single primary constructor", sym) + return false + } + + if (sym.typeParameters.size != 1) { + logger.error("A view adapter must have exactly one type parameter", sym) + return false + } + + if (!sym.isOpen()) { + logger.error("A view adapter implementation must be open.", sym) + return false + } + + return generator.addViewAdapter(sym) + } } diff --git a/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterSymbolProcessorProvider.kt b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterSymbolProcessorProvider.kt index d960512b40..d27cb74b84 100644 --- a/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterSymbolProcessorProvider.kt +++ b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/ViewAdapterSymbolProcessorProvider.kt @@ -28,8 +28,6 @@ import com.google.devtools.ksp.processing.SymbolProcessorProvider * @author Akash Yadav */ class ViewAdapterSymbolProcessorProvider : SymbolProcessorProvider { - - override fun create(environment: SymbolProcessorEnvironment): SymbolProcessor { - return ViewAdapterSymbolProcessor(environment.codeGenerator, environment.logger) - } + override fun create(environment: SymbolProcessorEnvironment): SymbolProcessor = + ViewAdapterSymbolProcessor(environment.codeGenerator, environment.logger) } diff --git a/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/kspUtils.kt b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/kspUtils.kt index 4672e6ddb7..7d9f93c354 100644 --- a/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/kspUtils.kt +++ b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/kspUtils.kt @@ -22,8 +22,8 @@ import com.google.devtools.ksp.symbol.KSAnnotation import kotlin.reflect.KClass fun KSAnnotated.getKSAnnotationsByType(annotationKClass: KClass): Sequence { - return this.annotations.filter { - it.shortName.getShortName() == annotationKClass.simpleName && it.annotationType.resolve().declaration - .qualifiedName?.asString() == annotationKClass.qualifiedName - } -} \ No newline at end of file +return this.annotations.filter { + it.shortName.getShortName() == annotationKClass.simpleName && it.annotationType.resolve().declaration + .qualifiedName?.asString() == annotationKClass.qualifiedName +} +} diff --git a/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/utils.kt b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/utils.kt index 8246c6ed5c..003f557839 100644 --- a/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/utils.kt +++ b/annotation-processors-ksp/src/main/kotlin/org/appdevforall/codeonthego/annotations/ksp/inflater/utils.kt @@ -38,5 +38,5 @@ const val METHOD_SET_MODULE = "setModuleNamespace" val viewAdapter = ClassName.get(ADAPTER_BASE_CLASS_PCK, ADAPTER_BASE_CLASS_NAME) val viewAdapterInterface: ClassName = - ClassName.get("org.appdevforall.codeonthego.inflater", "IViewAdapterIndex") -val viewClass = ClassName.get(ANDROID_VIEW_PCK, ANDROID_VIEW_CLASS) \ No newline at end of file +ClassName.get("org.appdevforall.codeonthego.inflater", "IViewAdapterIndex") +val viewClass = ClassName.get(ANDROID_VIEW_PCK, ANDROID_VIEW_CLASS) diff --git a/annotation-processors/src/main/java/org/appdevforall/codeonthego/annotations/EventBusAnnotationProcessor.java b/annotation-processors/src/main/java/org/appdevforall/codeonthego/annotations/EventBusAnnotationProcessor.java index 1e42a75867..9b12dd68de 100644 --- a/annotation-processors/src/main/java/org/appdevforall/codeonthego/annotations/EventBusAnnotationProcessor.java +++ b/annotation-processors/src/main/java/org/appdevforall/codeonthego/annotations/EventBusAnnotationProcessor.java @@ -16,22 +16,19 @@ package org.appdevforall.codeonthego.annotations; -import com.google.auto.service.AutoService; -import javax.annotation.processing.Processor; -import net.ltgt.gradle.incap.IncrementalAnnotationProcessor; - -import org.greenrobot.eventbus.Subscribe; -import org.greenrobot.eventbus.ThreadMode; +import static net.ltgt.gradle.incap.IncrementalAnnotationProcessorType.AGGREGATING; +import com.google.auto.service.AutoService; +import de.greenrobot.common.ListMap; import java.io.BufferedWriter; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; - import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.Messager; +import javax.annotation.processing.Processor; import javax.annotation.processing.RoundEnvironment; import javax.annotation.processing.SupportedAnnotationTypes; import javax.annotation.processing.SupportedOptions; @@ -48,399 +45,396 @@ import javax.lang.model.type.TypeVariable; import javax.tools.Diagnostic; import javax.tools.JavaFileObject; - -import de.greenrobot.common.ListMap; - - -import static net.ltgt.gradle.incap.IncrementalAnnotationProcessorType.AGGREGATING; +import net.ltgt.gradle.incap.IncrementalAnnotationProcessor; +import org.greenrobot.eventbus.Subscribe; +import org.greenrobot.eventbus.ThreadMode; /** - * Is an aggregating processor as it writes a single file, the subscriber index file, - * based on found elements with the @Subscriber annotation. + * Is an aggregating processor as it writes a single file, the subscriber index file, based on found elements with the @Subscriber annotation. */ @SupportedAnnotationTypes("org.greenrobot.eventbus.Subscribe") @SupportedOptions(value = {"eventBusIndex", "verbose"}) @IncrementalAnnotationProcessor(AGGREGATING) @AutoService(Processor.class) public class EventBusAnnotationProcessor extends AbstractProcessor { - public static final String OPTION_EVENT_BUS_INDEX = "eventBusIndex"; - public static final String OPTION_VERBOSE = "verbose"; - - /** Found subscriber methods for a class (without superclasses). */ - private final ListMap methodsByClass = new ListMap<>(); - private final Set classesToSkip = new HashSet<>(); - - private boolean writerRoundDone; - private int round; - private boolean verbose; - - @Override - public SourceVersion getSupportedSourceVersion() { - return SourceVersion.latest(); - } - - @Override - public boolean process(Set annotations, RoundEnvironment env) { - Messager messager = processingEnv.getMessager(); - try { - String index = processingEnv.getOptions().get(OPTION_EVENT_BUS_INDEX); - if (index == null) { - messager.printMessage(Diagnostic.Kind.ERROR, "No option " + OPTION_EVENT_BUS_INDEX + - " passed to annotation processor"); - return false; - } - verbose = Boolean.parseBoolean(processingEnv.getOptions().get(OPTION_VERBOSE)); - int lastPeriod = index.lastIndexOf('.'); - String indexPackage = lastPeriod != -1 ? index.substring(0, lastPeriod) : null; - - round++; - if (verbose) { - messager.printMessage(Diagnostic.Kind.NOTE, "Processing round " + round + ", new annotations: " + - !annotations.isEmpty() + ", processingOver: " + env.processingOver()); - } - if (env.processingOver()) { - if (!annotations.isEmpty()) { - messager.printMessage(Diagnostic.Kind.ERROR, - "Unexpected processing state: annotations still available after processing over"); - return false; - } - } - if (annotations.isEmpty()) { - return false; - } - - if (writerRoundDone) { - messager.printMessage(Diagnostic.Kind.ERROR, - "Unexpected processing state: annotations still available after writing."); - } - collectSubscribers(annotations, env, messager); - checkForSubscribersToSkip(messager, indexPackage); - - if (!methodsByClass.isEmpty()) { - createInfoIndexFile(index); - } else { - messager.printMessage(Diagnostic.Kind.WARNING, "No @Subscribe annotations found"); - } - writerRoundDone = true; - } catch (RuntimeException e) { - // IntelliJ does not handle exceptions nicely, so log and print a message - e.printStackTrace(); - messager.printMessage(Diagnostic.Kind.ERROR, "Unexpected error in EventBusAnnotationProcessor: " + e); - } - return true; - } - - private void collectSubscribers(Set annotations, RoundEnvironment env, Messager messager) { - for (TypeElement annotation : annotations) { - Set elements = env.getElementsAnnotatedWith(annotation); - for (Element element : elements) { - if (element instanceof ExecutableElement) { - ExecutableElement method = (ExecutableElement) element; - if (checkHasNoErrors(method, messager)) { - TypeElement classElement = (TypeElement) method.getEnclosingElement(); - methodsByClass.putElement(classElement, method); - } - } else { - messager.printMessage(Diagnostic.Kind.ERROR, "@Subscribe is only valid for methods", element); - } - } - } - } - - private boolean checkHasNoErrors(ExecutableElement element, Messager messager) { - if (element.getModifiers().contains(Modifier.STATIC)) { - messager.printMessage(Diagnostic.Kind.ERROR, "Subscriber method must not be static", element); - return false; - } - - if (!element.getModifiers().contains(Modifier.PUBLIC)) { - messager.printMessage(Diagnostic.Kind.ERROR, "Subscriber method must be public", element); - return false; - } - - List parameters = ((ExecutableElement) element).getParameters(); - if (parameters.size() != 1) { - messager.printMessage(Diagnostic.Kind.ERROR, "Subscriber method must have exactly 1 parameter", element); - return false; - } - return true; - } - - /** - * Subscriber classes should be skipped if their class or any involved event class are not visible to the index. - */ - private void checkForSubscribersToSkip(Messager messager, String myPackage) { - for (TypeElement skipCandidate : methodsByClass.keySet()) { - TypeElement subscriberClass = skipCandidate; - while (subscriberClass != null) { - if (!isVisible(myPackage, subscriberClass)) { - boolean added = classesToSkip.add(skipCandidate); - if (added) { - String msg; - if (subscriberClass.equals(skipCandidate)) { - msg = "Falling back to reflection because class is not public"; - } else { - msg = "Falling back to reflection because " + skipCandidate + - " has a non-public super class"; - } - messager.printMessage(Diagnostic.Kind.NOTE, msg, subscriberClass); - } - break; - } - List methods = methodsByClass.get(subscriberClass); - if (methods != null) { - for (ExecutableElement method : methods) { - String skipReason = null; - VariableElement param = method.getParameters().get(0); - TypeMirror typeMirror = getParamTypeMirror(param, messager); - if (!(typeMirror instanceof DeclaredType) || - !(((DeclaredType) typeMirror).asElement() instanceof TypeElement)) { - skipReason = "event type cannot be processed"; - } - if (skipReason == null) { - TypeElement eventTypeElement = (TypeElement) ((DeclaredType) typeMirror).asElement(); - if (!isVisible(myPackage, eventTypeElement)) { - skipReason = "event type is not public"; - } - } - if (skipReason != null) { - boolean added = classesToSkip.add(skipCandidate); - if (added) { - String msg = "Falling back to reflection because " + skipReason; - if (!subscriberClass.equals(skipCandidate)) { - msg += " (found in super class for " + skipCandidate + ")"; - } - messager.printMessage(Diagnostic.Kind.NOTE, msg, param); - } - break; - } - } - } - subscriberClass = getSuperclass(subscriberClass); - } - } - } - - private TypeMirror getParamTypeMirror(VariableElement param, Messager messager) { - TypeMirror typeMirror = param.asType(); - // Check for generic type - if (typeMirror instanceof TypeVariable) { - TypeMirror upperBound = ((TypeVariable) typeMirror).getUpperBound(); - if (upperBound instanceof DeclaredType) { - if (messager != null) { - messager.printMessage(Diagnostic.Kind.NOTE, "Using upper bound type " + upperBound + - " for generic parameter", param); - } - typeMirror = upperBound; - } - } - return typeMirror; - } - - private TypeElement getSuperclass(TypeElement type) { - if (type.getSuperclass().getKind() == TypeKind.DECLARED) { - TypeElement superclass = (TypeElement) processingEnv.getTypeUtils().asElement(type.getSuperclass()); - String name = superclass.getQualifiedName().toString(); - if (name.startsWith("java.") || name.startsWith("javax.") || name.startsWith("android.")) { - // Skip system classes, this just degrades performance - return null; - } else { - return superclass; - } - } else { - return null; - } - } - - private String getClassString(TypeElement typeElement, String myPackage) { - PackageElement packageElement = getPackageElement(typeElement); - String packageString = packageElement.getQualifiedName().toString(); - String className = typeElement.getQualifiedName().toString(); - if (packageString != null && !packageString.isEmpty()) { - if (packageString.equals(myPackage)) { - className = cutPackage(myPackage, className); - } else if (packageString.equals("java.lang")) { - className = typeElement.getSimpleName().toString(); - } - } - return className; - } - - private String cutPackage(String paket, String className) { - if (className.startsWith(paket + '.')) { - // Don't use TypeElement.getSimpleName, it doesn't work for us with inner classes - return className.substring(paket.length() + 1); - } else { - // Paranoia - throw new IllegalStateException("Mismatching " + paket + " vs. " + className); - } - } - - private PackageElement getPackageElement(TypeElement subscriberClass) { - Element candidate = subscriberClass.getEnclosingElement(); - while (!(candidate instanceof PackageElement)) { - candidate = candidate.getEnclosingElement(); - } - return (PackageElement) candidate; - } - - private void writeCreateSubscriberMethods(BufferedWriter writer, List methods, - String callPrefix, String myPackage) throws IOException { - for (ExecutableElement method : methods) { - List parameters = method.getParameters(); - TypeMirror paramType = getParamTypeMirror(parameters.get(0), null); - TypeElement paramElement = (TypeElement) processingEnv.getTypeUtils().asElement(paramType); - String methodName = method.getSimpleName().toString(); - String eventClass = getClassString(paramElement, myPackage) + ".class"; - - Subscribe subscribe = method.getAnnotation(Subscribe.class); - List parts = new ArrayList<>(); - parts.add(callPrefix + "(\"" + methodName + "\","); - String lineEnd = "),"; - if (subscribe.priority() == 0 && !subscribe.sticky()) { - if (subscribe.threadMode() == ThreadMode.POSTING) { - parts.add(eventClass + lineEnd); - } else { - parts.add(eventClass + ","); - parts.add("ThreadMode." + subscribe.threadMode().name() + lineEnd); - } - } else { - parts.add(eventClass + ","); - parts.add("ThreadMode." + subscribe.threadMode().name() + ","); - parts.add(subscribe.priority() + ","); - parts.add(subscribe.sticky() + lineEnd); - } - writeLine(writer, 3, parts.toArray(new String[parts.size()])); - - if (verbose) { - processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, "Indexed @Subscribe at " + - method.getEnclosingElement().getSimpleName() + "." + methodName + - "(" + paramElement.getSimpleName() + ")"); - } - - } - } - - private void createInfoIndexFile(String index) { - BufferedWriter writer = null; - try { - JavaFileObject sourceFile = processingEnv.getFiler().createSourceFile(index); - int period = index.lastIndexOf('.'); - String myPackage = period > 0 ? index.substring(0, period) : null; - String clazz = index.substring(period + 1); - writer = new BufferedWriter(sourceFile.openWriter()); - if (myPackage != null) { - writer.write("package " + myPackage + ";\n\n"); - } - writer.write("import org.greenrobot.eventbus.meta.SimpleSubscriberInfo;\n"); - writer.write("import org.greenrobot.eventbus.meta.SubscriberMethodInfo;\n"); - writer.write("import org.greenrobot.eventbus.meta.SubscriberInfo;\n"); - writer.write("import org.greenrobot.eventbus.meta.SubscriberInfoIndex;\n\n"); - writer.write("import org.greenrobot.eventbus.ThreadMode;\n\n"); - writer.write("import java.util.HashMap;\n"); - writer.write("import java.util.Map;\n\n"); - writer.write("/** This class is generated by EventBus, do not edit. */\n"); - writer.write("public class " + clazz + " implements SubscriberInfoIndex {\n"); - writer.write(" private static final Map, SubscriberInfo> SUBSCRIBER_INDEX;\n\n"); - writer.write(" static {\n"); - writer.write(" SUBSCRIBER_INDEX = new HashMap, SubscriberInfo>();\n\n"); - writeIndexLines(writer, myPackage); - writer.write(" }\n\n"); - writer.write(" private static void putIndex(SubscriberInfo info) {\n"); - writer.write(" SUBSCRIBER_INDEX.put(info.getSubscriberClass(), info);\n"); - writer.write(" }\n\n"); - writer.write(" @Override\n"); - writer.write(" public SubscriberInfo getSubscriberInfo(Class subscriberClass) {\n"); - writer.write(" SubscriberInfo info = SUBSCRIBER_INDEX.get(subscriberClass);\n"); - writer.write(" if (info != null) {\n"); - writer.write(" return info;\n"); - writer.write(" } else {\n"); - writer.write(" return null;\n"); - writer.write(" }\n"); - writer.write(" }\n"); - writer.write("}\n"); - } catch (IOException e) { - throw new RuntimeException("Could not write source for " + index, e); - } finally { - if (writer != null) { - try { - writer.close(); - } catch (IOException e) { - //Silent - } - } - } - } - - private void writeIndexLines(BufferedWriter writer, String myPackage) throws IOException { - for (TypeElement subscriberTypeElement : methodsByClass.keySet()) { - if (classesToSkip.contains(subscriberTypeElement)) { - continue; - } - - String subscriberClass = getClassString(subscriberTypeElement, myPackage); - if (isVisible(myPackage, subscriberTypeElement)) { - writeLine(writer, 2, - "putIndex(new SimpleSubscriberInfo(" + subscriberClass + ".class,", - "true,", "new SubscriberMethodInfo[] {"); - List methods = methodsByClass.get(subscriberTypeElement); - writeCreateSubscriberMethods(writer, methods, "new SubscriberMethodInfo", myPackage); - writer.write(" }));\n\n"); - } else { - writer.write(" // Subscriber not visible to index: " + subscriberClass + "\n"); - } - } - } - - private boolean isVisible(String myPackage, TypeElement typeElement) { - Set modifiers = typeElement.getModifiers(); - boolean visible; - if (modifiers.contains(Modifier.PUBLIC)) { - visible = true; - } else if (modifiers.contains(Modifier.PRIVATE) || modifiers.contains(Modifier.PROTECTED)) { - visible = false; - } else { - String subscriberPackage = getPackageElement(typeElement).getQualifiedName().toString(); - if (myPackage == null) { - visible = subscriberPackage.length() == 0; - } else { - visible = myPackage.equals(subscriberPackage); - } - } - return visible; - } - - private void writeLine(BufferedWriter writer, int indentLevel, String... parts) throws IOException { - writeLine(writer, indentLevel, 2, parts); - } - - private void writeLine(BufferedWriter writer, int indentLevel, int indentLevelIncrease, String... parts) - throws IOException { - writeIndent(writer, indentLevel); - int len = indentLevel * 4; - for (int i = 0; i < parts.length; i++) { - String part = parts[i]; - if (i != 0) { - if (len + part.length() > 118) { - writer.write("\n"); - if (indentLevel < 12) { - indentLevel += indentLevelIncrease; - } - writeIndent(writer, indentLevel); - len = indentLevel * 4; - } else { - writer.write(" "); - } - } - writer.write(part); - len += part.length(); - } - writer.write("\n"); - } - - private void writeIndent(BufferedWriter writer, int indentLevel) throws IOException { - for (int i = 0; i < indentLevel; i++) { - writer.write(" "); - } - } -} \ No newline at end of file + public static final String OPTION_EVENT_BUS_INDEX = "eventBusIndex"; + public static final String OPTION_VERBOSE = "verbose"; + + /** Found subscriber methods for a class (without superclasses). */ + private final ListMap methodsByClass = new ListMap<>(); + private final Set classesToSkip = new HashSet<>(); + + private boolean writerRoundDone; + private int round; + private boolean verbose; + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + + @Override + public boolean process(Set annotations, RoundEnvironment env) { + Messager messager = processingEnv.getMessager(); + try { + String index = processingEnv.getOptions().get(OPTION_EVENT_BUS_INDEX); + if (index == null) { + messager.printMessage(Diagnostic.Kind.ERROR, "No option " + OPTION_EVENT_BUS_INDEX + + " passed to annotation processor"); + return false; + } + verbose = Boolean.parseBoolean(processingEnv.getOptions().get(OPTION_VERBOSE)); + int lastPeriod = index.lastIndexOf('.'); + String indexPackage = lastPeriod != -1 ? index.substring(0, lastPeriod) : null; + + round++; + if (verbose) { + messager.printMessage(Diagnostic.Kind.NOTE, "Processing round " + round + ", new annotations: " + + !annotations.isEmpty() + ", processingOver: " + env.processingOver()); + } + if (env.processingOver()) { + if (!annotations.isEmpty()) { + messager.printMessage(Diagnostic.Kind.ERROR, + "Unexpected processing state: annotations still available after processing over"); + return false; + } + } + if (annotations.isEmpty()) { + return false; + } + + if (writerRoundDone) { + messager.printMessage(Diagnostic.Kind.ERROR, + "Unexpected processing state: annotations still available after writing."); + } + collectSubscribers(annotations, env, messager); + checkForSubscribersToSkip(messager, indexPackage); + + if (!methodsByClass.isEmpty()) { + createInfoIndexFile(index); + } else { + messager.printMessage(Diagnostic.Kind.WARNING, "No @Subscribe annotations found"); + } + writerRoundDone = true; + } catch (RuntimeException e) { + // IntelliJ does not handle exceptions nicely, so log and print a message + e.printStackTrace(); + messager.printMessage(Diagnostic.Kind.ERROR, "Unexpected error in EventBusAnnotationProcessor: " + e); + } + return true; + } + + /** + * Subscriber classes should be skipped if their class or any involved event class are not visible to the index. + */ + private void checkForSubscribersToSkip(Messager messager, String myPackage) { + for (TypeElement skipCandidate : methodsByClass.keySet()) { + TypeElement subscriberClass = skipCandidate; + while (subscriberClass != null) { + if (!isVisible(myPackage, subscriberClass)) { + boolean added = classesToSkip.add(skipCandidate); + if (added) { + String msg; + if (subscriberClass.equals(skipCandidate)) { + msg = "Falling back to reflection because class is not public"; + } else { + msg = "Falling back to reflection because " + skipCandidate + + " has a non-public super class"; + } + messager.printMessage(Diagnostic.Kind.NOTE, msg, subscriberClass); + } + break; + } + List methods = methodsByClass.get(subscriberClass); + if (methods != null) { + for (ExecutableElement method : methods) { + String skipReason = null; + VariableElement param = method.getParameters().get(0); + TypeMirror typeMirror = getParamTypeMirror(param, messager); + if (!(typeMirror instanceof DeclaredType) || + !(((DeclaredType) typeMirror).asElement() instanceof TypeElement)) { + skipReason = "event type cannot be processed"; + } + if (skipReason == null) { + TypeElement eventTypeElement = (TypeElement) ((DeclaredType) typeMirror).asElement(); + if (!isVisible(myPackage, eventTypeElement)) { + skipReason = "event type is not public"; + } + } + if (skipReason != null) { + boolean added = classesToSkip.add(skipCandidate); + if (added) { + String msg = "Falling back to reflection because " + skipReason; + if (!subscriberClass.equals(skipCandidate)) { + msg += " (found in super class for " + skipCandidate + ")"; + } + messager.printMessage(Diagnostic.Kind.NOTE, msg, param); + } + break; + } + } + } + subscriberClass = getSuperclass(subscriberClass); + } + } + } + + private boolean checkHasNoErrors(ExecutableElement element, Messager messager) { + if (element.getModifiers().contains(Modifier.STATIC)) { + messager.printMessage(Diagnostic.Kind.ERROR, "Subscriber method must not be static", element); + return false; + } + + if (!element.getModifiers().contains(Modifier.PUBLIC)) { + messager.printMessage(Diagnostic.Kind.ERROR, "Subscriber method must be public", element); + return false; + } + + List parameters = ((ExecutableElement) element).getParameters(); + if (parameters.size() != 1) { + messager.printMessage(Diagnostic.Kind.ERROR, "Subscriber method must have exactly 1 parameter", element); + return false; + } + return true; + } + + private void collectSubscribers(Set annotations, RoundEnvironment env, Messager messager) { + for (TypeElement annotation : annotations) { + Set elements = env.getElementsAnnotatedWith(annotation); + for (Element element : elements) { + if (element instanceof ExecutableElement) { + ExecutableElement method = (ExecutableElement) element; + if (checkHasNoErrors(method, messager)) { + TypeElement classElement = (TypeElement) method.getEnclosingElement(); + methodsByClass.putElement(classElement, method); + } + } else { + messager.printMessage(Diagnostic.Kind.ERROR, "@Subscribe is only valid for methods", element); + } + } + } + } + + private void createInfoIndexFile(String index) { + BufferedWriter writer = null; + try { + JavaFileObject sourceFile = processingEnv.getFiler().createSourceFile(index); + int period = index.lastIndexOf('.'); + String myPackage = period > 0 ? index.substring(0, period) : null; + String clazz = index.substring(period + 1); + writer = new BufferedWriter(sourceFile.openWriter()); + if (myPackage != null) { + writer.write("package " + myPackage + ";\n\n"); + } + writer.write("import org.greenrobot.eventbus.meta.SimpleSubscriberInfo;\n"); + writer.write("import org.greenrobot.eventbus.meta.SubscriberMethodInfo;\n"); + writer.write("import org.greenrobot.eventbus.meta.SubscriberInfo;\n"); + writer.write("import org.greenrobot.eventbus.meta.SubscriberInfoIndex;\n\n"); + writer.write("import org.greenrobot.eventbus.ThreadMode;\n\n"); + writer.write("import java.util.HashMap;\n"); + writer.write("import java.util.Map;\n\n"); + writer.write("/** This class is generated by EventBus, do not edit. */\n"); + writer.write("public class " + clazz + " implements SubscriberInfoIndex {\n"); + writer.write(" private static final Map, SubscriberInfo> SUBSCRIBER_INDEX;\n\n"); + writer.write(" static {\n"); + writer.write(" SUBSCRIBER_INDEX = new HashMap, SubscriberInfo>();\n\n"); + writeIndexLines(writer, myPackage); + writer.write(" }\n\n"); + writer.write(" private static void putIndex(SubscriberInfo info) {\n"); + writer.write(" SUBSCRIBER_INDEX.put(info.getSubscriberClass(), info);\n"); + writer.write(" }\n\n"); + writer.write(" @Override\n"); + writer.write(" public SubscriberInfo getSubscriberInfo(Class subscriberClass) {\n"); + writer.write(" SubscriberInfo info = SUBSCRIBER_INDEX.get(subscriberClass);\n"); + writer.write(" if (info != null) {\n"); + writer.write(" return info;\n"); + writer.write(" } else {\n"); + writer.write(" return null;\n"); + writer.write(" }\n"); + writer.write(" }\n"); + writer.write("}\n"); + } catch (IOException e) { + throw new RuntimeException("Could not write source for " + index, e); + } finally { + if (writer != null) { + try { + writer.close(); + } catch (IOException e) { + // Silent + } + } + } + } + + private String cutPackage(String paket, String className) { + if (className.startsWith(paket + '.')) { + // Don't use TypeElement.getSimpleName, it doesn't work for us with inner classes + return className.substring(paket.length() + 1); + } else { + // Paranoia + throw new IllegalStateException("Mismatching " + paket + " vs. " + className); + } + } + + private String getClassString(TypeElement typeElement, String myPackage) { + PackageElement packageElement = getPackageElement(typeElement); + String packageString = packageElement.getQualifiedName().toString(); + String className = typeElement.getQualifiedName().toString(); + if (packageString != null && !packageString.isEmpty()) { + if (packageString.equals(myPackage)) { + className = cutPackage(myPackage, className); + } else if (packageString.equals("java.lang")) { + className = typeElement.getSimpleName().toString(); + } + } + return className; + } + + private PackageElement getPackageElement(TypeElement subscriberClass) { + Element candidate = subscriberClass.getEnclosingElement(); + while (!(candidate instanceof PackageElement)) { + candidate = candidate.getEnclosingElement(); + } + return (PackageElement) candidate; + } + + private TypeMirror getParamTypeMirror(VariableElement param, Messager messager) { + TypeMirror typeMirror = param.asType(); + // Check for generic type + if (typeMirror instanceof TypeVariable) { + TypeMirror upperBound = ((TypeVariable) typeMirror).getUpperBound(); + if (upperBound instanceof DeclaredType) { + if (messager != null) { + messager.printMessage(Diagnostic.Kind.NOTE, "Using upper bound type " + upperBound + + " for generic parameter", param); + } + typeMirror = upperBound; + } + } + return typeMirror; + } + + private TypeElement getSuperclass(TypeElement type) { + if (type.getSuperclass().getKind() == TypeKind.DECLARED) { + TypeElement superclass = (TypeElement) processingEnv.getTypeUtils().asElement(type.getSuperclass()); + String name = superclass.getQualifiedName().toString(); + if (name.startsWith("java.") || name.startsWith("javax.") || name.startsWith("android.")) { + // Skip system classes, this just degrades performance + return null; + } else { + return superclass; + } + } else { + return null; + } + } + + private boolean isVisible(String myPackage, TypeElement typeElement) { + Set modifiers = typeElement.getModifiers(); + boolean visible; + if (modifiers.contains(Modifier.PUBLIC)) { + visible = true; + } else if (modifiers.contains(Modifier.PRIVATE) || modifiers.contains(Modifier.PROTECTED)) { + visible = false; + } else { + String subscriberPackage = getPackageElement(typeElement).getQualifiedName().toString(); + if (myPackage == null) { + visible = subscriberPackage.length() == 0; + } else { + visible = myPackage.equals(subscriberPackage); + } + } + return visible; + } + + private void writeCreateSubscriberMethods(BufferedWriter writer, List methods, + String callPrefix, String myPackage) throws IOException { + for (ExecutableElement method : methods) { + List parameters = method.getParameters(); + TypeMirror paramType = getParamTypeMirror(parameters.get(0), null); + TypeElement paramElement = (TypeElement) processingEnv.getTypeUtils().asElement(paramType); + String methodName = method.getSimpleName().toString(); + String eventClass = getClassString(paramElement, myPackage) + ".class"; + + Subscribe subscribe = method.getAnnotation(Subscribe.class); + List parts = new ArrayList<>(); + parts.add(callPrefix + "(\"" + methodName + "\","); + String lineEnd = "),"; + if (subscribe.priority() == 0 && !subscribe.sticky()) { + if (subscribe.threadMode() == ThreadMode.POSTING) { + parts.add(eventClass + lineEnd); + } else { + parts.add(eventClass + ","); + parts.add("ThreadMode." + subscribe.threadMode().name() + lineEnd); + } + } else { + parts.add(eventClass + ","); + parts.add("ThreadMode." + subscribe.threadMode().name() + ","); + parts.add(subscribe.priority() + ","); + parts.add(subscribe.sticky() + lineEnd); + } + writeLine(writer, 3, parts.toArray(new String[parts.size()])); + + if (verbose) { + processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, "Indexed @Subscribe at " + + method.getEnclosingElement().getSimpleName() + "." + methodName + + "(" + paramElement.getSimpleName() + ")"); + } + + } + } + + private void writeIndent(BufferedWriter writer, int indentLevel) throws IOException { + for (int i = 0; i < indentLevel; i++) { + writer.write(" "); + } + } + + private void writeIndexLines(BufferedWriter writer, String myPackage) throws IOException { + for (TypeElement subscriberTypeElement : methodsByClass.keySet()) { + if (classesToSkip.contains(subscriberTypeElement)) { + continue; + } + + String subscriberClass = getClassString(subscriberTypeElement, myPackage); + if (isVisible(myPackage, subscriberTypeElement)) { + writeLine(writer, 2, + "putIndex(new SimpleSubscriberInfo(" + subscriberClass + ".class,", + "true,", "new SubscriberMethodInfo[] {"); + List methods = methodsByClass.get(subscriberTypeElement); + writeCreateSubscriberMethods(writer, methods, "new SubscriberMethodInfo", myPackage); + writer.write(" }));\n\n"); + } else { + writer.write(" // Subscriber not visible to index: " + subscriberClass + "\n"); + } + } + } + + private void writeLine(BufferedWriter writer, int indentLevel, int indentLevelIncrease, String... parts) + throws IOException { + writeIndent(writer, indentLevel); + int len = indentLevel * 4; + for (int i = 0; i < parts.length; i++) { + String part = parts[i]; + if (i != 0) { + if (len + part.length() > 118) { + writer.write("\n"); + if (indentLevel < 12) { + indentLevel += indentLevelIncrease; + } + writeIndent(writer, indentLevel); + len = indentLevel * 4; + } else { + writer.write(" "); + } + } + writer.write(part); + len += part.length(); + } + writer.write("\n"); + } + + private void writeLine(BufferedWriter writer, int indentLevel, String... parts) throws IOException { + writeLine(writer, indentLevel, 2, parts); + } +} diff --git a/annotations/src/main/java/org/appdevforall/codeonthego/annotations/inflater/ViewAdapter.kt b/annotations/src/main/java/org/appdevforall/codeonthego/annotations/inflater/ViewAdapter.kt index 6c28886b14..bc257f64c0 100644 --- a/annotations/src/main/java/org/appdevforall/codeonthego/annotations/inflater/ViewAdapter.kt +++ b/annotations/src/main/java/org/appdevforall/codeonthego/annotations/inflater/ViewAdapter.kt @@ -30,4 +30,7 @@ import kotlin.reflect.KClass */ @Target(CLASS) @Retention(AnnotationRetention.SOURCE) -annotation class ViewAdapter(val forView: KClass, val moduleNamespace: String = "android") +annotation class ViewAdapter( + val forView: KClass, + val moduleNamespace: String = "android", +) diff --git a/annotations/src/main/java/org/appdevforall/codeonthego/annotations/uidesigner/IncludeInDesigner.kt b/annotations/src/main/java/org/appdevforall/codeonthego/annotations/uidesigner/IncludeInDesigner.kt index 622308b4ec..12403f40f9 100644 --- a/annotations/src/main/java/org/appdevforall/codeonthego/annotations/uidesigner/IncludeInDesigner.kt +++ b/annotations/src/main/java/org/appdevforall/codeonthego/annotations/uidesigner/IncludeInDesigner.kt @@ -24,14 +24,15 @@ package org.appdevforall.codeonthego.annotations.uidesigner * * @author Akash Yadav */ -annotation class IncludeInDesigner(val group: Group) { +annotation class IncludeInDesigner( + val group: Group, +) { + /** The widget groups that are available in the UI Designer. */ + enum class Group { + /** Includes the Android platform widgets. */ + WIDGETS, - /** The widget groups that are available in the UI Designer. */ - enum class Group { - /** Includes the Android platform widgets. */ - WIDGETS, - - /** Includes the Android platform layouts. */ - LAYOUTS - } + /** Includes the Android platform layouts. */ + LAYOUTS, + } } diff --git a/apk-viewer-plugin/build.gradle.kts b/apk-viewer-plugin/build.gradle.kts index c0638fa81b..992686fd89 100644 --- a/apk-viewer-plugin/build.gradle.kts +++ b/apk-viewer-plugin/build.gradle.kts @@ -1,67 +1,66 @@ plugins { - id("com.android.application") version "8.8.2" - id("org.jetbrains.kotlin.android") version "2.1.21" - id("org.appdevforall.codeonthego.plugins.build") + id("com.android.application") version "8.8.2" + id("org.jetbrains.kotlin.android") version "2.1.21" + id("org.appdevforall.codeonthego.plugins.build") } pluginBuilder { - pluginName = "apk-viewer" + pluginName = "apk-viewer" } android { - namespace = "com.example.sampleplugin" - compileSdk = 34 + namespace = "com.example.sampleplugin" + compileSdk = 34 - defaultConfig { - applicationId = "com.example.sampleplugin" - minSdk = 26 - targetSdk = 34 - versionCode = 1 - versionName = "1.0.0" - } + defaultConfig { + applicationId = "com.example.sampleplugin" + minSdk = 26 + targetSdk = 34 + versionCode = 1 + versionName = "1.0.0" + } - buildTypes { - release { - isMinifyEnabled = false - proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") - } - } + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } - kotlinOptions { - jvmTarget = "17" - } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + kotlinOptions { + jvmTarget = "17" + } - - - packaging { - resources { - excludes += setOf( - "META-INF/versions/9/OSGI-INF/MANIFEST.MF", - "META-INF/DEPENDENCIES", - "META-INF/LICENSE", - "META-INF/LICENSE.txt", - "META-INF/NOTICE", - "META-INF/NOTICE.txt" - ) - } - } + packaging { + resources { + excludes += + setOf( + "META-INF/versions/9/OSGI-INF/MANIFEST.MF", + "META-INF/DEPENDENCIES", + "META-INF/LICENSE", + "META-INF/LICENSE.txt", + "META-INF/NOTICE", + "META-INF/NOTICE.txt", + ) + } + } } dependencies { - compileOnly(project(":plugin-api")) + compileOnly(project(":plugin-api")) - implementation("androidx.appcompat:appcompat:1.6.1") - implementation("com.google.android.material:material:1.10.0") - implementation("androidx.fragment:fragment-ktx:1.8.8") - implementation("org.jetbrains.kotlin:kotlin-stdlib:2.1.21") - implementation("androidx.fragment:fragment:1.8.8") + implementation("androidx.appcompat:appcompat:1.6.1") + implementation("com.google.android.material:material:1.10.0") + implementation("androidx.fragment:fragment-ktx:1.8.8") + implementation("org.jetbrains.kotlin:kotlin-stdlib:2.1.21") + implementation("androidx.fragment:fragment:1.8.8") } tasks.wrapper { - gradleVersion = "8.10.2" - distributionType = Wrapper.DistributionType.BIN + gradleVersion = "8.10.2" + distributionType = Wrapper.DistributionType.BIN } diff --git a/apk-viewer-plugin/src/main/kotlin/com/example/sampleplugin/ApkViewer.kt b/apk-viewer-plugin/src/main/kotlin/com/example/sampleplugin/ApkViewer.kt index 54a3584fb5..380a2a929d 100644 --- a/apk-viewer-plugin/src/main/kotlin/com/example/sampleplugin/ApkViewer.kt +++ b/apk-viewer-plugin/src/main/kotlin/com/example/sampleplugin/ApkViewer.kt @@ -1,209 +1,206 @@ package com.example.sampleplugin import androidx.fragment.app.Fragment +import com.example.sampleplugin.R +import com.example.sampleplugin.fragments.ApkAnalyzerFragment import org.appdevforall.codeonthego.plugins.IPlugin import org.appdevforall.codeonthego.plugins.PluginContext -import org.appdevforall.codeonthego.plugins.extensions.UIExtension import org.appdevforall.codeonthego.plugins.extensions.EditorTabExtension -import org.appdevforall.codeonthego.plugins.extensions.MenuItem -import org.appdevforall.codeonthego.plugins.extensions.TabItem import org.appdevforall.codeonthego.plugins.extensions.EditorTabItem -import org.appdevforall.codeonthego.plugins.extensions.NavigationItem import org.appdevforall.codeonthego.plugins.extensions.FileOpenExtension import org.appdevforall.codeonthego.plugins.extensions.FileTabMenuItem +import org.appdevforall.codeonthego.plugins.extensions.MenuItem +import org.appdevforall.codeonthego.plugins.extensions.NavigationItem +import org.appdevforall.codeonthego.plugins.extensions.TabItem +import org.appdevforall.codeonthego.plugins.extensions.UIExtension import org.appdevforall.codeonthego.plugins.services.IdeEditorTabService -import com.example.sampleplugin.R -import com.example.sampleplugin.fragments.ApkAnalyzerFragment import java.io.File /** * APK Viewer Plugin * Provides APK analysis functionality via main menu toolbar and bottom sheet */ -class ApkViewer : IPlugin, UIExtension, EditorTabExtension, FileOpenExtension { - - private lateinit var context: PluginContext - private var pendingAnalysisFile: File? = null - - companion object { - private const val TAB_ID = "apk_analyzer_main_tab" - } - - override fun initialize(context: PluginContext): Boolean { - return try { - this.context = context - context.logger.info("ApkViewer: Plugin initialized successfully") - true - } catch (e: Exception) { - context.logger.error("ApkViewer: Plugin initialization failed", e) - false - } - } - - override fun activate(): Boolean { - context.logger.info("ApkViewer: Activating plugin") - return true - } - - override fun deactivate(): Boolean { - context.logger.info("ApkViewer: Deactivating plugin") - return true - } - - override fun dispose() { - context.logger.info("ApkViewer: Disposing plugin") - } - - // UIExtension - Main menu toolbar item - override fun getMainMenuItems(): List { - return listOf( - MenuItem( - id = "apk_analyzer_menu", - title = "APK Analyzer", - isEnabled = true, - isVisible = true, - action = { - context.logger.info("APK Analyzer menu item clicked") - openApkAnalyzerTab() - } - ) - ) - } - - // UIExtension - Bottom sheet tab - override fun getEditorTabs(): List { - context.logger.debug("ApkViewer: getEditorTabs() called") - - return listOf( - TabItem( - id = "apk_viewer_tab", - title = "APK Analyzer", - fragmentFactory = { - context.logger.debug("ApkViewer: Creating ApkAnalyzerFragment for bottom sheet") - ApkAnalyzerFragment() - }, - isEnabled = true, - isVisible = true, - order = 100 - ) - ) - } - - // UIExtension - Sidebar navigation item - override fun getSideMenuItems(): List { - return listOf( - NavigationItem( - id = "apk_analyzer_sidebar", - title = "APK Analyzer", - icon = R.drawable.ic_apk_analyzer, - isEnabled = true, - isVisible = true, - group = "tools", - order = 0, - action = { openApkAnalyzerTab() } - ) - ) - } - - // EditorTabExtension - Main editor tab to display the analyzer - override fun getMainEditorTabs(): List { - return listOf( - - EditorTabItem( - id = TAB_ID, - title = "APK Analyzer", - icon = R.drawable.ic_apk_analyzer, - fragmentFactory = { - context.logger.debug("Creating ApkAnalyzerFragment") - ApkAnalyzerFragment() - }, - isCloseable = true, - isPersistent = false, - order = 100, - isEnabled = true, - isVisible = true, - tooltip = "Analyze APK structure and contents" - ) - ) - } - - override fun onEditorTabSelected(tabId: String, fragment: Fragment) { - context.logger.info("Editor tab selected: $tabId") - val file = pendingAnalysisFile ?: return - pendingAnalysisFile = null - if (tabId == TAB_ID && fragment is ApkAnalyzerFragment) { - fragment.analyzeFile(file) - } - } - - override fun onEditorTabClosed(tabId: String) { - context.logger.info("Editor tab closed: $tabId") - } - - override fun canCloseEditorTab(tabId: String): Boolean { - return true - } - - override fun canHandleFileOpen(file: File): Boolean { - return file.extension.equals("apk", ignoreCase = true) - } - - override fun handleFileOpen(file: File): Boolean { - pendingAnalysisFile = file - openApkAnalyzerTab() - return true - } - - override fun onFileOpened(file: File) { - if (file.extension.equals("apk", ignoreCase = true)) { - context.logger.info("APK file opened: ${file.name}") - } - } - - override fun getFileTabMenuItems(file: File): List { - if (!file.extension.equals("apk", ignoreCase = true)) return emptyList() - - return listOf( - FileTabMenuItem( - id = "apk_viewer.analyze", - title = "Analyze APK", - order = 0, - action = { - pendingAnalysisFile = file - openApkAnalyzerTab() - } - ) - ) - } - - override fun onFileClosed(file: File) { - if (file.extension.equals("apk", ignoreCase = true)) { - context.logger.info("APK file closed: ${file.name}") - } - } - - private fun openApkAnalyzerTab() { - context.logger.info("Opening APK Analyzer tab") - - val editorTabService = context.services.get(IdeEditorTabService::class.java) - if (editorTabService == null) { - context.logger.error("Editor tab service not available") - return - } - - if (!editorTabService.isTabSystemAvailable()) { - context.logger.error("Editor tab system not available") - return - } - - try { - if (editorTabService.selectPluginTab(TAB_ID)) { - context.logger.info("Successfully opened APK Analyzer tab") - } else { - context.logger.warn("Failed to open APK Analyzer tab") - } - } catch (e: Exception) { - context.logger.error("Error opening APK Analyzer tab", e) - } - } +class ApkViewer : + IPlugin, + UIExtension, + EditorTabExtension, + FileOpenExtension { + private lateinit var context: PluginContext + private var pendingAnalysisFile: File? = null + + companion object { + private const val TAB_ID = "apk_analyzer_main_tab" + } + + override fun initialize(context: PluginContext): Boolean = + try { + this.context = context + context.logger.info("ApkViewer: Plugin initialized successfully") + true + } catch (e: Exception) { + context.logger.error("ApkViewer: Plugin initialization failed", e) + false + } + + override fun activate(): Boolean { + context.logger.info("ApkViewer: Activating plugin") + return true + } + + override fun deactivate(): Boolean { + context.logger.info("ApkViewer: Deactivating plugin") + return true + } + + override fun dispose() { + context.logger.info("ApkViewer: Disposing plugin") + } + + // UIExtension - Main menu toolbar item + override fun getMainMenuItems(): List = + listOf( + MenuItem( + id = "apk_analyzer_menu", + title = "APK Analyzer", + isEnabled = true, + isVisible = true, + action = { + context.logger.info("APK Analyzer menu item clicked") + openApkAnalyzerTab() + }, + ), + ) + + // UIExtension - Bottom sheet tab + override fun getEditorTabs(): List { + context.logger.debug("ApkViewer: getEditorTabs() called") + + return listOf( + TabItem( + id = "apk_viewer_tab", + title = "APK Analyzer", + fragmentFactory = { + context.logger.debug("ApkViewer: Creating ApkAnalyzerFragment for bottom sheet") + ApkAnalyzerFragment() + }, + isEnabled = true, + isVisible = true, + order = 100, + ), + ) + } + + // UIExtension - Sidebar navigation item + override fun getSideMenuItems(): List = + listOf( + NavigationItem( + id = "apk_analyzer_sidebar", + title = "APK Analyzer", + icon = R.drawable.ic_apk_analyzer, + isEnabled = true, + isVisible = true, + group = "tools", + order = 0, + action = { openApkAnalyzerTab() }, + ), + ) + + // EditorTabExtension - Main editor tab to display the analyzer + override fun getMainEditorTabs(): List = + listOf( + EditorTabItem( + id = TAB_ID, + title = "APK Analyzer", + icon = R.drawable.ic_apk_analyzer, + fragmentFactory = { + context.logger.debug("Creating ApkAnalyzerFragment") + ApkAnalyzerFragment() + }, + isCloseable = true, + isPersistent = false, + order = 100, + isEnabled = true, + isVisible = true, + tooltip = "Analyze APK structure and contents", + ), + ) + + override fun onEditorTabSelected( + tabId: String, + fragment: Fragment, + ) { + context.logger.info("Editor tab selected: $tabId") + val file = pendingAnalysisFile ?: return + pendingAnalysisFile = null + if (tabId == TAB_ID && fragment is ApkAnalyzerFragment) { + fragment.analyzeFile(file) + } + } + + override fun onEditorTabClosed(tabId: String) { + context.logger.info("Editor tab closed: $tabId") + } + + override fun canCloseEditorTab(tabId: String): Boolean = true + + override fun canHandleFileOpen(file: File): Boolean = file.extension.equals("apk", ignoreCase = true) + + override fun handleFileOpen(file: File): Boolean { + pendingAnalysisFile = file + openApkAnalyzerTab() + return true + } + + override fun onFileOpened(file: File) { + if (file.extension.equals("apk", ignoreCase = true)) { + context.logger.info("APK file opened: ${file.name}") + } + } + + override fun getFileTabMenuItems(file: File): List { + if (!file.extension.equals("apk", ignoreCase = true)) return emptyList() + + return listOf( + FileTabMenuItem( + id = "apk_viewer.analyze", + title = "Analyze APK", + order = 0, + action = { + pendingAnalysisFile = file + openApkAnalyzerTab() + }, + ), + ) + } + + override fun onFileClosed(file: File) { + if (file.extension.equals("apk", ignoreCase = true)) { + context.logger.info("APK file closed: ${file.name}") + } + } + + private fun openApkAnalyzerTab() { + context.logger.info("Opening APK Analyzer tab") + + val editorTabService = context.services.get(IdeEditorTabService::class.java) + if (editorTabService == null) { + context.logger.error("Editor tab service not available") + return + } + + if (!editorTabService.isTabSystemAvailable()) { + context.logger.error("Editor tab system not available") + return + } + + try { + if (editorTabService.selectPluginTab(TAB_ID)) { + context.logger.info("Successfully opened APK Analyzer tab") + } else { + context.logger.warn("Failed to open APK Analyzer tab") + } + } catch (e: Exception) { + context.logger.error("Error opening APK Analyzer tab", e) + } + } } diff --git a/apk-viewer-plugin/src/main/kotlin/com/example/sampleplugin/fragments/ApkAnalyzerFragment.kt b/apk-viewer-plugin/src/main/kotlin/com/example/sampleplugin/fragments/ApkAnalyzerFragment.kt index c5b9a633f7..bed3e6b263 100644 --- a/apk-viewer-plugin/src/main/kotlin/com/example/sampleplugin/fragments/ApkAnalyzerFragment.kt +++ b/apk-viewer-plugin/src/main/kotlin/com/example/sampleplugin/fragments/ApkAnalyzerFragment.kt @@ -28,315 +28,315 @@ import org.appdevforall.codeonthego.plugins.base.PluginFragmentHelper import kotlinx.coroutines.launch data class TableSection( - val title: String, - val headers: List, - val rows: List>, - val showAllAction: String? = null + val title: String, + val headers: List, + val rows: List>, + val showAllAction: String? = null ) class ApkAnalyzerFragment : Fragment() { - companion object { - private const val PLUGIN_ID = "com.example.apkviewer" - private const val MAX_LARGE_FILES_DISPLAYED = 10 - private const val FALLBACK_SURFACE = 0xFFFFFBFE.toInt() - private const val FALLBACK_SURFACE_VARIANT = 0xFFE7E0EC.toInt() - } - - private val viewModel by viewModels() - private var showAllLargeFiles = false - private var pendingAnalysisFile: java.io.File? = null - - private var statusText: TextView? = null - private var btnStart: Button? = null - private var progressBar: ProgressBar? = null - private var resultsContainer: LinearLayout? = null - - private val pickApkLauncher = registerForActivityResult( - ActivityResultContracts.StartActivityForResult() - ) { result -> - if (result.resultCode == Activity.RESULT_OK) { - result.data?.data?.let { viewModel.analyzeApk(it, requireContext().applicationContext) } - } - } - - override fun onGetLayoutInflater(savedInstanceState: Bundle?): LayoutInflater { - val inflater = super.onGetLayoutInflater(savedInstanceState) - return PluginFragmentHelper.getPluginInflater(PLUGIN_ID, inflater) - } - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - runCatching { - PluginFragmentHelper.getServiceRegistry(PLUGIN_ID) - } - } - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View? { - return inflater.inflate(R.layout.fragment_sample, container, false) - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - statusText = view.findViewById(R.id.tv_context) - btnStart = view.findViewById(R.id.btnStart) - progressBar = view.findViewById(R.id.progressBar) - resultsContainer = view.findViewById(R.id.resultsContainer) - - btnStart?.setOnClickListener { openFilePicker() } - - viewLifecycleOwner.lifecycleScope.launch { - viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { - viewModel.uiState.collect { state -> renderState(state) } - } - } - - val file = pendingAnalysisFile ?: viewModel.pendingFile - if (file != null) { - pendingAnalysisFile = null - viewModel.pendingFile = null - viewModel.analyzeApk(file) - } - } - - private fun renderState(state: ApkAnalyzerViewModel.UiState) { - resultsContainer?.removeAllViews() - when (state) { - is ApkAnalyzerViewModel.UiState.Idle -> { - progressBar?.visibility = View.GONE - statusText?.visibility = View.GONE - btnStart?.isEnabled = true - } - is ApkAnalyzerViewModel.UiState.Analyzing -> { - showAllLargeFiles = false - progressBar?.visibility = View.VISIBLE - statusText?.visibility = View.VISIBLE - statusText?.text = getString(R.string.analyzing_apk) - btnStart?.isEnabled = false - } - is ApkAnalyzerViewModel.UiState.Success -> { - progressBar?.visibility = View.GONE - statusText?.visibility = View.GONE - btnStart?.isEnabled = true - renderSections(mapToSections(state.data)) - } - is ApkAnalyzerViewModel.UiState.Error -> { - progressBar?.visibility = View.GONE - statusText?.visibility = View.VISIBLE - statusText?.text = getString(R.string.analysis_failed, state.message) - btnStart?.isEnabled = true - } - } - } - - private fun openFilePicker() { - val intent = Intent(Intent.ACTION_OPEN_DOCUMENT).apply { - addCategory(Intent.CATEGORY_OPENABLE) - type = "application/vnd.android.package-archive" - } - pickApkLauncher.launch(intent) - } - - fun analyzeFile(file: java.io.File) { - if (!isAdded || view == null) { - pendingAnalysisFile = file - return - } - viewModel.analyzeApk(file) - } - - private fun formatRatio(compressed: Long, raw: Long): String { - return if (raw > 0) { - String.format("%.1f%%", (compressed.toDouble() / raw.toDouble()) * 100) - } else getString(R.string.value_na) - } - - private fun mapToSections(data: ApkParseResult): List { - val sections = mutableListOf() - - sections.add(TableSection( - title = getString(R.string.section_apk_structure), - headers = listOf(getString(R.string.header_property), getString(R.string.header_value)), - rows = listOf( - listOf(getString(R.string.label_apk_file_size), formatFileSize(data.apkSize)), - listOf(getString(R.string.label_total_entries), "${data.totalEntries}"), - listOf(getString(R.string.label_uncompressed_size), formatFileSize(data.totalUncompressed)), - listOf(getString(R.string.label_compressed_size), formatFileSize(data.totalCompressed)), - listOf(getString(R.string.label_compression_ratio), formatRatio(data.totalCompressed, data.totalUncompressed)), - listOf(getString(R.string.label_directories), "${data.directoryCount}"), - listOf(getString(R.string.label_files), "${data.fileCount}") - ) - )) - - val keyFileRows = data.keyFiles.map { kf -> - if (kf.exists) { - listOf(kf.name, "\u2713", formatFileSize(kf.rawSize), formatFileSize(kf.compressedSize), formatRatio(kf.compressedSize, kf.rawSize)) - } else { - listOf(kf.name, "\u2717", "\u2014", "\u2014", "\u2014") - } - } - sections.add(TableSection( - title = getString(R.string.section_key_files), - headers = listOf(getString(R.string.header_file), "", getString(R.string.header_raw), getString(R.string.header_compressed), getString(R.string.header_ratio)), - rows = keyFileRows - )) - - if (data.nativeLibArchitectures.isNotEmpty()) { - val totalNativeLibs = data.nativeLibArchitectures.values.sumOf { it.size } - val nativeRows = mutableListOf>() - data.nativeLibArchitectures.forEach { (arch, libs) -> - val archRaw = libs.sumOf { it.rawSize } - val archCompressed = libs.sumOf { it.compressedSize } - nativeRows.add(listOf( - "\u25B8 $arch", - "${libs.size}", - formatFileSize(archRaw), - formatFileSize(archCompressed) - )) - libs.sortedByDescending { it.rawSize }.take(3).forEach { lib -> - nativeRows.add(listOf( - " ${lib.name}", - "", - formatFileSize(lib.rawSize), - formatFileSize(lib.compressedSize) - )) - } - if (libs.size > 3) { - nativeRows.add(listOf(" +${libs.size - 3} more", "", "", "")) - } - } - sections.add(TableSection( - title = getString(R.string.section_native_libraries, totalNativeLibs), - headers = listOf(getString(R.string.header_name), getString(R.string.header_count), getString(R.string.header_raw), getString(R.string.header_compressed)), - rows = nativeRows - )) - } - - if (data.resourceDirs.isNotEmpty()) { - val resDirRows = data.resourceDirs.map { dir -> - if (dir.rawSize > 0) { - listOf(dir.path, "${dir.fileCount}", formatFileSize(dir.rawSize), formatFileSize(dir.compressedSize)) - } else { - listOf(dir.path, "0", "\u2014", "\u2014") - } - } - sections.add(TableSection( - title = getString(R.string.section_resource_directories, data.resourceDirs.size), - headers = listOf(getString(R.string.header_directory), getString(R.string.header_files), getString(R.string.header_raw), getString(R.string.header_compressed)), - rows = resDirRows - )) - } - - if (data.largeFiles.isNotEmpty()) { - val displayedFiles = if (showAllLargeFiles) data.largeFiles else data.largeFiles.take(MAX_LARGE_FILES_DISPLAYED) - val largeFileRows = displayedFiles.map { lf -> - listOf(lf.name, formatFileSize(lf.rawSize), formatFileSize(lf.compressedSize), formatRatio(lf.compressedSize, lf.rawSize)) - } - sections.add(TableSection( - title = getString(R.string.section_large_files), - headers = listOf(getString(R.string.header_file), getString(R.string.header_raw), getString(R.string.header_compressed), getString(R.string.header_ratio)), - rows = largeFileRows, - showAllAction = if (!showAllLargeFiles && data.largeFiles.size > MAX_LARGE_FILES_DISPLAYED) { - getString(R.string.action_show_all, data.largeFiles.size) - } else null - )) - } - - val sigText = if (data.hasV1Signature) getString(R.string.value_v1_signing) else getString(R.string.value_v2_or_unsigned) - sections.add(TableSection( - title = getString(R.string.section_apk_metadata), - headers = listOf(getString(R.string.header_property), getString(R.string.header_value)), - rows = listOf( - listOf(getString(R.string.label_signature_scheme), sigText), - listOf(getString(R.string.label_multi_dex), if (data.hasMultiDex) getString(R.string.value_yes) else getString(R.string.value_no)), - listOf(getString(R.string.label_code_obfuscation), if (data.hasProguard) getString(R.string.value_detected) else getString(R.string.value_none_detected)) - ) - )) - - return sections - } - - private fun renderSections(sections: List) { - val container = resultsContainer ?: return - val inflater = layoutInflater - val ctx = requireContext() - - val surfaceColor = MaterialColors.getColor(ctx, com.google.android.material.R.attr.colorSurface, FALLBACK_SURFACE) - val surfaceVariantColor = MaterialColors.getColor(ctx, com.google.android.material.R.attr.colorSurfaceVariant, FALLBACK_SURFACE_VARIANT) - val altRowColor = ColorUtils.blendARGB(surfaceColor, surfaceVariantColor, 0.4f) - - sections.forEach { section -> - val cardView = inflater.inflate(R.layout.item_section_card, container, false) - val cardCtx = cardView.context - - cardView.findViewById(R.id.sectionTitle).text = section.title - val table = cardView.findViewById(R.id.sectionTable) - - if (section.headers.isNotEmpty()) { - val headerRow = TableRow(cardCtx).apply { - setBackgroundColor(surfaceVariantColor) - } - section.headers.forEach { header -> - headerRow.addView( - TextView(cardCtx, null, 0, R.style.TableHeaderCell).apply { - text = header - } - ) - } - table.addView(headerRow) - } - - section.rows.forEachIndexed { index, row -> - val dataRow = TableRow(cardCtx).apply { - if (index % 2 == 1) setBackgroundColor(altRowColor) - } - row.forEachIndexed { colIndex, cellText -> - dataRow.addView( - TextView(cardCtx, null, 0, R.style.TableDataCell).apply { - text = cellText - if (colIndex > 0 && section.headers.size > 2) { - gravity = Gravity.END - } - } - ) - } - table.addView(dataRow) - } - - if (section.showAllAction != null) { - val actionText = TextView(cardCtx).apply { - text = section.showAllAction - setPadding(16, 12, 16, 12) - setTextColor(MaterialColors.getColor(cardCtx, com.google.android.material.R.attr.colorPrimary, 0)) - isClickable = true - isFocusable = true - setOnClickListener { - showAllLargeFiles = true - val currentState = viewModel.uiState.value - if (currentState is ApkAnalyzerViewModel.UiState.Success) { - renderState(currentState) - } - } - } - (cardView as ViewGroup).addView(actionText) - } - - container.addView(cardView) - } - } - - private fun formatFileSize(bytes: Long): String { - val units = arrayOf("B", "KB", "MB", "GB") - var size = bytes.toDouble() - var unitIndex = 0 - while (size >= 1024 && unitIndex < units.size - 1) { - size /= 1024 - unitIndex++ - } - return String.format("%.2f %s", size, units[unitIndex]) - } + companion object { + private const val PLUGIN_ID = "com.example.apkviewer" + private const val MAX_LARGE_FILES_DISPLAYED = 10 + private const val FALLBACK_SURFACE = 0xFFFFFBFE.toInt() + private const val FALLBACK_SURFACE_VARIANT = 0xFFE7E0EC.toInt() + } + + private val viewModel by viewModels() + private var showAllLargeFiles = false + private var pendingAnalysisFile: java.io.File? = null + + private var statusText: TextView? = null + private var btnStart: Button? = null + private var progressBar: ProgressBar? = null + private var resultsContainer: LinearLayout? = null + + private val pickApkLauncher = registerForActivityResult( + ActivityResultContracts.StartActivityForResult() + ) { result -> + if (result.resultCode == Activity.RESULT_OK) { + result.data?.data?.let { viewModel.analyzeApk(it, requireContext().applicationContext) } + } + } + + override fun onGetLayoutInflater(savedInstanceState: Bundle?): LayoutInflater { + val inflater = super.onGetLayoutInflater(savedInstanceState) + return PluginFragmentHelper.getPluginInflater(PLUGIN_ID, inflater) + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + runCatching { + PluginFragmentHelper.getServiceRegistry(PLUGIN_ID) + } + } + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + return inflater.inflate(R.layout.fragment_sample, container, false) + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + statusText = view.findViewById(R.id.tv_context) + btnStart = view.findViewById(R.id.btnStart) + progressBar = view.findViewById(R.id.progressBar) + resultsContainer = view.findViewById(R.id.resultsContainer) + + btnStart?.setOnClickListener { openFilePicker() } + + viewLifecycleOwner.lifecycleScope.launch { + viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { + viewModel.uiState.collect { state -> renderState(state) } + } + } + + val file = pendingAnalysisFile ?: viewModel.pendingFile + if (file != null) { + pendingAnalysisFile = null + viewModel.pendingFile = null + viewModel.analyzeApk(file) + } + } + + private fun renderState(state: ApkAnalyzerViewModel.UiState) { + resultsContainer?.removeAllViews() + when (state) { + is ApkAnalyzerViewModel.UiState.Idle -> { + progressBar?.visibility = View.GONE + statusText?.visibility = View.GONE + btnStart?.isEnabled = true + } + is ApkAnalyzerViewModel.UiState.Analyzing -> { + showAllLargeFiles = false + progressBar?.visibility = View.VISIBLE + statusText?.visibility = View.VISIBLE + statusText?.text = getString(R.string.analyzing_apk) + btnStart?.isEnabled = false + } + is ApkAnalyzerViewModel.UiState.Success -> { + progressBar?.visibility = View.GONE + statusText?.visibility = View.GONE + btnStart?.isEnabled = true + renderSections(mapToSections(state.data)) + } + is ApkAnalyzerViewModel.UiState.Error -> { + progressBar?.visibility = View.GONE + statusText?.visibility = View.VISIBLE + statusText?.text = getString(R.string.analysis_failed, state.message) + btnStart?.isEnabled = true + } + } + } + + private fun openFilePicker() { + val intent = Intent(Intent.ACTION_OPEN_DOCUMENT).apply { + addCategory(Intent.CATEGORY_OPENABLE) + type = "application/vnd.android.package-archive" + } + pickApkLauncher.launch(intent) + } + + fun analyzeFile(file: java.io.File) { + if (!isAdded || view == null) { + pendingAnalysisFile = file + return + } + viewModel.analyzeApk(file) + } + + private fun formatRatio(compressed: Long, raw: Long): String { + return if (raw > 0) { + String.format("%.1f%%", (compressed.toDouble() / raw.toDouble()) * 100) + } else getString(R.string.value_na) + } + + private fun mapToSections(data: ApkParseResult): List { + val sections = mutableListOf() + + sections.add(TableSection( + title = getString(R.string.section_apk_structure), + headers = listOf(getString(R.string.header_property), getString(R.string.header_value)), + rows = listOf( + listOf(getString(R.string.label_apk_file_size), formatFileSize(data.apkSize)), + listOf(getString(R.string.label_total_entries), "${data.totalEntries}"), + listOf(getString(R.string.label_uncompressed_size), formatFileSize(data.totalUncompressed)), + listOf(getString(R.string.label_compressed_size), formatFileSize(data.totalCompressed)), + listOf(getString(R.string.label_compression_ratio), formatRatio(data.totalCompressed, data.totalUncompressed)), + listOf(getString(R.string.label_directories), "${data.directoryCount}"), + listOf(getString(R.string.label_files), "${data.fileCount}") + ) + )) + + val keyFileRows = data.keyFiles.map { kf -> + if (kf.exists) { + listOf(kf.name, "\u2713", formatFileSize(kf.rawSize), formatFileSize(kf.compressedSize), formatRatio(kf.compressedSize, kf.rawSize)) + } else { + listOf(kf.name, "\u2717", "\u2014", "\u2014", "\u2014") + } + } + sections.add(TableSection( + title = getString(R.string.section_key_files), + headers = listOf(getString(R.string.header_file), "", getString(R.string.header_raw), getString(R.string.header_compressed), getString(R.string.header_ratio)), + rows = keyFileRows + )) + + if (data.nativeLibArchitectures.isNotEmpty()) { + val totalNativeLibs = data.nativeLibArchitectures.values.sumOf { it.size } + val nativeRows = mutableListOf>() + data.nativeLibArchitectures.forEach { (arch, libs) -> + val archRaw = libs.sumOf { it.rawSize } + val archCompressed = libs.sumOf { it.compressedSize } + nativeRows.add(listOf( + "\u25B8 $arch", + "${libs.size}", + formatFileSize(archRaw), + formatFileSize(archCompressed) + )) + libs.sortedByDescending { it.rawSize }.take(3).forEach { lib -> + nativeRows.add(listOf( + " ${lib.name}", + "", + formatFileSize(lib.rawSize), + formatFileSize(lib.compressedSize) + )) + } + if (libs.size > 3) { + nativeRows.add(listOf(" +${libs.size - 3} more", "", "", "")) + } + } + sections.add(TableSection( + title = getString(R.string.section_native_libraries, totalNativeLibs), + headers = listOf(getString(R.string.header_name), getString(R.string.header_count), getString(R.string.header_raw), getString(R.string.header_compressed)), + rows = nativeRows + )) + } + + if (data.resourceDirs.isNotEmpty()) { + val resDirRows = data.resourceDirs.map { dir -> + if (dir.rawSize > 0) { + listOf(dir.path, "${dir.fileCount}", formatFileSize(dir.rawSize), formatFileSize(dir.compressedSize)) + } else { + listOf(dir.path, "0", "\u2014", "\u2014") + } + } + sections.add(TableSection( + title = getString(R.string.section_resource_directories, data.resourceDirs.size), + headers = listOf(getString(R.string.header_directory), getString(R.string.header_files), getString(R.string.header_raw), getString(R.string.header_compressed)), + rows = resDirRows + )) + } + + if (data.largeFiles.isNotEmpty()) { + val displayedFiles = if (showAllLargeFiles) data.largeFiles else data.largeFiles.take(MAX_LARGE_FILES_DISPLAYED) + val largeFileRows = displayedFiles.map { lf -> + listOf(lf.name, formatFileSize(lf.rawSize), formatFileSize(lf.compressedSize), formatRatio(lf.compressedSize, lf.rawSize)) + } + sections.add(TableSection( + title = getString(R.string.section_large_files), + headers = listOf(getString(R.string.header_file), getString(R.string.header_raw), getString(R.string.header_compressed), getString(R.string.header_ratio)), + rows = largeFileRows, + showAllAction = if (!showAllLargeFiles && data.largeFiles.size > MAX_LARGE_FILES_DISPLAYED) { + getString(R.string.action_show_all, data.largeFiles.size) + } else null + )) + } + + val sigText = if (data.hasV1Signature) getString(R.string.value_v1_signing) else getString(R.string.value_v2_or_unsigned) + sections.add(TableSection( + title = getString(R.string.section_apk_metadata), + headers = listOf(getString(R.string.header_property), getString(R.string.header_value)), + rows = listOf( + listOf(getString(R.string.label_signature_scheme), sigText), + listOf(getString(R.string.label_multi_dex), if (data.hasMultiDex) getString(R.string.value_yes) else getString(R.string.value_no)), + listOf(getString(R.string.label_code_obfuscation), if (data.hasProguard) getString(R.string.value_detected) else getString(R.string.value_none_detected)) + ) + )) + + return sections + } + + private fun renderSections(sections: List) { + val container = resultsContainer ?: return + val inflater = layoutInflater + val ctx = requireContext() + + val surfaceColor = MaterialColors.getColor(ctx, com.google.android.material.R.attr.colorSurface, FALLBACK_SURFACE) + val surfaceVariantColor = MaterialColors.getColor(ctx, com.google.android.material.R.attr.colorSurfaceVariant, FALLBACK_SURFACE_VARIANT) + val altRowColor = ColorUtils.blendARGB(surfaceColor, surfaceVariantColor, 0.4f) + + sections.forEach { section -> + val cardView = inflater.inflate(R.layout.item_section_card, container, false) + val cardCtx = cardView.context + + cardView.findViewById(R.id.sectionTitle).text = section.title + val table = cardView.findViewById(R.id.sectionTable) + + if (section.headers.isNotEmpty()) { + val headerRow = TableRow(cardCtx).apply { + setBackgroundColor(surfaceVariantColor) + } + section.headers.forEach { header -> + headerRow.addView( + TextView(cardCtx, null, 0, R.style.TableHeaderCell).apply { + text = header + } + ) + } + table.addView(headerRow) + } + + section.rows.forEachIndexed { index, row -> + val dataRow = TableRow(cardCtx).apply { + if (index % 2 == 1) setBackgroundColor(altRowColor) + } + row.forEachIndexed { colIndex, cellText -> + dataRow.addView( + TextView(cardCtx, null, 0, R.style.TableDataCell).apply { + text = cellText + if (colIndex > 0 && section.headers.size > 2) { + gravity = Gravity.END + } + } + ) + } + table.addView(dataRow) + } + + if (section.showAllAction != null) { + val actionText = TextView(cardCtx).apply { + text = section.showAllAction + setPadding(16, 12, 16, 12) + setTextColor(MaterialColors.getColor(cardCtx, com.google.android.material.R.attr.colorPrimary, 0)) + isClickable = true + isFocusable = true + setOnClickListener { + showAllLargeFiles = true + val currentState = viewModel.uiState.value + if (currentState is ApkAnalyzerViewModel.UiState.Success) { + renderState(currentState) + } + } + } + (cardView as ViewGroup).addView(actionText) + } + + container.addView(cardView) + } + } + + private fun formatFileSize(bytes: Long): String { + val units = arrayOf("B", "KB", "MB", "GB") + var size = bytes.toDouble() + var unitIndex = 0 + while (size >= 1024 && unitIndex < units.size - 1) { + size /= 1024 + unitIndex++ + } + return String.format("%.2f %s", size, units[unitIndex]) + } } diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/AutomationEndToEndTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/AutomationEndToEndTest.kt index 4156bcae12..bc5354541e 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/AutomationEndToEndTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/AutomationEndToEndTest.kt @@ -1,11 +1,11 @@ package org.appdevforall.codeonthego - -import com.itsaky.androidide.R import androidx.test.core.app.ActivityScenario import androidx.test.espresso.matcher.ViewMatchers.isNotEnabled import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry +import com.itsaky.androidide.R +import com.kaspersky.kaspresso.testcases.api.testcase.TestCase import org.appdevforall.codeonthego.activities.SplashActivity import org.appdevforall.codeonthego.helper.advancePastWelcomeScreen import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText @@ -23,7 +23,6 @@ import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.clickCreatePro import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.selectKotlinLanguage import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.setProjectName import org.appdevforall.codeonthego.utils.PermissionsHelper -import com.kaspersky.kaspresso.testcases.api.testcase.TestCase import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue import org.junit.Test diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/AutomationTestSuite.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/AutomationTestSuite.kt index eb9b20ccd8..fe304d4b3f 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/AutomationTestSuite.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/AutomationTestSuite.kt @@ -5,8 +5,8 @@ import org.junit.runners.Suite @RunWith(Suite::class) @Suite.SuiteClasses( - CleanupTest::class, - AutomationEndToEndTest::class, - ExportCacheDirectoryTest::class, + CleanupTest::class, + AutomationEndToEndTest::class, + ExportCacheDirectoryTest::class, ) class AutomationTestSuite diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/CleanupTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/CleanupTest.kt index bee1785b22..fd5f488657 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/CleanupTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/CleanupTest.kt @@ -12,23 +12,22 @@ import java.io.IOException @RunWith(AndroidJUnit4::class) class CleanupTest { + @Test + fun performCleanup() { + try { + val command = "rm -rf /sdcard/CodeOnTheGoProjects" + executeShellCommand(command) + println("Cleanup executed successfully!") + } catch (e: IOException) { + println("Failed to execute cleanup: ${e.message}") + // Don't fail the test - cleanup is best effort + } + } - @Test - fun performCleanup() { - try { - val command = "rm -rf /sdcard/CodeOnTheGoProjects" - executeShellCommand(command) - println("Cleanup executed successfully!") - } catch (e: IOException) { - println("Failed to execute cleanup: ${e.message}") - // Don't fail the test - cleanup is best effort - } - } - - private fun executeShellCommand(command: String): String { - val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation() - val pfd: ParcelFileDescriptor = instrumentation.uiAutomation.executeShellCommand(command) - val fileInputStream = FileInputStream(pfd.fileDescriptor) - return fileInputStream.bufferedReader().use { it.readText() } - } -} \ No newline at end of file + private fun executeShellCommand(command: String): String { + val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation() + val pfd: ParcelFileDescriptor = instrumentation.uiAutomation.executeShellCommand(command) + val fileInputStream = FileInputStream(pfd.fileDescriptor) + return fileInputStream.bufferedReader().use { it.readText() } + } +} diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/EndToEndTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/EndToEndTest.kt index 84dfff57bd..ff0a0ab730 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/EndToEndTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/EndToEndTest.kt @@ -1,11 +1,11 @@ package org.appdevforall.codeonthego - -import com.itsaky.androidide.R import androidx.test.core.app.ActivityScenario import androidx.test.espresso.matcher.ViewMatchers.isNotEnabled import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry +import com.itsaky.androidide.R +import com.kaspersky.kaspresso.testcases.api.testcase.TestCase import org.appdevforall.codeonthego.activities.SplashActivity import org.appdevforall.codeonthego.helper.advancePastWelcomeScreen import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText @@ -22,7 +22,6 @@ import org.appdevforall.codeonthego.screens.PermissionScreen import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.clickCreateProjectProjectSettings import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.setProjectName import org.appdevforall.codeonthego.utils.PermissionsHelper -import com.kaspersky.kaspresso.testcases.api.testcase.TestCase import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue import org.junit.Test diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/ExportCacheDirectoryTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/ExportCacheDirectoryTest.kt index 4bd8ffedf1..9bed93ca2a 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/ExportCacheDirectoryTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/ExportCacheDirectoryTest.kt @@ -3,96 +3,98 @@ package org.appdevforall.codeonthego import android.os.Environment import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry -import org.junit.Assume.assumeTrue import org.junit.Assert.assertTrue +import org.junit.Assume.assumeTrue import org.junit.Test import org.junit.runner.RunWith import java.io.File @RunWith(AndroidJUnit4::class) class ExportCacheDirectoryTest { - - @Test - fun exportGradleModuleCacheBeforeConnectedTestCleanup() { - val context = InstrumentationRegistry.getInstrumentation().targetContext - val args = InstrumentationRegistry.getArguments() - - val destinationRelativePath = - args.getString(ARG_DESTINATION_RELATIVE_PATH) ?: DEFAULT_DESTINATION_RELATIVE_PATH - - val source = File(context.filesDir, SOURCE_RELATIVE_PATH) - val externalBase = File(Environment.getExternalStorageDirectory(), EXPORT_BASE_DIRECTORY).canonicalFile - val destination = resolveSafeDestination(externalBase, destinationRelativePath) - - assumeTrue("Source does not exist: ${source.absolutePath}", source.exists()) - assumeTrue("Source is not a directory: ${source.absolutePath}", source.isDirectory) - - destination.deleteRecursively() - destination.parentFile?.mkdirs() - - assertTrue( - "Failed to copy ${source.absolutePath} to ${destination.absolutePath}", - source.copyRecursively(target = destination, overwrite = true), - ) - assertTrue("Destination does not exist: ${destination.absolutePath}", destination.exists()) - } - - @Test - fun exportGeneratedGradleApiJarWhenRequested() { - val context = InstrumentationRegistry.getInstrumentation().targetContext - val args = InstrumentationRegistry.getArguments() - val version = args.getString(ARG_GRADLE_API_VERSION) - - assumeTrue("No Gradle API version requested", !version.isNullOrBlank()) - require(!version!!.contains(File.separatorChar)) { - "Gradle API version must not contain path separators: $version" - } - - val destinationRelativePath = - args.getString(ARG_GRADLE_API_DESTINATION_RELATIVE_PATH) - ?: DEFAULT_GRADLE_API_DESTINATION_RELATIVE_PATH - - val source = - File( - context.filesDir, - "$GRADLE_CACHE_RELATIVE_PATH/$version/generated-gradle-jars/gradle-api-$version.jar", - ) - val externalBase = File(Environment.getExternalStorageDirectory(), EXPORT_BASE_DIRECTORY).canonicalFile - val destinationDir = resolveSafeDestination(externalBase, destinationRelativePath) - val destination = File(destinationDir, source.name) - - assertTrue("Source does not exist: ${source.absolutePath}", source.exists()) - assertTrue("Source is not a file: ${source.absolutePath}", source.isFile) - - destination.parentFile?.mkdirs() - source.copyTo(target = destination, overwrite = true) - - assertTrue("Destination does not exist: ${destination.absolutePath}", destination.exists()) - } - - private fun resolveSafeDestination(base: File, relativePath: String): File { - require(relativePath.isNotBlank()) { - "Destination path must be a non-blank relative path" - } - require(!File(relativePath).isAbsolute) { - "Destination path must be relative" - } - - val destination = File(base, relativePath.removePrefix("$EXPORT_BASE_DIRECTORY/")).canonicalFile - require(destination.toPath().startsWith(base.toPath())) { - "Destination must stay under ${base.absolutePath}: ${destination.absolutePath}" - } - return destination - } - - private companion object { - const val SOURCE_RELATIVE_PATH = "home/.gradle/caches/modules-2/files-2.1" - const val GRADLE_CACHE_RELATIVE_PATH = "home/.gradle/caches" - const val ARG_DESTINATION_RELATIVE_PATH = "androidide.exportCache.destination" - const val ARG_GRADLE_API_VERSION = "androidide.exportGradleApi.version" - const val ARG_GRADLE_API_DESTINATION_RELATIVE_PATH = "androidide.exportGradleApi.destination" - const val EXPORT_BASE_DIRECTORY = "CodeOnTheGoProjects" - const val DEFAULT_DESTINATION_RELATIVE_PATH = "CodeOnTheGoProjects/gradle-cache/modules-2/files-2.1" - const val DEFAULT_GRADLE_API_DESTINATION_RELATIVE_PATH = "CodeOnTheGoProjects/gradle-api" - } + @Test + fun exportGradleModuleCacheBeforeConnectedTestCleanup() { + val context = InstrumentationRegistry.getInstrumentation().targetContext + val args = InstrumentationRegistry.getArguments() + + val destinationRelativePath = + args.getString(ARG_DESTINATION_RELATIVE_PATH) ?: DEFAULT_DESTINATION_RELATIVE_PATH + + val source = File(context.filesDir, SOURCE_RELATIVE_PATH) + val externalBase = File(Environment.getExternalStorageDirectory(), EXPORT_BASE_DIRECTORY).canonicalFile + val destination = resolveSafeDestination(externalBase, destinationRelativePath) + + assumeTrue("Source does not exist: ${source.absolutePath}", source.exists()) + assumeTrue("Source is not a directory: ${source.absolutePath}", source.isDirectory) + + destination.deleteRecursively() + destination.parentFile?.mkdirs() + + assertTrue( + "Failed to copy ${source.absolutePath} to ${destination.absolutePath}", + source.copyRecursively(target = destination, overwrite = true), + ) + assertTrue("Destination does not exist: ${destination.absolutePath}", destination.exists()) + } + + @Test + fun exportGeneratedGradleApiJarWhenRequested() { + val context = InstrumentationRegistry.getInstrumentation().targetContext + val args = InstrumentationRegistry.getArguments() + val version = args.getString(ARG_GRADLE_API_VERSION) + + assumeTrue("No Gradle API version requested", !version.isNullOrBlank()) + require(!version!!.contains(File.separatorChar)) { + "Gradle API version must not contain path separators: $version" + } + + val destinationRelativePath = + args.getString(ARG_GRADLE_API_DESTINATION_RELATIVE_PATH) + ?: DEFAULT_GRADLE_API_DESTINATION_RELATIVE_PATH + + val source = + File( + context.filesDir, + "$GRADLE_CACHE_RELATIVE_PATH/$version/generated-gradle-jars/gradle-api-$version.jar", + ) + val externalBase = File(Environment.getExternalStorageDirectory(), EXPORT_BASE_DIRECTORY).canonicalFile + val destinationDir = resolveSafeDestination(externalBase, destinationRelativePath) + val destination = File(destinationDir, source.name) + + assertTrue("Source does not exist: ${source.absolutePath}", source.exists()) + assertTrue("Source is not a file: ${source.absolutePath}", source.isFile) + + destination.parentFile?.mkdirs() + source.copyTo(target = destination, overwrite = true) + + assertTrue("Destination does not exist: ${destination.absolutePath}", destination.exists()) + } + + private fun resolveSafeDestination( + base: File, + relativePath: String, + ): File { + require(relativePath.isNotBlank()) { + "Destination path must be a non-blank relative path" + } + require(!File(relativePath).isAbsolute) { + "Destination path must be relative" + } + + val destination = File(base, relativePath.removePrefix("$EXPORT_BASE_DIRECTORY/")).canonicalFile + require(destination.toPath().startsWith(base.toPath())) { + "Destination must stay under ${base.absolutePath}: ${destination.absolutePath}" + } + return destination + } + + private companion object { + const val SOURCE_RELATIVE_PATH = "home/.gradle/caches/modules-2/files-2.1" + const val GRADLE_CACHE_RELATIVE_PATH = "home/.gradle/caches" + const val ARG_DESTINATION_RELATIVE_PATH = "androidide.exportCache.destination" + const val ARG_GRADLE_API_VERSION = "androidide.exportGradleApi.version" + const val ARG_GRADLE_API_DESTINATION_RELATIVE_PATH = "androidide.exportGradleApi.destination" + const val EXPORT_BASE_DIRECTORY = "CodeOnTheGoProjects" + const val DEFAULT_DESTINATION_RELATIVE_PATH = "CodeOnTheGoProjects/gradle-cache/modules-2/files-2.1" + const val DEFAULT_GRADLE_API_DESTINATION_RELATIVE_PATH = "CodeOnTheGoProjects/gradle-api" + } } diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/ProjectBuildTestWithGroovyGradle.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/ProjectBuildTestWithGroovyGradle.kt index ad0be533e1..801aa8e753 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/ProjectBuildTestWithGroovyGradle.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/ProjectBuildTestWithGroovyGradle.kt @@ -1,8 +1,8 @@ package org.appdevforall.codeonthego - -import com.itsaky.androidide.R import androidx.test.platform.app.InstrumentationRegistry +import com.itsaky.androidide.R +import com.kaspersky.kaspresso.testcases.api.testcase.TestCase import org.appdevforall.codeonthego.helper.initializeProjectAndCancelBuild import org.appdevforall.codeonthego.helper.navigateToMainScreen import org.appdevforall.codeonthego.helper.selectProjectTemplate @@ -11,201 +11,198 @@ import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.clickCreatePro import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.selectJavaLanguage import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.selectKotlinLanguage import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.uncheckKotlinScript -import com.kaspersky.kaspresso.testcases.api.testcase.TestCase import org.junit.Test - class ProjectBuildTestWithGroovyGradle : TestCase() { - - @Test - fun test_projectBuild_emptyProject_java_groovyGradle() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the empty project", - R.string.template_empty - ) - selectJavaLanguage() - uncheckKotlinScript() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_emptyProject_kotlin_groovyGradle() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the empty project", - R.string.template_empty - ) - selectKotlinLanguage() - uncheckKotlinScript() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_baseProject_java_groovyGradle() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the basic project", - R.string.template_basic - ) - selectJavaLanguage() - uncheckKotlinScript() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_baseProject_kotlin_groovyGradle() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the basic project", - R.string.template_basic - ) - selectKotlinLanguage() - uncheckKotlinScript() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_navigationDrawerProject_java_groovyGradle() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the navigation drawer project", - R.string.template_navigation_drawer - ) - selectJavaLanguage() - uncheckKotlinScript() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_navigationDrawerProject_kotlin_groovyGradle() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the navigation drawer project", - R.string.template_navigation_drawer - ) - selectKotlinLanguage() - uncheckKotlinScript() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_bottomNavigationProject_java_groovyGradle() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the bottom navigation project", - R.string.template_navigation_tabs - ) - selectJavaLanguage() - uncheckKotlinScript() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_bottomNavigationProject_kotlin_groovyGradle() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the bottom navigation project", - R.string.template_navigation_tabs - ) - selectKotlinLanguage() - uncheckKotlinScript() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_tabbedActivityProject_java_groovyGradle() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the tabbed activity project", - R.string.template_tabs - ) - selectJavaLanguage() - uncheckKotlinScript() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_tabbedActivityProject_kotlin_groovyGradle() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the tabbed activity project", - R.string.template_tabs - ) - selectKotlinLanguage() - uncheckKotlinScript() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_noAndroidXProject_java_groovyGradle() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the no AndroidX project", - R.string.template_no_AndroidX - ) - selectJavaLanguage() - uncheckKotlinScript() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_noAndroidXProject_kotlin_groovyGradle() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the no AndroidX project", - R.string.template_no_AndroidX - ) - selectKotlinLanguage() - uncheckKotlinScript() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } -} \ No newline at end of file + @Test + fun test_projectBuild_emptyProject_java_groovyGradle() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the empty project", + R.string.template_empty, + ) + selectJavaLanguage() + uncheckKotlinScript() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_emptyProject_kotlin_groovyGradle() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the empty project", + R.string.template_empty, + ) + selectKotlinLanguage() + uncheckKotlinScript() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_baseProject_java_groovyGradle() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the basic project", + R.string.template_basic, + ) + selectJavaLanguage() + uncheckKotlinScript() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_baseProject_kotlin_groovyGradle() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the basic project", + R.string.template_basic, + ) + selectKotlinLanguage() + uncheckKotlinScript() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_navigationDrawerProject_java_groovyGradle() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the navigation drawer project", + R.string.template_navigation_drawer, + ) + selectJavaLanguage() + uncheckKotlinScript() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_navigationDrawerProject_kotlin_groovyGradle() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the navigation drawer project", + R.string.template_navigation_drawer, + ) + selectKotlinLanguage() + uncheckKotlinScript() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_bottomNavigationProject_java_groovyGradle() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the bottom navigation project", + R.string.template_navigation_tabs, + ) + selectJavaLanguage() + uncheckKotlinScript() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_bottomNavigationProject_kotlin_groovyGradle() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the bottom navigation project", + R.string.template_navigation_tabs, + ) + selectKotlinLanguage() + uncheckKotlinScript() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_tabbedActivityProject_java_groovyGradle() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the tabbed activity project", + R.string.template_tabs, + ) + selectJavaLanguage() + uncheckKotlinScript() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_tabbedActivityProject_kotlin_groovyGradle() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the tabbed activity project", + R.string.template_tabs, + ) + selectKotlinLanguage() + uncheckKotlinScript() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_noAndroidXProject_java_groovyGradle() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the no AndroidX project", + R.string.template_no_AndroidX, + ) + selectJavaLanguage() + uncheckKotlinScript() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_noAndroidXProject_kotlin_groovyGradle() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the no AndroidX project", + R.string.template_no_AndroidX, + ) + selectKotlinLanguage() + uncheckKotlinScript() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } +} diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/ProjectBuildTestWithKtsGradle.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/ProjectBuildTestWithKtsGradle.kt index 4204adc7a2..0687536281 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/ProjectBuildTestWithKtsGradle.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/ProjectBuildTestWithKtsGradle.kt @@ -1,8 +1,8 @@ package org.appdevforall.codeonthego - -import com.itsaky.androidide.R import androidx.test.platform.app.InstrumentationRegistry +import com.itsaky.androidide.R +import com.kaspersky.kaspresso.testcases.api.testcase.TestCase import org.appdevforall.codeonthego.helper.initializeProjectAndCancelBuild import org.appdevforall.codeonthego.helper.navigateToMainScreen import org.appdevforall.codeonthego.helper.selectProjectTemplate @@ -10,221 +10,218 @@ import org.appdevforall.codeonthego.screens.HomeScreen.clickCreateProjectHomeScr import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.clickCreateProjectProjectSettings import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.selectJavaLanguage import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.selectKotlinLanguage -import com.kaspersky.kaspresso.testcases.api.testcase.TestCase import org.junit.Test class ProjectBuildTestWithKtsGradle : TestCase() { - - - @Test - fun test_projectBuild_emptyProject_java() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the empty project", - R.string.template_empty - ) - selectJavaLanguage() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_emptyProject_kotlin() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the empty project", - R.string.template_empty - ) - selectKotlinLanguage() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_baseProject_java() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the basic project", - R.string.template_basic - ) - selectJavaLanguage() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_baseProject_kotlin() { - run { - step("Navigate to main screen") { - // Ensure consistent start state with increased timeout - flakySafely(timeoutMs = 30000) { - navigateToMainScreen() - } - } - - step("Click create project on home screen") { - flakySafely(timeoutMs = 10000) { - clickCreateProjectHomeScreen() - } - } - - step("Select the basic project template") { - flakySafely(timeoutMs = 10000) { - selectProjectTemplate( - "Select the basic project", - R.string.template_basic - ) - } - } - - step("Select Kotlin language") { - flakySafely(timeoutMs = 10000) { - selectKotlinLanguage() - } - } - - step("Click create project on settings screen") { - flakySafely(timeoutMs = 10000) { - clickCreateProjectProjectSettings() - } - } - - step("Initialize project and cancel build") { - flakySafely(timeoutMs = 10000) { - initializeProjectAndCancelBuild() - } - } - } - } - - @Test - fun test_projectBuild_navigationDrawerProject_java() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the navigation drawer project", - R.string.template_navigation_drawer - ) - selectJavaLanguage() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_navigationDrawerProject_kotlin() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the navigation drawer project", - R.string.template_navigation_drawer - ) - selectKotlinLanguage() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_bottomNavigationProject_java() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the bottom navigation project", - R.string.template_navigation_tabs - ) - selectJavaLanguage() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_bottomNavigationProject_kotlin() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the bottom navigation project", - R.string.template_navigation_tabs - ) - selectKotlinLanguage() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_tabbedActivityProject_java() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the tabbed activity project", - R.string.template_tabs - ) - selectJavaLanguage() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_tabbedActivityProject_kotlin() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the tabbed activity project", - R.string.template_tabs - ) - selectKotlinLanguage() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_noAnd2roidXProject_java() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the no AndroidX project", - R.string.template_no_AndroidX - ) - selectJavaLanguage() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } - - @Test - fun test_projectBuild_noAndroidXProject_kotlin() { - run { - navigateToMainScreen() - clickCreateProjectHomeScreen() - selectProjectTemplate( - "Select the no AndroidX project", - R.string.template_no_AndroidX - ) - selectKotlinLanguage() - clickCreateProjectProjectSettings() - initializeProjectAndCancelBuild() - } - } + @Test + fun test_projectBuild_emptyProject_java() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the empty project", + R.string.template_empty, + ) + selectJavaLanguage() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_emptyProject_kotlin() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the empty project", + R.string.template_empty, + ) + selectKotlinLanguage() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_baseProject_java() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the basic project", + R.string.template_basic, + ) + selectJavaLanguage() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_baseProject_kotlin() { + run { + step("Navigate to main screen") { + // Ensure consistent start state with increased timeout + flakySafely(timeoutMs = 30000) { + navigateToMainScreen() + } + } + + step("Click create project on home screen") { + flakySafely(timeoutMs = 10000) { + clickCreateProjectHomeScreen() + } + } + + step("Select the basic project template") { + flakySafely(timeoutMs = 10000) { + selectProjectTemplate( + "Select the basic project", + R.string.template_basic, + ) + } + } + + step("Select Kotlin language") { + flakySafely(timeoutMs = 10000) { + selectKotlinLanguage() + } + } + + step("Click create project on settings screen") { + flakySafely(timeoutMs = 10000) { + clickCreateProjectProjectSettings() + } + } + + step("Initialize project and cancel build") { + flakySafely(timeoutMs = 10000) { + initializeProjectAndCancelBuild() + } + } + } + } + + @Test + fun test_projectBuild_navigationDrawerProject_java() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the navigation drawer project", + R.string.template_navigation_drawer, + ) + selectJavaLanguage() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_navigationDrawerProject_kotlin() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the navigation drawer project", + R.string.template_navigation_drawer, + ) + selectKotlinLanguage() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_bottomNavigationProject_java() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the bottom navigation project", + R.string.template_navigation_tabs, + ) + selectJavaLanguage() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_bottomNavigationProject_kotlin() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the bottom navigation project", + R.string.template_navigation_tabs, + ) + selectKotlinLanguage() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_tabbedActivityProject_java() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the tabbed activity project", + R.string.template_tabs, + ) + selectJavaLanguage() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_tabbedActivityProject_kotlin() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the tabbed activity project", + R.string.template_tabs, + ) + selectKotlinLanguage() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_noAnd2roidXProject_java() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the no AndroidX project", + R.string.template_no_AndroidX, + ) + selectJavaLanguage() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } + + @Test + fun test_projectBuild_noAndroidXProject_kotlin() { + run { + navigateToMainScreen() + clickCreateProjectHomeScreen() + selectProjectTemplate( + "Select the no AndroidX project", + R.string.template_no_AndroidX, + ) + selectKotlinLanguage() + clickCreateProjectProjectSettings() + initializeProjectAndCancelBuild() + } + } // TODO: to be uncommented out when the compose project template is fixed // @Test diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildFlagOffTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildFlagOffTest.kt index 2e77267f34..0bcce17884 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildFlagOffTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildFlagOffTest.kt @@ -3,6 +3,7 @@ package org.appdevforall.codeonthego import androidx.test.core.app.ActivityScenario import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry +import com.kaspersky.kaspresso.testcases.api.testcase.TestCase import org.appdevforall.codeonthego.activities.SplashActivity import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity import org.appdevforall.codeonthego.app.configuration.IJdkDistributionProvider @@ -12,7 +13,6 @@ import org.appdevforall.codeonthego.helper.waitForMainHomeOrEditorUi import org.appdevforall.codeonthego.screens.QuickBuildScreen.assertQuickBuildButtonAbsent import org.appdevforall.codeonthego.screens.QuickBuildScreen.assertQuickBuildButtonShown import org.appdevforall.codeonthego.utils.EditorActivityActions -import com.kaspersky.kaspresso.testcases.api.testcase.TestCase import org.junit.Test import org.junit.runner.RunWith diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildPipelineTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildPipelineTest.kt index 2e61b2e1ba..10e56bdd6f 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildPipelineTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildPipelineTest.kt @@ -1,12 +1,19 @@ package org.appdevforall.codeonthego - -import com.itsaky.androidide.R import android.os.Build import androidx.test.core.app.ActivityScenario import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiSelector +import com.itsaky.androidide.R +import com.kaspersky.kaspresso.testcases.api.testcase.TestCase +import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.first +import kotlinx.coroutines.launch +import kotlinx.coroutines.runBlocking +import kotlinx.coroutines.withTimeoutOrNull import org.appdevforall.codeonthego.activities.SplashActivity import org.appdevforall.codeonthego.app.configuration.IJdkDistributionProvider import org.appdevforall.codeonthego.helper.FakeInstalledPackages @@ -25,14 +32,6 @@ import org.appdevforall.codeonthego.screens.ProjectSettingsScreen.setProjectName import org.appdevforall.codeonthego.screens.QuickBuildScreen.assertQuickBuildButtonShown import org.appdevforall.codeonthego.screens.QuickBuildScreen.dismissFirstBuildNoticeIfShown import org.appdevforall.codeonthego.screens.QuickBuildScreen.tapQuickBuildButton -import com.kaspersky.kaspresso.testcases.api.testcase.TestCase -import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.flow.first -import kotlinx.coroutines.launch -import kotlinx.coroutines.runBlocking -import kotlinx.coroutines.withTimeoutOrNull import org.appdevforall.cotg.quickbuild.domain.session.QuickBuildSessionState import org.appdevforall.cotg.quickbuild.domain.session.SessionFailure import org.appdevforall.cotg.quickbuild.service.deploy.ProxyAppConnections diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildSmokeTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildSmokeTest.kt index a522dffbf4..686c6de613 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildSmokeTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/QuickBuildSmokeTest.kt @@ -1,11 +1,15 @@ package org.appdevforall.codeonthego - -import com.itsaky.androidide.R import androidx.test.core.app.ActivityScenario import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiSelector +import com.itsaky.androidide.R +import com.kaspersky.kaspresso.testcases.api.testcase.TestCase +import kotlinx.coroutines.flow.first +import kotlinx.coroutines.runBlocking +import kotlinx.coroutines.withTimeout +import kotlinx.coroutines.withTimeoutOrNull import org.appdevforall.codeonthego.activities.SplashActivity import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity import org.appdevforall.codeonthego.app.configuration.IJdkDistributionProvider @@ -36,11 +40,6 @@ import org.appdevforall.codeonthego.screens.QuickBuildScreen.longPressOpensQuick import org.appdevforall.codeonthego.screens.QuickBuildScreen.restartSessionViaDropdown import org.appdevforall.codeonthego.screens.QuickBuildScreen.tapQuickBuildButton import org.appdevforall.codeonthego.utils.flashError -import com.kaspersky.kaspresso.testcases.api.testcase.TestCase -import kotlinx.coroutines.flow.first -import kotlinx.coroutines.runBlocking -import kotlinx.coroutines.withTimeout -import kotlinx.coroutines.withTimeoutOrNull import org.appdevforall.cotg.quickbuild.domain.session.QuickBuildStatus import org.appdevforall.cotg.quickbuild.service.provision.InstalledPackages import org.appdevforall.cotg.quickbuild.service.provision.QuickBuildClobberCheck diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/WhitelistRulesTest.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/WhitelistRulesTest.kt index d1c5c7abe4..6c5fce3d23 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/WhitelistRulesTest.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/app/strictmode/WhitelistRulesTest.kt @@ -73,7 +73,7 @@ class WhitelistRulesTest { stackTraceElement("com.google.firebase.components.Lazy", "get", "Lazy.java", 53), stackTraceElement("com.google.firebase.FirebaseApp", "isDataCollectionDefaultEnabled", "FirebaseApp.java", 371), stackTraceElement("com.google.firebase.analytics.connector.AnalyticsConnectorImpl", "getInstance", "play-services-measurement-api@@22.1.2", 31), - stackTraceElement("com.google.firebase.FirebaseApp\$UserUnlockReceiver", "onReceive", "FirebaseApp.java", 672) + stackTraceElement("com.google.firebase.FirebaseApp\$UserUnlockReceiver", "onReceive", "FirebaseApp.java", 672), // @formatter:on ) } @@ -84,7 +84,7 @@ class WhitelistRulesTest { stackTraceElement("org.appdevforall.codeonthego.utils.ServiceLoader", "parse"), stackTraceElement( "org.appdevforall.codeonthego.app.configuration.IJdkDistributionProvider\$Companion", - "_instance_delegate\$lambda\$0" + "_instance_delegate\$lambda\$0", ), ) } @@ -95,7 +95,7 @@ class WhitelistRulesTest { stackTraceElement("java.io.File", "exists"), stackTraceElement( "org.appdevforall.codeonthego.activities.OnboardingActivity", - "checkToolsIsInstalled" + "checkToolsIsInstalled", ), ) } diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/AdvancePastWelcomeScreenHelper.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/AdvancePastWelcomeScreenHelper.kt index f6af7737f7..da89a7dd8f 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/AdvancePastWelcomeScreenHelper.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/AdvancePastWelcomeScreenHelper.kt @@ -9,52 +9,59 @@ import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext * The button is in the system gesture exclusion zone so coordinate-based clicks fail. */ fun TestContext.advancePastWelcomeScreen() { - step("Click continue button on the Welcome Screen") { - flakySafely(timeoutMs = 3_000) { - device.uiDevice.waitForIdle() + step("Click continue button on the Welcome Screen") { + flakySafely(timeoutMs = 3_000) { + device.uiDevice.waitForIdle() - val clicked = accessibilityClickByDescription("NEXT") - || accessibilityClickByText("Next") - || accessibilityClickByText("Continue") + val clicked = + accessibilityClickByDescription("NEXT") || + accessibilityClickByText("Next") || + accessibilityClickByText("Continue") - if (!clicked) { - throw AssertionError("Next/Continue button not found on welcome screen") - } - device.uiDevice.waitForIdle() - } - } + if (!clicked) { + throw AssertionError("Next/Continue button not found on welcome screen") + } + device.uiDevice.waitForIdle() + } + } } private fun accessibilityClickByDescription(desc: String): Boolean { - val root = InstrumentationRegistry.getInstrumentation().uiAutomation - .rootInActiveWindow ?: return false - val nodes = root.findAccessibilityNodeInfosByText(desc) - for (node in nodes) { - if (node.contentDescription?.toString()?.contains(desc, ignoreCase = true) == true) { - val result = node.performAction(AccessibilityNodeInfo.ACTION_CLICK) - node.recycle() - root.recycle() - return result - } - node.recycle() - } - root.recycle() - return false + val root = + InstrumentationRegistry + .getInstrumentation() + .uiAutomation + .rootInActiveWindow ?: return false + val nodes = root.findAccessibilityNodeInfosByText(desc) + for (node in nodes) { + if (node.contentDescription?.toString()?.contains(desc, ignoreCase = true) == true) { + val result = node.performAction(AccessibilityNodeInfo.ACTION_CLICK) + node.recycle() + root.recycle() + return result + } + node.recycle() + } + root.recycle() + return false } private fun accessibilityClickByText(text: String): Boolean { - val root = InstrumentationRegistry.getInstrumentation().uiAutomation - .rootInActiveWindow ?: return false - val nodes = root.findAccessibilityNodeInfosByText(text) - for (node in nodes) { - if (node.text?.toString()?.contains(text, ignoreCase = true) == true) { - val result = node.performAction(AccessibilityNodeInfo.ACTION_CLICK) - node.recycle() - root.recycle() - return result - } - node.recycle() - } - root.recycle() - return false + val root = + InstrumentationRegistry + .getInstrumentation() + .uiAutomation + .rootInActiveWindow ?: return false + val nodes = root.findAccessibilityNodeInfosByText(text) + for (node in nodes) { + if (node.text?.toString()?.contains(text, ignoreCase = true) == true) { + val result = node.performAction(AccessibilityNodeInfo.ACTION_CLICK) + node.recycle() + root.recycle() + return result + } + node.recycle() + } + root.recycle() + return false } diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ConfigureAutomationBuildPreferencesHelper.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ConfigureAutomationBuildPreferencesHelper.kt index 8002152386..86c01eea15 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ConfigureAutomationBuildPreferencesHelper.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ConfigureAutomationBuildPreferencesHelper.kt @@ -2,8 +2,8 @@ package org.appdevforall.codeonthego.helper import android.util.Log import androidx.test.platform.app.InstrumentationRegistry -import org.appdevforall.codeonthego.preferences.internal.BuildPreferences import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext +import org.appdevforall.codeonthego.preferences.internal.BuildPreferences private const val TAG = "AutomationBuildPrefs" private const val ARG_BUILD_OFFLINE = "androidide.build.offline" diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/EnsureHomeScreenHelper.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/EnsureHomeScreenHelper.kt index 58e94283bc..8687fa5697 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/EnsureHomeScreenHelper.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/EnsureHomeScreenHelper.kt @@ -9,10 +9,10 @@ import androidx.test.uiautomator.UiDevice import androidx.test.uiautomator.UiSelector import com.itsaky.androidide.BuildConfig import com.itsaky.androidide.R +import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext import org.appdevforall.codeonthego.activities.MainActivity import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences import org.appdevforall.codeonthego.screens.HomeScreen -import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext import org.hamcrest.Matchers private const val TAG = "EnsureHomeScreen" @@ -65,16 +65,20 @@ fun TestContext.ensureOnHomeScreenBeforeCreateProject() { testLog("Post-onboarding screen=$state (package=$pkg)") when (state) { - PostOnboardingScreen.EDITOR -> + PostOnboardingScreen.EDITOR -> { runCatching { testLog("Attempting drawer → close project → close without saving") closeProjectViaDrawerThenCloseWithoutSaving(device.uiDevice, targetContext) }.onFailure { testLog("Drawer close failed: ${it.message}") } + } - PostOnboardingScreen.UNKNOWN -> + PostOnboardingScreen.UNKNOWN -> { testLog("Screen UNKNOWN — will try relaunch if home not visible") + } - PostOnboardingScreen.HOME -> testLog("Screen looks like HOME already") + PostOnboardingScreen.HOME -> { + testLog("Screen looks like HOME already") + } } device.uiDevice.waitForIdle(3000) diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ExperimentsFlagHelper.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ExperimentsFlagHelper.kt index 458ea7df64..95b9170338 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ExperimentsFlagHelper.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ExperimentsFlagHelper.kt @@ -2,8 +2,8 @@ package org.appdevforall.codeonthego.helper import android.os.ParcelFileDescriptor import androidx.test.platform.app.InstrumentationRegistry -import org.appdevforall.codeonthego.utils.FeatureFlags import kotlinx.coroutines.runBlocking +import org.appdevforall.codeonthego.utils.FeatureFlags import org.junit.Assert.assertEquals private const val EXPERIMENTS_FLAG_PATH = "/sdcard/Download/CodeOnTheGo.exp" diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/GrantRequiredPermissionsUiHelper.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/GrantRequiredPermissionsUiHelper.kt index f4403300ce..2e0090995e 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/GrantRequiredPermissionsUiHelper.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/GrantRequiredPermissionsUiHelper.kt @@ -3,9 +3,9 @@ package org.appdevforall.codeonthego.helper import android.Manifest import androidx.test.platform.app.InstrumentationRegistry import com.itsaky.androidide.R +import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext import org.appdevforall.codeonthego.screens.PermissionScreen import org.appdevforall.codeonthego.utils.PermissionsHelper -import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext /** * Drives the onboarding permission list and system Settings UIs for every entry in @@ -41,15 +41,19 @@ fun TestContext.grantAllRequiredPermissionsThroughOnboardingUi() { Manifest.permission.POST_NOTIFICATIONS -> { device.grantPostNotificationsUi() } + Manifest.permission_group.STORAGE -> { device.grantStorageManageAllFilesUi() } + Manifest.permission.REQUEST_INSTALL_PACKAGES -> { device.grantInstallUnknownAppsUi() } + Manifest.permission.SYSTEM_ALERT_WINDOW -> { device.grantDisplayOverOtherAppsUi() } + else -> { throw IllegalStateException("Unknown permission row: ${item.permission}") } diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/HandlePrivacyDisclosureHelper.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/HandlePrivacyDisclosureHelper.kt index ba64c88ace..7794b29bfe 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/HandlePrivacyDisclosureHelper.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/HandlePrivacyDisclosureHelper.kt @@ -3,9 +3,9 @@ package org.appdevforall.codeonthego.helper import android.util.Log import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiSelector +import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext import org.appdevforall.codeonthego.preferences.internal.StatPreferences import org.appdevforall.codeonthego.preferences.internal.TelemetryConsent -import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue import com.itsaky.androidide.resources.R as ResourcesR diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ProjectBuildHelper.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ProjectBuildHelper.kt index 69017debef..fb775901e9 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ProjectBuildHelper.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/helper/ProjectBuildHelper.kt @@ -1,48 +1,48 @@ package org.appdevforall.codeonthego.helper +import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext import org.appdevforall.codeonthego.scenarios.InitializationProjectAndCancelingBuildScenario import org.appdevforall.codeonthego.scenarios.NavigateToMainScreenScenario import org.appdevforall.codeonthego.scenarios.RunAssembleTasksScenario import org.appdevforall.codeonthego.screens.TemplateScreen.selectTemplate -import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext fun TestContext.navigateToMainScreen() { - step("Initialize the app and navigate to the Main Screen") { - scenario(NavigateToMainScreenScenario()) - } + step("Initialize the app and navigate to the Main Screen") { + scenario(NavigateToMainScreenScenario()) + } } fun TestContext.selectProjectTemplate( - stepTitle: String, - templateResId: Int, - visibleTextOverride: String? = null, + stepTitle: String, + templateResId: Int, + visibleTextOverride: String? = null, ) { - step(stepTitle) { - selectTemplate(templateResId, visibleTextOverride) - } + step(stepTitle) { + selectTemplate(templateResId, visibleTextOverride) + } } fun TestContext.initializeProjectAndCancelBuild() { - step("Initialization the project and cancelling the build") { - scenario(InitializationProjectAndCancelingBuildScenario()) - } + step("Initialization the project and cancelling the build") { + scenario(InitializationProjectAndCancelingBuildScenario()) + } } fun TestContext.initializeProjectRunAssembleTasksAndCancelBuild() { - step("Initialize project, quick-run debug build, and run assemble task set") { - var failure: Throwable? = null - try { - scenario(InitializationProjectAndCancelingBuildScenario(closeProjectAfterBuild = false)) - scenario(RunAssembleTasksScenario()) - } catch (throwable: Throwable) { - failure = throwable - throw throwable - } finally { - runCatching { - scenario(InitializationProjectAndCancelingBuildScenario.CloseProjectScenario()) - }.onFailure { closeFailure -> - failure?.addSuppressed(closeFailure) ?: throw closeFailure - } - } - } + step("Initialize project, quick-run debug build, and run assemble task set") { + var failure: Throwable? = null + try { + scenario(InitializationProjectAndCancelingBuildScenario(closeProjectAfterBuild = false)) + scenario(RunAssembleTasksScenario()) + } catch (throwable: Throwable) { + failure = throwable + throw throwable + } finally { + runCatching { + scenario(InitializationProjectAndCancelingBuildScenario.CloseProjectScenario()) + }.onFailure { closeFailure -> + failure?.addSuppressed(closeFailure) ?: throw closeFailure + } + } + } } diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/InitializationProjectAndCancelingBuildScenario.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/InitializationProjectAndCancelingBuildScenario.kt index 3c422f32ad..807979a0f7 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/InitializationProjectAndCancelingBuildScenario.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/InitializationProjectAndCancelingBuildScenario.kt @@ -4,10 +4,10 @@ import android.util.Log import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiSelector import com.itsaky.androidide.R -import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByDescription -import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText import com.kaspersky.kaspresso.testcases.api.scenario.Scenario import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByDescription +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText private const val CLOSE_PROJECT_TAG = "CloseProjectScenario" private const val DEFAULT_TOOLBAR_BUTTON_TIMEOUT_MS = 10_000L diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/NavigateToMainScreenScenario.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/NavigateToMainScreenScenario.kt index bb02229280..f9409a2fad 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/NavigateToMainScreenScenario.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/NavigateToMainScreenScenario.kt @@ -1,5 +1,9 @@ package org.appdevforall.codeonthego.scenarios +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.uiautomator.UiSelector +import com.kaspersky.kaspresso.testcases.api.scenario.Scenario +import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext import org.appdevforall.codeonthego.helper.advancePastWelcomeScreen import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText import org.appdevforall.codeonthego.helper.grantAllRequiredPermissionsThroughOnboardingUi @@ -7,10 +11,6 @@ import org.appdevforall.codeonthego.helper.logOnboardingNavigation import org.appdevforall.codeonthego.helper.waitForMainHomeOrEditorUi import org.appdevforall.codeonthego.screens.InstallToolsScreen import org.appdevforall.codeonthego.screens.PermissionScreen -import com.kaspersky.kaspresso.testcases.api.scenario.Scenario -import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.uiautomator.UiSelector /** * Navigates from whatever the current onboarding state is to the main screen. @@ -20,107 +20,106 @@ import androidx.test.uiautomator.UiSelector * the permissions list, or already on the main screen. */ class NavigateToMainScreenScenario : Scenario() { + override val steps: TestContext.() -> Unit = { + logOnboardingNavigation("NavigateToMainScreenScenario: starting") - override val steps: TestContext.() -> Unit = { - logOnboardingNavigation("NavigateToMainScreenScenario: starting") - - val d = device.uiDevice - val pkg = InstrumentationRegistry.getInstrumentation().targetContext.packageName + val d = device.uiDevice + val pkg = InstrumentationRegistry.getInstrumentation().targetContext.packageName - // If we're already on the main screen, skip everything - step("Check if already on main screen") { - d.waitForIdle() - val getStarted = d.findObject(UiSelector().resourceIdMatches(".*:id/getStarted")) - val editor = d.findObject(UiSelector().resourceIdMatches(".*:id/editor_appBarLayout")) - if (getStarted.waitForExists(1_000) || editor.exists()) { - logOnboardingNavigation("Already on main screen — skipping onboarding") - return@step - } - } + // If we're already on the main screen, skip everything + step("Check if already on main screen") { + d.waitForIdle() + val getStarted = d.findObject(UiSelector().resourceIdMatches(".*:id/getStarted")) + val editor = d.findObject(UiSelector().resourceIdMatches(".*:id/editor_appBarLayout")) + if (getStarted.waitForExists(1_000) || editor.exists()) { + logOnboardingNavigation("Already on main screen — skipping onboarding") + return@step + } + } - // If the welcome screen NEXT button is visible, advance past it - step("Advance past welcome screen (if showing)") { - val nextBtn = d.findObject(UiSelector().descriptionContains("NEXT")) - val permissionTitle = d.findObject(UiSelector().resourceIdMatches(".*:id/onboarding_title")) - // Only advance if we appear to be on the welcome slide (NEXT visible but not yet on permissions) - if (nextBtn.waitForExists(1_000)) { - // Check if we're on the welcome slide vs permissions info slide - // The welcome slide has a greeting title, not the permissions title - val greetingTitle = d.findObject(UiSelector().resourceIdMatches(".*:id/title").textContains("Code on the Go")) - if (greetingTitle.exists()) { - logOnboardingNavigation("Welcome screen visible — advancing") - advancePastWelcomeScreen() - } - } - } + // If the welcome screen NEXT button is visible, advance past it + step("Advance past welcome screen (if showing)") { + val nextBtn = d.findObject(UiSelector().descriptionContains("NEXT")) + val permissionTitle = d.findObject(UiSelector().resourceIdMatches(".*:id/onboarding_title")) + // Only advance if we appear to be on the welcome slide (NEXT visible but not yet on permissions) + if (nextBtn.waitForExists(1_000)) { + // Check if we're on the welcome slide vs permissions info slide + // The welcome slide has a greeting title, not the permissions title + val greetingTitle = d.findObject(UiSelector().resourceIdMatches(".*:id/title").textContains("Code on the Go")) + if (greetingTitle.exists()) { + logOnboardingNavigation("Welcome screen visible — advancing") + advancePastWelcomeScreen() + } + } + } - // If the privacy dialog is showing, accept it - step("Accept privacy dialog (if showing)") { - val ctx = InstrumentationRegistry.getInstrumentation().targetContext - val accept = ctx.getString(com.itsaky.androidide.resources.R.string.privacy_disclosure_accept) - val btn = d.findObject(UiSelector().text(accept)) - if (btn.waitForExists(1_000)) { - logOnboardingNavigation("Privacy dialog visible — accepting") - clickFirstAccessibilityNodeByText(accept) - d.waitForIdle() - } - } + // If the privacy dialog is showing, accept it + step("Accept privacy dialog (if showing)") { + val ctx = InstrumentationRegistry.getInstrumentation().targetContext + val accept = ctx.getString(com.itsaky.androidide.resources.R.string.privacy_disclosure_accept) + val btn = d.findObject(UiSelector().text(accept)) + if (btn.waitForExists(1_000)) { + logOnboardingNavigation("Privacy dialog visible — accepting") + clickFirstAccessibilityNodeByText(accept) + d.waitForIdle() + } + } - // If the permission list is showing, grant all permissions - step("Grant permissions (if on permission list)") { - val permScreen = d.findObject(UiSelector().resourceIdMatches(".*:id/onboarding_items")) - if (permScreen.waitForExists(2_000)) { - val ctx = InstrumentationRegistry.getInstrumentation().targetContext - val grantText = ctx.getString(com.itsaky.androidide.R.string.title_grant) - val grantBtn = d.findObject(UiSelector().text(grantText)) - if (grantBtn.exists()) { - logOnboardingNavigation("Permission list visible with ungranted permissions — granting") - grantAllRequiredPermissionsThroughOnboardingUi() - } - } - } + // If the permission list is showing, grant all permissions + step("Grant permissions (if on permission list)") { + val permScreen = d.findObject(UiSelector().resourceIdMatches(".*:id/onboarding_items")) + if (permScreen.waitForExists(2_000)) { + val ctx = InstrumentationRegistry.getInstrumentation().targetContext + val grantText = ctx.getString(com.itsaky.androidide.R.string.title_grant) + val grantBtn = d.findObject(UiSelector().text(grantText)) + if (grantBtn.exists()) { + logOnboardingNavigation("Permission list visible with ungranted permissions — granting") + grantAllRequiredPermissionsThroughOnboardingUi() + } + } + } - step("Finish installation (leave permission screen)") { - flakySafely(timeoutMs = 20_000) { - PermissionScreen { - finishInstallationButton { - isVisible() - isEnabled() - isClickable() - click() - } - } - } - } + step("Finish installation (leave permission screen)") { + flakySafely(timeoutMs = 20_000) { + PermissionScreen { + finishInstallationButton { + isVisible() + isEnabled() + isClickable() + click() + } + } + } + } - step("After Finish installation: optional AppIntro Done, then wait for IDE setup -> main UI") { - logOnboardingNavigation( - "Permissions Finish starts in-app IDE setup; AppIntro R.id.done is often absent — waiting for main UI", - ) - runCatching { - flakySafely(timeoutMs = 12_000) { - InstallToolsScreen.doneButton { - isVisible() - click() - } - } - }.fold( - onSuccess = { logOnboardingNavigation("Clicked legacy AppIntro Done (optional)") }, - onFailure = { - logOnboardingNavigation( - "No AppIntro Done within 12s (expected): ${it.javaClass.simpleName} ${it.message}", - ) - }, - ) - waitForMainHomeOrEditorUi(device.uiDevice, maxWaitMs = 300_000L) - } + step("After Finish installation: optional AppIntro Done, then wait for IDE setup -> main UI") { + logOnboardingNavigation( + "Permissions Finish starts in-app IDE setup; AppIntro R.id.done is often absent — waiting for main UI", + ) + runCatching { + flakySafely(timeoutMs = 12_000) { + InstallToolsScreen.doneButton { + isVisible() + click() + } + } + }.fold( + onSuccess = { logOnboardingNavigation("Clicked legacy AppIntro Done (optional)") }, + onFailure = { + logOnboardingNavigation( + "No AppIntro Done within 12s (expected): ${it.javaClass.simpleName} ${it.message}", + ) + }, + ) + waitForMainHomeOrEditorUi(device.uiDevice, maxWaitMs = 300_000L) + } - step("Decline runtime permission dialog if still shown") { - runCatching { - flakySafely(timeoutMs = 8000) { - device.permissions.denyViaDialog() - } - } - } - } + step("Decline runtime permission dialog if still shown") { + runCatching { + flakySafely(timeoutMs = 8000) { + device.permissions.denyViaDialog() + } + } + } + } } diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/RunAssembleTasksScenario.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/RunAssembleTasksScenario.kt index 7c675278e0..eea58ff2cc 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/RunAssembleTasksScenario.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/scenarios/RunAssembleTasksScenario.kt @@ -5,10 +5,10 @@ import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiScrollable import androidx.test.uiautomator.UiSelector import com.itsaky.androidide.R -import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByDescription -import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeParentByText import com.kaspersky.kaspresso.testcases.api.scenario.Scenario import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByDescription +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeParentByText private const val RUN_ASSEMBLE_TAG = "RunAssembleTasks" private const val SHORT_UI_TIMEOUT_MS = 2_000L @@ -21,147 +21,148 @@ private const val BUILD_LOG_INTERVAL_MS = 10_000L private const val POLL_INTERVAL_MS = 1_000L private fun runAssembleLog(message: String) { - Log.e(RUN_ASSEMBLE_TAG, message) - System.err.println("$RUN_ASSEMBLE_TAG: $message") + Log.e(RUN_ASSEMBLE_TAG, message) + System.err.println("$RUN_ASSEMBLE_TAG: $message") } class RunAssembleTasksScenario( - private val tasks: List = DEFAULT_ASSEMBLE_TASKS, + private val tasks: List = DEFAULT_ASSEMBLE_TASKS, ) : Scenario() { - - override val steps: TestContext.() -> Unit = { - step("Dismiss post-build overlays before running assemble tasks") { - val d = device.uiDevice - val dismiss = d.findObject(UiSelector().text("Dismiss")) - if (dismiss.waitForExists(DEFAULT_UI_TIMEOUT_MS)) { - dismiss.click() - d.waitForIdle() - } - val installer = d.findObject( - UiSelector().packageNameMatches(".*packageinstaller.*|.*permissioncontroller.*") - ) - if (installer.exists()) { - runAssembleLog("Package installer still visible before assemble tasks; dismissing") - val cancel = d.findObject(UiSelector().textMatches("(?i)cancel")) - if (cancel.waitForExists(SHORT_UI_TIMEOUT_MS)) { - cancel.click() - } else { - d.pressBack() - } - runCatching { installer.waitUntilGone(INSTALLER_GONE_TIMEOUT_MS) } - d.waitForIdle() - } - } - - step("Open Run tasks dialog") { - val d = device.uiDevice - val targetContext = InstrumentationRegistry.getInstrumentation().targetContext - val runTasksDescription = targetContext.getString(R.string.cd_toolbar_run_gradle_tasks) - val toolbar = d.findObject(UiSelector().resourceIdMatches(".*:id/editor_appBarLayout")) - check(toolbar.waitForExists(EDITOR_TOOLBAR_TIMEOUT_MS)) { "Editor toolbar not found" } - clickFirstAccessibilityNodeByDescription(runTasksDescription) - d.waitForIdle() - - val title = targetContext.getString(R.string.title_run_tasks) - check(d.findObject(UiSelector().text(title)).waitForExists(RUN_TASKS_DIALOG_TIMEOUT_MS)) { - "Run tasks dialog did not open" - } - } - - step("Filter assemble tasks") { - val d = device.uiDevice - val search = d.findObject(UiSelector().className("android.widget.EditText")) - check(search.waitForExists(RUN_TASKS_DIALOG_TIMEOUT_MS)) { "Run tasks search field not found" } - search.setText("assemble") - d.waitForIdle() - } - - tasks.forEach { task -> - step("Select Gradle task $task") { - val d = device.uiDevice - var taskNode = d.findObject(UiSelector().text(task)) - if (!taskNode.waitForExists(DEFAULT_UI_TIMEOUT_MS)) { - UiScrollable(UiSelector().scrollable(true)).scrollTextIntoView(task) - taskNode = d.findObject(UiSelector().text(task)) - } - check(taskNode.waitForExists(TASK_SELECTION_TIMEOUT_MS)) { - "Task not found in Run tasks dialog: $task" - } - clickFirstAccessibilityNodeParentByText(task) - d.waitForIdle() - } - } - - step("Confirm and run selected Gradle tasks") { - val d = device.uiDevice - val runButton = d.findObject(UiSelector().resourceIdMatches(".*:id/exec")) - check(runButton.waitForExists(RUN_TASKS_DIALOG_TIMEOUT_MS)) { "Run tasks execute button not found" } - runButton.click() - d.waitForIdle() - - tasks.forEach { task -> - check(d.findObject(UiSelector().textContains(task)).waitForExists(RUN_TASKS_DIALOG_TIMEOUT_MS)) { - "Run tasks confirmation missing selected task: $task" - } - } - - runButton.click() - d.waitForIdle() - runAssembleLog("Selected assemble tasks submitted") - } - - step("Wait for selected Gradle tasks to finish") { - runAssembleLog("Waiting for selected assemble tasks to finish") - val d = device.uiDevice - val success = d.findObject(UiSelector().textContains("Build completed successfully")) - val gradleSuccess = d.findObject(UiSelector().textContains("BUILD SUCCESSFUL")) - val failure = d.findObject(UiSelector().textContains("Build failed")) - val gradleFailure = d.findObject(UiSelector().textContains("BUILD FAILED")) - - val deadline = System.currentTimeMillis() + BUILD_TIMEOUT_MS - var lastLogAt = 0L - var completed = false - - while (System.currentTimeMillis() < deadline && !completed) { - if (success.exists() || gradleSuccess.exists()) { - completed = true - break - } - - check(!failure.exists() && !gradleFailure.exists()) { - "Selected Gradle tasks failed" - } - - val now = System.currentTimeMillis() - if (now - lastLogAt > BUILD_LOG_INTERVAL_MS) { - runAssembleLog("Still waiting for selected assemble tasks to finish") - lastLogAt = now - } - - Thread.sleep(POLL_INTERVAL_MS) - d.waitForIdle() - } - - check(completed) { - "Timed out waiting for selected Gradle tasks to complete" - } - runAssembleLog("Selected assemble tasks finished; continuing to close project") - d.waitForIdle() - } - } - - companion object { - val DEFAULT_ASSEMBLE_TASKS = listOf( - ":app:assemble", - ":app:assembleAndroidTest", - ":app:assembleDebug", - ":app:assembleDebugAndroidTest", - ":app:assembleDebugUnitTest", - ":app:assembleRelease", - ":app:assembleReleaseUnitTest", - ":app:assembleUnitTest", - ) - - private const val BUILD_TIMEOUT_MS = 10 * 60 * 1000L - } + override val steps: TestContext.() -> Unit = { + step("Dismiss post-build overlays before running assemble tasks") { + val d = device.uiDevice + val dismiss = d.findObject(UiSelector().text("Dismiss")) + if (dismiss.waitForExists(DEFAULT_UI_TIMEOUT_MS)) { + dismiss.click() + d.waitForIdle() + } + val installer = + d.findObject( + UiSelector().packageNameMatches(".*packageinstaller.*|.*permissioncontroller.*"), + ) + if (installer.exists()) { + runAssembleLog("Package installer still visible before assemble tasks; dismissing") + val cancel = d.findObject(UiSelector().textMatches("(?i)cancel")) + if (cancel.waitForExists(SHORT_UI_TIMEOUT_MS)) { + cancel.click() + } else { + d.pressBack() + } + runCatching { installer.waitUntilGone(INSTALLER_GONE_TIMEOUT_MS) } + d.waitForIdle() + } + } + + step("Open Run tasks dialog") { + val d = device.uiDevice + val targetContext = InstrumentationRegistry.getInstrumentation().targetContext + val runTasksDescription = targetContext.getString(R.string.cd_toolbar_run_gradle_tasks) + val toolbar = d.findObject(UiSelector().resourceIdMatches(".*:id/editor_appBarLayout")) + check(toolbar.waitForExists(EDITOR_TOOLBAR_TIMEOUT_MS)) { "Editor toolbar not found" } + clickFirstAccessibilityNodeByDescription(runTasksDescription) + d.waitForIdle() + + val title = targetContext.getString(R.string.title_run_tasks) + check(d.findObject(UiSelector().text(title)).waitForExists(RUN_TASKS_DIALOG_TIMEOUT_MS)) { + "Run tasks dialog did not open" + } + } + + step("Filter assemble tasks") { + val d = device.uiDevice + val search = d.findObject(UiSelector().className("android.widget.EditText")) + check(search.waitForExists(RUN_TASKS_DIALOG_TIMEOUT_MS)) { "Run tasks search field not found" } + search.setText("assemble") + d.waitForIdle() + } + + tasks.forEach { task -> + step("Select Gradle task $task") { + val d = device.uiDevice + var taskNode = d.findObject(UiSelector().text(task)) + if (!taskNode.waitForExists(DEFAULT_UI_TIMEOUT_MS)) { + UiScrollable(UiSelector().scrollable(true)).scrollTextIntoView(task) + taskNode = d.findObject(UiSelector().text(task)) + } + check(taskNode.waitForExists(TASK_SELECTION_TIMEOUT_MS)) { + "Task not found in Run tasks dialog: $task" + } + clickFirstAccessibilityNodeParentByText(task) + d.waitForIdle() + } + } + + step("Confirm and run selected Gradle tasks") { + val d = device.uiDevice + val runButton = d.findObject(UiSelector().resourceIdMatches(".*:id/exec")) + check(runButton.waitForExists(RUN_TASKS_DIALOG_TIMEOUT_MS)) { "Run tasks execute button not found" } + runButton.click() + d.waitForIdle() + + tasks.forEach { task -> + check(d.findObject(UiSelector().textContains(task)).waitForExists(RUN_TASKS_DIALOG_TIMEOUT_MS)) { + "Run tasks confirmation missing selected task: $task" + } + } + + runButton.click() + d.waitForIdle() + runAssembleLog("Selected assemble tasks submitted") + } + + step("Wait for selected Gradle tasks to finish") { + runAssembleLog("Waiting for selected assemble tasks to finish") + val d = device.uiDevice + val success = d.findObject(UiSelector().textContains("Build completed successfully")) + val gradleSuccess = d.findObject(UiSelector().textContains("BUILD SUCCESSFUL")) + val failure = d.findObject(UiSelector().textContains("Build failed")) + val gradleFailure = d.findObject(UiSelector().textContains("BUILD FAILED")) + + val deadline = System.currentTimeMillis() + BUILD_TIMEOUT_MS + var lastLogAt = 0L + var completed = false + + while (System.currentTimeMillis() < deadline && !completed) { + if (success.exists() || gradleSuccess.exists()) { + completed = true + break + } + + check(!failure.exists() && !gradleFailure.exists()) { + "Selected Gradle tasks failed" + } + + val now = System.currentTimeMillis() + if (now - lastLogAt > BUILD_LOG_INTERVAL_MS) { + runAssembleLog("Still waiting for selected assemble tasks to finish") + lastLogAt = now + } + + Thread.sleep(POLL_INTERVAL_MS) + d.waitForIdle() + } + + check(completed) { + "Timed out waiting for selected Gradle tasks to complete" + } + runAssembleLog("Selected assemble tasks finished; continuing to close project") + d.waitForIdle() + } + } + + companion object { + val DEFAULT_ASSEMBLE_TASKS = + listOf( + ":app:assemble", + ":app:assembleAndroidTest", + ":app:assembleDebug", + ":app:assembleDebugAndroidTest", + ":app:assembleDebugUnitTest", + ":app:assembleRelease", + ":app:assembleReleaseUnitTest", + ":app:assembleUnitTest", + ) + + private const val BUILD_TIMEOUT_MS = 10 * 60 * 1000L + } } diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/EditorScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/EditorScreen.kt index b9a212fbb0..ca79a16994 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/EditorScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/EditorScreen.kt @@ -4,12 +4,11 @@ import com.kaspersky.kaspresso.screens.KScreen import io.github.kakaocup.kakao.dialog.KAlertDialog object EditorScreen : KScreen() { + override val layoutId: Int? = null - override val layoutId: Int? = null + override val viewClass: Class<*>? = null - override val viewClass: Class<*>? = null + val firstBuildDialog = KAlertDialog() - val firstBuildDialog = KAlertDialog() - - val closeProjectDialog = KAlertDialog() -} \ No newline at end of file + val closeProjectDialog = KAlertDialog() +} diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/HomeScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/HomeScreen.kt index e33410e97c..de4734956a 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/HomeScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/HomeScreen.kt @@ -2,10 +2,10 @@ package org.appdevforall.codeonthego.screens import androidx.test.platform.app.InstrumentationRegistry import com.itsaky.androidide.R -import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText import com.kaspersky.kaspresso.screens.KScreen import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext import io.github.kakaocup.kakao.text.KTextView +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText import com.itsaky.androidide.resources.R as ResourcesR object HomeScreen : KScreen() { diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/InstallToolsScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/InstallToolsScreen.kt index dcd91b0a8a..00ace11ac7 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/InstallToolsScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/InstallToolsScreen.kt @@ -5,9 +5,8 @@ import com.kaspersky.kaspresso.screens.KScreen import io.github.kakaocup.kakao.text.KButton object InstallToolsScreen : KScreen() { + override val layoutId: Int? = null + override val viewClass: Class<*>? = null - override val layoutId: Int? = null - override val viewClass: Class<*>? = null - - val doneButton = KButton { withId(R.id.done) } -} \ No newline at end of file + val doneButton = KButton { withId(R.id.done) } +} diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/OnboardingScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/OnboardingScreen.kt index ca12c4b3f6..b8a91550f4 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/OnboardingScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/OnboardingScreen.kt @@ -6,17 +6,18 @@ import io.github.kakaocup.kakao.text.KButton import io.github.kakaocup.kakao.text.KTextView object OnboardingScreen : KScreen() { + override val layoutId: Int? = null + override val viewClass: Class<*>? = null - override val layoutId: Int? = null - override val viewClass: Class<*>? = null - - val greetingTitle = KTextView { - withId(R.id.title) - isDisplayed() - } - val greetingSubtitle = KTextView { - withId(R.id.description) - isDisplayed() - } - val nextButton = KButton { withId(R.id.next) } -} \ No newline at end of file + val greetingTitle = + KTextView { + withId(R.id.title) + isDisplayed() + } + val greetingSubtitle = + KTextView { + withId(R.id.description) + isDisplayed() + } + val nextButton = KButton { withId(R.id.next) } +} diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/PermissionScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/PermissionScreen.kt index abe4a2596b..017681e63e 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/PermissionScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/PermissionScreen.kt @@ -10,24 +10,25 @@ import io.github.kakaocup.kakao.text.KTextView import org.hamcrest.Matcher object PermissionScreen : KScreen() { - - override val layoutId: Int? = null - override val viewClass: Class<*>? = null - - val title = KTextView { withText(R.string.onboarding_title_permissions) } - val subTitle = KTextView { withText(R.string.onboarding_subtitle_permissions) } - - val rvPermissions = KRecyclerView( - builder = { withId(R.id.onboarding_items) }, - itemTypeBuilder = { itemType(::PermissionItem) } - ) - - val finishInstallationButton = KButton { withId(R.id.finish_installation_button) } - - class PermissionItem(matcher: Matcher) : KRecyclerItem(matcher) { - - val grantButton = KButton(matcher) { withId(R.id.grant_button) } - val title = KTextView(matcher) { withId(R.id.title) } - val description = KTextView(matcher) { withId(R.id.description) } - } -} \ No newline at end of file + override val layoutId: Int? = null + override val viewClass: Class<*>? = null + + val title = KTextView { withText(R.string.onboarding_title_permissions) } + val subTitle = KTextView { withText(R.string.onboarding_subtitle_permissions) } + + val rvPermissions = + KRecyclerView( + builder = { withId(R.id.onboarding_items) }, + itemTypeBuilder = { itemType(::PermissionItem) }, + ) + + val finishInstallationButton = KButton { withId(R.id.finish_installation_button) } + + class PermissionItem( + matcher: Matcher, + ) : KRecyclerItem(matcher) { + val grantButton = KButton(matcher) { withId(R.id.grant_button) } + val title = KTextView(matcher) { withId(R.id.title) } + val description = KTextView(matcher) { withId(R.id.description) } + } +} diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/ProjectSettingsScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/ProjectSettingsScreen.kt index af61dfa237..abaf6b7611 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/ProjectSettingsScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/ProjectSettingsScreen.kt @@ -2,14 +2,14 @@ package org.appdevforall.codeonthego.screens import androidx.test.uiautomator.UiSelector import com.itsaky.androidide.R -import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText -import org.appdevforall.codeonthego.helper.setAccessibilityEditText import com.kaspersky.kaspresso.screens.KScreen import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext import io.github.kakaocup.kakao.check.KCheckBox import io.github.kakaocup.kakao.spinner.KSpinner import io.github.kakaocup.kakao.spinner.KSpinnerItem import io.github.kakaocup.kakao.text.KButton +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText +import org.appdevforall.codeonthego.helper.setAccessibilityEditText private const val KOTLIN_LANGUAGE_SELECTION_TIMEOUT_MS = 30_000L private const val LANGUAGE_OPTION_TIMEOUT_MS = 5_000L @@ -18,110 +18,112 @@ private const val PROJECT_NAME_FIELD_TIMEOUT_MS = 3_000L private const val LANGUAGE_DROPDOWN_FALLBACK_X_OFFSET = 80 object ProjectSettingsScreen : KScreen() { - - override val layoutId: Int? = null - - override val viewClass: Class<*>? = null - - val createProjectButton = KButton { - withText(R.string.create_project) - withId(R.id.finish) - } - - val spinner = KSpinner( - builder = { withHint("Project Language") }, - itemTypeBuilder = { itemType(::KSpinnerItem) } - ) - - val kotlinScriptText = KCheckBox { - withText(R.string.msg_use_kts) - } - - fun TestContext.selectJavaLanguage() { - step("Select the java language") { - val javaText = device.targetContext.getString(R.string.lang_java) - ProjectSettingsScreen { - spinner { - isVisible() - open() - - childAt(0) { - isVisible() - hasText(javaText) - click() - } - } - } - } - } - - fun TestContext.selectKotlinLanguage() { - step("Select the kotlin language") { - flakySafely(KOTLIN_LANGUAGE_SELECTION_TIMEOUT_MS) { - val kotlinText = device.targetContext.getString(R.string.lang_kotlin) - openProjectLanguageDropdown() - - val d = device.uiDevice - val kotlin = d.findObject(UiSelector().text(kotlinText)) - check(kotlin.waitForExists(LANGUAGE_OPTION_TIMEOUT_MS)) { "Kotlin language option not found" } - kotlin.click() - d.waitForIdle() - } - } - } - - private fun TestContext.openProjectLanguageDropdown() { - val d = device.uiDevice - val javaText = device.targetContext.getString(R.string.lang_java) - val kotlinText = device.targetContext.getString(R.string.lang_kotlin) - val languageLabelText = device.targetContext.getString(R.string.wizard_language) - - val javaValue = d.findObject(UiSelector().text(javaText)) - if (javaValue.waitForExists(LANGUAGE_OPTION_TIMEOUT_MS)) { - val bounds = javaValue.visibleBounds - d.click(bounds.centerX(), bounds.centerY()) - d.waitForIdle() - if (d.findObject(UiSelector().text(kotlinText)).waitForExists(LANGUAGE_DROPDOWN_EXPANSION_TIMEOUT_MS)) { - return - } - } - - val languageLabel = d.findObject(UiSelector().text(languageLabelText)) - if (languageLabel.waitForExists(LANGUAGE_OPTION_TIMEOUT_MS)) { - val bounds = languageLabel.visibleBounds - d.click(d.displayWidth - LANGUAGE_DROPDOWN_FALLBACK_X_OFFSET, bounds.centerY()) - d.waitForIdle() - if (d.findObject(UiSelector().text(kotlinText)).waitForExists(LANGUAGE_DROPDOWN_EXPANSION_TIMEOUT_MS)) { - return - } - } - - error("Project language dropdown did not open") - } - - fun TestContext.clickCreateProjectProjectSettings() { - step("Click create project on the Settings Page") { - val createText = device.targetContext.getString(R.string.create_project) - clickFirstAccessibilityNodeByText(createText) - device.uiDevice.waitForIdle() - } - } - - fun TestContext.setProjectName(name: String) { - step("Set project name to '$name'") { - val d = device.uiDevice - val byText = d.findObject(UiSelector().textStartsWith("My Application")) - check(byText.waitForExists(PROJECT_NAME_FIELD_TIMEOUT_MS)) { "Project name field not found" } - setAccessibilityEditText("My Application", name, "project name") - d.waitForIdle() - } - } - - fun TestContext.uncheckKotlinScript() { - step("Unselect Kotlin Script for Gradle") { - kotlinScriptText { - setChecked(false) - } - } - } + override val layoutId: Int? = null + + override val viewClass: Class<*>? = null + + val createProjectButton = + KButton { + withText(R.string.create_project) + withId(R.id.finish) + } + + val spinner = + KSpinner( + builder = { withHint("Project Language") }, + itemTypeBuilder = { itemType(::KSpinnerItem) }, + ) + + val kotlinScriptText = + KCheckBox { + withText(R.string.msg_use_kts) + } + + fun TestContext.selectJavaLanguage() { + step("Select the java language") { + val javaText = device.targetContext.getString(R.string.lang_java) + ProjectSettingsScreen { + spinner { + isVisible() + open() + + childAt(0) { + isVisible() + hasText(javaText) + click() + } + } + } + } + } + + fun TestContext.selectKotlinLanguage() { + step("Select the kotlin language") { + flakySafely(KOTLIN_LANGUAGE_SELECTION_TIMEOUT_MS) { + val kotlinText = device.targetContext.getString(R.string.lang_kotlin) + openProjectLanguageDropdown() + + val d = device.uiDevice + val kotlin = d.findObject(UiSelector().text(kotlinText)) + check(kotlin.waitForExists(LANGUAGE_OPTION_TIMEOUT_MS)) { "Kotlin language option not found" } + kotlin.click() + d.waitForIdle() + } + } + } + + private fun TestContext.openProjectLanguageDropdown() { + val d = device.uiDevice + val javaText = device.targetContext.getString(R.string.lang_java) + val kotlinText = device.targetContext.getString(R.string.lang_kotlin) + val languageLabelText = device.targetContext.getString(R.string.wizard_language) + + val javaValue = d.findObject(UiSelector().text(javaText)) + if (javaValue.waitForExists(LANGUAGE_OPTION_TIMEOUT_MS)) { + val bounds = javaValue.visibleBounds + d.click(bounds.centerX(), bounds.centerY()) + d.waitForIdle() + if (d.findObject(UiSelector().text(kotlinText)).waitForExists(LANGUAGE_DROPDOWN_EXPANSION_TIMEOUT_MS)) { + return + } + } + + val languageLabel = d.findObject(UiSelector().text(languageLabelText)) + if (languageLabel.waitForExists(LANGUAGE_OPTION_TIMEOUT_MS)) { + val bounds = languageLabel.visibleBounds + d.click(d.displayWidth - LANGUAGE_DROPDOWN_FALLBACK_X_OFFSET, bounds.centerY()) + d.waitForIdle() + if (d.findObject(UiSelector().text(kotlinText)).waitForExists(LANGUAGE_DROPDOWN_EXPANSION_TIMEOUT_MS)) { + return + } + } + + error("Project language dropdown did not open") + } + + fun TestContext.clickCreateProjectProjectSettings() { + step("Click create project on the Settings Page") { + val createText = device.targetContext.getString(R.string.create_project) + clickFirstAccessibilityNodeByText(createText) + device.uiDevice.waitForIdle() + } + } + + fun TestContext.setProjectName(name: String) { + step("Set project name to '$name'") { + val d = device.uiDevice + val byText = d.findObject(UiSelector().textStartsWith("My Application")) + check(byText.waitForExists(PROJECT_NAME_FIELD_TIMEOUT_MS)) { "Project name field not found" } + setAccessibilityEditText("My Application", name, "project name") + d.waitForIdle() + } + } + + fun TestContext.uncheckKotlinScript() { + step("Unselect Kotlin Script for Gradle") { + kotlinScriptText { + setChecked(false) + } + } + } } diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/QuickBuildScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/QuickBuildScreen.kt index 8490fd5e14..5df5c43d6c 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/QuickBuildScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/QuickBuildScreen.kt @@ -3,10 +3,10 @@ package org.appdevforall.codeonthego.screens import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiObject import androidx.test.uiautomator.UiSelector -import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText import com.itsaky.androidide.resources.R import com.kaspersky.kaspresso.screens.KScreen import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText import org.junit.Assert.assertTrue private const val FIRST_BUILD_NOTICE_TIMEOUT_MS = 3_000L diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/SystemPermissionsScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/SystemPermissionsScreen.kt index 203139d2d8..5f4123393c 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/SystemPermissionsScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/SystemPermissionsScreen.kt @@ -4,19 +4,19 @@ import com.kaspersky.components.kautomator.component.common.views.UiView import com.kaspersky.components.kautomator.screen.UiScreen object SystemPermissionsScreen : UiScreen() { - override val packageName: String = "com.android.settings" + override val packageName: String = "com.android.settings" - val storagePermissionView = UiView { withText("Allow access to manage all files") } - val storagePermissionViewAlt1 = UiView { withText("Files and media") } - val storagePermissionViewAlt2 = UiView { withText("Access all files") } - val storagePermissionViewAlt3 = UiView { withText("Allow") } - val storagePermissionViewAlt4 = UiView { withText("Allow file management") } - val storagePermissionViewAlt5 = UiView { withText("Allow permission") } - val storagePermissionViewAlt6 = UiView { withText("Use USB storage") } - val storagePermissionViewAlt7 = UiView { withText("Storage") } - val storagePermissionViewAlt8 = UiView { withText("Files") } + val storagePermissionView = UiView { withText("Allow access to manage all files") } + val storagePermissionViewAlt1 = UiView { withText("Files and media") } + val storagePermissionViewAlt2 = UiView { withText("Access all files") } + val storagePermissionViewAlt3 = UiView { withText("Allow") } + val storagePermissionViewAlt4 = UiView { withText("Allow file management") } + val storagePermissionViewAlt5 = UiView { withText("Allow permission") } + val storagePermissionViewAlt6 = UiView { withText("Use USB storage") } + val storagePermissionViewAlt7 = UiView { withText("Storage") } + val storagePermissionViewAlt8 = UiView { withText("Files") } - val installPackagesPermission = UiView { withText("Allow from this source") } - val installPackagesPermissionAlt1 = UiView { withText("Allow install of apps") } - val installPackagesPermissionAlt2 = UiView { withText("Allow") } -} \ No newline at end of file + val installPackagesPermission = UiView { withText("Allow from this source") } + val installPackagesPermissionAlt1 = UiView { withText("Allow install of apps") } + val installPackagesPermissionAlt2 = UiView { withText("Allow") } +} diff --git a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/TemplateScreen.kt b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/TemplateScreen.kt index 533d905fcf..14dea9f83f 100644 --- a/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/TemplateScreen.kt +++ b/app/src/androidTest/kotlin/org/appdevforall/codeonthego/screens/TemplateScreen.kt @@ -1,33 +1,37 @@ package org.appdevforall.codeonthego.screens -import androidx.test.uiautomator.UiSelector import androidx.test.uiautomator.UiScrollable -import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeParentByText +import androidx.test.uiautomator.UiSelector import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext +import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeParentByText object TemplateScreen { + fun TestContext.selectTemplate( + templateResId: Int, + visibleTextOverride: String? = null, + ) { + val templateText = visibleTextOverride ?: device.targetContext.getString(templateResId) - fun TestContext.selectTemplate(templateResId: Int, visibleTextOverride: String? = null) { - val templateText = visibleTextOverride ?: device.targetContext.getString(templateResId) - - val d = device.uiDevice - var templateItem = d.findObject( - UiSelector().resourceIdMatches(".*:id/template_name").text(templateText), - ) - if (!templateItem.waitForExists(3_000)) { - runCatching { - UiScrollable(UiSelector().scrollable(true)).scrollTextIntoView(templateText) - } - d.waitForIdle() - templateItem = d.findObject( - UiSelector().resourceIdMatches(".*:id/template_name").text(templateText), - ) - } + val d = device.uiDevice + var templateItem = + d.findObject( + UiSelector().resourceIdMatches(".*:id/template_name").text(templateText), + ) + if (!templateItem.waitForExists(3_000)) { + runCatching { + UiScrollable(UiSelector().scrollable(true)).scrollTextIntoView(templateText) + } + d.waitForIdle() + templateItem = + d.findObject( + UiSelector().resourceIdMatches(".*:id/template_name").text(templateText), + ) + } - check(templateItem.waitForExists(3_000)) { - "Template '$templateText' not found in template list" - } - clickFirstAccessibilityNodeParentByText(templateText, "template '$templateText'") - d.waitForIdle() - } + check(templateItem.waitForExists(3_000)) { + "Template '$templateText' not found in template list" + } + clickFirstAccessibilityNodeParentByText(templateText, "template '$templateText'") + d.waitForIdle() + } } diff --git a/app/src/debug/java/org/appdevforall/codeonthego/app/LeakCanaryConfig.kt b/app/src/debug/java/org/appdevforall/codeonthego/app/LeakCanaryConfig.kt index 9639e18844..b99bcb3806 100644 --- a/app/src/debug/java/org/appdevforall/codeonthego/app/LeakCanaryConfig.kt +++ b/app/src/debug/java/org/appdevforall/codeonthego/app/LeakCanaryConfig.kt @@ -1,7 +1,7 @@ package org.appdevforall.codeonthego.app -import org.appdevforall.codeonthego.utils.FeatureFlags import leakcanary.LeakCanary +import org.appdevforall.codeonthego.utils.FeatureFlags internal object LeakCanaryConfig { fun applyFromFeatureFlags() { diff --git a/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/QuickBuildBenchActivity.kt b/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/QuickBuildBenchActivity.kt index 8e8a932a7c..45f624959b 100644 --- a/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/QuickBuildBenchActivity.kt +++ b/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/QuickBuildBenchActivity.kt @@ -3,13 +3,13 @@ package org.appdevforall.codeonthego.quickbuild import android.app.Activity import android.content.Intent import android.os.Bundle +import kotlinx.coroutines.runBlocking import org.appdevforall.codeonthego.activities.editor.EditorActivityKt import org.appdevforall.codeonthego.models.EditorIntentExtras import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences import org.appdevforall.codeonthego.projects.ProjectManagerImpl import org.appdevforall.codeonthego.utils.Environment import org.appdevforall.codeonthego.utils.FeatureFlags -import kotlinx.coroutines.runBlocking import org.appdevforall.cotg.quickbuild.service.session.QuickBuildSessionManager import org.koin.core.context.GlobalContext import org.slf4j.LoggerFactory diff --git a/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/QuickBuildBenchHooks.kt b/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/QuickBuildBenchHooks.kt index 2a29d1c3d7..de667ac2c6 100644 --- a/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/QuickBuildBenchHooks.kt +++ b/app/src/debug/java/org/appdevforall/codeonthego/quickbuild/QuickBuildBenchHooks.kt @@ -1,10 +1,10 @@ package org.appdevforall.codeonthego.quickbuild -import org.appdevforall.codeonthego.utils.FeatureFlags import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.flow.StateFlow +import org.appdevforall.codeonthego.utils.FeatureFlags import org.appdevforall.cotg.quickbuild.domain.session.QuickBuildSessionState import org.appdevforall.cotg.quickbuild.domain.telemetry.QuickBuildMetricsSink import org.koin.core.context.GlobalContext diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/BaseBuildAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/BaseBuildAction.kt index cfcf4fef51..800c84c63d 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/BaseBuildAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/BaseBuildAction.kt @@ -17,9 +17,9 @@ package org.appdevforall.codeonthego.actions +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.lookup.Lookup import org.appdevforall.codeonthego.projects.builder.BuildService -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.utils.flashInfoLong /** diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/BaseEditorAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/BaseEditorAction.kt index 7439b04d25..d186207852 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/BaseEditorAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/BaseEditorAction.kt @@ -22,76 +22,74 @@ import android.graphics.drawable.Drawable import android.widget.EditText import androidx.core.content.ContextCompat import androidx.core.graphics.drawable.DrawableCompat -import org.appdevforall.codeonthego.editor.ui.IDEEditor import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.editor.adapters.IdeEditorAdapter +import org.appdevforall.codeonthego.editor.ui.IDEEditor /** @author Akash Yadav */ abstract class BaseEditorAction : EditorActionItem { - - override var label: String = "" - override var visible: Boolean = true - override var enabled: Boolean = true - override var icon: Drawable? = null - override var requiresUIThread: Boolean = true // all editor actions must be executed on UI thread - override var location: ActionItem.Location = ActionItem.Location.EDITOR_TEXT_ACTIONS - - override fun prepare(data: ActionData) { - super.prepare(data) - - val textTarget = getTextTarget(data) - val ideEditor = data.get(IDEEditor::class.java) - - if (textTarget != null) { - visible = true - enabled = (textTarget as? MutableTextTarget)?.isEditable() ?: false - return - } - - if (ideEditor != null) { - visible = true - enabled = true - return - } - - visible = false - enabled = visible - } - - fun getTextTarget(data: ActionData): TextTarget? { - val mutable = data.get(MutableTextTarget::class.java) - if (mutable != null) return mutable - - val target = data.get(TextTarget::class.java) - if (target != null) return target - - val editor = data.get(IDEEditor::class.java) - if (editor != null) { - return IdeEditorAdapter(editor) - } - - val view = data.get(EditText::class.java) - if (view != null) { - return EditTextAdapter(view) - } - - return null - } - - fun getEditor(data: ActionData): IDEEditor? { - return data.get(IDEEditor::class.java) - } - - fun getContext(data: ActionData): Context? { - return getTextTarget(data)?.getAnchorView()?.context - } - - fun tintDrawable(context: Context, drawable: Drawable): Drawable { - val wrapped = DrawableCompat.wrap(drawable).mutate() - val solidColor = ContextCompat.getColor(context, R.color.primaryIconColor) - - wrapped.alpha = 255 - DrawableCompat.setTint(wrapped, solidColor) - return wrapped - } + override var label: String = "" + override var visible: Boolean = true + override var enabled: Boolean = true + override var icon: Drawable? = null + override var requiresUIThread: Boolean = true // all editor actions must be executed on UI thread + override var location: ActionItem.Location = ActionItem.Location.EDITOR_TEXT_ACTIONS + + override fun prepare(data: ActionData) { + super.prepare(data) + + val textTarget = getTextTarget(data) + val ideEditor = data.get(IDEEditor::class.java) + + if (textTarget != null) { + visible = true + enabled = (textTarget as? MutableTextTarget)?.isEditable() ?: false + return + } + + if (ideEditor != null) { + visible = true + enabled = true + return + } + + visible = false + enabled = visible + } + + fun getTextTarget(data: ActionData): TextTarget? { + val mutable = data.get(MutableTextTarget::class.java) + if (mutable != null) return mutable + + val target = data.get(TextTarget::class.java) + if (target != null) return target + + val editor = data.get(IDEEditor::class.java) + if (editor != null) { + return IdeEditorAdapter(editor) + } + + val view = data.get(EditText::class.java) + if (view != null) { + return EditTextAdapter(view) + } + + return null + } + + fun getEditor(data: ActionData): IDEEditor? = data.get(IDEEditor::class.java) + + fun getContext(data: ActionData): Context? = getTextTarget(data)?.getAnchorView()?.context + + fun tintDrawable( + context: Context, + drawable: Drawable, + ): Drawable { + val wrapped = DrawableCompat.wrap(drawable).mutate() + val solidColor = ContextCompat.getColor(context, R.color.primaryIconColor) + + wrapped.alpha = 255 + DrawableCompat.setTint(wrapped, solidColor) + return wrapped + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/EditorActivityAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/EditorActivityAction.kt index 10c02bdee1..049fd645a9 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/EditorActivityAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/EditorActivityAction.kt @@ -19,46 +19,41 @@ package org.appdevforall.codeonthego.actions import android.content.Context import android.graphics.drawable.Drawable -import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity -import org.appdevforall.codeonthego.tasks.cancelIfActive import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.plus +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity +import org.appdevforall.codeonthego.tasks.cancelIfActive /** @author Akash Yadav */ abstract class EditorActivityAction : ActionItem { - - override var enabled: Boolean = true - override var visible: Boolean = true - override var icon: Drawable? = null - override var label: String = "" - override var location: ActionItem.Location = ActionItem.Location.EDITOR_TOOLBAR - - override var requiresUIThread: Boolean = false - - protected val actionScope = CoroutineScope(Dispatchers.Default) + - CoroutineName("${javaClass.simpleName}Scope") - - override fun prepare(data: ActionData) { - super.prepare(data) - if (!data.hasRequiredData(Context::class.java)) { - markInvisible() - return - } - } - - fun ActionData.getActivity(): EditorHandlerActivity? { - return this[Context::class.java] as? EditorHandlerActivity - } - - fun ActionData.requireActivity(): EditorHandlerActivity { - return getActivity()!! - } - - override fun destroy() { - super.destroy() - actionScope.cancelIfActive("Action is being destroyed") - } - + override var enabled: Boolean = true + override var visible: Boolean = true + override var icon: Drawable? = null + override var label: String = "" + override var location: ActionItem.Location = ActionItem.Location.EDITOR_TOOLBAR + + override var requiresUIThread: Boolean = false + + protected val actionScope = + CoroutineScope(Dispatchers.Default) + + CoroutineName("${javaClass.simpleName}Scope") + + override fun prepare(data: ActionData) { + super.prepare(data) + if (!data.hasRequiredData(Context::class.java)) { + markInvisible() + return + } + } + + fun ActionData.getActivity(): EditorHandlerActivity? = this[Context::class.java] as? EditorHandlerActivity + + fun ActionData.requireActivity(): EditorHandlerActivity = getActivity()!! + + override fun destroy() { + super.destroy() + actionScope.cancelIfActive("Action is being destroyed") + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/EditorRelatedAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/EditorRelatedAction.kt index 2e68266728..e222a4f7a7 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/EditorRelatedAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/EditorRelatedAction.kt @@ -21,29 +21,29 @@ import org.appdevforall.codeonthego.editor.ui.IDEEditor import org.appdevforall.codeonthego.ui.CodeEditorView /** @author Akash Yadav */ -abstract class EditorRelatedAction : EditorActivityAction(), EditorActionItem { - - override var requiresUIThread: Boolean = true - - override fun prepare(data: ActionData) { - super.prepare(data) - super.prepare(data) - val editor = - data.getEditor() - ?: run { - visible = false - enabled = false - return - } - - val file = editor.file - - visible = file != null - enabled = visible - } - - fun ActionData.getEditor(): IDEEditor? = get(IDEEditor::class.java) - - fun ActionData.getEditorView(): CodeEditorView? = get(CodeEditorView::class.java) - +abstract class EditorRelatedAction : + EditorActivityAction(), + EditorActionItem { + override var requiresUIThread: Boolean = true + + override fun prepare(data: ActionData) { + super.prepare(data) + super.prepare(data) + val editor = + data.getEditor() + ?: run { + visible = false + enabled = false + return + } + + val file = editor.file + + visible = file != null + enabled = visible + } + + fun ActionData.getEditor(): IDEEditor? = get(IDEEditor::class.java) + + fun ActionData.getEditorView(): CodeEditorView? = get(CodeEditorView::class.java) } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/FileActionManager.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/FileActionManager.kt index b23fd09b7c..3d510e205b 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/FileActionManager.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/FileActionManager.kt @@ -1,14 +1,14 @@ package org.appdevforall.codeonthego.actions -import org.appdevforall.codeonthego.actions.observers.FileActionObserver -import org.appdevforall.codeonthego.eventbus.events.file.FileCreationEvent -import org.appdevforall.codeonthego.utils.FileIOUtils import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import org.apache.commons.text.StringEscapeUtils +import org.appdevforall.codeonthego.actions.observers.FileActionObserver +import org.appdevforall.codeonthego.eventbus.events.file.FileCreationEvent +import org.appdevforall.codeonthego.utils.FileIOUtils import org.greenrobot.eventbus.EventBus import java.io.File import java.io.IOException diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/PluginActionItem.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/PluginActionItem.kt index adf7f34c33..9d954abe4c 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/PluginActionItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/PluginActionItem.kt @@ -2,59 +2,55 @@ package org.appdevforall.codeonthego.actions - -import com.itsaky.androidide.R import android.content.Context import android.graphics.drawable.Drawable import androidx.core.content.ContextCompat +import com.itsaky.androidide.R import org.appdevforall.codeonthego.plugins.extensions.MenuItem import org.appdevforall.codeonthego.plugins.manager.pluginCategory import org.appdevforall.codeonthego.plugins.manager.pluginTooltipTag import org.appdevforall.codeonthego.plugins.manager.ui.PluginDrawableResolver - class PluginActionItem( - context: Context, - private val menuItem: MenuItem, - override val order: Int, - val pluginId: String + context: Context, + private val menuItem: MenuItem, + override val order: Int, + val pluginId: String, ) : EditorActivityAction() { - - override val id: String = "plugin.${menuItem.id}" - - init { - label = menuItem.title - val iconResId = menuItem.icon - icon = if (iconResId != null) { - PluginDrawableResolver.resolve(iconResId, pluginId, context) - ?: ContextCompat.getDrawable(context, R.drawable.ic_package) - } else { - ContextCompat.getDrawable(context, R.drawable.ic_package) - } - location = ActionItem.Location.EDITOR_TOOLBAR - requiresUIThread = true - } - - override fun prepare(data: ActionData) { - super.prepare(data) - enabled = menuItem.isEnabledProvider?.invoke() ?: menuItem.isEnabled - visible = menuItem.isVisibleProvider?.invoke() ?: menuItem.isVisible - } - - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = - menuItem.tooltipTag ?: pluginTooltipTag(pluginId, menuItem.id) - - override fun retrieveTooltipCategory(): String = pluginCategory(pluginId) - - override suspend fun execAction(data: ActionData): Any { - return try { - // Execute the plugin's action callback on UI thread - menuItem.action.invoke() - true - } catch (e: Exception) { - // Log error but don't crash the app - android.util.Log.e("PluginActionItem", "Error executing plugin action '${menuItem.id}': ${e.message}", e) - false - } - } + override val id: String = "plugin.${menuItem.id}" + + init { + label = menuItem.title + val iconResId = menuItem.icon + icon = + if (iconResId != null) { + PluginDrawableResolver.resolve(iconResId, pluginId, context) + ?: ContextCompat.getDrawable(context, R.drawable.ic_package) + } else { + ContextCompat.getDrawable(context, R.drawable.ic_package) + } + location = ActionItem.Location.EDITOR_TOOLBAR + requiresUIThread = true + } + + override fun prepare(data: ActionData) { + super.prepare(data) + enabled = menuItem.isEnabledProvider?.invoke() ?: menuItem.isEnabled + visible = menuItem.isVisibleProvider?.invoke() ?: menuItem.isVisible + } + + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = menuItem.tooltipTag ?: pluginTooltipTag(pluginId, menuItem.id) + + override fun retrieveTooltipCategory(): String = pluginCategory(pluginId) + + override suspend fun execAction(data: ActionData): Any = + try { + // Execute the plugin's action callback on UI thread + menuItem.action.invoke() + true + } catch (e: Exception) { + // Log error but don't crash the app + android.util.Log.e("PluginActionItem", "Error executing plugin action '${menuItem.id}': ${e.message}", e) + false + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/PluginSidebarActionItem.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/PluginSidebarActionItem.kt index 77acb77ea8..6be6574d26 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/PluginSidebarActionItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/PluginSidebarActionItem.kt @@ -6,68 +6,67 @@ import android.content.Context import android.graphics.drawable.Drawable import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment +import com.itsaky.androidide.R +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext import org.appdevforall.codeonthego.plugins.extensions.NavigationItem import org.appdevforall.codeonthego.plugins.manager.pluginCategory import org.appdevforall.codeonthego.plugins.manager.pluginTooltipTag import org.appdevforall.codeonthego.plugins.manager.ui.PluginDrawableResolver -import com.itsaky.androidide.R -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.withContext import kotlin.reflect.KClass class PluginSidebarActionItem( - private val context: Context, - private val navigationItem: NavigationItem, - baseOrder: Int, - val pluginId: String + private val context: Context, + private val navigationItem: NavigationItem, + baseOrder: Int, + val pluginId: String, ) : SidebarActionItem { + override val id: String = "plugin_sidebar_${navigationItem.id}" + override var enabled: Boolean = navigationItem.isEnabled + override var visible: Boolean = navigationItem.isVisible + override var label: String = navigationItem.title + override var order: Int = navigationItem.order + 1000 + baseOrder + override var requiresUIThread: Boolean = true + override var location: ActionItem.Location = ActionItem.Location.EDITOR_SIDEBAR - override val id: String = "plugin_sidebar_${navigationItem.id}" - override var enabled: Boolean = navigationItem.isEnabled - override var visible: Boolean = navigationItem.isVisible - override var label: String = navigationItem.title - override var order: Int = navigationItem.order + 1000 + baseOrder - override var requiresUIThread: Boolean = true - override var location: ActionItem.Location = ActionItem.Location.EDITOR_SIDEBAR - - override var icon: Drawable? = null + override var icon: Drawable? = null - override val fragmentClass: KClass? = null + override val fragmentClass: KClass? = null - init { - val iconResId = navigationItem.icon - icon = if (iconResId != null) { - PluginDrawableResolver.resolve(iconResId, pluginId, context) - ?: ContextCompat.getDrawable(context, R.drawable.ic_extension) - } else { - ContextCompat.getDrawable(context, R.drawable.ic_extension) - } - } + init { + val iconResId = navigationItem.icon + icon = + if (iconResId != null) { + PluginDrawableResolver.resolve(iconResId, pluginId, context) + ?: ContextCompat.getDrawable(context, R.drawable.ic_extension) + } else { + ContextCompat.getDrawable(context, R.drawable.ic_extension) + } + } - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = - navigationItem.tooltipTag ?: pluginTooltipTag(pluginId, navigationItem.id) + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = + navigationItem.tooltipTag ?: pluginTooltipTag(pluginId, navigationItem.id) - override fun retrieveTooltipCategory(): String = pluginCategory(pluginId) + override fun retrieveTooltipCategory(): String = pluginCategory(pluginId) - override suspend fun execAction(data: ActionData): Boolean { - return try { - // Plugin actions might need UI thread access for dialogs/UI operations - if (requiresUIThread) { - withContext(Dispatchers.Main) { - navigationItem.action.invoke() - } - } else { - navigationItem.action.invoke() - } - true - } catch (e: Exception) { - false - } - } + override suspend fun execAction(data: ActionData): Boolean = + try { + // Plugin actions might need UI thread access for dialogs/UI operations + if (requiresUIThread) { + withContext(Dispatchers.Main) { + navigationItem.action.invoke() + } + } else { + navigationItem.action.invoke() + } + true + } catch (e: Exception) { + false + } - override fun prepare(data: ActionData) { - super.prepare(data) - visible = navigationItem.isVisible - enabled = navigationItem.isEnabled - } -} \ No newline at end of file + override fun prepare(data: ActionData) { + super.prepare(data) + visible = navigationItem.isVisible + enabled = navigationItem.isEnabled + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/PluginToolbarActionItem.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/PluginToolbarActionItem.kt index 8b80712e48..41c0cfad6b 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/PluginToolbarActionItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/PluginToolbarActionItem.kt @@ -21,75 +21,74 @@ import org.appdevforall.codeonthego.plugins.manager.ui.PluginDrawableResolver * so the toolbar fully removes it (instead of greying it) when not applicable. */ class PluginToolbarActionItem( - private val context: Context, - private val toolbarAction: ToolbarAction, - val pluginId: String + private val context: Context, + private val toolbarAction: ToolbarAction, + val pluginId: String, ) : EditorActivityAction() { + override val id: String = "plugin.toolbar.${toolbarAction.id}" - override val id: String = "plugin.toolbar.${toolbarAction.id}" + override val order: Int = toolbarAction.order - override val order: Int = toolbarAction.order + override val honorVisibility: Boolean get() = true - override val honorVisibility: Boolean get() = true + init { + label = toolbarAction.title + val iconResId = toolbarAction.icon + icon = + if (iconResId != null) { + PluginDrawableResolver.resolve(iconResId, pluginId, context) + ?: ContextCompat.getDrawable(context, R.drawable.ic_package) + } else { + ContextCompat.getDrawable(context, R.drawable.ic_package) + } + location = ActionItem.Location.EDITOR_TOOLBAR + requiresUIThread = true + } - init { - label = toolbarAction.title - val iconResId = toolbarAction.icon - icon = if (iconResId != null) { - PluginDrawableResolver.resolve(iconResId, pluginId, context) - ?: ContextCompat.getDrawable(context, R.drawable.ic_package) - } else { - ContextCompat.getDrawable(context, R.drawable.ic_package) - } - location = ActionItem.Location.EDITOR_TOOLBAR - requiresUIThread = true - } + override fun prepare(data: ActionData) { + super.prepare(data) + if (!visible) { + // EditorActivityAction.prepare() hides the action when the editor context is + // missing; respect that and skip the plugin providers. + return + } + runCatching { + enabled = toolbarAction.isEnabledProvider?.invoke() ?: toolbarAction.isEnabled + visible = toolbarAction.isVisibleProvider?.invoke() ?: toolbarAction.isVisible + // Re-resolve the icon on every rebuild when the plugin drives it dynamically. + // When iconProvider is null the icon stays as resolved in init (static behavior). + if (visible) { + toolbarAction.iconProvider?.invoke()?.let { resId -> + PluginDrawableResolver.resolve(resId, pluginId, context)?.let { icon = it } + } + } + }.onFailure { e -> + // A throwing/disposed plugin must never keep a stale icon on the toolbar. + Log.w("PluginToolbarActionItem", "prepare failed for '${toolbarAction.id}'", e) + enabled = false + visible = false + } + } - override fun prepare(data: ActionData) { - super.prepare(data) - if (!visible) { - // EditorActivityAction.prepare() hides the action when the editor context is - // missing; respect that and skip the plugin providers. - return - } - runCatching { - enabled = toolbarAction.isEnabledProvider?.invoke() ?: toolbarAction.isEnabled - visible = toolbarAction.isVisibleProvider?.invoke() ?: toolbarAction.isVisible - // Re-resolve the icon on every rebuild when the plugin drives it dynamically. - // When iconProvider is null the icon stays as resolved in init (static behavior). - if (visible) { - toolbarAction.iconProvider?.invoke()?.let { resId -> - PluginDrawableResolver.resolve(resId, pluginId, context)?.let { icon = it } - } - } - }.onFailure { e -> - // A throwing/disposed plugin must never keep a stale icon on the toolbar. - Log.w("PluginToolbarActionItem", "prepare failed for '${toolbarAction.id}'", e) - enabled = false - visible = false - } - } + override fun getShowAsActionFlags(data: ActionData): Int = + when (toolbarAction.showAsAction) { + ShowAsAction.ALWAYS -> MenuItem.SHOW_AS_ACTION_ALWAYS + ShowAsAction.IF_ROOM -> MenuItem.SHOW_AS_ACTION_IF_ROOM + ShowAsAction.NEVER -> MenuItem.SHOW_AS_ACTION_NEVER + ShowAsAction.WITH_TEXT -> MenuItem.SHOW_AS_ACTION_WITH_TEXT + ShowAsAction.COLLAPSE_ACTION_VIEW -> MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW + } - override fun getShowAsActionFlags(data: ActionData): Int = when (toolbarAction.showAsAction) { - ShowAsAction.ALWAYS -> MenuItem.SHOW_AS_ACTION_ALWAYS - ShowAsAction.IF_ROOM -> MenuItem.SHOW_AS_ACTION_IF_ROOM - ShowAsAction.NEVER -> MenuItem.SHOW_AS_ACTION_NEVER - ShowAsAction.WITH_TEXT -> MenuItem.SHOW_AS_ACTION_WITH_TEXT - ShowAsAction.COLLAPSE_ACTION_VIEW -> MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW - } + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = pluginTooltipTag(pluginId, toolbarAction.id) - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = - pluginTooltipTag(pluginId, toolbarAction.id) + override fun retrieveTooltipCategory(): String = pluginCategory(pluginId) - override fun retrieveTooltipCategory(): String = pluginCategory(pluginId) - - override suspend fun execAction(data: ActionData): Any { - return try { - toolbarAction.action.invoke() - true - } catch (e: Exception) { - Log.e("PluginToolbarActionItem", "Error executing toolbar action '${toolbarAction.id}'", e) - false - } - } + override suspend fun execAction(data: ActionData): Any = + try { + toolbarAction.action.invoke() + true + } catch (e: Exception) { + Log.e("PluginToolbarActionItem", "Error executing toolbar action '${toolbarAction.id}'", e) + false + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/Util.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/Util.kt index 05957d05e5..dfd88b1644 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/Util.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/Util.kt @@ -17,19 +17,19 @@ import androidx.appcompat.app.AlertDialog import androidx.core.content.ContextCompat.startForegroundService import androidx.core.view.setPadding import com.google.android.material.textview.MaterialTextView +import com.itsaky.androidide.resources.R +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext +import moe.shizuku.manager.adb.AdbPairingService +import org.adfa.constants.CONTENT_KEY import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity import org.appdevforall.codeonthego.activities.editor.HelpActivity -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.utils.DialogUtils import org.appdevforall.codeonthego.utils.PermissionsHelper import org.appdevforall.codeonthego.utils.appendHtmlWithLinks import org.appdevforall.codeonthego.utils.appendOrderedList import org.appdevforall.codeonthego.utils.flashError import org.appdevforall.codeonthego.utils.isAtLeastS -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.withContext -import moe.shizuku.manager.adb.AdbPairingService -import org.adfa.constants.CONTENT_KEY import org.slf4j.Logger @RequiresApi(Build.VERSION_CODES.R) @@ -87,6 +87,7 @@ suspend fun handleMissingOverlayPermission( PermissionsHelper.OverlayPermissionState.UNSUPPORTED -> { activity.flashError(activity.getString(R.string.permission_overlay_unsupported_hint)) } + PermissionsHelper.OverlayPermissionState.REQUESTABLE -> { val intent = Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION).apply { @@ -102,6 +103,7 @@ suspend fun handleMissingOverlayPermission( ) } } + else -> {} } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/build/AbstractCancellableRunAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/build/AbstractCancellableRunAction.kt index 9029f04c12..4d669e31ba 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/build/AbstractCancellableRunAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/build/AbstractCancellableRunAction.kt @@ -4,13 +4,13 @@ import android.content.Context import androidx.annotation.DrawableRes import androidx.annotation.StringRes import androidx.core.content.ContextCompat +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.BaseBuildAction import org.appdevforall.codeonthego.actions.markInvisible import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity import org.appdevforall.codeonthego.lookup.Lookup import org.appdevforall.codeonthego.projects.builder.BuildService -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.utils.flashError import org.appdevforall.codeonthego.utils.requestBuildCancellation import org.slf4j.Logger diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/build/AbstractModuleAssemblerAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/build/AbstractModuleAssemblerAction.kt index 851a0704d9..0dc966584a 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/build/AbstractModuleAssemblerAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/build/AbstractModuleAssemblerAction.kt @@ -4,6 +4,7 @@ import android.content.Context import androidx.activity.viewModels import androidx.annotation.DrawableRes import androidx.annotation.StringRes +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.openApplicationModuleChooser import org.appdevforall.codeonthego.actions.profiler.ProfilerAction @@ -12,7 +13,6 @@ import org.appdevforall.codeonthego.project.AndroidModels import org.appdevforall.codeonthego.projects.IProjectManager import org.appdevforall.codeonthego.projects.api.AndroidModule import org.appdevforall.codeonthego.projects.isPluginProject -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.utils.flashError import org.appdevforall.codeonthego.viewmodel.BuildViewModel diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/build/DebugAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/build/DebugAction.kt index c519ed90c7..410b884bf0 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/build/DebugAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/build/DebugAction.kt @@ -1,6 +1,9 @@ package org.appdevforall.codeonthego.actions.build import android.content.Context +import com.itsaky.androidide.resources.R +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.canShowPairingNotification import org.appdevforall.codeonthego.actions.handleMissingOverlayPermission @@ -13,12 +16,9 @@ import org.appdevforall.codeonthego.lsp.java.JavaLanguageServer import org.appdevforall.codeonthego.lsp.java.debug.JdwpOptions import org.appdevforall.codeonthego.projects.IProjectManager import org.appdevforall.codeonthego.projects.isPluginProject -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.utils.PermissionsHelper import org.appdevforall.codeonthego.utils.flashError import org.appdevforall.codeonthego.utils.isAtLeastR -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.withContext import rikka.shizuku.Shizuku /** @@ -69,8 +69,7 @@ class DebugAction( val javaLsp = ILanguageServerRegistry.default .getServer(JavaLanguageServer.SERVER_ID) - if (javaLsp?.debugAdapter?.isReady != true - ) { + if (javaLsp?.debugAdapter?.isReady != true) { withContext(Dispatchers.Main.immediate) { showDebuggerNotReadyMessage(activity) } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/build/PluginBuildActionItem.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/build/PluginBuildActionItem.kt index 3af3a6d938..628848b758 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/build/PluginBuildActionItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/build/PluginBuildActionItem.kt @@ -8,6 +8,11 @@ import android.graphics.drawable.Drawable import androidx.core.content.ContextCompat import androidx.lifecycle.lifecycleScope import com.google.android.material.bottomsheet.BottomSheetBehavior +import com.itsaky.androidide.resources.R +import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.ActionItem import org.appdevforall.codeonthego.actions.BaseBuildAction @@ -21,13 +26,8 @@ import org.appdevforall.codeonthego.plugins.manager.build.RegisteredBuildAction import org.appdevforall.codeonthego.plugins.manager.core.PluginManager import org.appdevforall.codeonthego.plugins.manager.ui.PluginDrawableResolver import org.appdevforall.codeonthego.plugins.services.IdeCommandService -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.utils.resolveAttr import org.appdevforall.codeonthego.viewmodel.BottomSheetViewModel -import kotlinx.coroutines.CancellationException -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext class PluginBuildActionItem( context: Context, diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/build/ProjectSyncAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/build/ProjectSyncAction.kt index 9780bd9f4f..890ae5d1f8 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/build/ProjectSyncAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/build/ProjectSyncAction.kt @@ -19,11 +19,11 @@ package org.appdevforall.codeonthego.actions.build import android.content.Context import androidx.core.content.ContextCompat +import com.itsaky.androidide.resources.R +import com.itsaky.androidide.resources.R.string import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.BaseBuildAction import org.appdevforall.codeonthego.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R -import com.itsaky.androidide.resources.R.string /** * Triggers a project sync request. diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/build/QuickBuildAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/build/QuickBuildAction.kt index 20fc9cc4c6..4650d181ce 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/build/QuickBuildAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/build/QuickBuildAction.kt @@ -9,6 +9,10 @@ import androidx.annotation.DrawableRes import androidx.annotation.StringRes import androidx.core.content.ContextCompat import androidx.lifecycle.lifecycleScope +import com.itsaky.androidide.resources.R +import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.EditorActivityAction import org.appdevforall.codeonthego.actions.getContext @@ -17,12 +21,8 @@ import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.lookup.Lookup import org.appdevforall.codeonthego.projects.builder.BuildService import org.appdevforall.codeonthego.quickbuild.QuickBuildGraphWarmUp -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.utils.flashError import org.appdevforall.codeonthego.utils.resolveAttr -import kotlinx.coroutines.CancellationException -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch import org.appdevforall.cotg.quickbuild.domain.session.QuickBuildTone import org.appdevforall.cotg.quickbuild.domain.session.toTone import org.appdevforall.cotg.quickbuild.service.session.QuickBuildSessionManager diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/build/QuickRunAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/build/QuickRunAction.kt index 9fafde27d1..b1ea873814 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/build/QuickRunAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/build/QuickRunAction.kt @@ -21,13 +21,13 @@ import android.content.Context import android.graphics.ColorFilter import android.graphics.PorterDuff import android.graphics.PorterDuffColorFilter +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.getContext import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.projects.api.AndroidModule import org.appdevforall.codeonthego.projects.builder.BuildService -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.tooling.api.messages.TaskExecutionMessage import org.appdevforall.codeonthego.tooling.api.models.BasicAndroidVariantMetadata import org.appdevforall.codeonthego.utils.resolveAttr @@ -40,31 +40,33 @@ import org.appdevforall.codeonthego.utils.resolveAttr * * @author Akash Yadav */ -class QuickRunAction(context: Context, override val order: Int) : - AbstractRunAction( +class QuickRunAction( + context: Context, + override val order: Int, +) : AbstractRunAction( context = context, labelRes = R.string.quick_run_debug, - iconRes = R.drawable.ic_run_outline + iconRes = R.drawable.ic_run_outline, ) { - override val id: String = ID companion object { const val ID = "ide.editor.build.quickRun" } - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = - TooltipTag.EDITOR_TOOLBAR_QUICK_RUN + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.EDITOR_TOOLBAR_QUICK_RUN - override fun createColorFilter(data: ActionData): ColorFilter? { - return data.getContext()?.let { + override fun createColorFilter(data: ActionData): ColorFilter? = + data.getContext()?.let { PorterDuffColorFilter( it.resolveAttr( - if (data.getActivity().isBuildInProgress()) + if (data.getActivity().isBuildInProgress()) { R.attr.colorError - else R.attr.colorSuccess - ), PorterDuff.Mode.SRC_ATOP + } else { + R.attr.colorSuccess + }, + ), + PorterDuff.Mode.SRC_ATOP, ) } - } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/build/RunTasksAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/build/RunTasksAction.kt index b47553635f..9509ae231c 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/build/RunTasksAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/build/RunTasksAction.kt @@ -19,11 +19,11 @@ package org.appdevforall.codeonthego.actions.build import android.content.Context import androidx.core.content.ContextCompat +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.BaseBuildAction import org.appdevforall.codeonthego.fragments.RunTasksDialogFragment import org.appdevforall.codeonthego.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R /** @author Akash Yadav */ class RunTasksAction( diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/debug/AbstractDebuggerAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/AbstractDebuggerAction.kt index 7aef72b282..79e776d614 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/debug/AbstractDebuggerAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/AbstractDebuggerAction.kt @@ -12,26 +12,25 @@ import org.appdevforall.codeonthego.lsp.IDEDebugClientImpl * @author Akash Yadav */ abstract class AbstractDebuggerAction( - @DrawableRes private val iconRes: Int + @DrawableRes private val iconRes: Int, ) : ActionItem { + // debugger actions must always be executed in a background thread + override var requiresUIThread = false + override var location = ActionItem.Location.DEBUGGER_ACTIONS - // debugger actions must always be executed in a background thread - override var requiresUIThread = false - override var location = ActionItem.Location.DEBUGGER_ACTIONS + override var visible = true + override var enabled = true + override var icon: Drawable? = null - override var visible = true - override var enabled = true - override var icon: Drawable? = null + protected val debugClient: IDEDebugClientImpl? + get() = IDEDebugClientImpl.getInstance() - protected val debugClient: IDEDebugClientImpl? - get() = IDEDebugClientImpl.getInstance() + protected open fun checkEnabled(data: ActionData): Boolean = debugClient?.isVmConnected() == true - protected open fun checkEnabled(data: ActionData): Boolean = debugClient?.isVmConnected() == true + override fun prepare(data: ActionData) { + super.prepare(data) - override fun prepare(data: ActionData) { - super.prepare(data) - - icon = ContextCompat.getDrawable(data.requireContext(), iconRes) - enabled = checkEnabled(data) - } + icon = ContextCompat.getDrawable(data.requireContext(), iconRes) + enabled = checkEnabled(data) + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/debug/AbstractStepAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/AbstractStepAction.kt index ac010565b4..77aa6b570f 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/debug/AbstractStepAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/AbstractStepAction.kt @@ -5,11 +5,10 @@ import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.viewmodel.DebuggerConnectionState abstract class AbstractStepAction( - @DrawableRes iconRes: Int -): AbstractDebuggerAction(iconRes) { - - override fun checkEnabled(data: ActionData): Boolean { - val client = debugClient ?: return false - return client.connectionState >= DebuggerConnectionState.AWAITING_BREAKPOINT - } + @DrawableRes iconRes: Int, +) : AbstractDebuggerAction(iconRes) { + override fun checkEnabled(data: ActionData): Boolean { + val client = debugClient ?: return false + return client.connectionState >= DebuggerConnectionState.AWAITING_BREAKPOINT + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/debug/KillVmAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/KillVmAction.kt index 48ecfaf1e4..554b3fb4ee 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/debug/KillVmAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/KillVmAction.kt @@ -9,14 +9,14 @@ import org.appdevforall.codeonthego.idetooltips.TooltipTag * @author Akash Yadav */ class KillVmAction( - context: Context + context: Context, ) : AbstractDebuggerAction(R.drawable.ic_stop) { - override val id = "ide.debug.stop-vm" - override var label = context.getString(R.string.debugger_kill) - override val order = 4 - override var tooltipTag = TooltipTag.DEBUGGER_ACTION_KILL + override val id = "ide.debug.stop-vm" + override var label = context.getString(R.string.debugger_kill) + override val order = 4 + override var tooltipTag = TooltipTag.DEBUGGER_ACTION_KILL - override suspend fun execAction(data: ActionData) { - debugClient?.killVm() - } + override suspend fun execAction(data: ActionData) { + debugClient?.killVm() + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/debug/RestartVmAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/RestartVmAction.kt index 786a28b53f..f5959d8a63 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/debug/RestartVmAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/RestartVmAction.kt @@ -2,14 +2,14 @@ package org.appdevforall.codeonthego.actions.debug import android.content.Context import com.itsaky.androidide.R +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.delay +import kotlinx.coroutines.withContext import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.requireContext import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.lsp.IDEDebugClientImpl import org.appdevforall.codeonthego.utils.IntentUtils -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.delay -import kotlinx.coroutines.withContext import kotlin.time.Duration.Companion.seconds /** @@ -21,7 +21,7 @@ class RestartVmAction( override val id = "ide.debug.restart-vm" override var label = context.getString(R.string.debugger_restart) override val order = 5 - override var tooltipTag = TooltipTag.DEBUGGER_ACTION_RESTART + override var tooltipTag = TooltipTag.DEBUGGER_ACTION_RESTART companion object { val RESTART_DELAY = 1.seconds diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepIntoAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepIntoAction.kt index 96f409743b..6f1243da97 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepIntoAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepIntoAction.kt @@ -9,14 +9,14 @@ import org.appdevforall.codeonthego.idetooltips.TooltipTag * @author Akash Yadav */ class StepIntoAction( - context: Context + context: Context, ) : AbstractStepAction(R.drawable.ic_step_into) { - override val id = "ide.debug.step-into" - override var label = context.getString(R.string.debugger_step_into) - override val order = 2 - override var tooltipTag = TooltipTag.DEBUGGER_ACTION_STEP_INTO + override val id = "ide.debug.step-into" + override var label = context.getString(R.string.debugger_step_into) + override val order = 2 + override var tooltipTag = TooltipTag.DEBUGGER_ACTION_STEP_INTO - override suspend fun execAction(data: ActionData) { - debugClient?.stepInto() - } + override suspend fun execAction(data: ActionData) { + debugClient?.stepInto() + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepOutAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepOutAction.kt index a37c416de8..db19b44f99 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepOutAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepOutAction.kt @@ -9,14 +9,14 @@ import org.appdevforall.codeonthego.idetooltips.TooltipTag * @author Akash Yadav */ class StepOutAction( - context: Context + context: Context, ) : AbstractStepAction(R.drawable.ic_step_out) { - override val id = "ide.debug.step-out" - override var label = context.getString(R.string.debugger_step_out) - override val order = 3 - override var tooltipTag = TooltipTag.DEBUGGER_ACTION_STEP_OUT + override val id = "ide.debug.step-out" + override var label = context.getString(R.string.debugger_step_out) + override val order = 3 + override var tooltipTag = TooltipTag.DEBUGGER_ACTION_STEP_OUT - override suspend fun execAction(data: ActionData) { - debugClient?.stepOut() - } + override suspend fun execAction(data: ActionData) { + debugClient?.stepOut() + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepOverAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepOverAction.kt index 66440acdaa..1a75331d6d 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepOverAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/StepOverAction.kt @@ -9,14 +9,14 @@ import org.appdevforall.codeonthego.idetooltips.TooltipTag * @author Akash Yadav */ class StepOverAction( - context: Context + context: Context, ) : AbstractStepAction(R.drawable.ic_step_over) { - override val id = "ide.debug.step-over" - override var label = context.getString(R.string.debugger_step_over) - override val order = 1 - override var tooltipTag = TooltipTag.DEBUGGER_ACTION_STEP_OVER + override val id = "ide.debug.step-over" + override var label = context.getString(R.string.debugger_step_over) + override val order = 1 + override var tooltipTag = TooltipTag.DEBUGGER_ACTION_STEP_OVER - override suspend fun execAction(data: ActionData) { - debugClient?.stepOver() - } + override suspend fun execAction(data: ActionData) { + debugClient?.stepOver() + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/debug/SuspendResumeVmAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/SuspendResumeVmAction.kt index 75034f28ed..b571b25fcc 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/debug/SuspendResumeVmAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/debug/SuspendResumeVmAction.kt @@ -11,33 +11,32 @@ import org.appdevforall.codeonthego.idetooltips.TooltipTag * @author Akash Yadav */ class SuspendResumeVmAction( - context: Context + context: Context, ) : AbstractDebuggerAction(R.drawable.ic_pause) { + override val id = "ide.debug.suspend-resume" + override var label = context.getString(R.string.debugger_suspend) + override val order = 0 + override var tooltipTag = TooltipTag.DEBUGGER_ACTION_PAUSE_RESUME - override val id = "ide.debug.suspend-resume" - override var label = context.getString(R.string.debugger_suspend) - override val order = 0 - override var tooltipTag = TooltipTag.DEBUGGER_ACTION_PAUSE_RESUME + override fun prepare(data: ActionData) { + super.prepare(data) + val context = data.requireContext() + val isSuspended = debugClient?.isVmSuspended() == true + if (isSuspended) { + label = context.getString(R.string.debugger_resume) + icon = ContextCompat.getDrawable(context, R.drawable.ic_run) + } else { + label = context.getString(R.string.debugger_suspend) + icon = ContextCompat.getDrawable(context, R.drawable.ic_pause) + } + } - override fun prepare(data: ActionData) { - super.prepare(data) - val context = data.requireContext() - val isSuspended = debugClient?.isVmSuspended() == true - if (isSuspended) { - label = context.getString(R.string.debugger_resume) - icon = ContextCompat.getDrawable(context, R.drawable.ic_run) - } else { - label = context.getString(R.string.debugger_suspend) - icon = ContextCompat.getDrawable(context, R.drawable.ic_pause) - } - } - - override suspend fun execAction(data: ActionData) { - val client = debugClient ?: return - if (client.isVmSuspended()) { - client.resumeVm() - } else { - client.suspendVm() - } - } + override suspend fun execAction(data: ActionData) { + val client = debugClient ?: return + if (client.isVmSuspended()) { + client.resumeVm() + } else { + client.suspendVm() + } + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/editor/CopyAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/CopyAction.kt index 413803442a..0b66b8f97d 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/editor/CopyAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/CopyAction.kt @@ -18,53 +18,53 @@ package org.appdevforall.codeonthego.actions.editor import android.content.Context +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.BaseEditorAction import org.appdevforall.codeonthego.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R /** @author Akash Yadav */ -class CopyAction(context: Context, override val order: Int) : - BaseEditorAction() { - - init { - label = context.getString(R.string.copy) +class CopyAction( + context: Context, + override val order: Int, +) : BaseEditorAction() { + init { + label = context.getString(R.string.copy) - val arr = context.obtainStyledAttributes(intArrayOf(android.R.attr.actionModeCopyDrawable)) - icon = arr.getDrawable(0)?.let { tintDrawable(context, it) } - arr.recycle() - } + val arr = context.obtainStyledAttributes(intArrayOf(android.R.attr.actionModeCopyDrawable)) + icon = arr.getDrawable(0)?.let { tintDrawable(context, it) } + arr.recycle() + } - companion object { - const val ID = "ide.editor.code.text.copy" - } + companion object { + const val ID = "ide.editor.code.text.copy" + } - override val id: String = ID + override val id: String = ID - override fun prepare(data: ActionData) { - super.prepare(data) + override fun prepare(data: ActionData) { + super.prepare(data) - if (!visible) return + if (!visible) return - val target = getTextTarget(data) + val target = getTextTarget(data) - visible = target != null - enabled = visible && target?.hasSelection() == true - } + visible = target != null + enabled = visible && target?.hasSelection() == true + } - override suspend fun execAction(data: ActionData): Boolean { - val target = getTextTarget(data) ?: return false - if (!target.hasSelection()) return false + override suspend fun execAction(data: ActionData): Boolean { + val target = getTextTarget(data) ?: return false + if (!target.hasSelection()) return false - target.copyText() - return true - } + target.copyText() + return true + } - override fun retrieveTooltipTag(isAlternateContext: Boolean): String { - return if (isAlternateContext) { - TooltipTag.EDITOR_TOOLBAR_OUTPUT_COPY - } else { - TooltipTag.EDITOR_TOOLBAR_COPY - } - } + override fun retrieveTooltipTag(isAlternateContext: Boolean): String = + if (isAlternateContext) { + TooltipTag.EDITOR_TOOLBAR_OUTPUT_COPY + } else { + TooltipTag.EDITOR_TOOLBAR_COPY + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/editor/CutAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/CutAction.kt index 15cd284b4e..82a157a3b5 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/editor/CutAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/CutAction.kt @@ -22,39 +22,44 @@ import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.BaseEditorAction import org.appdevforall.codeonthego.actions.MutableTextTarget import org.appdevforall.codeonthego.idetooltips.TooltipTag + /** @author Akash Yadav */ -class CutAction(context: Context, override val order: Int) : BaseEditorAction() { - - init { - label = context.getString(android.R.string.cut) - - val arr = context.obtainStyledAttributes(intArrayOf(android.R.attr.actionModeCutDrawable)) - icon = arr.getDrawable(0)?.let { tintDrawable(context, it) } - arr.recycle() - } - - companion object { - const val ID = "ide.editor.code.text.cut" - } - - override fun prepare(data: ActionData) { - super.prepare(data) - - if (!visible) return - - val target = getTextTarget(data) - visible = (target is MutableTextTarget) && target.isEditable() - enabled = visible && target?.hasSelection() == true - } - - override val id: String = ID - override suspend fun execAction(data: ActionData): Boolean { - val target = getTextTarget(data) ?: return false - if (target is MutableTextTarget) { - target.cut() - return true - } - return false - } - override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.EDITOR_TOOLBAR_CUT +class CutAction( + context: Context, + override val order: Int, +) : BaseEditorAction() { + init { + label = context.getString(android.R.string.cut) + + val arr = context.obtainStyledAttributes(intArrayOf(android.R.attr.actionModeCutDrawable)) + icon = arr.getDrawable(0)?.let { tintDrawable(context, it) } + arr.recycle() + } + + companion object { + const val ID = "ide.editor.code.text.cut" + } + + override fun prepare(data: ActionData) { + super.prepare(data) + + if (!visible) return + + val target = getTextTarget(data) + visible = (target is MutableTextTarget) && target.isEditable() + enabled = visible && target?.hasSelection() == true + } + + override val id: String = ID + + override suspend fun execAction(data: ActionData): Boolean { + val target = getTextTarget(data) ?: return false + if (target is MutableTextTarget) { + target.cut() + return true + } + return false + } + + override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.EDITOR_TOOLBAR_CUT } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/editor/ExpandSelectionAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/ExpandSelectionAction.kt index c6f9c20566..bbd52a5266 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/editor/ExpandSelectionAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/ExpandSelectionAction.kt @@ -19,30 +19,30 @@ package org.appdevforall.codeonthego.actions.editor import android.content.Context import androidx.core.content.ContextCompat +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.ActionItem import org.appdevforall.codeonthego.actions.EditorRelatedAction import org.appdevforall.codeonthego.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R /** * Expands the current selection using the language server set in editor. * * @author Akash Yadav */ -class ExpandSelectionAction(context: Context, override val order: Int) : EditorRelatedAction() { - override val id: String = "ide.editor.code.actions.expandSelection" - override var location: ActionItem.Location = ActionItem.Location.EDITOR_TEXT_ACTIONS +class ExpandSelectionAction( + context: Context, + override val order: Int, +) : EditorRelatedAction() { + override val id: String = "ide.editor.code.actions.expandSelection" + override var location: ActionItem.Location = ActionItem.Location.EDITOR_TEXT_ACTIONS - init { - label = context.getString(R.string.action_expand_selection) - icon = ContextCompat.getDrawable(context, R.drawable.ic_expand_selection) - } + init { + label = context.getString(R.string.action_expand_selection) + icon = ContextCompat.getDrawable(context, R.drawable.ic_expand_selection) + } - override suspend fun execAction(data: ActionData): Any { - return data.getEditor()?.expandSelection() ?: false - } + override suspend fun execAction(data: ActionData): Any = data.getEditor()?.expandSelection() ?: false - override fun retrieveTooltipTag(isAlternateContext: Boolean) = - TooltipTag.EDITOR_TOOLBAR_EXPAND_SELECTION + override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.EDITOR_TOOLBAR_EXPAND_SELECTION } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/editor/LongSelectAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/LongSelectAction.kt index dacf149350..38dfbf4cc8 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/editor/LongSelectAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/LongSelectAction.kt @@ -1,16 +1,16 @@ /* * This file is part of AndroidIDE. - * + * * AndroidIDE is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * AndroidIDE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ @@ -25,29 +25,30 @@ import org.appdevforall.codeonthego.actions.ActionItem import org.appdevforall.codeonthego.actions.EditorRelatedAction import org.appdevforall.codeonthego.actions.markInvisible import org.appdevforall.codeonthego.idetooltips.TooltipTag + /** * An action to long select text in the editor. * * @author Akash Yadav */ -class LongSelectAction(context: Context, override val order: Int) : EditorRelatedAction() { +class LongSelectAction( + context: Context, + override val order: Int, +) : EditorRelatedAction() { + override val id: String = "ide.editor.code.text.longSelect" + override var location: ActionItem.Location = ActionItem.Location.EDITOR_TEXT_ACTIONS - override val id: String = "ide.editor.code.text.longSelect" - override var location: ActionItem.Location = ActionItem.Location.EDITOR_TEXT_ACTIONS + init { + label = context.getString(R.string.title_begin_long_select) + icon = ContextCompat.getDrawable(context, R.drawable.editor_text_select_start) + } - init { - label = context.getString(R.string.title_begin_long_select) - icon = ContextCompat.getDrawable(context, R.drawable.editor_text_select_start) - } + override fun prepare(data: ActionData) { + super.prepare(data) + data.getEditor() ?: markInvisible() + } - override fun prepare(data: ActionData) { - super.prepare(data) - data.getEditor() ?: markInvisible() - } + override suspend fun execAction(data: ActionData): Any = data.getEditor()?.beginLongSelect() ?: false - override suspend fun execAction(data: ActionData): Any { - return data.getEditor()?.beginLongSelect() ?: false - } - override fun retrieveTooltipTag(isAlternateContext: Boolean) = - TooltipTag.EDITOR_TOOLBAR_LONG_SELECT -} \ No newline at end of file + override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.EDITOR_TOOLBAR_LONG_SELECT +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/editor/PasteAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/PasteAction.kt index ff79a2d7ed..92eaf1a416 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/editor/PasteAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/PasteAction.kt @@ -22,41 +22,44 @@ import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.BaseEditorAction import org.appdevforall.codeonthego.actions.MutableTextTarget import org.appdevforall.codeonthego.idetooltips.TooltipTag -/** @author Akash Yadav */ -class PasteAction(context: Context, override val order: Int) : BaseEditorAction() { - init { - label = context.getString(android.R.string.paste) +/** @author Akash Yadav */ +class PasteAction( + context: Context, + override val order: Int, +) : BaseEditorAction() { + init { + label = context.getString(android.R.string.paste) - val arr = context.obtainStyledAttributes(intArrayOf(android.R.attr.actionModePasteDrawable)) - icon = arr.getDrawable(0)?.let { tintDrawable(context, it) } - arr.recycle() - } + val arr = context.obtainStyledAttributes(intArrayOf(android.R.attr.actionModePasteDrawable)) + icon = arr.getDrawable(0)?.let { tintDrawable(context, it) } + arr.recycle() + } - companion object { - const val ID = "ide.editor.code.text.paste" - } + companion object { + const val ID = "ide.editor.code.text.paste" + } - override val id: String = ID + override val id: String = ID - override fun prepare(data: ActionData) { - super.prepare(data) + override fun prepare(data: ActionData) { + super.prepare(data) - if (!visible) return + if (!visible) return - val target = getTextTarget(data) - visible = (target is MutableTextTarget) && target.isEditable() - enabled = visible - } + val target = getTextTarget(data) + visible = (target is MutableTextTarget) && target.isEditable() + enabled = visible + } - override suspend fun execAction(data: ActionData): Boolean { - val target = getTextTarget(data) ?: return false - if (target is MutableTextTarget) { - target.paste() - return true - } - return false - } + override suspend fun execAction(data: ActionData): Boolean { + val target = getTextTarget(data) ?: return false + if (target is MutableTextTarget) { + target.paste() + return true + } + return false + } - override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.EDITOR_TOOLBAR_PASTE + override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.EDITOR_TOOLBAR_PASTE } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/editor/SelectAllAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/SelectAllAction.kt index 2598de4b92..792030203e 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/editor/SelectAllAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/editor/SelectAllAction.kt @@ -21,47 +21,49 @@ import android.content.Context import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.BaseEditorAction import org.appdevforall.codeonthego.idetooltips.TooltipTag -/** @author Akash Yadav */ -class SelectAllAction(context: Context, override val order: Int) : BaseEditorAction() { - init { - label = context.getString(android.R.string.selectAll) +/** @author Akash Yadav */ +class SelectAllAction( + context: Context, + override val order: Int, +) : BaseEditorAction() { + init { + label = context.getString(android.R.string.selectAll) - val arr = context.obtainStyledAttributes(intArrayOf(android.R.attr.actionModeSelectAllDrawable)) - icon = arr.getDrawable(0)?.let { tintDrawable(context, it) } - arr.recycle() - } + val arr = context.obtainStyledAttributes(intArrayOf(android.R.attr.actionModeSelectAllDrawable)) + icon = arr.getDrawable(0)?.let { tintDrawable(context, it) } + arr.recycle() + } - companion object { - const val ID = "ide.editor.code.text.selectAll" - } + companion object { + const val ID = "ide.editor.code.text.selectAll" + } - override val id: String = ID + override val id: String = ID - override fun prepare(data: ActionData) { - super.prepare(data) + override fun prepare(data: ActionData) { + super.prepare(data) - if (!visible) return + if (!visible) return - val target = getTextTarget(data) + val target = getTextTarget(data) - visible = target != null - enabled = visible - } + visible = target != null + enabled = visible + } - override suspend fun execAction(data: ActionData): Boolean { - val target = getTextTarget(data) ?: return false - target.selectAll() - return true - } + override suspend fun execAction(data: ActionData): Boolean { + val target = getTextTarget(data) ?: return false + target.selectAll() + return true + } - override fun dismissOnAction() = false + override fun dismissOnAction() = false - override fun retrieveTooltipTag(isAlternateContext: Boolean): String { - return if (isAlternateContext) { - TooltipTag.EDITOR_TOOLBAR_OUTPUT_SELECT_ALL - } else { - TooltipTag.EDITOR_TOOLBAR_SELECT_ALL - } - } + override fun retrieveTooltipTag(isAlternateContext: Boolean): String = + if (isAlternateContext) { + TooltipTag.EDITOR_TOOLBAR_OUTPUT_SELECT_ALL + } else { + TooltipTag.EDITOR_TOOLBAR_SELECT_ALL + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/etc/DisconnectLogSendersAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/DisconnectLogSendersAction.kt index ea00e051ee..1137b6eec8 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/etc/DisconnectLogSendersAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/DisconnectLogSendersAction.kt @@ -31,36 +31,39 @@ import org.appdevforall.codeonthego.services.log.lookupLogService * * @author Akash Yadav */ -class DisconnectLogSendersAction(context: Context, override val order: Int) : EditorActivityAction() { +class DisconnectLogSendersAction( + context: Context, + override val order: Int, +) : EditorActivityAction() { + override val id: String = "ide.editor.service.logreceiver.disconnectSenders" - override val id: String = "ide.editor.service.logreceiver.disconnectSenders" - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.EDITOR_TOOLBAR_LOG_SENDER + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.EDITOR_TOOLBAR_LOG_SENDER - init { - label = context.getString(R.string.title_disconnect_log_senders) - icon = ContextCompat.getDrawable(context, R.drawable.ic_logs_disconnect) - } + init { + label = context.getString(R.string.title_disconnect_log_senders) + icon = ContextCompat.getDrawable(context, R.drawable.ic_logs_disconnect) + } - override fun prepare(data: ActionData) { - super.prepare(data) - data.getActivity() ?: run { - markInvisible() - return - } + override fun prepare(data: ActionData) { + super.prepare(data) + data.getActivity() ?: run { + markInvisible() + return + } - val receiverService = lookupLogService() - if (receiverService == null) { - markInvisible() - return - } - } + val receiverService = lookupLogService() + if (receiverService == null) { + markInvisible() + return + } + } - override suspend fun execAction(data: ActionData): Any { - val receiverService = lookupLogService() - receiverService?.disconnectAll() + override suspend fun execAction(data: ActionData): Any { + val receiverService = lookupLogService() + receiverService?.disconnectAll() - markInvisible() - data.getActivity()?.invalidateOptionsMenu() - return true - } -} \ No newline at end of file + markInvisible() + data.getActivity()?.invalidateOptionsMenu() + return true + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindAction.kt index 43f5f91638..ae96e41b2d 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindAction.kt @@ -19,41 +19,39 @@ package org.appdevforall.codeonthego.actions.etc import android.content.Context import androidx.core.content.ContextCompat +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.EditorActivityAction import org.appdevforall.codeonthego.actions.build.AbstractCancellableRunAction.Companion.isBuildInProgress import org.appdevforall.codeonthego.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R /** @author Akash Yadav */ class FindAction() : EditorActivityAction() { + override var requiresUIThread: Boolean = true + override var order: Int = 0 + + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.EDITOR_TOOLBAR_FIND + + constructor(context: Context, order: Int) : this() { + this.label = context.getString(R.string.menu_find) + this.icon = ContextCompat.getDrawable(context, R.drawable.ic_search) + this.order = order + } + + override val id: String = "ide.editor.find" + + override fun prepare(data: ActionData) { + super.prepare(data) + enabled = data.getActivity().isBuildInProgress().not() + } + + override suspend fun execAction(data: ActionData): Boolean { + val context = data.getActivity() ?: return false + val dialog = context.findActionDialog(data) - override var requiresUIThread: Boolean = true - override var order: Int = 0 - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String { - return TooltipTag.EDITOR_TOOLBAR_FIND - } - - constructor(context: Context, order: Int) : this() { - this.label = context.getString(R.string.menu_find) - this.icon = ContextCompat.getDrawable(context, R.drawable.ic_search) - this.order = order - } - - override val id: String = "ide.editor.find" - - override fun prepare(data: ActionData) { - super.prepare(data) - enabled = data.getActivity().isBuildInProgress().not() - } - - override suspend fun execAction(data: ActionData): Boolean { - val context = data.getActivity() ?: return false - val dialog = context.findActionDialog(data) - - return run { - dialog.show() - true - } - } + return run { + dialog.show() + true + } + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindInFileAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindInFileAction.kt index 6a101158f8..4500b94095 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindInFileAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindInFileAction.kt @@ -19,34 +19,34 @@ package org.appdevforall.codeonthego.actions.etc import android.content.Context import androidx.core.content.ContextCompat +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.ActionItem import org.appdevforall.codeonthego.actions.EditorRelatedAction import org.appdevforall.codeonthego.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R /** @author Akash Yadav */ class FindInFileAction() : EditorRelatedAction() { + override val id: String = ID + override var requiresUIThread: Boolean = true + override var location: ActionItem.Location = ActionItem.Location.EDITOR_FIND_ACTION_MENU + override var order: Int = 0 - override val id: String = ID - override var requiresUIThread: Boolean = true - override var location: ActionItem.Location = ActionItem.Location.EDITOR_FIND_ACTION_MENU - override var order: Int = 0 - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.EDITOR_TOOLBAR_FIND_IN_FILE + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.EDITOR_TOOLBAR_FIND_IN_FILE - companion object{ - const val ID = "ide.editor.find.inFile" - } + companion object { + const val ID = "ide.editor.find.inFile" + } - constructor(context: Context, order: Int) : this() { - this.label = context.getString(R.string.menu_find_file) - this.icon = ContextCompat.getDrawable(context, R.drawable.ic_search_file) - this.order = order - } + constructor(context: Context, order: Int) : this() { + this.label = context.getString(R.string.menu_find_file) + this.icon = ContextCompat.getDrawable(context, R.drawable.ic_search_file) + this.order = order + } - override suspend fun execAction(data: ActionData): Boolean { - val editor = data.getEditorView() ?: return false - editor.beginSearch() - return true - } + override suspend fun execAction(data: ActionData): Boolean { + val editor = data.getEditorView() ?: return false + editor.beginSearch() + return true + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindInProjectAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindInProjectAction.kt index 920687ae28..9578c8014b 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindInProjectAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/FindInProjectAction.kt @@ -19,13 +19,13 @@ package org.appdevforall.codeonthego.actions.etc import android.content.Context import androidx.core.content.ContextCompat +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.ActionItem import org.appdevforall.codeonthego.actions.EditorActivityAction import org.appdevforall.codeonthego.actions.markInvisible import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.projects.IProjectManager -import com.itsaky.androidide.resources.R /** @author Akash Yadav */ class FindInProjectAction() : EditorActivityAction() { diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/etc/LaunchAppAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/LaunchAppAction.kt index a1f3f3514c..a75d315f7b 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/etc/LaunchAppAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/LaunchAppAction.kt @@ -21,6 +21,7 @@ import android.content.Context import android.view.MenuItem import androidx.core.content.ContextCompat import com.itsaky.androidide.R +import kotlinx.coroutines.launch import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.EditorActivityAction import org.appdevforall.codeonthego.actions.markInvisible @@ -29,7 +30,6 @@ import org.appdevforall.codeonthego.idetooltips.TooltipTag.EDITOR_TOOLBAR_LAUNCH import org.appdevforall.codeonthego.projects.IProjectManager import org.appdevforall.codeonthego.utils.IntentUtils import org.appdevforall.codeonthego.utils.flashError -import kotlinx.coroutines.launch import org.slf4j.LoggerFactory /** @@ -37,67 +37,70 @@ import org.slf4j.LoggerFactory * * @author Akash Yadav */ -class LaunchAppAction(context: Context, override val order: Int) : EditorActivityAction() { - - override val id: String = "ide.editor.launchInstalledApp" - override var requiresUIThread: Boolean = true - override fun retrieveTooltipTag(isReadOnlyContext: Boolean) = EDITOR_TOOLBAR_LAUNCH_APP - - init { - label = context.getString(R.string.title_launch_app) - icon = ContextCompat.getDrawable(context, R.drawable.ic_open_external) - } - - companion object { - private val log = LoggerFactory.getLogger(LaunchAppAction::class.java) - } - - override fun prepare(data: ActionData) { - super.prepare(data) - data.getActivity() ?: run { - markInvisible() - return - } - - visible = true - - val projectManager = IProjectManager.getInstance() - enabled = projectManager.getAndroidAppModules().isNotEmpty() - } - - override suspend fun execAction(data: ActionData) { - openApplicationModuleChooser(data) { app -> - val variant = app.getSelectedVariant() - - log.debug("Selected variant: {}", variant?.name) - - if (variant == null) { - flashError(R.string.err_selected_variant_not_found) - return@openApplicationModuleChooser - } - - val applicationId = variant.mainArtifact.applicationId - if (applicationId == null) { - log.error("Unable to launch application. variant.mainArtifact.applicationId is null") - flashError(R.string.err_cannot_determine_package) - return@openApplicationModuleChooser - } - - log.info("Launching application: {}", applicationId) - - val activity = data.requireActivity() - activity.activityScope.launch { - IntentUtils.launchApp( +class LaunchAppAction( + context: Context, + override val order: Int, +) : EditorActivityAction() { + override val id: String = "ide.editor.launchInstalledApp" + override var requiresUIThread: Boolean = true + + override fun retrieveTooltipTag(isReadOnlyContext: Boolean) = EDITOR_TOOLBAR_LAUNCH_APP + + init { + label = context.getString(R.string.title_launch_app) + icon = ContextCompat.getDrawable(context, R.drawable.ic_open_external) + } + + companion object { + private val log = LoggerFactory.getLogger(LaunchAppAction::class.java) + } + + override fun prepare(data: ActionData) { + super.prepare(data) + data.getActivity() ?: run { + markInvisible() + return + } + + visible = true + + val projectManager = IProjectManager.getInstance() + enabled = projectManager.getAndroidAppModules().isNotEmpty() + } + + override suspend fun execAction(data: ActionData) { + openApplicationModuleChooser(data) { app -> + val variant = app.getSelectedVariant() + + log.debug("Selected variant: {}", variant?.name) + + if (variant == null) { + flashError(R.string.err_selected_variant_not_found) + return@openApplicationModuleChooser + } + + val applicationId = variant.mainArtifact.applicationId + if (applicationId == null) { + log.error("Unable to launch application. variant.mainArtifact.applicationId is null") + flashError(R.string.err_cannot_determine_package) + return@openApplicationModuleChooser + } + + log.info("Launching application: {}", applicationId) + + val activity = data.requireActivity() + activity.activityScope.launch { + IntentUtils.launchApp( context = activity, packageName = applicationId, - logError = false + logError = false, ) - } - } - } - - override fun getShowAsActionFlags(data: ActionData): Int { - // prefer showing this in the overflow menu - return MenuItem.SHOW_AS_ACTION_IF_ROOM - } -} \ No newline at end of file + } + } + } + + override fun getShowAsActionFlags(data: ActionData): Int { + // prefer showing this in the overflow menu + return MenuItem.SHOW_AS_ACTION_IF_ROOM + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/etc/ReplaceInProjectAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/ReplaceInProjectAction.kt index 97ea41f541..e8f9792350 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/etc/ReplaceInProjectAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/etc/ReplaceInProjectAction.kt @@ -2,13 +2,13 @@ package org.appdevforall.codeonthego.actions.etc import android.content.Context import androidx.core.content.ContextCompat +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.ActionItem import org.appdevforall.codeonthego.actions.EditorActivityAction import org.appdevforall.codeonthego.actions.markInvisible import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.projects.IProjectManager -import com.itsaky.androidide.resources.R class ReplaceInProjectAction() : EditorActivityAction() { override val id: String = ID diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseAllFilesAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseAllFilesAction.kt index bc597feba8..59222017d3 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseAllFilesAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseAllFilesAction.kt @@ -28,19 +28,21 @@ import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity * * @author Akash Yadav */ -class CloseAllFilesAction(context: Context, override val order: Int) : FileTabAction() { +class CloseAllFilesAction( + context: Context, + override val order: Int, +) : FileTabAction() { + override val id: String = "ide.editor.fileTab.close.all" - override val id: String = "ide.editor.fileTab.close.all" + init { + label = context.getString(R.string.action_closeAll) + icon = ContextCompat.getDrawable(context, R.drawable.ic_close_all) + } - init { - label = context.getString(R.string.action_closeAll) - icon = ContextCompat.getDrawable(context, R.drawable.ic_close_all) - } - - override fun EditorHandlerActivity.doAction(data: ActionData): Boolean { - closeAll { - invalidateOptionsMenu() - } - return true - } + override fun EditorHandlerActivity.doAction(data: ActionData): Boolean { + closeAll { + invalidateOptionsMenu() + } + return true + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseFileAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseFileAction.kt index e559f43253..e1c5d75289 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseFileAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseFileAction.kt @@ -28,21 +28,23 @@ import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity * * @author Akash Yadav */ -class CloseFileAction(context: Context, override val order: Int) : FileTabAction() { +class CloseFileAction( + context: Context, + override val order: Int, +) : FileTabAction() { + override val id: String = ID - override val id: String = ID + companion object { + const val ID = "ide.editor.fileTab.close.current" + } - companion object { - const val ID = "ide.editor.fileTab.close.current" - } + init { + label = context.getString(R.string.action_closeThis) + icon = ContextCompat.getDrawable(context, R.drawable.ic_close_this) + } - init { - label = context.getString(R.string.action_closeThis) - icon = ContextCompat.getDrawable(context, R.drawable.ic_close_this) - } - - override fun EditorHandlerActivity.doAction(data: ActionData): Boolean { - data.getActivity()?.closeCurrentFile() - return true - } + override fun EditorHandlerActivity.doAction(data: ActionData): Boolean { + data.getActivity()?.closeCurrentFile() + return true + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseOtherFilesAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseOtherFilesAction.kt index ab73029bc2..8fb701826f 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseOtherFilesAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/file/CloseOtherFilesAction.kt @@ -28,17 +28,19 @@ import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity * * @author Akash Yadav */ -class CloseOtherFilesAction(context: Context, override val order: Int) : FileTabAction() { +class CloseOtherFilesAction( + context: Context, + override val order: Int, +) : FileTabAction() { + override val id: String = "ide.editor.fileTab.close.others" - override val id: String = "ide.editor.fileTab.close.others" + init { + label = context.getString(R.string.action_closeOthers) + icon = ContextCompat.getDrawable(context, R.drawable.ic_close_others) + } - init { - label = context.getString(R.string.action_closeOthers) - icon = ContextCompat.getDrawable(context, R.drawable.ic_close_others) - } - - override fun EditorHandlerActivity.doAction(data: ActionData): Boolean { - closeOthers() - return true - } + override fun EditorHandlerActivity.doAction(data: ActionData): Boolean { + closeOthers() + return true + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/file/CreateLinkAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/file/CreateLinkAction.kt index f75c1dac80..d944df5227 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/file/CreateLinkAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/file/CreateLinkAction.kt @@ -21,6 +21,9 @@ import android.content.Context import androidx.annotation.VisibleForTesting import androidx.core.content.ContextCompat import com.itsaky.androidide.R +import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.markInvisible import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity @@ -32,9 +35,6 @@ import org.appdevforall.codeonthego.utils.deepLinkTargetOfOpenProjectOrNull import org.appdevforall.codeonthego.utils.deepLinkTargetOfOpenProjectWithoutIo import org.appdevforall.codeonthego.utils.flashError import org.appdevforall.codeonthego.utils.flashSuccess -import kotlinx.coroutines.CancellationException -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch import org.slf4j.LoggerFactory import java.io.File import java.util.concurrent.ConcurrentHashMap diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/file/FileTabAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/file/FileTabAction.kt index ddc4c7772e..9a1874e16c 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/file/FileTabAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/file/FileTabAction.kt @@ -30,32 +30,31 @@ import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity * @author Akash Yadav */ abstract class FileTabAction : EditorActivityAction() { + override var location: Location = EDITOR_FILE_TABS + override var requiresUIThread: Boolean = true - override var location: Location = EDITOR_FILE_TABS - override var requiresUIThread: Boolean = true + override fun prepare(data: ActionData) { + super.prepare(data) - override fun prepare(data: ActionData) { - super.prepare(data) + if (!visible) { + return + } - if (!visible) { - return - } + val activity = + data.getActivity() + ?: run { + markInvisible() + return + } - val activity = - data.getActivity() - ?: run { - markInvisible() - return - } + visible = activity.editorViewModel.getOpenedFiles().isNotEmpty() + enabled = visible + } - visible = activity.editorViewModel.getOpenedFiles().isNotEmpty() - enabled = visible - } + override suspend fun execAction(data: ActionData): Any { + val activity = data.getActivity() ?: return false + return activity.doAction(data) + } - override suspend fun execAction(data: ActionData): Any { - val activity = data.getActivity() ?: return false - return activity.doAction(data) - } - - abstract fun EditorHandlerActivity.doAction(data: ActionData): Boolean + abstract fun EditorHandlerActivity.doAction(data: ActionData): Boolean } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/file/FormatCodeAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/file/FormatCodeAction.kt index 93de1c4f2a..0d870739ea 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/file/FormatCodeAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/file/FormatCodeAction.kt @@ -19,37 +19,40 @@ package org.appdevforall.codeonthego.actions.file import android.content.Context import androidx.core.content.ContextCompat +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.ActionItem import org.appdevforall.codeonthego.actions.EditorRelatedAction import org.appdevforall.codeonthego.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R /** * Action that formats the code in the editor. * * @author Akash Yadav */ -class FormatCodeAction(context: Context, override val order: Int) : EditorRelatedAction() { - override val id: String = "ide.editor.code.text.format" - override var location: ActionItem.Location = ActionItem.Location.EDITOR_TEXT_ACTIONS - override fun retrieveTooltipTag(isReadOnlyContext: Boolean) = - TooltipTag.EDITOR_TOOLBAR_FORMAT_CODE +class FormatCodeAction( + context: Context, + override val order: Int, +) : EditorRelatedAction() { + override val id: String = "ide.editor.code.text.format" + override var location: ActionItem.Location = ActionItem.Location.EDITOR_TEXT_ACTIONS + + override fun retrieveTooltipTag(isReadOnlyContext: Boolean) = TooltipTag.EDITOR_TOOLBAR_FORMAT_CODE - init { - label = context.getString(R.string.title_format_code) - icon = ContextCompat.getDrawable(context, R.drawable.ic_format_code) - } + init { + label = context.getString(R.string.title_format_code) + icon = ContextCompat.getDrawable(context, R.drawable.ic_format_code) + } - override suspend fun execAction(data: ActionData): Any { - val editor = data.getEditor()!! - val cursor = editor.text.cursor + override suspend fun execAction(data: ActionData): Any { + val editor = data.getEditor()!! + val cursor = editor.text.cursor - if (cursor.isSelected) { - editor.formatCodeAsync(cursor.left(), cursor.right()) - } else { - editor.formatCodeAsync() - } - return true - } + if (cursor.isSelected) { + editor.formatCodeAsync(cursor.left(), cursor.right()) + } else { + editor.formatCodeAsync() + } + return true + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/file/InstallFileAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/file/InstallFileAction.kt index aeab26c72b..bc36a900e3 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/file/InstallFileAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/file/InstallFileAction.kt @@ -19,16 +19,16 @@ package org.appdevforall.codeonthego.actions.file import android.content.Context import androidx.lifecycle.lifecycleScope +import com.itsaky.androidide.resources.R +import kotlinx.coroutines.launch +import org.adfa.constants.PLUGIN_ARCHIVE_EXTENSION import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.markInvisible import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity import org.appdevforall.codeonthego.repositories.PluginRepository -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.utils.DialogUtils import org.appdevforall.codeonthego.utils.flashError import org.appdevforall.codeonthego.utils.flashSuccess -import kotlinx.coroutines.launch -import org.adfa.constants.PLUGIN_ARCHIVE_EXTENSION import org.koin.core.context.GlobalContext class InstallFileAction( diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/file/SaveFileAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/file/SaveFileAction.kt index a9ed37b62d..e050b8ae3a 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/file/SaveFileAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/file/SaveFileAction.kt @@ -19,12 +19,12 @@ package org.appdevforall.codeonthego.actions.file import android.content.Context import androidx.core.content.ContextCompat +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.EditorRelatedAction import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.models.SaveResult import org.appdevforall.codeonthego.quickbuild.GenerateSourcesDeferral -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.utils.flashError import org.appdevforall.codeonthego.utils.flashSuccess import org.slf4j.LoggerFactory diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/BaseDirNodeAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/BaseDirNodeAction.kt index 5dbd14da99..c0d614b997 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/BaseDirNodeAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/BaseDirNodeAction.kt @@ -29,24 +29,25 @@ import org.appdevforall.codeonthego.actions.requireFile * * @author Akash Yadav */ -abstract class BaseDirNodeAction(context: Context, - @StringRes labelRes: Int? = null, - @DrawableRes iconRes: Int? = null) : BaseFileTreeAction(context, labelRes, iconRes) { +abstract class BaseDirNodeAction( + context: Context, + @StringRes labelRes: Int? = null, + @DrawableRes iconRes: Int? = null, +) : BaseFileTreeAction(context, labelRes, iconRes) { + override fun prepare(data: ActionData) { + super.prepare(data) + if (!data.hasFileTreeData()) { + markInvisible() + return + } - override fun prepare(data: ActionData) { - super.prepare(data) - if (!data.hasFileTreeData()) { - markInvisible() - return - } + val file = data.requireFile() + if (!file.isDirectory) { + markInvisible() + return + } - val file = data.requireFile() - if (!file.isDirectory) { - markInvisible() - return - } - - visible = true - enabled = true - } + visible = true + enabled = true + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/BaseFileTreeAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/BaseFileTreeAction.kt index 918c5b8553..8e21c4e720 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/BaseFileTreeAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/BaseFileTreeAction.kt @@ -21,6 +21,7 @@ import android.content.Context import androidx.annotation.DrawableRes import androidx.annotation.StringRes import androidx.core.content.ContextCompat +import com.unnamed.b.atv.model.TreeNode import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.ActionItem import org.appdevforall.codeonthego.actions.EditorActivityAction @@ -30,7 +31,6 @@ import org.appdevforall.codeonthego.eventbus.events.Event import org.appdevforall.codeonthego.events.CollapseTreeNodeRequestEvent import org.appdevforall.codeonthego.events.ExpandTreeNodeRequestEvent import org.appdevforall.codeonthego.events.ListProjectFilesRequestEvent -import com.unnamed.b.atv.model.TreeNode import org.greenrobot.eventbus.EventBus import java.io.File @@ -40,56 +40,52 @@ import java.io.File * @author Akash Yadav */ abstract class BaseFileTreeAction( - context: Context, - @StringRes labelRes: Int? = null, - @DrawableRes iconRes: Int? = null + context: Context, + @StringRes labelRes: Int? = null, + @DrawableRes iconRes: Int? = null, ) : EditorActivityAction() { + override var requiresUIThread: Boolean = true + override var location: ActionItem.Location = ActionItem.Location.EDITOR_FILE_TREE - override var requiresUIThread: Boolean = true - override var location: ActionItem.Location = ActionItem.Location.EDITOR_FILE_TREE - - init { - labelRes?.let { label = context.getString(it) } - iconRes?.let { icon = ContextCompat.getDrawable(context, it) } - } + init { + labelRes?.let { label = context.getString(it) } + iconRes?.let { icon = ContextCompat.getDrawable(context, it) } + } - override fun prepare(data: ActionData) { - super.prepare(data) - if (!data.hasFileTreeData()) { - markInvisible() - return - } + override fun prepare(data: ActionData) { + super.prepare(data) + if (!data.hasFileTreeData()) { + markInvisible() + return + } - visible = true - enabled = true - } + visible = true + enabled = true + } - protected open fun ActionData.hasFileTreeData(): Boolean { - return hasRequiredData(Context::class.java, File::class.java, TreeNode::class.java) - } + protected open fun ActionData.hasFileTreeData(): Boolean = hasRequiredData(Context::class.java, File::class.java, TreeNode::class.java) - protected fun ActionData.getTreeNode() : TreeNode? { - return this[TreeNode::class.java] - } + protected fun ActionData.getTreeNode(): TreeNode? = this[TreeNode::class.java] - protected fun ActionData.requireTreeNode() : TreeNode { - return getTreeNode()!! - } + protected fun ActionData.requireTreeNode(): TreeNode = getTreeNode()!! - protected fun Event.putData(context: Context): Event { - put(Context::class.java, context) - return this - } + protected fun Event.putData(context: Context): Event { + put(Context::class.java, context) + return this + } - protected fun requestFileListing() { - EventBus.getDefault().post(ListProjectFilesRequestEvent()) - } + protected fun requestFileListing() { + EventBus.getDefault().post(ListProjectFilesRequestEvent()) + } - protected fun requestExpandNode(node: TreeNode) { - EventBus.getDefault().post(ExpandTreeNodeRequestEvent(node)) - } + protected fun requestExpandNode(node: TreeNode) { + EventBus.getDefault().post(ExpandTreeNodeRequestEvent(node)) + } - protected fun requestCollapseNode(node: TreeNode, includeSubnodes: Boolean) { - EventBus.getDefault().post(CollapseTreeNodeRequestEvent(node, includeSubnodes)) - } + protected fun requestCollapseNode( + node: TreeNode, + includeSubnodes: Boolean, + ) { + EventBus.getDefault().post(CollapseTreeNodeRequestEvent(node, includeSubnodes)) + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/CopyPathAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/CopyPathAction.kt index 06ef61de88..7ad93d2dd3 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/CopyPathAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/CopyPathAction.kt @@ -18,11 +18,11 @@ package org.appdevforall.codeonthego.actions.filetree import android.content.Context +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.requireContext import org.appdevforall.codeonthego.actions.requireFile import org.appdevforall.codeonthego.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.utils.copyToClipboard import org.appdevforall.codeonthego.utils.flashSuccess diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/DeleteAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/DeleteAction.kt index caad99de4f..996243ac00 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/DeleteAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/DeleteAction.kt @@ -19,13 +19,13 @@ package org.appdevforall.codeonthego.actions.filetree import android.app.ProgressDialog import android.content.Context +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.requireFile import org.appdevforall.codeonthego.eventbus.events.file.FileDeletionEvent import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.idetooltips.attachTooltip import org.appdevforall.codeonthego.projects.FileManager -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.tasks.executeAsync import org.appdevforall.codeonthego.utils.DialogUtils import org.appdevforall.codeonthego.utils.FileUtils diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/HelpAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/HelpAction.kt index b6e14dc801..460804e2f7 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/HelpAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/HelpAction.kt @@ -7,29 +7,30 @@ import org.appdevforall.codeonthego.actions.requireContext import org.appdevforall.codeonthego.idetooltips.TooltipManager import org.appdevforall.codeonthego.idetooltips.TooltipTag -class HelpAction(context: Context, override val order: Int) : - BaseFileTreeAction( - context = context, - labelRes = R.string.help, - iconRes = R.drawable.ic_action_help_outlined - ) { - override val id: String = "ide.editor.fileTree.help" - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String { - return if (isReadOnlyContext) { - TooltipTag.PROJECT_FOLDER_HELP - } else { - TooltipTag.PROJECT_FILE_HELP - } - } +class HelpAction( + context: Context, + override val order: Int, +) : BaseFileTreeAction( + context = context, + labelRes = R.string.help, + iconRes = R.drawable.ic_action_help_outlined, + ) { + override val id: String = "ide.editor.fileTree.help" - override suspend fun execAction(data: ActionData) { - val context = data.requireContext() + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = + if (isReadOnlyContext) { + TooltipTag.PROJECT_FOLDER_HELP + } else { + TooltipTag.PROJECT_FILE_HELP + } - TooltipManager.showIdeCategoryTooltip( - context = context, - anchorView = data.requireTreeNode().viewHolder.view, - tag = TooltipTag.PROJECT_FILE_HELP, - ) - } + override suspend fun execAction(data: ActionData) { + val context = data.requireContext() -} \ No newline at end of file + TooltipManager.showIdeCategoryTooltip( + context = context, + anchorView = data.requireTreeNode().viewHolder.view, + tag = TooltipTag.PROJECT_FILE_HELP, + ) + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/NewFileAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/NewFileAction.kt index b79f3b29da..3c582cda44 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/NewFileAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/NewFileAction.kt @@ -22,19 +22,22 @@ import android.content.DialogInterface import android.view.LayoutInflater import androidx.appcompat.app.AlertDialog import androidx.core.view.isVisible +import com.itsaky.androidide.databinding.LayoutCreateFileCppBinding +import com.itsaky.androidide.databinding.LayoutCreateFileJavaBinding +import com.itsaky.androidide.preferences.databinding.LayoutDialogTextInputBinding +import com.itsaky.androidide.resources.R +import com.unnamed.b.atv.model.TreeNode +import jdkx.lang.model.SourceVersion +import kotlinx.coroutines.CancellationException import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.FileActionManager import org.appdevforall.codeonthego.actions.observers.FileActionObserver import org.appdevforall.codeonthego.actions.requireFile -import com.itsaky.androidide.databinding.LayoutCreateFileCppBinding -import com.itsaky.androidide.databinding.LayoutCreateFileJavaBinding import org.appdevforall.codeonthego.eventbus.events.file.FileCreationEvent import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.idetooltips.attachTooltip -import com.itsaky.androidide.preferences.databinding.LayoutDialogTextInputBinding import org.appdevforall.codeonthego.projects.IProjectManager import org.appdevforall.codeonthego.projects.ProjectManagerImpl -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.templates.base.models.Dependency import org.appdevforall.codeonthego.utils.ClassBuilder.SourceLanguage import org.appdevforall.codeonthego.utils.DialogUtils @@ -45,9 +48,6 @@ import org.appdevforall.codeonthego.utils.ProjectWriter import org.appdevforall.codeonthego.utils.SingleTextWatcher import org.appdevforall.codeonthego.utils.flashError import org.appdevforall.codeonthego.utils.flashSuccess -import com.unnamed.b.atv.model.TreeNode -import jdkx.lang.model.SourceVersion -import kotlinx.coroutines.CancellationException import org.greenrobot.eventbus.EventBus import org.koin.core.component.KoinComponent import org.koin.core.component.get diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/NewFolderAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/NewFolderAction.kt index aaa54f041c..2c064446d8 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/NewFolderAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/NewFolderAction.kt @@ -19,17 +19,17 @@ package org.appdevforall.codeonthego.actions.filetree import android.content.Context import android.view.LayoutInflater +import com.itsaky.androidide.preferences.databinding.LayoutDialogTextInputBinding +import com.itsaky.androidide.resources.R +import com.unnamed.b.atv.model.TreeNode import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.requireFile import org.appdevforall.codeonthego.adapters.viewholders.FileTreeViewHolder import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.idetooltips.attachTooltip -import com.itsaky.androidide.preferences.databinding.LayoutDialogTextInputBinding -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.utils.DialogUtils import org.appdevforall.codeonthego.utils.flashError import org.appdevforall.codeonthego.utils.flashSuccess -import com.unnamed.b.atv.model.TreeNode import java.io.File /** diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/OpenWithAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/OpenWithAction.kt index dceed85bf3..ab4cf9da60 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/OpenWithAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/OpenWithAction.kt @@ -19,11 +19,11 @@ package org.appdevforall.codeonthego.actions.filetree import android.content.Context import android.content.Intent +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.markInvisible import org.appdevforall.codeonthego.actions.requireFile import org.appdevforall.codeonthego.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.utils.IntentUtils /** @@ -31,29 +31,29 @@ import org.appdevforall.codeonthego.utils.IntentUtils * * @author Akash Yadav */ -class OpenWithAction(context: Context, override val order: Int) : - BaseFileTreeAction( - context = context, - labelRes = R.string.open_with, - iconRes = R.drawable.ic_open_with - ) { +class OpenWithAction( + context: Context, + override val order: Int, +) : BaseFileTreeAction( + context = context, + labelRes = R.string.open_with, + iconRes = R.drawable.ic_open_with, + ) { + override val id: String = "ide.editor.fileTree.openWith" - override val id: String = "ide.editor.fileTree.openWith" + override fun retrieveTooltipTag(isAlternateContext: Boolean): String = TooltipTag.PROJECT_FILE_OPENWITH - override fun retrieveTooltipTag(isAlternateContext: Boolean): String = - TooltipTag.PROJECT_FILE_OPENWITH + override fun prepare(data: ActionData) { + super.prepare(data) - override fun prepare(data: ActionData) { - super.prepare(data) - - // Hide "Open with" option for directories - val file = data.requireFile() - if (file.isDirectory) { - markInvisible() - } - } + // Hide "Open with" option for directories + val file = data.requireFile() + if (file.isDirectory) { + markInvisible() + } + } - override suspend fun execAction(data: ActionData) { - IntentUtils.startIntent(data.requireActivity(), data.requireFile(), "*/*", Intent.ACTION_VIEW) - } + override suspend fun execAction(data: ActionData) { + IntentUtils.startIntent(data.requireActivity(), data.requireFile(), "*/*", Intent.ACTION_VIEW) + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/RenameAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/RenameAction.kt index 09e469533b..a7b9c32db0 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/RenameAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/filetree/RenameAction.kt @@ -21,11 +21,11 @@ import android.content.Context import android.view.LayoutInflater import androidx.activity.viewModels import com.itsaky.androidide.R +import com.itsaky.androidide.preferences.databinding.LayoutDialogTextInputBinding import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.requireFile import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.idetooltips.attachTooltip -import com.itsaky.androidide.preferences.databinding.LayoutDialogTextInputBinding import org.appdevforall.codeonthego.utils.DialogUtils import org.appdevforall.codeonthego.utils.flashError import org.appdevforall.codeonthego.viewmodel.FileManagerViewModel diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/internalActionUtils.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/internalActionUtils.kt index f07f0128db..203bed20de 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/internalActionUtils.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/internalActionUtils.kt @@ -1,16 +1,16 @@ /* * This file is part of AndroidIDE. - * + * * AndroidIDE is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * AndroidIDE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . */ @@ -29,8 +29,8 @@ import org.appdevforall.codeonthego.utils.flashError * @see openApplicationModuleChooser */ inline fun openApplicationModuleChooser(data: ActionData, - crossinline callback: (AndroidModule) -> Unit) = - openApplicationModuleChooser(data.requireContext(), callback) +crossinline callback: (AndroidModule) -> Unit) = +openApplicationModuleChooser(data.requireContext(), callback) /** * Shows a dialog to let the user choose between Android application modules in case the project has @@ -40,32 +40,32 @@ inline fun openApplicationModuleChooser(data: ActionData, * @param */ inline fun openApplicationModuleChooser(context: Context, - crossinline callback: (AndroidModule) -> Unit) { - val projectManager = IProjectManager.getInstance() - val applications = projectManager.getAndroidAppModules() - if (applications.isEmpty()) { - flashError(R.string.msg_launch_failure_no_app_module) - ILogger.ROOT.error("Cannot run application. No application modules found in project.") - return - } +crossinline callback: (AndroidModule) -> Unit) { +val projectManager = IProjectManager.getInstance() +val applications = projectManager.getAndroidAppModules() +if (applications.isEmpty()) { + flashError(R.string.msg_launch_failure_no_app_module) + ILogger.ROOT.error("Cannot run application. No application modules found in project.") + return +} - if (applications.size == 1) { - // Only one application module in available in the project. - callback(applications.first()) - return - } +if (applications.size == 1) { + // Only one application module in available in the project. + callback(applications.first()) + return +} - // there are multiple application modules in the project - // ask the user to select the application module to build - val builder = DialogUtils.newSingleChoiceDialog( - context, - context.getString(R.string.title_choose_application), - applications.map { it.path }.toTypedArray(), - 0) { selection -> - val app = applications[selection] - ILogger.ROOT.info("Selected application: '{}'", app.path) - callback(app) - } +// there are multiple application modules in the project +// ask the user to select the application module to build +val builder = DialogUtils.newSingleChoiceDialog( + context, + context.getString(R.string.title_choose_application), + applications.map { it.path }.toTypedArray(), + 0) { selection -> + val app = applications[selection] + ILogger.ROOT.info("Selected application: '{}'", app.path) + callback(app) +} - builder.show() -} \ No newline at end of file +builder.show() +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/main/CloneRepositoryAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/main/CloneRepositoryAction.kt index ed188c3df8..53a387a38b 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/main/CloneRepositoryAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/main/CloneRepositoryAction.kt @@ -11,34 +11,35 @@ import org.appdevforall.codeonthego.activities.MainActivity import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.utils.FeatureFlags -class CloneRepositoryAction(context: Context) : ActionItem { - - override val id: String = ID - - companion object { - const val ID = "ide.main.cloneRepository" - } - - override var label: String = context.getString(R.string.clone_git_project) - override var visible: Boolean = true - override var enabled: Boolean = true - override var icon: Drawable? = ContextCompat.getDrawable(context, R.drawable.ic_clone_repo) - override var requiresUIThread: Boolean = true - override var location: ActionItem.Location = ActionItem.Location.MAIN_SCREEN - override val order: Int = 2 - - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.MAIN_GIT - - override fun prepare(data: ActionData) { - super.prepare(data) - val context = data.get(Context::class.java) - if (context !is MainActivity) { - markInvisible() - } - } - - override suspend fun execAction(data: ActionData): Any { - val context = data.get(Context::class.java) as? MainActivity ?: return false - return context.showCloneRepository() - } +class CloneRepositoryAction( + context: Context, +) : ActionItem { + override val id: String = ID + + companion object { + const val ID = "ide.main.cloneRepository" + } + + override var label: String = context.getString(R.string.clone_git_project) + override var visible: Boolean = true + override var enabled: Boolean = true + override var icon: Drawable? = ContextCompat.getDrawable(context, R.drawable.ic_clone_repo) + override var requiresUIThread: Boolean = true + override var location: ActionItem.Location = ActionItem.Location.MAIN_SCREEN + override val order: Int = 2 + + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.MAIN_GIT + + override fun prepare(data: ActionData) { + super.prepare(data) + val context = data.get(Context::class.java) + if (context !is MainActivity) { + markInvisible() + } + } + + override suspend fun execAction(data: ActionData): Any { + val context = data.get(Context::class.java) as? MainActivity ?: return false + return context.showCloneRepository() + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/main/CreateProjectAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/main/CreateProjectAction.kt index c0f1a6ac61..e97a701058 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/main/CreateProjectAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/main/CreateProjectAction.kt @@ -10,34 +10,35 @@ import org.appdevforall.codeonthego.actions.markInvisible import org.appdevforall.codeonthego.activities.MainActivity import org.appdevforall.codeonthego.idetooltips.TooltipTag -class CreateProjectAction(context: Context) : ActionItem { - - override val id: String = ID - - companion object { - const val ID = "ide.main.createProject" - } - - override var label: String = context.getString(R.string.create_project) - override var visible: Boolean = true - override var enabled: Boolean = true - override var icon: Drawable? = ContextCompat.getDrawable(context, R.drawable.ic_add) - override var requiresUIThread: Boolean = true - override var location: ActionItem.Location = ActionItem.Location.MAIN_SCREEN - override val order: Int = 0 - - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.PROJECT_NEW - - override fun prepare(data: ActionData) { - super.prepare(data) - val context = data.get(Context::class.java) - if (context !is MainActivity) { - markInvisible() - } - } - - override suspend fun execAction(data: ActionData): Any { - val context = data.get(Context::class.java) as? MainActivity ?: return false - return context.showCreateProject() - } +class CreateProjectAction( + context: Context, +) : ActionItem { + override val id: String = ID + + companion object { + const val ID = "ide.main.createProject" + } + + override var label: String = context.getString(R.string.create_project) + override var visible: Boolean = true + override var enabled: Boolean = true + override var icon: Drawable? = ContextCompat.getDrawable(context, R.drawable.ic_add) + override var requiresUIThread: Boolean = true + override var location: ActionItem.Location = ActionItem.Location.MAIN_SCREEN + override val order: Int = 0 + + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.PROJECT_NEW + + override fun prepare(data: ActionData) { + super.prepare(data) + val context = data.get(Context::class.java) + if (context !is MainActivity) { + markInvisible() + } + } + + override suspend fun execAction(data: ActionData): Any { + val context = data.get(Context::class.java) as? MainActivity ?: return false + return context.showCreateProject() + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/main/DeleteProjectAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/main/DeleteProjectAction.kt index 326a566675..9fa824e353 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/main/DeleteProjectAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/main/DeleteProjectAction.kt @@ -10,34 +10,35 @@ import org.appdevforall.codeonthego.actions.markInvisible import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.viewmodel.MainViewModel -class DeleteProjectAction(context: Context) : ActionItem { - - override val id: String = ID - - companion object { - const val ID = "ide.main.deleteProject" - } - - override var label: String = context.getString(R.string.msg_delete_existing_project) - override var visible: Boolean = true - override var enabled: Boolean = true - override var icon: Drawable? = ContextCompat.getDrawable(context, R.drawable.ic_delete) - override var requiresUIThread: Boolean = true - override var location: ActionItem.Location = ActionItem.Location.MAIN_SCREEN - override val order: Int = 3 - - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.MAIN_PROJECT_DELETE - - override fun prepare(data: ActionData) { - super.prepare(data) - if (data.get(MainViewModel::class.java) == null || data.get(Context::class.java) == null) { - markInvisible() - } - } - - override suspend fun execAction(data: ActionData): Any { - val viewModel = data.get(MainViewModel::class.java) ?: return false - viewModel.setScreen(MainViewModel.SCREEN_DELETE_PROJECTS) - return true - } +class DeleteProjectAction( + context: Context, +) : ActionItem { + override val id: String = ID + + companion object { + const val ID = "ide.main.deleteProject" + } + + override var label: String = context.getString(R.string.msg_delete_existing_project) + override var visible: Boolean = true + override var enabled: Boolean = true + override var icon: Drawable? = ContextCompat.getDrawable(context, R.drawable.ic_delete) + override var requiresUIThread: Boolean = true + override var location: ActionItem.Location = ActionItem.Location.MAIN_SCREEN + override val order: Int = 3 + + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.MAIN_PROJECT_DELETE + + override fun prepare(data: ActionData) { + super.prepare(data) + if (data.get(MainViewModel::class.java) == null || data.get(Context::class.java) == null) { + markInvisible() + } + } + + override suspend fun execAction(data: ActionData): Any { + val viewModel = data.get(MainViewModel::class.java) ?: return false + viewModel.setScreen(MainViewModel.SCREEN_DELETE_PROJECTS) + return true + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/main/DocsAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/main/DocsAction.kt index db339e37de..baefe1871b 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/main/DocsAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/main/DocsAction.kt @@ -5,48 +5,49 @@ import android.content.Intent import android.graphics.drawable.Drawable import androidx.core.content.ContextCompat import com.itsaky.androidide.R +import com.itsaky.androidide.resources.R.string +import org.adfa.constants.CONTENT_KEY +import org.adfa.constants.CONTENT_TITLE_KEY import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.ActionItem import org.appdevforall.codeonthego.actions.markInvisible import org.appdevforall.codeonthego.activities.editor.HelpActivity import org.appdevforall.codeonthego.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R.string -import org.adfa.constants.CONTENT_KEY -import org.adfa.constants.CONTENT_TITLE_KEY - -class DocsAction(context: Context) : ActionItem { - - override val id: String = ID - - companion object { - const val ID = "ide.main.docs" - } - - override var label: String = context.getString(R.string.btn_docs) - override var visible: Boolean = true - override var enabled: Boolean = true - override var icon: Drawable? = ContextCompat.getDrawable(context, R.drawable.ic_action_help_outlined) - override var requiresUIThread: Boolean = true - override var location: ActionItem.Location = ActionItem.Location.MAIN_SCREEN - override val order: Int = 7 - - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.MAIN_HELP - - override fun prepare(data: ActionData) { - super.prepare(data) - if (data.get(Context::class.java) == null) { - markInvisible() - } - } - override suspend fun execAction(data: ActionData): Any { - val context = data.get(Context::class.java) ?: return false - val intent = - Intent(context, HelpActivity::class.java).apply { - putExtra(CONTENT_KEY, context.getString(string.docs_url)) - putExtra(CONTENT_TITLE_KEY, context.getString(string.back_to_cogo)) - } - context.startActivity(intent) - return true - } +class DocsAction( + context: Context, +) : ActionItem { + override val id: String = ID + + companion object { + const val ID = "ide.main.docs" + } + + override var label: String = context.getString(R.string.btn_docs) + override var visible: Boolean = true + override var enabled: Boolean = true + override var icon: Drawable? = ContextCompat.getDrawable(context, R.drawable.ic_action_help_outlined) + override var requiresUIThread: Boolean = true + override var location: ActionItem.Location = ActionItem.Location.MAIN_SCREEN + override val order: Int = 7 + + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.MAIN_HELP + + override fun prepare(data: ActionData) { + super.prepare(data) + if (data.get(Context::class.java) == null) { + markInvisible() + } + } + + override suspend fun execAction(data: ActionData): Any { + val context = data.get(Context::class.java) ?: return false + val intent = + Intent(context, HelpActivity::class.java).apply { + putExtra(CONTENT_KEY, context.getString(string.docs_url)) + putExtra(CONTENT_TITLE_KEY, context.getString(string.back_to_cogo)) + } + context.startActivity(intent) + return true + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/main/DonateAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/main/DonateAction.kt index e77007786a..4c3a419c98 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/main/DonateAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/main/DonateAction.kt @@ -10,33 +10,34 @@ import org.appdevforall.codeonthego.actions.markInvisible import org.appdevforall.codeonthego.actions.requireContext import org.appdevforall.codeonthego.utils.UrlManager -class DonateAction(context: Context) : ActionItem { +class DonateAction( + context: Context, +) : ActionItem { + override val id: String = ID - override val id: String = ID + companion object { + const val ID = "ide.main.donate" + } - companion object { - const val ID = "ide.main.donate" - } + override var label: String = context.getString(R.string.btn_donate) + override var visible: Boolean = true + override var enabled: Boolean = true + override var icon: Drawable? = ContextCompat.getDrawable(context, R.drawable.ic_heart) + override var requiresUIThread: Boolean = true + override var location: ActionItem.Location = ActionItem.Location.MAIN_SCREEN + override val order: Int = 6 - override var label: String = context.getString(R.string.btn_donate) - override var visible: Boolean = true - override var enabled: Boolean = true - override var icon: Drawable? = ContextCompat.getDrawable(context, R.drawable.ic_heart) - override var requiresUIThread: Boolean = true - override var location: ActionItem.Location = ActionItem.Location.MAIN_SCREEN - override val order: Int = 6 + override fun prepare(data: ActionData) { + super.prepare(data) + if (data.get(Context::class.java) == null) { + markInvisible() + } + markInvisible() // Until we allow donations + } - override fun prepare(data: ActionData) { - super.prepare(data) - if (data.get(Context::class.java) == null) { - markInvisible() - } - markInvisible() // Until we allow donations - } - - override suspend fun execAction(data: ActionData): Any { - val context = data.requireContext() - UrlManager.openUrl(context.getString(R.string.sponsor_url), null, context) - return true - } + override suspend fun execAction(data: ActionData): Any { + val context = data.requireContext() + UrlManager.openUrl(context.getString(R.string.sponsor_url), null, context) + return true + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/main/OpenProjectAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/main/OpenProjectAction.kt index 27228f67b1..e3fce6d38c 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/main/OpenProjectAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/main/OpenProjectAction.kt @@ -10,34 +10,35 @@ import org.appdevforall.codeonthego.actions.markInvisible import org.appdevforall.codeonthego.activities.MainActivity import org.appdevforall.codeonthego.idetooltips.TooltipTag -class OpenProjectAction(context: Context) : ActionItem { - - override val id: String = ID - - companion object { - const val ID = "ide.main.openProject" - } - - override var label: String = context.getString(R.string.msg_open_existing_project) - override var visible: Boolean = true - override var enabled: Boolean = true - override var icon: Drawable? = ContextCompat.getDrawable(context, R.drawable.ic_folder_open) - override var requiresUIThread: Boolean = true - override var location: ActionItem.Location = ActionItem.Location.MAIN_SCREEN - override val order: Int = 1 - - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.PROJECT_OPEN - - override fun prepare(data: ActionData) { - super.prepare(data) - val context = data.get(Context::class.java) - if (context !is MainActivity) { - markInvisible() - } - } - - override suspend fun execAction(data: ActionData): Any { - val context = data.get(Context::class.java) as? MainActivity ?: return false - return context.showOpenProject() - } +class OpenProjectAction( + context: Context, +) : ActionItem { + override val id: String = ID + + companion object { + const val ID = "ide.main.openProject" + } + + override var label: String = context.getString(R.string.msg_open_existing_project) + override var visible: Boolean = true + override var enabled: Boolean = true + override var icon: Drawable? = ContextCompat.getDrawable(context, R.drawable.ic_folder_open) + override var requiresUIThread: Boolean = true + override var location: ActionItem.Location = ActionItem.Location.MAIN_SCREEN + override val order: Int = 1 + + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.PROJECT_OPEN + + override fun prepare(data: ActionData) { + super.prepare(data) + val context = data.get(Context::class.java) + if (context !is MainActivity) { + markInvisible() + } + } + + override suspend fun execAction(data: ActionData): Any { + val context = data.get(Context::class.java) as? MainActivity ?: return false + return context.showOpenProject() + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/main/OpenTerminalAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/main/OpenTerminalAction.kt index ba2aebb0e6..fff51ba40c 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/main/OpenTerminalAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/main/OpenTerminalAction.kt @@ -12,36 +12,38 @@ import org.appdevforall.codeonthego.activities.TerminalActivity import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.utils.applyMultiWindowFlags -class OpenTerminalAction(context: Context) : ActionItem { - - override val id: String = ID - - companion object { - const val ID = "ide.main.openTerminal" - } - - override var label: String = context.getString(R.string.title_terminal) - override var visible: Boolean = true - override var enabled: Boolean = true - override var icon: Drawable? = ContextCompat.getDrawable(context, R.drawable.ic_terminal) - override var requiresUIThread: Boolean = true - override var location: ActionItem.Location = ActionItem.Location.MAIN_SCREEN - override val order: Int = 4 - - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.MAIN_TERMINAL - - override fun prepare(data: ActionData) { - super.prepare(data) - if (data.get(Context::class.java) == null) { - markInvisible() - } - } - - override suspend fun execAction(data: ActionData): Any { - val context = data.get(Context::class.java) ?: return false - val intent = Intent(context, TerminalActivity::class.java) - .applyMultiWindowFlags(context) - context.startActivity(intent) - return true - } +class OpenTerminalAction( + context: Context, +) : ActionItem { + override val id: String = ID + + companion object { + const val ID = "ide.main.openTerminal" + } + + override var label: String = context.getString(R.string.title_terminal) + override var visible: Boolean = true + override var enabled: Boolean = true + override var icon: Drawable? = ContextCompat.getDrawable(context, R.drawable.ic_terminal) + override var requiresUIThread: Boolean = true + override var location: ActionItem.Location = ActionItem.Location.MAIN_SCREEN + override val order: Int = 4 + + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.MAIN_TERMINAL + + override fun prepare(data: ActionData) { + super.prepare(data) + if (data.get(Context::class.java) == null) { + markInvisible() + } + } + + override suspend fun execAction(data: ActionData): Any { + val context = data.get(Context::class.java) ?: return false + val intent = + Intent(context, TerminalActivity::class.java) + .applyMultiWindowFlags(context) + context.startActivity(intent) + return true + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/main/PreferencesAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/main/PreferencesAction.kt index 42b6de5cac..b097305693 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/main/PreferencesAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/main/PreferencesAction.kt @@ -11,34 +11,35 @@ import org.appdevforall.codeonthego.actions.markInvisible import org.appdevforall.codeonthego.activities.PreferencesActivity import org.appdevforall.codeonthego.idetooltips.TooltipTag -class PreferencesAction(context: Context) : ActionItem { - - override val id: String = ID - - companion object { - const val ID = "ide.main.preferences" - } - - override var label: String = context.getString(R.string.msg_preferences) - override var visible: Boolean = true - override var enabled: Boolean = true - override var icon: Drawable? = ContextCompat.getDrawable(context, R.drawable.ic_settings) - override var requiresUIThread: Boolean = true - override var location: ActionItem.Location = ActionItem.Location.MAIN_SCREEN - override val order: Int = 5 - - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.MAIN_PREFERENCES - - override fun prepare(data: ActionData) { - super.prepare(data) - if (data.get(Context::class.java) == null) { - markInvisible() - } - } - - override suspend fun execAction(data: ActionData): Any { - val context = data.get(Context::class.java) ?: return false - context.startActivity(Intent(context, PreferencesActivity::class.java)) - return true - } +class PreferencesAction( + context: Context, +) : ActionItem { + override val id: String = ID + + companion object { + const val ID = "ide.main.preferences" + } + + override var label: String = context.getString(R.string.msg_preferences) + override var visible: Boolean = true + override var enabled: Boolean = true + override var icon: Drawable? = ContextCompat.getDrawable(context, R.drawable.ic_settings) + override var requiresUIThread: Boolean = true + override var location: ActionItem.Location = ActionItem.Location.MAIN_SCREEN + override val order: Int = 5 + + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.MAIN_PREFERENCES + + override fun prepare(data: ActionData) { + super.prepare(data) + if (data.get(Context::class.java) == null) { + markInvisible() + } + } + + override suspend fun execAction(data: ActionData): Any { + val context = data.get(Context::class.java) ?: return false + context.startActivity(Intent(context, PreferencesActivity::class.java)) + return true + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/observers/FileActionObserver.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/observers/FileActionObserver.kt index df8086620c..5e39612d52 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/observers/FileActionObserver.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/observers/FileActionObserver.kt @@ -7,6 +7,10 @@ import java.io.File * Implement this in your Fragment or Activity to show UI feedback. */ interface FileActionObserver { - fun onActionSuccess(message: String, createdFile: File?) - fun onActionFailure(errorMessage: String) -} \ No newline at end of file + fun onActionSuccess( + message: String, + createdFile: File?, + ) + + fun onActionFailure(errorMessage: String) +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/profiler/ProfilerAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/profiler/ProfilerAction.kt index edd03fb1b8..021f38504d 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/profiler/ProfilerAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/profiler/ProfilerAction.kt @@ -1,6 +1,9 @@ package org.appdevforall.codeonthego.actions.profiler import android.content.Context +import com.itsaky.androidide.resources.R +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.build.AbstractRunAction import org.appdevforall.codeonthego.actions.canShowPairingNotification @@ -11,12 +14,9 @@ import org.appdevforall.codeonthego.project.AndroidModels import org.appdevforall.codeonthego.projects.IProjectManager import org.appdevforall.codeonthego.projects.api.AndroidModule import org.appdevforall.codeonthego.projects.isPluginProject -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig.PROPERTY_PROFILEABLE_ENABLED import org.appdevforall.codeonthego.utils.flashError import org.appdevforall.codeonthego.utils.isAtLeastR -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.withContext import rikka.shizuku.Shizuku class ProfilerAction( diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/AbstractSidebarAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/AbstractSidebarAction.kt index 1b65667349..bd012887a1 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/AbstractSidebarAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/AbstractSidebarAction.kt @@ -26,21 +26,18 @@ import org.appdevforall.codeonthego.actions.SidebarActionItem * @author Akash Yadav */ abstract class AbstractSidebarAction : SidebarActionItem { + // sidebar actions should always be executed on UI thread + override var requiresUIThread = true + override var visible = true + override var enabled = true - // sidebar actions should always be executed on UI thread - override var requiresUIThread = true - override var visible = true - override var enabled = true + // should never change + override var location = ActionItem.Location.EDITOR_SIDEBAR - // should never change - override var location = ActionItem.Location.EDITOR_SIDEBAR + // Subclasses should accept a Context in their constructor and initialize these values + // when the object instance is initialized + override var icon: Drawable? = null + override var label: String = "" - // Subclasses should accept a Context in their constructor and initialize these values - // when the object instance is initialized - override var icon: Drawable? = null - override var label: String = "" - - override suspend fun execAction(data: ActionData): Any { - return false - } -} \ No newline at end of file + override suspend fun execAction(data: ActionData): Any = false +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/BuildVariantsSidebarAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/BuildVariantsSidebarAction.kt index 95d2c72f65..49a6ee94c2 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/BuildVariantsSidebarAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/BuildVariantsSidebarAction.kt @@ -31,21 +31,22 @@ import kotlin.reflect.KClass * * @author Akash Yadav */ -class BuildVariantsSidebarAction(context: Context, override val order: Int) : - AbstractSidebarAction() { +class BuildVariantsSidebarAction( + context: Context, + override val order: Int, +) : AbstractSidebarAction() { + override val fragmentClass: KClass = BuildVariantsFragment::class + override val id: String = "ide.editor.sidebar.buildVariants" + override var location: ActionItem.Location = ActionItem.Location.EDITOR_SIDEBAR - override val fragmentClass: KClass = BuildVariantsFragment::class - override val id: String = "ide.editor.sidebar.buildVariants" - override var location: ActionItem.Location = ActionItem.Location.EDITOR_SIDEBAR + companion object { + const val ID = "ide.editor.sidebar.buildVariants" + } + init { + label = context.getString(R.string.title_build_variants) + icon = ContextCompat.getDrawable(context, R.drawable.ic_android) + } - companion object { - const val ID ="ide.editor.sidebar.buildVariants" - } - init { - label = context.getString(R.string.title_build_variants) - icon = ContextCompat.getDrawable(context, R.drawable.ic_android) - } - - override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.BUILD_VARIANT_SIDEBAR -} \ No newline at end of file + override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.BUILD_VARIANT_SIDEBAR +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/CloseProjectSidebarAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/CloseProjectSidebarAction.kt index 8432a3f8e1..b62240d582 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/CloseProjectSidebarAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/CloseProjectSidebarAction.kt @@ -20,11 +20,11 @@ package org.appdevforall.codeonthego.actions.sidebar import android.content.Context import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.requireContext import org.appdevforall.codeonthego.activities.editor.BaseEditorActivity import org.appdevforall.codeonthego.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R import kotlin.reflect.KClass /** @@ -32,21 +32,23 @@ import kotlin.reflect.KClass * * @author Akash Yadav */ -class CloseProjectSidebarAction(context: Context, override val order: Int) : - AbstractSidebarAction() { +class CloseProjectSidebarAction( + context: Context, + override val order: Int, +) : AbstractSidebarAction() { + override val id: String = "ide.editor.sidebar.closeProject" + override val fragmentClass: KClass? = null - override val id: String = "ide.editor.sidebar.closeProject" - override val fragmentClass: KClass? = null + init { + label = context.getString(R.string.title_close_project) + icon = ContextCompat.getDrawable(context, R.drawable.ic_folder_close) + } - init { - label = context.getString(R.string.title_close_project) - icon = ContextCompat.getDrawable(context, R.drawable.ic_folder_close) - } + override suspend fun execAction(data: ActionData): Any { + val context = data.requireContext() as BaseEditorActivity + context.doConfirmProjectClose() + return true + } - override suspend fun execAction(data: ActionData): Any { - val context = data.requireContext() as BaseEditorActivity - context.doConfirmProjectClose() - return true - } - override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.CLOSE_PROJECT_SIDEBAR -} \ No newline at end of file + override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.CLOSE_PROJECT_SIDEBAR +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/FileTreeSidebarAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/FileTreeSidebarAction.kt index 32bf3fc9b4..029dfe66a5 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/FileTreeSidebarAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/FileTreeSidebarAction.kt @@ -30,19 +30,21 @@ import kotlin.reflect.KClass * * @author Akash Yadav */ -class FileTreeSidebarAction(context: Context, override val order: Int) : AbstractSidebarAction() { +class FileTreeSidebarAction( + context: Context, + override val order: Int, +) : AbstractSidebarAction() { + companion object { + const val ID = "ide.editor.sidebar.fileTree" + } - companion object { - const val ID ="ide.editor.sidebar.fileTree" - } + override val id: String = ID + override val fragmentClass: KClass = FileTreeFragment::class - override val id: String = ID - override val fragmentClass: KClass = FileTreeFragment::class + init { + label = context.getString(R.string.msg_file_tree) + icon = ContextCompat.getDrawable(context, R.drawable.ic_folder) + } - init { - label = context.getString(R.string.msg_file_tree) - icon = ContextCompat.getDrawable(context, R.drawable.ic_folder) - } - - override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.FILE_TREE_SIDEBAR -} \ No newline at end of file + override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.FILE_TREE_SIDEBAR +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/HelpSideBarAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/HelpSideBarAction.kt index 2f66420d6d..0901c00793 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/HelpSideBarAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/HelpSideBarAction.kt @@ -20,11 +20,11 @@ package org.appdevforall.codeonthego.actions.sidebar import android.content.Context import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.requireContext import org.appdevforall.codeonthego.activities.editor.BaseEditorActivity import org.appdevforall.codeonthego.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R import kotlin.reflect.KClass /** @@ -32,21 +32,23 @@ import kotlin.reflect.KClass * * @author Daniel Alome */ -class HelpSideBarAction(context: Context, override val order: Int) : - AbstractSidebarAction() { +class HelpSideBarAction( + context: Context, + override val order: Int, +) : AbstractSidebarAction() { + override val id: String = "ide.editor.sidebar.help" + override val fragmentClass: KClass? = null - override val id: String = "ide.editor.sidebar.help" - override val fragmentClass: KClass? = null + init { + label = context.getString(R.string.action_open_help) + icon = ContextCompat.getDrawable(context, R.drawable.ic_action_help_outlined) + } - init { - label = context.getString(R.string.action_open_help) - icon = ContextCompat.getDrawable(context, R.drawable.ic_action_help_outlined) - } + override suspend fun execAction(data: ActionData): Any { + val context = data.requireContext() as BaseEditorActivity + context.doOpenHelp() + return true + } - override suspend fun execAction(data: ActionData): Any { - val context = data.requireContext() as BaseEditorActivity - context.doOpenHelp() - return true - } - override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.HELP_SIDEBAR -} \ No newline at end of file + override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.HELP_SIDEBAR +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/PreferencesSidebarAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/PreferencesSidebarAction.kt index 3763c8c027..3a45160244 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/PreferencesSidebarAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/PreferencesSidebarAction.kt @@ -33,26 +33,28 @@ import kotlin.reflect.KClass * * @author Akash Yadav */ -class PreferencesSidebarAction(context: Context, override val order: Int) : AbstractSidebarAction() { - - override val id: String = ID - - companion object { - const val ID = "ide.editor.sidebar.preferences" - } - - // TODO : Should we show the preferences in the sidebar itself? - override val fragmentClass: KClass? = null - - init { - label = context.getString(R.string.ide_preferences) - icon = ContextCompat.getDrawable(context, R.drawable.ic_settings) - } - - override suspend fun execAction(data: ActionData): Any { - val context = data.requireContext() - return context.startActivity(Intent(context, PreferencesActivity::class.java)) - } - override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.PREFERENCES_SIDEBAR - +class PreferencesSidebarAction( + context: Context, + override val order: Int, +) : AbstractSidebarAction() { + override val id: String = ID + + companion object { + const val ID = "ide.editor.sidebar.preferences" + } + + // TODO : Should we show the preferences in the sidebar itself? + override val fragmentClass: KClass? = null + + init { + label = context.getString(R.string.ide_preferences) + icon = ContextCompat.getDrawable(context, R.drawable.ic_settings) + } + + override suspend fun execAction(data: ActionData): Any { + val context = data.requireContext() + return context.startActivity(Intent(context, PreferencesActivity::class.java)) + } + + override fun retrieveTooltipTag(isAlternateContext: Boolean) = TooltipTag.PREFERENCES_SIDEBAR } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/TerminalSidebarAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/TerminalSidebarAction.kt index d1cca9359b..0c54ff9cc4 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/TerminalSidebarAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/sidebar/TerminalSidebarAction.kt @@ -22,13 +22,13 @@ import android.content.Intent import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import com.itsaky.androidide.R +import com.termux.shared.termux.TermuxConstants.TERMUX_APP.TERMUX_ACTIVITY import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.requireContext import org.appdevforall.codeonthego.activities.TerminalActivity import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.projects.IProjectManager import org.appdevforall.codeonthego.utils.applyMultiWindowFlags -import com.termux.shared.termux.TermuxConstants.TERMUX_APP.TERMUX_ACTIVITY import java.util.Objects import kotlin.reflect.KClass @@ -58,21 +58,22 @@ class TerminalSidebarAction( ) { val context = data.requireContext() val intent = - Intent(context, TerminalActivity::class.java).apply { - putExtra( - TERMUX_ACTIVITY.EXTRA_SESSION_WORKING_DIR, - Objects.requireNonNull(IProjectManager.getInstance().projectDirPath), - ) - putExtra( - TERMUX_ACTIVITY.EXTRA_SESSION_NAME, - IProjectManager - .getInstance() - .workspace - ?.rootProject - ?.name, - ) - putExtra(TERMUX_ACTIVITY.EXTRA_FAILSAFE_SESSION, isFailsafe) - }.applyMultiWindowFlags(context) + Intent(context, TerminalActivity::class.java) + .apply { + putExtra( + TERMUX_ACTIVITY.EXTRA_SESSION_WORKING_DIR, + Objects.requireNonNull(IProjectManager.getInstance().projectDirPath), + ) + putExtra( + TERMUX_ACTIVITY.EXTRA_SESSION_NAME, + IProjectManager + .getInstance() + .workspace + ?.rootProject + ?.name, + ) + putExtra(TERMUX_ACTIVITY.EXTRA_FAILSAFE_SESSION, isFailsafe) + }.applyMultiWindowFlags(context) context.startActivity(intent) } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/text/RedoAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/text/RedoAction.kt index 98a4e46adf..5de6b4b6df 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/text/RedoAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/text/RedoAction.kt @@ -21,11 +21,11 @@ import android.app.Activity import android.content.Context import android.view.MenuItem import androidx.core.content.ContextCompat +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.EditorRelatedAction import org.appdevforall.codeonthego.actions.markInvisible import org.appdevforall.codeonthego.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.utils.isSoftInputVisible /** @author Akash Yadav */ diff --git a/app/src/main/java/org/appdevforall/codeonthego/actions/text/UndoAction.kt b/app/src/main/java/org/appdevforall/codeonthego/actions/text/UndoAction.kt index 391fcb0be3..07139a38cb 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/actions/text/UndoAction.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/actions/text/UndoAction.kt @@ -19,45 +19,48 @@ package org.appdevforall.codeonthego.actions.text import android.content.Context import androidx.core.content.ContextCompat +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.EditorRelatedAction import org.appdevforall.codeonthego.idetooltips.TooltipTag -import com.itsaky.androidide.resources.R /** @author Akash Yadav */ -class UndoAction(context: Context, override val order: Int) : EditorRelatedAction() { - - override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.EDITOR_TOOLBAR_UNDO - override val id: String = ID - - companion object { - const val ID = "ide.editor.code.text.undo" - } - - init { - label = context.getString(R.string.undo) - icon = ContextCompat.getDrawable(context, R.drawable.ic_undo) - } - - override fun prepare(data: ActionData) { - super.prepare(data) - - if (!visible) { - return - } - - val editor = data.getEditor()!! - enabled = editor.canUndo() - } - - override suspend fun execAction(data: ActionData): Any { - val editor = data.getEditor() - return if (editor != null) { - editor.undo() - data.getActivity()?.invalidateOptionsMenu() - true - } else { - false - } - } +class UndoAction( + context: Context, + override val order: Int, +) : EditorRelatedAction() { + override fun retrieveTooltipTag(isReadOnlyContext: Boolean): String = TooltipTag.EDITOR_TOOLBAR_UNDO + + override val id: String = ID + + companion object { + const val ID = "ide.editor.code.text.undo" + } + + init { + label = context.getString(R.string.undo) + icon = ContextCompat.getDrawable(context, R.drawable.ic_undo) + } + + override fun prepare(data: ActionData) { + super.prepare(data) + + if (!visible) { + return + } + + val editor = data.getEditor()!! + enabled = editor.canUndo() + } + + override suspend fun execAction(data: ActionData): Any { + val editor = data.getEditor() + return if (editor != null) { + editor.undo() + data.getActivity()?.invalidateOptionsMenu() + true + } else { + false + } + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/activities/AboutActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/AboutActivity.kt index 38cd1b198c..f07e73b2f0 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/activities/AboutActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/AboutActivity.kt @@ -28,13 +28,13 @@ import androidx.core.content.ContextCompat import androidx.core.graphics.Insets import androidx.core.view.updatePaddingRelative import com.itsaky.androidide.BuildConfig -import org.appdevforall.codeonthego.FeedbackButtonManager import com.itsaky.androidide.R +import com.itsaky.androidide.buildinfo.BuildInfo +import com.itsaky.androidide.databinding.ActivityAboutBinding +import org.appdevforall.codeonthego.FeedbackButtonManager import org.appdevforall.codeonthego.adapters.SimpleIconTitleDescriptionAdapter import org.appdevforall.codeonthego.app.EdgeToEdgeIDEActivity import org.appdevforall.codeonthego.app.configuration.IDEBuildConfigProvider -import com.itsaky.androidide.buildinfo.BuildInfo -import com.itsaky.androidide.databinding.ActivityAboutBinding import org.appdevforall.codeonthego.models.IconTitleDescriptionItem import org.appdevforall.codeonthego.models.SimpleIconTitleDescriptionItem import org.appdevforall.codeonthego.utils.BasicBuildInfo diff --git a/app/src/main/java/org/appdevforall/codeonthego/activities/CrashHandlerActivity.java b/app/src/main/java/org/appdevforall/codeonthego/activities/CrashHandlerActivity.java index 5be98f5697..07e91397cd 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/activities/CrashHandlerActivity.java +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/CrashHandlerActivity.java @@ -19,48 +19,46 @@ import android.os.Bundle; import android.view.View; - import androidx.annotation.NonNull; - -import org.appdevforall.codeonthego.app.IDEActivity; import com.itsaky.androidide.databinding.ActivityCrashHandlerBinding; +import org.appdevforall.codeonthego.app.IDEActivity; import org.appdevforall.codeonthego.fragments.CrashReportFragment; public class CrashHandlerActivity extends IDEActivity { - public static final String REPORT_ACTION = "org.appdevforall.codeonthego.REPORT_CRASH"; - public static final String TRACE_KEY = "crash_trace"; - private ActivityCrashHandlerBinding binding; + public static final String REPORT_ACTION = "org.appdevforall.codeonthego.REPORT_CRASH"; + public static final String TRACE_KEY = "crash_trace"; + private ActivityCrashHandlerBinding binding; - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); + @Override + @NonNull + protected View bindLayout() { + binding = ActivityCrashHandlerBinding.inflate(getLayoutInflater()); + return binding.getRoot(); + } - final var extra = getIntent().getExtras(); - if (extra == null) { - finishAffinity(); - return; - } + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); - final var fragment = CrashReportFragment.newInstance(); + final var extra = getIntent().getExtras(); + if (extra == null) { + finishAffinity(); + return; + } - getSupportFragmentManager() - .beginTransaction() - .replace(binding.getRoot().getId(), fragment, "crash_report_fragment") - .addToBackStack(null) - .commit(); - } + final var fragment = CrashReportFragment.newInstance(); - @Override - @NonNull - protected View bindLayout() { - binding = ActivityCrashHandlerBinding.inflate(getLayoutInflater()); - return binding.getRoot(); - } + getSupportFragmentManager() + .beginTransaction() + .replace(binding.getRoot().getId(), fragment, "crash_report_fragment") + .addToBackStack(null) + .commit(); + } - @Override - protected void onDestroy() { - super.onDestroy(); - binding = null; - } + @Override + protected void onDestroy() { + super.onDestroy(); + binding = null; + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/activities/DeepLinkActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/DeepLinkActivity.kt index 483e769552..744de64577 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/activities/DeepLinkActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/DeepLinkActivity.kt @@ -21,6 +21,7 @@ import android.app.Activity import android.content.Intent import android.os.Bundle import android.widget.Toast +import com.itsaky.androidide.resources.R.string import org.appdevforall.codeonthego.activities.editor.EditorActivityKt import org.appdevforall.codeonthego.analytics.DeepLinkDepth import org.appdevforall.codeonthego.analytics.DeepLinkMetric @@ -29,7 +30,6 @@ import org.appdevforall.codeonthego.analytics.IAnalyticsManager import org.appdevforall.codeonthego.analytics.depth import org.appdevforall.codeonthego.api.ActionContextProvider import org.appdevforall.codeonthego.models.DeepLinkRequest -import com.itsaky.androidide.resources.R.string import org.koin.android.ext.android.inject /** diff --git a/app/src/main/java/org/appdevforall/codeonthego/activities/MainActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/MainActivity.kt index 67fd463e09..8cd198a370 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/activities/MainActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/MainActivity.kt @@ -33,8 +33,13 @@ import androidx.lifecycle.lifecycleScope import androidx.transition.TransitionManager import androidx.transition.doOnEnd import com.google.android.material.transition.MaterialSharedAxis -import org.appdevforall.codeonthego.FeedbackButtonManager import com.itsaky.androidide.R +import com.itsaky.androidide.databinding.ActivityMainBinding +import com.itsaky.androidide.resources.R.string +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext +import org.appdevforall.codeonthego.FeedbackButtonManager import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.activities.editor.EditorActivityKt import org.appdevforall.codeonthego.analytics.DeepLinkMetric @@ -42,7 +47,6 @@ import org.appdevforall.codeonthego.analytics.DeepLinkOutcome import org.appdevforall.codeonthego.analytics.IAnalyticsManager import org.appdevforall.codeonthego.analytics.depth import org.appdevforall.codeonthego.app.EdgeToEdgeIDEActivity -import com.itsaky.androidide.databinding.ActivityMainBinding import org.appdevforall.codeonthego.deeplink.ConsumedRequests import org.appdevforall.codeonthego.fragments.MainFragment import org.appdevforall.codeonthego.fragments.RecentProjectsFragment @@ -57,7 +61,6 @@ import org.appdevforall.codeonthego.models.PendingFileRequest import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences import org.appdevforall.codeonthego.projects.IProjectManager import org.appdevforall.codeonthego.repositories.RecentProjectRepository -import com.itsaky.androidide.resources.R.string import org.appdevforall.codeonthego.roomData.recentproject.RecentProject import org.appdevforall.codeonthego.shortcuts.IdeShortcutActions import org.appdevforall.codeonthego.shortcuts.ShortcutContext @@ -85,9 +88,6 @@ import org.appdevforall.codeonthego.viewmodel.MainViewModel.Companion.SCREEN_SAV import org.appdevforall.codeonthego.viewmodel.MainViewModel.Companion.SCREEN_TEMPLATE_DETAILS import org.appdevforall.codeonthego.viewmodel.MainViewModel.Companion.SCREEN_TEMPLATE_LIST import org.appdevforall.codeonthego.viewmodel.MainViewModel.Companion.TOOLTIPS_WEB_VIEW -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext import org.koin.android.ext.android.inject import org.koin.androidx.viewmodel.ext.android.viewModel import org.slf4j.LoggerFactory diff --git a/app/src/main/java/org/appdevforall/codeonthego/activities/OnboardingActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/OnboardingActivity.kt index 5a99e4536d..409580d36c 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/activities/OnboardingActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/OnboardingActivity.kt @@ -34,9 +34,16 @@ import androidx.lifecycle.lifecycleScope import com.github.appintro.AppIntro2 import com.github.appintro.AppIntroPageTransformerType import com.google.android.material.floatingactionbutton.FloatingActionButton -import org.appdevforall.codeonthego.FeedbackButtonManager import com.itsaky.androidide.R import com.itsaky.androidide.R.string +import com.termux.shared.android.PackageUtils +import com.termux.shared.markdown.MarkdownUtils +import com.termux.shared.termux.TermuxConstants +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.Job +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext +import org.appdevforall.codeonthego.FeedbackButtonManager import org.appdevforall.codeonthego.app.configuration.IDEBuildConfigProvider import org.appdevforall.codeonthego.app.configuration.IJdkDistributionProvider import org.appdevforall.codeonthego.fragments.onboarding.GreetingFragment @@ -52,13 +59,6 @@ import org.appdevforall.codeonthego.utils.isAtLeastV import org.appdevforall.codeonthego.utils.isSystemInDarkMode import org.appdevforall.codeonthego.utils.isTestMode import org.appdevforall.codeonthego.utils.resolveAttr -import com.termux.shared.android.PackageUtils -import com.termux.shared.markdown.MarkdownUtils -import com.termux.shared.termux.TermuxConstants -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.Job -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext import org.slf4j.LoggerFactory class OnboardingActivity : AppIntro2() { diff --git a/app/src/main/java/org/appdevforall/codeonthego/activities/PluginManagerActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/PluginManagerActivity.kt index 39b1d19b55..86e5651e15 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/activities/PluginManagerActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/PluginManagerActivity.kt @@ -4,10 +4,10 @@ import android.content.Intent import android.os.Bundle import android.view.View import androidx.core.graphics.Insets -import org.appdevforall.codeonthego.FeedbackButtonManager import com.itsaky.androidide.R -import org.appdevforall.codeonthego.app.EdgeToEdgeIDEActivity import com.itsaky.androidide.databinding.ActivityPluginManagerBinding +import org.appdevforall.codeonthego.FeedbackButtonManager +import org.appdevforall.codeonthego.app.EdgeToEdgeIDEActivity import org.appdevforall.codeonthego.ui.compose.ManagerScreen import org.appdevforall.codeonthego.ui.compose.theme.ManagerTheme import org.appdevforall.codeonthego.utils.flashError diff --git a/app/src/main/java/org/appdevforall/codeonthego/activities/PreferencesActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/PreferencesActivity.kt index e68ee17fe5..7ee1446483 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/activities/PreferencesActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/PreferencesActivity.kt @@ -21,10 +21,10 @@ import android.view.View import androidx.core.graphics.Insets import androidx.core.os.BundleCompat import androidx.fragment.app.Fragment -import org.appdevforall.codeonthego.FeedbackButtonManager import com.itsaky.androidide.R -import org.appdevforall.codeonthego.app.EdgeToEdgeIDEActivity import com.itsaky.androidide.databinding.ActivityPreferencesBinding +import org.appdevforall.codeonthego.FeedbackButtonManager +import org.appdevforall.codeonthego.app.EdgeToEdgeIDEActivity import org.appdevforall.codeonthego.fragments.IDEPreferencesFragment import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.preferences.PluginSettingsEntryPreference diff --git a/app/src/main/java/org/appdevforall/codeonthego/activities/editor/BaseEditorActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/BaseEditorActivity.kt index 480e06b23e..d6195b8873 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/activities/editor/BaseEditorActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/BaseEditorActivity.kt @@ -72,9 +72,17 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_COLLAPS import com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_HIDDEN import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayout.Tab -import org.appdevforall.codeonthego.FeedbackButtonManager import com.itsaky.androidide.R import com.itsaky.androidide.R.string +import com.itsaky.androidide.databinding.ActivityEditorBinding +import com.itsaky.androidide.databinding.ContentEditorBinding +import com.itsaky.androidide.databinding.LayoutDiagnosticInfoBinding +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext +import org.appdevforall.codeonthego.FeedbackButtonManager import org.appdevforall.codeonthego.actions.build.DebugAction import org.appdevforall.codeonthego.activities.MainActivity import org.appdevforall.codeonthego.activities.projectsRoot @@ -84,9 +92,6 @@ import org.appdevforall.codeonthego.api.BuildOutputProvider import org.appdevforall.codeonthego.api.LogsProvider import org.appdevforall.codeonthego.app.EdgeToEdgeIDEActivity import org.appdevforall.codeonthego.app.IDEApplication -import com.itsaky.androidide.databinding.ActivityEditorBinding -import com.itsaky.androidide.databinding.ContentEditorBinding -import com.itsaky.androidide.databinding.LayoutDiagnosticInfoBinding import org.appdevforall.codeonthego.deeplink.ConsumedRequests import org.appdevforall.codeonthego.events.InstallationEvent import org.appdevforall.codeonthego.fragments.debug.DebuggerFragment @@ -99,6 +104,7 @@ import org.appdevforall.codeonthego.handlers.SnippetHandler.loadUserSnippets import org.appdevforall.codeonthego.handlers.SnippetHandler.refreshPluginSnippets import org.appdevforall.codeonthego.idetooltips.TooltipManager import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.indexing.service.IndexingState import org.appdevforall.codeonthego.interfaces.DiagnosticClickListener import org.appdevforall.codeonthego.lookup.Lookup import org.appdevforall.codeonthego.lsp.models.DiagnosticItem @@ -162,12 +168,6 @@ import org.appdevforall.codeonthego.viewmodel.WADBConnectionViewModel import org.appdevforall.codeonthego.xml.resources.ResourceTableRegistry import org.appdevforall.codeonthego.xml.versions.ApiVersionsRegistry import org.appdevforall.codeonthego.xml.widgets.WidgetTableRegistry -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.flow.collectLatest -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext -import org.appdevforall.codeonthego.indexing.service.IndexingState import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode.MAIN import org.slf4j.Logger diff --git a/app/src/main/java/org/appdevforall/codeonthego/activities/editor/EditorActivityKt.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/EditorActivityKt.kt index bc3a0497d0..d004c08d67 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/activities/editor/EditorActivityKt.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/EditorActivityKt.kt @@ -22,4 +22,4 @@ package org.appdevforall.codeonthego.activities.editor */ class EditorActivityKt : EditorHandlerActivity() -// TODO: Should we adjust to the display cutout insets? \ No newline at end of file +// TODO: Should we adjust to the display cutout insets? diff --git a/app/src/main/java/org/appdevforall/codeonthego/activities/editor/EditorHandlerActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/EditorHandlerActivity.kt index 62fca9cefe..717f758a87 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/activities/editor/EditorHandlerActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/EditorHandlerActivity.kt @@ -47,6 +47,15 @@ import com.google.gson.Gson import com.google.gson.JsonSyntaxException import com.itsaky.androidide.R import com.itsaky.androidide.R.string +import com.itsaky.androidide.databinding.FileActionPopupWindowBinding +import com.itsaky.androidide.databinding.FileActionPopupWindowItemBinding +import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.NonCancellable +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext +import org.adfa.constants.CONTENT_KEY import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.ActionItem import org.appdevforall.codeonthego.actions.ActionItem.Location.EDITOR_TOOLBAR @@ -65,8 +74,6 @@ import org.appdevforall.codeonthego.app.BaseApplication import org.appdevforall.codeonthego.app.EditorEvents import org.appdevforall.codeonthego.app.EditorProviderImpl import org.appdevforall.codeonthego.app.IDEApplication -import com.itsaky.androidide.databinding.FileActionPopupWindowBinding -import com.itsaky.androidide.databinding.FileActionPopupWindowItemBinding import org.appdevforall.codeonthego.deeplink.PendingDeepLinkOpen import org.appdevforall.codeonthego.di.APPLICATION_SCOPE import org.appdevforall.codeonthego.editor.floating.MetricsCarouselDockableContent @@ -139,13 +146,6 @@ import org.appdevforall.codeonthego.utils.isDeepLinkTargetOfOpenProject import org.appdevforall.codeonthego.utils.recordProjectOpenedBookkeeping import org.appdevforall.codeonthego.utils.resolveDeepLinkProject import org.appdevforall.codeonthego.utils.resolveWithinDirectory -import kotlinx.coroutines.CancellationException -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.NonCancellable -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext -import org.adfa.constants.CONTENT_KEY import org.appdevforall.cotg.quickbuild.domain.session.QuickBuildTone import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode diff --git a/app/src/main/java/org/appdevforall/codeonthego/activities/editor/FAQActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/FAQActivity.kt index 5c3c5e1c2e..ec31477fcc 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/activities/editor/FAQActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/FAQActivity.kt @@ -25,10 +25,10 @@ import android.webkit.WebView import android.webkit.WebViewClient import androidx.core.graphics.Insets import com.itsaky.androidide.R -import org.appdevforall.codeonthego.app.EdgeToEdgeIDEActivity import com.itsaky.androidide.databinding.ActivityFaqBinding -import org.appdevforall.codeonthego.documentation.DocumentationRequestInterceptor import org.adfa.constants.CONTENT_KEY +import org.appdevforall.codeonthego.app.EdgeToEdgeIDEActivity +import org.appdevforall.codeonthego.documentation.DocumentationRequestInterceptor class FAQActivity : EdgeToEdgeIDEActivity() { @Suppress("ktlint:standard:backing-property-naming") diff --git a/app/src/main/java/org/appdevforall/codeonthego/activities/editor/IDELogcatReader.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/IDELogcatReader.kt index e017f91324..5d2f52c95c 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/activities/editor/IDELogcatReader.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/IDELogcatReader.kt @@ -17,13 +17,13 @@ package org.appdevforall.codeonthego.activities.editor import android.os.Process -import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences -import org.appdevforall.codeonthego.utils.Environment import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job import kotlinx.coroutines.cancel import kotlinx.coroutines.launch +import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences +import org.appdevforall.codeonthego.utils.Environment import org.slf4j.LoggerFactory import java.io.File import java.text.SimpleDateFormat @@ -36,99 +36,102 @@ import java.util.Locale * @author Akash Yadav */ class IDELogcatReader { + private var job: Job? = null + private var shouldRun = false - private var job: Job? = null - private var shouldRun = false - - companion object { - - private val log = LoggerFactory.getLogger(IDELogcatReader::class.java) - private const val MAX_LOG_BYTES: Long = 5L * 1024L * 1024L - } + companion object { + private val log = LoggerFactory.getLogger(IDELogcatReader::class.java) + private const val MAX_LOG_BYTES: Long = 5L * 1024L * 1024L + } - /** - * Start reading the logs. - */ - fun start() { - shouldRun = true + /** + * Start reading the logs. + */ + fun start() { + shouldRun = true - check(job == null) { - "Logcat reader is already running" - } + check(job == null) { + "Logcat reader is already running" + } - job = CoroutineScope(Dispatchers.IO).launch { - run() - } - } + job = + CoroutineScope(Dispatchers.IO).launch { + run() + } + } - /** - * Stop the log reader. - */ - fun stop() { - shouldRun = false - job?.cancel("User requested cancellation") - job = null - } + /** + * Stop the log reader. + */ + fun stop() { + shouldRun = false + job?.cancel("User requested cancellation") + job = null + } - private fun run() { - val date = Date() - val dateFormat = SimpleDateFormat("yyyy-MM-dd_HH:mm:ss.SSS", Locale.US) - val outputFile = File(Environment.ANDROIDIDE_HOME, - "logs/CodeOnTheGo-LOG-${dateFormat.format(date)}.txt") + private fun run() { + val date = Date() + val dateFormat = SimpleDateFormat("yyyy-MM-dd_HH:mm:ss.SSS", Locale.US) + val outputFile = + File( + Environment.ANDROIDIDE_HOME, + "logs/CodeOnTheGo-LOG-${dateFormat.format(date)}.txt", + ) - log.debug("Creating output file: {}", outputFile) + log.debug("Creating output file: {}", outputFile) - outputFile.parentFile!!.mkdirs() - try { - outputFile.createNewFile() - } catch (e: Exception) { - log.error("Failed to create output file for log", e) - return - } + outputFile.parentFile!!.mkdirs() + try { + outputFile.createNewFile() + } catch (e: Exception) { + log.error("Failed to create output file for log", e) + return + } - outputFile.outputStream().buffered().use { writer -> - try { - val captureAllBuffers = GeneralPreferences.logcatCaptureAll - val args = mutableListOf("logcat") - if (captureAllBuffers) { - args.addAll(listOf("-b", "all")) - } - args.addAll(listOf("--pid", Process.myPid().toString(), "-v", "threadtime")) + outputFile.outputStream().buffered().use { writer -> + try { + val captureAllBuffers = GeneralPreferences.logcatCaptureAll + val args = mutableListOf("logcat") + if (captureAllBuffers) { + args.addAll(listOf("-b", "all")) + } + args.addAll(listOf("--pid", Process.myPid().toString(), "-v", "threadtime")) - val process = ProcessBuilder(args).let { builder -> - builder.redirectErrorStream(true) - builder.start() - } - try { - val buffer = ByteArray(8 * 1024) - var written = 0L - process.inputStream.use { input -> - while (shouldRun) { - val read = input.read(buffer) - if (read <= 0) break - val remaining = MAX_LOG_BYTES - written - if (remaining <= 0) break - val toWrite = if (read > remaining) remaining.toInt() else read - writer.write(buffer, 0, toWrite) - written += toWrite - if (written >= MAX_LOG_BYTES) break - } - } + val process = + ProcessBuilder(args).let { builder -> + builder.redirectErrorStream(true) + builder.start() + } + try { + val buffer = ByteArray(8 * 1024) + var written = 0L + process.inputStream.use { input -> + while (shouldRun) { + val read = input.read(buffer) + if (read <= 0) break + val remaining = MAX_LOG_BYTES - written + if (remaining <= 0) break + val toWrite = if (read > remaining) remaining.toInt() else read + writer.write(buffer, 0, toWrite) + written += toWrite + if (written >= MAX_LOG_BYTES) break + } + } - writer.flush() - if (written >= MAX_LOG_BYTES) { - log.warn( - "Logcat capture reached max size ({} bytes). Truncating output.", - MAX_LOG_BYTES - ) - } - } finally { - process.destroy() - log.info("Process ended with exit code: {}", process.waitFor()) - } - } catch (err: Throwable) { - log.error("Failed to read logs", err) - } - } - } + writer.flush() + if (written >= MAX_LOG_BYTES) { + log.warn( + "Logcat capture reached max size ({} bytes). Truncating output.", + MAX_LOG_BYTES, + ) + } + } finally { + process.destroy() + log.info("Process ended with exit code: {}", process.waitFor()) + } + } catch (err: Throwable) { + log.error("Failed to read logs", err) + } + } + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/activities/editor/ProjectHandlerActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/ProjectHandlerActivity.kt index 05efcadb56..99b91e8534 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/activities/editor/ProjectHandlerActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/activities/editor/ProjectHandlerActivity.kt @@ -39,6 +39,19 @@ import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import com.google.android.material.bottomsheet.BottomSheetBehavior import com.itsaky.androidide.R +import com.itsaky.androidide.databinding.LayoutSearchProjectBinding +import com.itsaky.androidide.resources.R.string +import io.github.rosemoe.sora.text.ICUUtils +import io.github.rosemoe.sora.util.IntPair +import io.sentry.Sentry +import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.future.await +import kotlinx.coroutines.launch +import kotlinx.coroutines.suspendCancellableCoroutine +import kotlinx.coroutines.withContext +import kotlinx.coroutines.withTimeoutOrNull +import org.adfa.constants.CONTENT_KEY import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.ActionItem.Location.EDITOR_FIND_ACTION_MENU import org.appdevforall.codeonthego.actions.ActionsRegistry.Companion.getInstance @@ -49,7 +62,6 @@ import org.appdevforall.codeonthego.actions.etc.ReplaceInProjectAction import org.appdevforall.codeonthego.actions.internal.DefaultActionsRegistry import org.appdevforall.codeonthego.activities.MainActivity import org.appdevforall.codeonthego.app.IDEApplication -import com.itsaky.androidide.databinding.LayoutSearchProjectBinding import org.appdevforall.codeonthego.flashbar.Flashbar import org.appdevforall.codeonthego.fragments.FindActionDialog import org.appdevforall.codeonthego.fragments.SearchFieldToolbar @@ -92,7 +104,6 @@ import org.appdevforall.codeonthego.quickbuild.QuickBuildWontStayUpRestart import org.appdevforall.codeonthego.quickbuild.quickBuildStatusBarUpdate import org.appdevforall.codeonthego.quickbuild.resolve import org.appdevforall.codeonthego.repositories.PluginRepository -import com.itsaky.androidide.resources.R.string import org.appdevforall.codeonthego.search.replace.ReplaceCoordinator import org.appdevforall.codeonthego.search.replace.ReplaceHost import org.appdevforall.codeonthego.search.replace.ReplaceSession @@ -140,17 +151,6 @@ import org.appdevforall.codeonthego.viewmodel.BuildState import org.appdevforall.codeonthego.viewmodel.BuildVariantsViewModel import org.appdevforall.codeonthego.viewmodel.BuildViewModel import org.appdevforall.codeonthego.viewmodel.EditorViewModel.SearchResultSection -import io.github.rosemoe.sora.text.ICUUtils -import io.github.rosemoe.sora.util.IntPair -import io.sentry.Sentry -import kotlinx.coroutines.CancellationException -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.future.await -import kotlinx.coroutines.launch -import kotlinx.coroutines.suspendCancellableCoroutine -import kotlinx.coroutines.withContext -import kotlinx.coroutines.withTimeoutOrNull -import org.adfa.constants.CONTENT_KEY import org.appdevforall.cotg.quickbuild.domain.session.QuickBuildNotice import org.appdevforall.cotg.quickbuild.domain.session.QuickBuildSessionState import org.appdevforall.cotg.quickbuild.domain.session.QuickBuildStatus diff --git a/app/src/main/java/org/appdevforall/codeonthego/adapters/BuildVariantsAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/BuildVariantsAdapter.kt index 2209417a66..648002cd9f 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/adapters/BuildVariantsAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/BuildVariantsAdapter.kt @@ -37,64 +37,74 @@ import java.util.Objects * @author Akash Yadav */ class BuildVariantsAdapter( - private val viewModel: BuildVariantsViewModel, - private var items: List + private val viewModel: BuildVariantsViewModel, + private var items: List, ) : RecyclerView.Adapter() { - - class ViewHolder(internal val binding: LayoutBuildVariantItemBinding) : - RecyclerView.ViewHolder(binding.root) - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { - val binding = LayoutBuildVariantItemBinding.inflate(LayoutInflater.from(parent.context), parent, - false) - return ViewHolder(binding) - } - - override fun getItemCount(): Int { - return items.size - } - - override fun onBindViewHolder(holder: ViewHolder, position: Int) { - val binding = holder.binding - val variantInfo = items[position] - - binding.moduleName.text = variantInfo.projectPath - - binding.variantName.apply { - - val viewModel = viewModel - - setAdapter( - ArrayAdapter(binding.root.context, R.layout.support_simple_spinner_dropdown_item, - variantInfo.buildVariants - ) - ) - - var listSelection = variantInfo.buildVariants.indexOf(variantInfo.selectedVariant) - if (listSelection < 0 || listSelection >= variantInfo.buildVariants.size) { - listSelection = 0 - } - - this.listSelection = listSelection - setText(variantInfo.selectedVariant, false) - - addTextChangedListener { editable -> - // update the changed build variants map - viewModel.updatedBuildVariants = viewModel.updatedBuildVariants.also { variants -> - - // the newly selected build variant - // if this is different that the variant that was used while initializing the project, - // then the user is notified to re-sync the project - // else the selection is cleared - val newSelection = editable?.toString() ?: IAndroidProject.DEFAULT_VARIANT - - if (!Objects.equals(variantInfo.selectedVariant, newSelection)) { - variants[variantInfo.projectPath] = variantInfo.withSelection(newSelection) - } else { - variants.remove(variantInfo.projectPath) - } - } - } - } - } -} \ No newline at end of file + class ViewHolder( + internal val binding: LayoutBuildVariantItemBinding, + ) : RecyclerView.ViewHolder(binding.root) + + override fun onCreateViewHolder( + parent: ViewGroup, + viewType: Int, + ): ViewHolder { + val binding = + LayoutBuildVariantItemBinding.inflate( + LayoutInflater.from(parent.context), + parent, + false, + ) + return ViewHolder(binding) + } + + override fun getItemCount(): Int = items.size + + override fun onBindViewHolder( + holder: ViewHolder, + position: Int, + ) { + val binding = holder.binding + val variantInfo = items[position] + + binding.moduleName.text = variantInfo.projectPath + + binding.variantName.apply { + val viewModel = viewModel + + setAdapter( + ArrayAdapter( + binding.root.context, + R.layout.support_simple_spinner_dropdown_item, + variantInfo.buildVariants, + ), + ) + + var listSelection = variantInfo.buildVariants.indexOf(variantInfo.selectedVariant) + if (listSelection < 0 || listSelection >= variantInfo.buildVariants.size) { + listSelection = 0 + } + + this.listSelection = listSelection + setText(variantInfo.selectedVariant, false) + + addTextChangedListener { editable -> + // update the changed build variants map + viewModel.updatedBuildVariants = + viewModel.updatedBuildVariants.also { variants -> + + // the newly selected build variant + // if this is different that the variant that was used while initializing the project, + // then the user is notified to re-sync the project + // else the selection is cleared + val newSelection = editable?.toString() ?: IAndroidProject.DEFAULT_VARIANT + + if (!Objects.equals(variantInfo.selectedVariant, newSelection)) { + variants[variantInfo.projectPath] = variantInfo.withSelection(newSelection) + } else { + variants.remove(variantInfo.projectPath) + } + } + } + } + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/adapters/DeleteProjectListAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/DeleteProjectListAdapter.kt index 2230d3daba..e9fb2d2073 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/adapters/DeleteProjectListAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/DeleteProjectListAdapter.kt @@ -9,63 +9,70 @@ import org.appdevforall.codeonthego.models.Checkable import org.appdevforall.codeonthego.models.ProjectFile class DeleteProjectListAdapter( - private var projects: List>, - private val onSelectionChange: (Boolean) -> Unit, - private val onCheckboxLongPress: () -> Boolean + private var projects: List>, + private val onSelectionChange: (Boolean) -> Unit, + private val onCheckboxLongPress: () -> Boolean, ) : RecyclerView.Adapter() { - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ProjectViewHolder { - val binding = - DeleteProjectsItemBinding.inflate(LayoutInflater.from(parent.context), parent, false) - return ProjectViewHolder(binding) - } - - override fun onBindViewHolder(holder: ProjectViewHolder, position: Int) { - holder.bind(projects[position]) - } - - override fun getItemCount(): Int = projects.size - - fun getSelectedProjects(): List = projects.filter { it.isChecked }.map { it.data } - - fun updateProjects(newProjects: List>) { - projects = newProjects - notifyDataSetChanged() - } - - private fun hasSelection(): Boolean = projects.any { it.isChecked } - - private fun renderDate(binding: DeleteProjectsItemBinding, project: ProjectFile) { - binding.projectDate.text = project.renderDateText(binding.root.context) - } - - inner class ProjectViewHolder(private val binding: DeleteProjectsItemBinding) : - RecyclerView.ViewHolder(binding.root) { - - fun bind(item: Checkable) { - val project = item.data - - binding.projectName.text = project.name - renderDate(binding, project) - binding.icon.text = project.name.take(2).uppercase() - - binding.checkbox.visibility = View.VISIBLE - binding.checkbox.isChecked = item.isChecked - - binding.root.setOnClickListener { - item.isChecked = !item.isChecked - binding.checkbox.isChecked = item.isChecked - onSelectionChange(hasSelection()) - } - - binding.checkbox.setOnClickListener { - binding.root.performClick() - } - - binding.checkbox.setOnLongClickListener { - onCheckboxLongPress() - } - } - } + override fun onCreateViewHolder( + parent: ViewGroup, + viewType: Int, + ): ProjectViewHolder { + val binding = + DeleteProjectsItemBinding.inflate(LayoutInflater.from(parent.context), parent, false) + return ProjectViewHolder(binding) + } + + override fun onBindViewHolder( + holder: ProjectViewHolder, + position: Int, + ) { + holder.bind(projects[position]) + } + + override fun getItemCount(): Int = projects.size + + fun getSelectedProjects(): List = projects.filter { it.isChecked }.map { it.data } + + fun updateProjects(newProjects: List>) { + projects = newProjects + notifyDataSetChanged() + } + + private fun hasSelection(): Boolean = projects.any { it.isChecked } + + private fun renderDate( + binding: DeleteProjectsItemBinding, + project: ProjectFile, + ) { + binding.projectDate.text = project.renderDateText(binding.root.context) + } + + inner class ProjectViewHolder( + private val binding: DeleteProjectsItemBinding, + ) : RecyclerView.ViewHolder(binding.root) { + fun bind(item: Checkable) { + val project = item.data + + binding.projectName.text = project.name + renderDate(binding, project) + binding.icon.text = project.name.take(2).uppercase() + + binding.checkbox.visibility = View.VISIBLE + binding.checkbox.isChecked = item.isChecked + + binding.root.setOnClickListener { + item.isChecked = !item.isChecked + binding.checkbox.isChecked = item.isChecked + onSelectionChange(hasSelection()) + } + + binding.checkbox.setOnClickListener { + binding.root.performClick() + } + + binding.checkbox.setOnLongClickListener { + onCheckboxLongPress() + } + } + } } - diff --git a/app/src/main/java/org/appdevforall/codeonthego/adapters/DiagnosticItemAdapter.java b/app/src/main/java/org/appdevforall/codeonthego/adapters/DiagnosticItemAdapter.java index 5f41614158..a7f2b293e9 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/adapters/DiagnosticItemAdapter.java +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/DiagnosticItemAdapter.java @@ -24,81 +24,81 @@ import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.RecyclerView; import com.itsaky.androidide.databinding.LayoutDiagnosticItemBinding; -import org.appdevforall.codeonthego.interfaces.DiagnosticClickListener; -import org.appdevforall.codeonthego.lsp.models.DiagnosticItem; -import org.appdevforall.codeonthego.lsp.models.DiagnosticSeverity; import com.itsaky.androidide.resources.R; import java.io.File; import java.util.List; import java.util.Objects; +import org.appdevforall.codeonthego.interfaces.DiagnosticClickListener; +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem; +import org.appdevforall.codeonthego.lsp.models.DiagnosticSeverity; public class DiagnosticItemAdapter extends RecyclerView.Adapter { - private final List diagnostics; - private final File file; - private final DiagnosticClickListener listener; + private final List diagnostics; + private final File file; + private final DiagnosticClickListener listener; - public DiagnosticItemAdapter( - List diagnostics, File file, DiagnosticClickListener listener) { - this.diagnostics = Objects.requireNonNull(diagnostics); - this.file = file; - this.listener = listener; - } + public DiagnosticItemAdapter( + List diagnostics, File file, DiagnosticClickListener listener) { + this.diagnostics = Objects.requireNonNull(diagnostics); + this.file = file; + this.listener = listener; + } - @NonNull - @Override - public DiagnosticItemAdapter.VH onCreateViewHolder(@NonNull ViewGroup p1, int p2) { - return new VH( - LayoutDiagnosticItemBinding.inflate(LayoutInflater.from(p1.getContext()), p1, false)); - } + @Override + public int getItemCount() { + return diagnostics.size(); + } - @Override - public void onBindViewHolder(DiagnosticItemAdapter.VH p1, int p2) { - final DiagnosticItem diagnostic = diagnostics.get(p2); - final LayoutDiagnosticItemBinding binding = p1.binding; + @Override + public void onBindViewHolder(DiagnosticItemAdapter.VH p1, int p2) { + final DiagnosticItem diagnostic = diagnostics.get(p2); + final LayoutDiagnosticItemBinding binding = p1.binding; - binding.icon.setImageResource(getDiagnosticIconId(diagnostic)); - binding.icon.setContentDescription( - binding.icon.getContext().getString( - diagnostic.getSeverity() == DiagnosticSeverity.ERROR - ? R.string.cd_diagnostic_error - : R.string.cd_diagnostic_warning)); - binding.icon.setColorFilter( - ContextCompat.getColor( - binding.icon.getContext(), - diagnostic.getSeverity() == DiagnosticSeverity.ERROR - ? R.color.diagnostic_error - : R.color.diagnostic_warning), - PorterDuff.Mode.SRC_ATOP); - binding.title.setText(diagnostic.getMessage()); + binding.icon.setImageResource(getDiagnosticIconId(diagnostic)); + binding.icon.setContentDescription( + binding.icon.getContext().getString( + diagnostic.getSeverity() == DiagnosticSeverity.ERROR + ? R.string.cd_diagnostic_error + : R.string.cd_diagnostic_warning)); + binding.icon.setColorFilter( + ContextCompat.getColor( + binding.icon.getContext(), + diagnostic.getSeverity() == DiagnosticSeverity.ERROR + ? R.color.diagnostic_error + : R.color.diagnostic_warning), + PorterDuff.Mode.SRC_ATOP); + binding.title.setText(diagnostic.getMessage()); - binding - .getRoot() - .setOnClickListener( - v -> { - if (listener != null) { - listener.onDiagnosticClick(file, diagnostic); - } - }); - } + binding + .getRoot() + .setOnClickListener( + v -> { + if (listener != null) { + listener.onDiagnosticClick(file, diagnostic); + } + }); + } - @Override - public int getItemCount() { - return diagnostics.size(); - } + @NonNull + @Override + public DiagnosticItemAdapter.VH onCreateViewHolder(@NonNull ViewGroup p1, int p2) { + return new VH( + LayoutDiagnosticItemBinding.inflate(LayoutInflater.from(p1.getContext()), p1, false)); + } - private int getDiagnosticIconId(DiagnosticItem diagnostic) { - if (diagnostic.getSeverity() == DiagnosticSeverity.ERROR) - return R.drawable.ic_compilation_error; - return R.drawable.ic_info; - } + private int getDiagnosticIconId(DiagnosticItem diagnostic) { + if (diagnostic.getSeverity() == DiagnosticSeverity.ERROR) + return R.drawable.ic_compilation_error; + return R.drawable.ic_info; + } - public static class VH extends RecyclerView.ViewHolder { - private LayoutDiagnosticItemBinding binding; + public static class VH extends RecyclerView.ViewHolder { + private LayoutDiagnosticItemBinding binding; - public VH(LayoutDiagnosticItemBinding binding) { - super(binding.getRoot()); - this.binding = binding; - } - } + public VH(LayoutDiagnosticItemBinding binding) { + super(binding.getRoot()); + this.binding = binding; + } + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/adapters/DiagnosticsAdapter.java b/app/src/main/java/org/appdevforall/codeonthego/adapters/DiagnosticsAdapter.java index 6fed19aed3..9d5323ba1e 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/adapters/DiagnosticsAdapter.java +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/DiagnosticsAdapter.java @@ -24,61 +24,60 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.itsaky.androidide.databinding.LayoutDiagnosticGroupBinding; -import org.appdevforall.codeonthego.interfaces.DiagnosticClickListener; -import org.appdevforall.codeonthego.models.DiagnosticGroup; import java.util.List; import java.util.Objects; +import org.appdevforall.codeonthego.interfaces.DiagnosticClickListener; +import org.appdevforall.codeonthego.models.DiagnosticGroup; public class DiagnosticsAdapter extends RecyclerView.Adapter { - private final List diagnostics; - private final DiagnosticClickListener listener; + private final List diagnostics; + private final DiagnosticClickListener listener; - public DiagnosticsAdapter(List diagnostics, DiagnosticClickListener listener) { - this.diagnostics = Objects.requireNonNull(diagnostics); - this.listener = listener; - } + public DiagnosticsAdapter(List diagnostics, DiagnosticClickListener listener) { + this.diagnostics = Objects.requireNonNull(diagnostics); + this.listener = listener; + } - @NonNull - @Override - public DiagnosticsAdapter.VH onCreateViewHolder(ViewGroup p1, int p2) { - return new VH( - LayoutDiagnosticGroupBinding.inflate(LayoutInflater.from(p1.getContext()), p1, false)); - } + @Override + public int getItemCount() { + return diagnostics.size(); + } - @Override - public void onBindViewHolder(DiagnosticsAdapter.VH p1, int p2) { - final DiagnosticGroup group = diagnostics.get(p2); - final LayoutDiagnosticGroupBinding binding = p1.binding; + @Override + public void onBindViewHolder(DiagnosticsAdapter.VH p1, int p2) { + final DiagnosticGroup group = diagnostics.get(p2); + final LayoutDiagnosticGroupBinding binding = p1.binding; - binding.info.icon.setImageResource(group.icon); - binding.info.title.setText(group.text); - binding.diagnostics.setLayoutManager(new LinearLayoutManager(binding.diagnostics.getContext())); - binding.diagnostics.setAdapter( - new DiagnosticItemAdapter(group.diagnostics, group.file, listener)); + binding.info.icon.setImageResource(group.icon); + binding.info.title.setText(group.text); + binding.diagnostics.setLayoutManager(new LinearLayoutManager(binding.diagnostics.getContext())); + binding.diagnostics.setAdapter( + new DiagnosticItemAdapter(group.diagnostics, group.file, listener)); - binding - .info - .getRoot() - .setOnClickListener( - v -> { - if (listener != null) { - listener.onGroupClick(group); - } - }); - } + binding.info + .getRoot() + .setOnClickListener( + v -> { + if (listener != null) { + listener.onGroupClick(group); + } + }); + } - @Override - public int getItemCount() { - return diagnostics.size(); - } + @NonNull + @Override + public DiagnosticsAdapter.VH onCreateViewHolder(ViewGroup p1, int p2) { + return new VH( + LayoutDiagnosticGroupBinding.inflate(LayoutInflater.from(p1.getContext()), p1, false)); + } - public class VH extends RecyclerView.ViewHolder { - private LayoutDiagnosticGroupBinding binding; + public class VH extends RecyclerView.ViewHolder { + private LayoutDiagnosticGroupBinding binding; - public VH(LayoutDiagnosticGroupBinding binding) { - super(binding.getRoot()); - this.binding = binding; - } - } + public VH(LayoutDiagnosticGroupBinding binding) { + super(binding.getRoot()); + this.binding = binding; + } + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/adapters/EditorBottomSheetTabAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/EditorBottomSheetTabAdapter.kt index dbff9d06bc..44fba7252c 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/adapters/EditorBottomSheetTabAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/EditorBottomSheetTabAdapter.kt @@ -20,6 +20,7 @@ import androidx.collection.LongSparseArray import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity import androidx.viewpager2.adapter.FragmentStateAdapter +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.app.IDEApplication.Companion.getPluginManager import org.appdevforall.codeonthego.fragments.DiagnosticsListFragment import org.appdevforall.codeonthego.fragments.SearchResultFragment @@ -35,7 +36,6 @@ import org.appdevforall.codeonthego.plugins.extensions.UIExtension import org.appdevforall.codeonthego.plugins.manager.fragment.PluginFragmentFactory import org.appdevforall.codeonthego.plugins.manager.pluginCategory import org.appdevforall.codeonthego.plugins.manager.pluginTooltipTag -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.utils.FeatureFlags import org.appdevforall.cotg.profiler.ProfilerFragment import org.slf4j.LoggerFactory diff --git a/app/src/main/java/org/appdevforall/codeonthego/adapters/FilterableRecyclerViewAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/FilterableRecyclerViewAdapter.kt index d5c4d615d5..a6ae84ce1b 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/adapters/FilterableRecyclerViewAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/FilterableRecyclerViewAdapter.kt @@ -34,89 +34,86 @@ import kotlinx.coroutines.withContext * * @author Akash Yadav */ -abstract class FilterableRecyclerViewAdapter(val items: List) : - RecyclerView.Adapter() { - - protected var filtered: List = mutableListOf().apply { addAll(items) } - private var filterJob: Job? = null - - /** - * Filter the list with the given query. - * - * @param query The query. - */ - @SuppressLint("NotifyDataSetChanged") - fun filter(query: String?) { - filterJob?.cancel(CancellationException("A new query has been submitted for filtering")) - - val items = this.items - filterJob = CoroutineScope(Dispatchers.Default).launch { - val (filtered, result) = doFilter(query?.trim(), items) - - withContext(Dispatchers.Main) { - val adapter = this@FilterableRecyclerViewAdapter - if (result == null) { - adapter.filtered = adapter.items - notifyDataSetChanged() - return@withContext - } - - adapter.filtered = filtered - result.dispatchUpdatesTo(adapter) - } - } - } - - private fun doFilter( - query: String?, - items: List, - ): Pair, DiffResult?> { - if (query.isNullOrBlank()) { - return items to null - } - - val filtered = items.filter { - onFilter(it, query) - } - - val result = - DiffUtil.calculateDiff( - object : Callback() { - override fun getOldListSize(): Int { - return items.size - } - - override fun getNewListSize(): Int { - return filtered.size - } - - override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean { - return items[oldItemPosition] == filtered[newItemPosition] - } - - override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean { - return items[oldItemPosition] == filtered[newItemPosition] - } - } - ) - - return filtered to result - } - - /** Get the list item at given index. */ - fun getItem(index: Int): D { - return filtered[index] - } - - override fun getItemCount(): Int { - return filtered.size - } - - /** Get the query candidate for the given list item. */ - abstract fun getQueryCandidate(item: D): String - - /** Called on every item when filtering the data. */ - protected open fun onFilter(item: D, query: String): Boolean { - return getQueryCandidate(item).contains(query, ignoreCase = true) - } +abstract class FilterableRecyclerViewAdapter( + val items: List, +) : RecyclerView.Adapter() { + protected var filtered: List = mutableListOf().apply { addAll(items) } + private var filterJob: Job? = null + + /** + * Filter the list with the given query. + * + * @param query The query. + */ + @SuppressLint("NotifyDataSetChanged") + fun filter(query: String?) { + filterJob?.cancel(CancellationException("A new query has been submitted for filtering")) + + val items = this.items + filterJob = + CoroutineScope(Dispatchers.Default).launch { + val (filtered, result) = doFilter(query?.trim(), items) + + withContext(Dispatchers.Main) { + val adapter = this@FilterableRecyclerViewAdapter + if (result == null) { + adapter.filtered = adapter.items + notifyDataSetChanged() + return@withContext + } + + adapter.filtered = filtered + result.dispatchUpdatesTo(adapter) + } + } + } + + private fun doFilter( + query: String?, + items: List, + ): Pair, DiffResult?> { + if (query.isNullOrBlank()) { + return items to null + } + + val filtered = + items.filter { + onFilter(it, query) + } + + val result = + DiffUtil.calculateDiff( + object : Callback() { + override fun getOldListSize(): Int = items.size + + override fun getNewListSize(): Int = filtered.size + + override fun areItemsTheSame( + oldItemPosition: Int, + newItemPosition: Int, + ): Boolean = items[oldItemPosition] == filtered[newItemPosition] + + override fun areContentsTheSame( + oldItemPosition: Int, + newItemPosition: Int, + ): Boolean = items[oldItemPosition] == filtered[newItemPosition] + }, + ) + + return filtered to result + } + + /** Get the list item at given index. */ + fun getItem(index: Int): D = filtered[index] + + override fun getItemCount(): Int = filtered.size + + /** Get the query candidate for the given list item. */ + abstract fun getQueryCandidate(item: D): String + + /** Called on every item when filtering the data. */ + protected open fun onFilter( + item: D, + query: String, + ): Boolean = getQueryCandidate(item).contains(query, ignoreCase = true) } diff --git a/app/src/main/java/org/appdevforall/codeonthego/adapters/MainActionsListAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/MainActionsListAdapter.kt index 7944b8ab97..6cf4f9608e 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/adapters/MainActionsListAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/MainActionsListAdapter.kt @@ -22,8 +22,8 @@ import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.google.android.material.button.MaterialButton -import org.appdevforall.codeonthego.actions.ActionItem import com.itsaky.androidide.databinding.LayoutMainActionItemBinding +import org.appdevforall.codeonthego.actions.ActionItem /** * Adapter for the actions available on the main screen. @@ -31,49 +31,56 @@ import com.itsaky.androidide.databinding.LayoutMainActionItemBinding * @author Akash Yadav */ class MainActionsListAdapter -@JvmOverloads -constructor( - val actions: List = emptyList(), - private val onClick: ((ActionItem, View) -> Unit)? = null, - private val onLongClick: ((ActionItem, View) -> Boolean)? = null, -) : - RecyclerView.Adapter() { - inner class VH(val binding: LayoutMainActionItemBinding) : RecyclerView.ViewHolder(binding.root) + @JvmOverloads + constructor( + val actions: List = emptyList(), + private val onClick: ((ActionItem, View) -> Unit)? = null, + private val onLongClick: ((ActionItem, View) -> Boolean)? = null, + ) : RecyclerView.Adapter() { + inner class VH( + val binding: LayoutMainActionItemBinding, + ) : RecyclerView.ViewHolder(binding.root) - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = - VH(LayoutMainActionItemBinding.inflate(LayoutInflater.from(parent.context), parent, false)) + override fun onCreateViewHolder( + parent: ViewGroup, + viewType: Int, + ) = VH(LayoutMainActionItemBinding.inflate(LayoutInflater.from(parent.context), parent, false)) - override fun getItemCount(): Int = actions.size + override fun getItemCount(): Int = actions.size - fun getAction(index: Int) = actions[index] + fun getAction(index: Int) = actions[index] - override fun onBindViewHolder(holder: VH, position: Int) { - val action = getAction(index = position) - val binding = holder.binding + override fun onBindViewHolder( + holder: VH, + position: Int, + ) { + val action = getAction(index = position) + val binding = holder.binding - binding.root.apply { - val originalText = action.label - text = originalText - isEnabled = action.enabled - icon = action.icon - contentDescription = originalText - setOnClickListener { - onClick?.invoke(action, it) - } - setOnLongClickListener { - onLongClick?.invoke(action, it) ?: true - } - } - (binding.root as? MaterialButton)?.findViewById(com.google.android.material.R.id.icon) - ?.importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO - if (binding.root is ViewGroup) { - for (i in 0 until (binding.root as ViewGroup).childCount) { - val child = (binding.root as ViewGroup).getChildAt(i) - if (child is android.widget.ImageView) { - child.importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO - break - } - } - } - } -} + binding.root.apply { + val originalText = action.label + text = originalText + isEnabled = action.enabled + icon = action.icon + contentDescription = originalText + setOnClickListener { + onClick?.invoke(action, it) + } + setOnLongClickListener { + onLongClick?.invoke(action, it) ?: true + } + } + (binding.root as? MaterialButton) + ?.findViewById(com.google.android.material.R.id.icon) + ?.importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO + if (binding.root is ViewGroup) { + for (i in 0 until (binding.root as ViewGroup).childCount) { + val child = (binding.root as ViewGroup).getChildAt(i) + if (child is android.widget.ImageView) { + child.importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO + break + } + } + } + } + } diff --git a/app/src/main/java/org/appdevforall/codeonthego/adapters/OptionsSheetAdapter.java b/app/src/main/java/org/appdevforall/codeonthego/adapters/OptionsSheetAdapter.java index 2eab49eeda..93e9f8d426 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/adapters/OptionsSheetAdapter.java +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/OptionsSheetAdapter.java @@ -22,70 +22,69 @@ import android.view.LayoutInflater; import android.view.ViewGroup; - import androidx.recyclerview.widget.RecyclerView; - import com.itsaky.androidide.databinding.LayoutOptionssheetItemBinding; -import org.appdevforall.codeonthego.models.SheetOption; - import java.util.List; +import org.appdevforall.codeonthego.models.SheetOption; public class OptionsSheetAdapter extends RecyclerView.Adapter { - private OnOptionsClickListener listener; - private List options; - - public OptionsSheetAdapter(List options, OnOptionsClickListener listener) { - this.options = options; - this.listener = listener; - } - - @Override - public OptionsSheetAdapter.VH onCreateViewHolder(ViewGroup p1, int p2) { - return new VH( - LayoutOptionssheetItemBinding.inflate(LayoutInflater.from(p1.getContext()), p1, false)); - } - - @Override - public void onBindViewHolder(OptionsSheetAdapter.VH p1, int p2) { - final LayoutOptionssheetItemBinding binding = p1.binding; - final SheetOption option = options.get(p2); - - binding.text.setText(option.title); - binding.icon.setImageDrawable(option.icon); - - binding - .getRoot() - .setOnClickListener( - v -> { - if (listener != null) listener.onOptionClick(option); - }); - binding - .getRoot() - .setOnLongClickListener( - v -> { - if (listener != null) listener.onOptionLongClick(option); - return true; - }); - } - - @Override - public int getItemCount() { - return options.size(); - } - - public class VH extends RecyclerView.ViewHolder { - private LayoutOptionssheetItemBinding binding; - - public VH(LayoutOptionssheetItemBinding binding) { - super(binding.getRoot()); - this.binding = binding; - } - } - - public static interface OnOptionsClickListener { - public void onOptionClick(SheetOption option); - - public void onOptionLongClick(SheetOption option); - } + private OnOptionsClickListener listener; + private List options; + + public OptionsSheetAdapter(List options, OnOptionsClickListener listener) { + this.options = options; + this.listener = listener; + } + + @Override + public int getItemCount() { + return options.size(); + } + + @Override + public void onBindViewHolder(OptionsSheetAdapter.VH p1, int p2) { + final LayoutOptionssheetItemBinding binding = p1.binding; + final SheetOption option = options.get(p2); + + binding.text.setText(option.title); + binding.icon.setImageDrawable(option.icon); + + binding + .getRoot() + .setOnClickListener( + v -> { + if (listener != null) + listener.onOptionClick(option); + }); + binding + .getRoot() + .setOnLongClickListener( + v -> { + if (listener != null) + listener.onOptionLongClick(option); + return true; + }); + } + + @Override + public OptionsSheetAdapter.VH onCreateViewHolder(ViewGroup p1, int p2) { + return new VH( + LayoutOptionssheetItemBinding.inflate(LayoutInflater.from(p1.getContext()), p1, false)); + } + + public static interface OnOptionsClickListener { + public void onOptionClick(SheetOption option); + + public void onOptionLongClick(SheetOption option); + } + + public class VH extends RecyclerView.ViewHolder { + private LayoutOptionssheetItemBinding binding; + + public VH(LayoutOptionssheetItemBinding binding) { + super(binding.getRoot()); + this.binding = binding; + } + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/adapters/RunTasksListAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/RunTasksListAdapter.kt index a260af140f..1f39b3dd64 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/adapters/RunTasksListAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/RunTasksListAdapter.kt @@ -20,8 +20,8 @@ package org.appdevforall.codeonthego.adapters import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import org.appdevforall.codeonthego.adapters.RunTasksListAdapter.VH import com.itsaky.androidide.databinding.LayoutRunTaskItemBinding +import org.appdevforall.codeonthego.adapters.RunTasksListAdapter.VH import org.appdevforall.codeonthego.idetooltips.TooltipManager import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.models.Checkable diff --git a/app/src/main/java/org/appdevforall/codeonthego/adapters/SymbolInputAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/SymbolInputAdapter.kt index 8a535fc59c..37de48094f 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/adapters/SymbolInputAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/SymbolInputAdapter.kt @@ -25,12 +25,12 @@ import androidx.appcompat.widget.TooltipCompat import androidx.recyclerview.widget.RecyclerView import com.itsaky.androidide.R import com.itsaky.androidide.databinding.LayoutSymbolItemBinding +import io.github.rosemoe.sora.widget.SelectionMovement import org.appdevforall.codeonthego.editor.ui.IDEEditor import org.appdevforall.codeonthego.idetooltips.TooltipManager import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.models.Symbol import org.appdevforall.codeonthego.utils.resolveAttr -import io.github.rosemoe.sora.widget.SelectionMovement import java.util.Objects class SymbolInputAdapter diff --git a/app/src/main/java/org/appdevforall/codeonthego/adapters/TemplateListAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/TemplateListAdapter.kt index f82355b31d..1af3c29cf4 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/adapters/TemplateListAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/TemplateListAdapter.kt @@ -24,8 +24,8 @@ import android.widget.ImageView import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.google.android.material.shape.CornerFamily -import org.appdevforall.codeonthego.adapters.TemplateListAdapter.ViewHolder import com.itsaky.androidide.databinding.LayoutTemplateListItemBinding +import org.appdevforall.codeonthego.adapters.TemplateListAdapter.ViewHolder import org.appdevforall.codeonthego.templates.Template import org.appdevforall.codeonthego.utils.dpToPx diff --git a/app/src/main/java/org/appdevforall/codeonthego/adapters/TemplateWidgetsListAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/TemplateWidgetsListAdapter.kt index 98ff204e07..2fff18b7bf 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/adapters/TemplateWidgetsListAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/TemplateWidgetsListAdapter.kt @@ -21,8 +21,8 @@ import android.view.LayoutInflater import android.view.ViewGroup import android.widget.LinearLayout import androidx.recyclerview.widget.RecyclerView -import org.appdevforall.codeonthego.adapters.TemplateWidgetsListAdapter.WidgetViewHolder import com.itsaky.androidide.databinding.LayoutTemplateWidgetlistItemBinding +import org.appdevforall.codeonthego.adapters.TemplateWidgetsListAdapter.WidgetViewHolder import org.appdevforall.codeonthego.idetooltips.TooltipManager import org.appdevforall.codeonthego.templates.ITemplateWidgetViewProvider import org.appdevforall.codeonthego.templates.Widget @@ -63,11 +63,11 @@ class TemplateWidgetsListAdapter( val widget = widgets[position] val view = viewProvider.createView(root.context, widget) viewProvider.applyCallTooltip { tooltipTag -> - TooltipManager.showIdeCategoryTooltip( - context = root.context, - anchorView = root, - tag = tooltipTag, - ) + TooltipManager.showIdeCategoryTooltip( + context = root.context, + anchorView = root, + tag = tooltipTag, + ) } root.removeAllViews() root.addView( diff --git a/app/src/main/java/org/appdevforall/codeonthego/adapters/onboarding/DefaultOnboardingItemAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/adapters/onboarding/DefaultOnboardingItemAdapter.kt index 5713be4a0f..6997be087c 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/adapters/onboarding/DefaultOnboardingItemAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/onboarding/DefaultOnboardingItemAdapter.kt @@ -31,73 +31,78 @@ import org.appdevforall.codeonthego.models.OnboardingItem * @author Akash Yadav */ open class DefaultOnboardingItemAdapter( - protected val items: List, - protected val onItemClickListener: OnItemClickListener? = null, - protected val onItemLongClickListener: OnItemLongClickListener? = null + protected val items: List, + protected val onItemClickListener: OnItemClickListener? = null, + protected val onItemLongClickListener: OnItemLongClickListener? = null, ) : RecyclerView.Adapter() { - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { - return ViewHolder( - LayoutOnboardingItemBinding.inflate(LayoutInflater.from(parent.context), parent, false)) - } - - override fun onBindViewHolder(holder: ViewHolder, position: Int) { - doBindViewHolder(holder, position, getItem(position), holder.binding) - } - - protected open fun doBindViewHolder( - holder: ViewHolder, - position: Int, - item: T, - binding: LayoutOnboardingItemBinding - ) { - binding.content.title.text = item.title - - if (item.description.isNotBlank()) { - binding.content.description.text = item.description - } else { - binding.content.description.visibility = View.INVISIBLE - } - - if (item.icon != 0) { - binding.content.icon.setImageResource(item.icon) - if (item.iconTint != 0) { - binding.content.icon.supportImageTintList = ColorStateList.valueOf(item.iconTint) - } - } else { - binding.content.icon.visibility = View.INVISIBLE - } - - binding.root.isClickable = item.isClickable - binding.root.isFocusable = item.isClickable - - if (item.isClickable && onItemClickListener != null) { - binding.root.setOnClickListener { onItemClickListener.onClick(item, position, binding) } - } - - if (item.isLongClickable && onItemLongClickListener != null) { - binding.root.setOnLongClickListener { onItemLongClickListener.onLongClick(item, position, binding) } - } - } - - override fun getItemCount(): Int { - return items.size - } - - fun getItem(index: Int): T { - return items[index] - } - - class ViewHolder(val binding: LayoutOnboardingItemBinding) : - RecyclerView.ViewHolder(binding.root) - - fun interface OnItemClickListener { - - fun onClick(item: T, position: Int, binding: LayoutOnboardingItemBinding) - } - - fun interface OnItemLongClickListener { - - fun onLongClick(item: T, position: Int, binding: LayoutOnboardingItemBinding): Boolean - } -} \ No newline at end of file + override fun onCreateViewHolder( + parent: ViewGroup, + viewType: Int, + ): ViewHolder = ViewHolder(LayoutOnboardingItemBinding.inflate(LayoutInflater.from(parent.context), parent, false)) + + override fun onBindViewHolder( + holder: ViewHolder, + position: Int, + ) { + doBindViewHolder(holder, position, getItem(position), holder.binding) + } + + protected open fun doBindViewHolder( + holder: ViewHolder, + position: Int, + item: T, + binding: LayoutOnboardingItemBinding, + ) { + binding.content.title.text = item.title + + if (item.description.isNotBlank()) { + binding.content.description.text = item.description + } else { + binding.content.description.visibility = View.INVISIBLE + } + + if (item.icon != 0) { + binding.content.icon.setImageResource(item.icon) + if (item.iconTint != 0) { + binding.content.icon.supportImageTintList = ColorStateList.valueOf(item.iconTint) + } + } else { + binding.content.icon.visibility = View.INVISIBLE + } + + binding.root.isClickable = item.isClickable + binding.root.isFocusable = item.isClickable + + if (item.isClickable && onItemClickListener != null) { + binding.root.setOnClickListener { onItemClickListener.onClick(item, position, binding) } + } + + if (item.isLongClickable && onItemLongClickListener != null) { + binding.root.setOnLongClickListener { onItemLongClickListener.onLongClick(item, position, binding) } + } + } + + override fun getItemCount(): Int = items.size + + fun getItem(index: Int): T = items[index] + + class ViewHolder( + val binding: LayoutOnboardingItemBinding, + ) : RecyclerView.ViewHolder(binding.root) + + fun interface OnItemClickListener { + fun onClick( + item: T, + position: Int, + binding: LayoutOnboardingItemBinding, + ) + } + + fun interface OnItemLongClickListener { + fun onLongClick( + item: T, + position: Int, + binding: LayoutOnboardingItemBinding, + ): Boolean + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/adapters/viewholders/FileTreeViewHolder.java b/app/src/main/java/org/appdevforall/codeonthego/adapters/viewholders/FileTreeViewHolder.java index 62f67448c2..df7035cb46 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/adapters/viewholders/FileTreeViewHolder.java +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/viewholders/FileTreeViewHolder.java @@ -24,17 +24,14 @@ import android.view.LayoutInflater; import android.view.View; import android.widget.LinearLayout; - import androidx.transition.ChangeImageTransform; import androidx.transition.TransitionManager; - import com.itsaky.androidide.databinding.LayoutFiletreeItemBinding; -import org.appdevforall.codeonthego.models.FileExtension; import com.itsaky.androidide.resources.R; -import org.appdevforall.codeonthego.utils.ContextUtilsKt; import com.unnamed.b.atv.model.TreeNode; - import java.io.File; +import org.appdevforall.codeonthego.models.FileExtension; +import org.appdevforall.codeonthego.utils.ContextUtilsKt; public class FileTreeViewHolder extends TreeNode.BaseNodeViewHolder { diff --git a/app/src/main/java/org/appdevforall/codeonthego/adapters/viewholders/MultiSelectFileTreeViewHolder.java b/app/src/main/java/org/appdevforall/codeonthego/adapters/viewholders/MultiSelectFileTreeViewHolder.java index d3df4d6e20..dba9b63062 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/adapters/viewholders/MultiSelectFileTreeViewHolder.java +++ b/app/src/main/java/org/appdevforall/codeonthego/adapters/viewholders/MultiSelectFileTreeViewHolder.java @@ -3,136 +3,138 @@ import android.content.Context; import android.view.LayoutInflater; import android.view.View; - import com.itsaky.androidide.R; import com.itsaky.androidide.databinding.LayoutFiletreeItemSelectableBinding; -import org.appdevforall.codeonthego.models.FileExtension; import com.unnamed.b.atv.model.TreeNode; - import java.io.File; import java.util.List; import java.util.Set; +import org.appdevforall.codeonthego.models.FileExtension; public class MultiSelectFileTreeViewHolder extends TreeNode.BaseNodeViewHolder { - private LayoutFiletreeItemSelectableBinding binding; - private Set selectedFiles; - - public MultiSelectFileTreeViewHolder(Context context, Set selectedFiles) { - super(context); - this.selectedFiles = selectedFiles; - } - - @Override - public View createNodeView(TreeNode node, File file) { - // This is where the binding is created, only for visible nodes. - binding = LayoutFiletreeItemSelectableBinding.inflate(LayoutInflater.from(context)); - - final boolean isDir = node.isDirectory(); - - binding.filetreeName.setText(file.getName()); - binding.filetreeIcon.setImageResource(FileExtension.Factory.forFile(file, isDir).getIcon()); - - int padding = (int) (context.getResources().getDisplayMetrics().density * 16 * (node.getLevel() - 1)); - binding.getRoot().setPadding(padding, binding.getRoot().getPaddingTop(), binding.getRoot().getPaddingRight(), binding.getRoot().getPaddingBottom()); - - if (isDir) { - binding.filetreeChevron.setVisibility(View.VISIBLE); - binding.filetreeChevron.setRotation(node.isExpanded() ? 90 : 0); - } else { - binding.filetreeChevron.setVisibility(View.INVISIBLE); - } - - View.OnClickListener toggleListener = v -> { - if (file.isDirectory()) { - getTreeView().toggleNode(node); - } - }; - binding.filetreeName.setOnClickListener(toggleListener); - binding.filetreeIcon.setOnClickListener(toggleListener); - binding.filetreeChevron.setOnClickListener(toggleListener); - - binding.filetreeCheckbox.setOnCheckedChangeListener(null); - updateCheckboxState(node); - binding.filetreeCheckbox.setOnCheckedChangeListener((buttonView, isChecked) -> { - propagateSelectionToChildren(node, isChecked); - updateParentCheckboxStates(node.getParent()); - }); - - return binding.getRoot(); - } - - @Override - public void toggle(boolean active) { - if (binding == null) return; - binding.filetreeChevron.setRotation(active ? 90 : 0); - } - - private void propagateSelectionToChildren(TreeNode node, boolean isSelected) { - File file = (File) node.getValue(); - if (isSelected) { - selectedFiles.add(file); - } else { - selectedFiles.remove(file); - } - updateCheckboxState(node); - - if (node.isDirectory()) { - for (TreeNode child : (List) node.getChildren()) { - propagateSelectionToChildren(child, isSelected); - } - } - } - - private void updateParentCheckboxStates(TreeNode parent) { - if (parent == null || parent.getValue() == null) return; - - MultiSelectFileTreeViewHolder parentViewHolder = (MultiSelectFileTreeViewHolder) parent.getViewHolder(); - if (parentViewHolder != null) { - parentViewHolder.updateCheckboxState(parent); - } - - updateParentCheckboxStates(parent.getParent()); - } - - public void updateCheckboxState(TreeNode node) { - if (binding == null) return; - - File file = node.getValue(); - if (file == null) return; - - binding.filetreeCheckbox.setOnCheckedChangeListener(null); - - if (file.isDirectory()) { - int childCount = node.getChildren().size(); - int selectedCount = 0; - for (TreeNode child : (List) node.getChildren()) { - if (selectedFiles.contains(child.getValue())) { - selectedCount++; - } - } - - if (selectedCount == 0) { - binding.filetreeCheckbox.setButtonDrawable(R.drawable.abc_btn_check_material); - binding.filetreeCheckbox.setChecked(false); - selectedFiles.remove(file); - } else if (selectedCount == childCount) { - binding.filetreeCheckbox.setButtonDrawable(R.drawable.abc_btn_check_material); - binding.filetreeCheckbox.setChecked(true); - selectedFiles.add(file); - } else { - binding.filetreeCheckbox.setButtonDrawable(R.drawable.ic_indeterminate_check_box); - binding.filetreeCheckbox.setChecked(true); - selectedFiles.remove(file); - } - } else { - binding.filetreeCheckbox.setButtonDrawable(R.drawable.abc_btn_check_material); - binding.filetreeCheckbox.setChecked(selectedFiles.contains(file)); - } - - binding.filetreeCheckbox.setOnCheckedChangeListener((buttonView, isChecked) -> { - propagateSelectionToChildren(node, isChecked); - updateParentCheckboxStates(node.getParent()); - }); - } -} \ No newline at end of file + private LayoutFiletreeItemSelectableBinding binding; + private Set selectedFiles; + + public MultiSelectFileTreeViewHolder(Context context, Set selectedFiles) { + super(context); + this.selectedFiles = selectedFiles; + } + + @Override + public View createNodeView(TreeNode node, File file) { + // This is where the binding is created, only for visible nodes. + binding = LayoutFiletreeItemSelectableBinding.inflate(LayoutInflater.from(context)); + + final boolean isDir = node.isDirectory(); + + binding.filetreeName.setText(file.getName()); + binding.filetreeIcon.setImageResource(FileExtension.Factory.forFile(file, isDir).getIcon()); + + int padding = (int) (context.getResources().getDisplayMetrics().density * 16 * (node.getLevel() - 1)); + binding.getRoot().setPadding(padding, binding.getRoot().getPaddingTop(), binding.getRoot().getPaddingRight(), binding.getRoot().getPaddingBottom()); + + if (isDir) { + binding.filetreeChevron.setVisibility(View.VISIBLE); + binding.filetreeChevron.setRotation(node.isExpanded() ? 90 : 0); + } else { + binding.filetreeChevron.setVisibility(View.INVISIBLE); + } + + View.OnClickListener toggleListener = v -> { + if (file.isDirectory()) { + getTreeView().toggleNode(node); + } + }; + binding.filetreeName.setOnClickListener(toggleListener); + binding.filetreeIcon.setOnClickListener(toggleListener); + binding.filetreeChevron.setOnClickListener(toggleListener); + + binding.filetreeCheckbox.setOnCheckedChangeListener(null); + updateCheckboxState(node); + binding.filetreeCheckbox.setOnCheckedChangeListener((buttonView, isChecked) -> { + propagateSelectionToChildren(node, isChecked); + updateParentCheckboxStates(node.getParent()); + }); + + return binding.getRoot(); + } + + @Override + public void toggle(boolean active) { + if (binding == null) + return; + binding.filetreeChevron.setRotation(active ? 90 : 0); + } + + public void updateCheckboxState(TreeNode node) { + if (binding == null) + return; + + File file = node.getValue(); + if (file == null) + return; + + binding.filetreeCheckbox.setOnCheckedChangeListener(null); + + if (file.isDirectory()) { + int childCount = node.getChildren().size(); + int selectedCount = 0; + for (TreeNode child : (List) node.getChildren()) { + if (selectedFiles.contains(child.getValue())) { + selectedCount++; + } + } + + if (selectedCount == 0) { + binding.filetreeCheckbox.setButtonDrawable(R.drawable.abc_btn_check_material); + binding.filetreeCheckbox.setChecked(false); + selectedFiles.remove(file); + } else if (selectedCount == childCount) { + binding.filetreeCheckbox.setButtonDrawable(R.drawable.abc_btn_check_material); + binding.filetreeCheckbox.setChecked(true); + selectedFiles.add(file); + } else { + binding.filetreeCheckbox.setButtonDrawable(R.drawable.ic_indeterminate_check_box); + binding.filetreeCheckbox.setChecked(true); + selectedFiles.remove(file); + } + } else { + binding.filetreeCheckbox.setButtonDrawable(R.drawable.abc_btn_check_material); + binding.filetreeCheckbox.setChecked(selectedFiles.contains(file)); + } + + binding.filetreeCheckbox.setOnCheckedChangeListener((buttonView, isChecked) -> { + propagateSelectionToChildren(node, isChecked); + updateParentCheckboxStates(node.getParent()); + }); + } + + private void propagateSelectionToChildren(TreeNode node, boolean isSelected) { + File file = (File) node.getValue(); + if (isSelected) { + selectedFiles.add(file); + } else { + selectedFiles.remove(file); + } + updateCheckboxState(node); + + if (node.isDirectory()) { + for (TreeNode child : (List) node.getChildren()) { + propagateSelectionToChildren(child, isSelected); + } + } + } + + private void updateParentCheckboxStates(TreeNode parent) { + if (parent == null || parent.getValue() == null) + return; + + MultiSelectFileTreeViewHolder parentViewHolder = (MultiSelectFileTreeViewHolder) parent.getViewHolder(); + if (parentViewHolder != null) { + parentViewHolder.updateCheckboxState(parent); + } + + updateParentCheckboxStates(parent.getParent()); + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/agent/model/ModelLoadResult.kt b/app/src/main/java/org/appdevforall/codeonthego/agent/model/ModelLoadResult.kt index 3e99dc239f..b7ce181c1c 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/agent/model/ModelLoadResult.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/agent/model/ModelLoadResult.kt @@ -1,16 +1,16 @@ package org.appdevforall.codeonthego.agent.model sealed interface ModelLoadResult { - data class Loaded( - val modelName: String - ) : ModelLoadResult + data class Loaded( + val modelName: String, + ) : ModelLoadResult - data class Rejected( - val message: String - ) : ModelLoadResult + data class Rejected( + val message: String, + ) : ModelLoadResult - data class Failed( - val message: String, - val cause: Throwable? = null - ) : ModelLoadResult + data class Failed( + val message: String, + val cause: Throwable? = null, + ) : ModelLoadResult } diff --git a/app/src/main/java/org/appdevforall/codeonthego/api/BuildOutputProvider.kt b/app/src/main/java/org/appdevforall/codeonthego/api/BuildOutputProvider.kt index e6bba720aa..d9e482f1bd 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/api/BuildOutputProvider.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/api/BuildOutputProvider.kt @@ -2,13 +2,13 @@ package org.appdevforall.codeonthego.api import android.os.Looper import androidx.annotation.VisibleForTesting -import org.appdevforall.codeonthego.app.IDEApplication -import org.appdevforall.codeonthego.ui.EditorBottomSheet -import org.appdevforall.codeonthego.viewmodel.BuildOutputViewModel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.runBlocking import kotlinx.coroutines.withContext import kotlinx.coroutines.withTimeoutOrNull +import org.appdevforall.codeonthego.app.IDEApplication +import org.appdevforall.codeonthego.ui.EditorBottomSheet +import org.appdevforall.codeonthego.viewmodel.BuildOutputViewModel import org.slf4j.LoggerFactory import java.io.File import java.lang.ref.WeakReference diff --git a/app/src/main/java/org/appdevforall/codeonthego/api/IDEApiFacade.kt b/app/src/main/java/org/appdevforall/codeonthego/api/IDEApiFacade.kt index 56288d8747..03d11be204 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/api/IDEApiFacade.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/api/IDEApiFacade.kt @@ -1,76 +1,81 @@ package org.appdevforall.codeonthego.api +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.suspendCancellableCoroutine +import kotlinx.coroutines.withContext import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.ActionItem import org.appdevforall.codeonthego.actions.ActionsRegistry import org.appdevforall.codeonthego.actions.internal.DefaultActionsRegistry import org.appdevforall.codeonthego.projects.builder.BuildResult -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.suspendCancellableCoroutine -import kotlinx.coroutines.withContext import kotlin.coroutines.resume /** * Simple result wrapper for API operations. */ data class ApiResult( - val success: Boolean, - val message: String = "", - val data: String = "" + val success: Boolean, + val message: String = "", + val data: String = "", ) /** * The single, clean entry point for the AI agent to interact with the IDE. */ object IDEApiFacade { + suspend fun runApp(): ApiResult { + val activity = + ActionContextProvider.getActivity() + ?: return ApiResult(false, "No active IDE window to launch the app.") + + val action = + ActionsRegistry + .getInstance() + .findAction(ActionItem.Location.EDITOR_TOOLBAR, "ide.editor.build.quickRun") + ?: return ApiResult(false, "Launch App action is not available.") - suspend fun runApp(): ApiResult { - val activity = ActionContextProvider.getActivity() - ?: return ApiResult(false, "No active IDE window to launch the app.") + val actionData = ActionData.create(activity) - val action = ActionsRegistry.getInstance() - .findAction(ActionItem.Location.EDITOR_TOOLBAR, "ide.editor.build.quickRun") - ?: return ApiResult(false, "Launch App action is not available.") + return suspendCancellableCoroutine { continuation -> + val listener = + java.util.function.Consumer { result -> + when { + result.isSuccess && result.launchResult != null && result.launchResult.isSuccess -> { + continuation.resume(ApiResult(true, "App built and launched successfully on the device.")) + } - val actionData = ActionData.create(activity) + result.isSuccess -> { + val launchError = + result.launchResult?.message ?: "Launch failed for an unknown reason." + continuation.resume(ApiResult(false, "Build was successful, but the app failed to launch: $launchError")) + } - return suspendCancellableCoroutine { continuation -> - val listener = java.util.function.Consumer { result -> - when { - result.isSuccess && result.launchResult != null && result.launchResult.isSuccess -> { - continuation.resume(ApiResult(true, "App built and launched successfully on the device.")) - } - result.isSuccess -> { - val launchError = - result.launchResult?.message ?: "Launch failed for an unknown reason." - continuation.resume(ApiResult(false, "Build was successful, but the app failed to launch: $launchError")) - } - else -> { - continuation.resume(ApiResult(false, "Build failed: ${result.message}")) - } - } - } + else -> { + continuation.resume(ApiResult(false, "Build failed: ${result.message}")) + } + } + } - continuation.invokeOnCancellation { activity.removeOneTimeBuildResultListener(listener) } + continuation.invokeOnCancellation { activity.removeOneTimeBuildResultListener(listener) } - val registry = ActionsRegistry.getInstance() as? DefaultActionsRegistry - if (registry == null) { - continuation.resume(ApiResult(false, "Failed to get action registry instance.")) - return@suspendCancellableCoroutine - } + val registry = ActionsRegistry.getInstance() as? DefaultActionsRegistry + if (registry == null) { + continuation.resume(ApiResult(false, "Failed to get action registry instance.")) + return@suspendCancellableCoroutine + } - activity.addOneTimeBuildResultListener(listener) + activity.addOneTimeBuildResultListener(listener) - try { - registry.executeAction(action, actionData) - } catch (t: Throwable) { - activity.removeOneTimeBuildResultListener(listener) - if (continuation.isActive) { - continuation.resume( - ApiResult(false, "Failed to launch the app: ${t.message}") - ) - } - } - } - } + try { + registry.executeAction(action, actionData) + } catch (t: Throwable) { + activity.removeOneTimeBuildResultListener(listener) + if (continuation.isActive) { + continuation.resume( + ApiResult(false, "Failed to launch the app: ${t.message}"), + ) + } + } + } + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/app/DeviceProtectedApplicationLoader.kt b/app/src/main/java/org/appdevforall/codeonthego/app/DeviceProtectedApplicationLoader.kt index 0be9b5e15c..22ba7ed11e 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/app/DeviceProtectedApplicationLoader.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/DeviceProtectedApplicationLoader.kt @@ -6,27 +6,11 @@ import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.ProcessLifecycleOwner import com.itsaky.androidide.BuildConfig -import org.appdevforall.codeonthego.analytics.AttachedDevicesCollector -import org.appdevforall.codeonthego.analytics.AttachedDevicesMetric -import org.appdevforall.codeonthego.analytics.IAnalyticsManager -import org.appdevforall.codeonthego.app.strictmode.StrictModeConfig -import org.appdevforall.codeonthego.app.strictmode.StrictModeManager import com.itsaky.androidide.events.AppEventsIndex import com.itsaky.androidide.events.EditorEventsIndex import com.itsaky.androidide.events.LspApiEventsIndex import com.itsaky.androidide.events.LspJavaEventsIndex import com.itsaky.androidide.events.ProjectsApiEventsIndex -import org.appdevforall.codeonthego.handlers.CrashEventSubscriber -import org.appdevforall.codeonthego.handlers.GlitchTipDiagnosticsContext -import org.appdevforall.codeonthego.handlers.MetricsCrashAttachment -import org.appdevforall.codeonthego.logging.provider.IdeLogRouter -import org.appdevforall.codeonthego.preferences.internal.StatPreferences -import org.appdevforall.codeonthego.preferences.internal.TelemetryConsent -import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE -import org.appdevforall.codeonthego.ui.themes.IThemeManager -import org.appdevforall.codeonthego.utils.Environment -import org.appdevforall.codeonthego.utils.FeatureFlags -import org.appdevforall.codeonthego.utils.MetricsScratch import com.termux.shared.reflection.ReflectionUtils import io.github.rosemoe.sora.widget.schemes.EditorColorScheme import io.sentry.Breadcrumb @@ -38,6 +22,22 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import moe.shizuku.manager.ShizukuSettings +import org.appdevforall.codeonthego.analytics.AttachedDevicesCollector +import org.appdevforall.codeonthego.analytics.AttachedDevicesMetric +import org.appdevforall.codeonthego.analytics.IAnalyticsManager +import org.appdevforall.codeonthego.app.strictmode.StrictModeConfig +import org.appdevforall.codeonthego.app.strictmode.StrictModeManager +import org.appdevforall.codeonthego.handlers.CrashEventSubscriber +import org.appdevforall.codeonthego.handlers.GlitchTipDiagnosticsContext +import org.appdevforall.codeonthego.handlers.MetricsCrashAttachment +import org.appdevforall.codeonthego.logging.provider.IdeLogRouter +import org.appdevforall.codeonthego.preferences.internal.StatPreferences +import org.appdevforall.codeonthego.preferences.internal.TelemetryConsent +import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE +import org.appdevforall.codeonthego.ui.themes.IThemeManager +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.FeatureFlags +import org.appdevforall.codeonthego.utils.MetricsScratch import org.greenrobot.eventbus.EventBus import org.koin.core.component.KoinComponent import org.koin.core.component.inject diff --git a/app/src/main/java/org/appdevforall/codeonthego/app/EdgeToEdgeIDEActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/app/EdgeToEdgeIDEActivity.kt index c2b88a14bd..87de409f4f 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/app/EdgeToEdgeIDEActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/EdgeToEdgeIDEActivity.kt @@ -47,145 +47,152 @@ import org.slf4j.LoggerFactory * @author Akash Yadav */ abstract class EdgeToEdgeIDEActivity : IDEActivity() { - - /** - * Whether edge-to-edge should be applied to the activity. - */ - protected open var edgeToEdgeEnabled = true - - /** - * Whether the decor view padding should be updated to match the system bars in landscape orientation. - */ - protected open var eteUpdateDecorViewPaddingInLandscape = true - - /** - * Style for the status bar. - */ - protected open val statusBarStyle = EdgeToEdgeUtils.DEFAULT_STATUS_BAR_STYLE!! - - /** - * Style for the navigation bar. - */ - protected open val navigationBarStyle = EdgeToEdgeUtils.DEFAULT_NAVIGATION_BAR_STYLE!! - - /** - * Original padding of the window's decor view. - */ - protected open var decorViewPadding: Rect? = null - - /** - * Last window insets. - */ - protected open var systemBarInsets: Insets? = null - - override var enableSystemBarTheming: Boolean - get() = false - set(@Suppress("UNUSED_PARAMETER") value) { - throw UnsupportedOperationException("Use edgeToEdgeEnabled and systemBarStyles instead") - } - - private val log = LoggerFactory.getLogger(EdgeToEdgeIDEActivity::class.java) - - @SuppressLint("WrongConstant") - private val onApplyWindowInsetsListener = OnApplyWindowInsetsListener { view, insets -> - onApplyWindowInsets(insets) - if (!eteUpdateDecorViewPaddingInLandscape || - view.resources.configuration.orientation != Configuration.ORIENTATION_LANDSCAPE - ) { - decorViewPadding?.also { p -> - // when switching from landscape to portrait, restore the original padding - view.setPadding(p.left, p.top, p.right, p.bottom) - } - return@OnApplyWindowInsetsListener insets - } - - if (decorViewPadding == null) { - Rect().apply { - left = view.paddingLeft - top = view.paddingTop - right = view.paddingRight - bottom = view.paddingBottom - }.also { paddings -> - decorViewPadding = paddings - } - } - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { - val systemBarInsets = insets.getInsets(WindowInsets.Type.systemBars()) - view.setPadding( - systemBarInsets.left, - 0, - systemBarInsets.right, - systemBarInsets.bottom - ) - } else { - @Suppress("DEPRECATION") - view.setPadding( - insets.stableInsetLeft, - 0, - insets.stableInsetRight, - insets.stableInsetBottom - ) - } - - insets - } - - override fun onCreate(savedInstanceState: Bundle?) { - applyEdgeToEdge() - super.onCreate(savedInstanceState) - } - - override fun onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) { - applyEdgeToEdge() - super.onCreate(savedInstanceState, persistentState) - } - - @SuppressLint("RestrictedApi") - private fun applyEdgeToEdge() { - this.window!!.apply { - addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) - @Suppress("DEPRECATION") - clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION) - if (Build.VERSION.SDK_INT >= VERSION_CODES.P) { - attributes = attributes.apply { - layoutInDisplayCutoutMode = - WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES - } - } - } - - EdgeToEdgeUtils.applyEdgeToEdge(this, this.statusBarStyle, this.navigationBarStyle) - - ViewCompat.setOnApplyWindowInsetsListener( - this.window.decorView, - this.onApplyWindowInsetsListener - ) - - this.window.decorView.doOnAttach { onApplySystemBarInsets(getSystemBarInsets(it)) } - } - - /** - * Called when the window insets change. - * - * @param insets The window insets. These insets are not expected to be consumed. - */ - @CallSuper - protected open fun onApplyWindowInsets(insets: WindowInsetsCompat) { - this.systemBarInsets = getSystemBarInsets(insets) - } - - /** - * Called with the system bar insets when the decor view is attached to the window. - */ - protected open fun onApplySystemBarInsets(insets: Insets) {} - - fun closeKeyboard() { - // Get the current focused view; if none, create a new one so that we have a valid window token - val view = currentFocus ?: View(this) - // Retrieve the input method manager service - val inputMethodManager = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager - // Request to hide the keyboard from the window - inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0) - } + /** + * Whether edge-to-edge should be applied to the activity. + */ + protected open var edgeToEdgeEnabled = true + + /** + * Whether the decor view padding should be updated to match the system bars in landscape orientation. + */ + protected open var eteUpdateDecorViewPaddingInLandscape = true + + /** + * Style for the status bar. + */ + protected open val statusBarStyle = EdgeToEdgeUtils.DEFAULT_STATUS_BAR_STYLE!! + + /** + * Style for the navigation bar. + */ + protected open val navigationBarStyle = EdgeToEdgeUtils.DEFAULT_NAVIGATION_BAR_STYLE!! + + /** + * Original padding of the window's decor view. + */ + protected open var decorViewPadding: Rect? = null + + /** + * Last window insets. + */ + protected open var systemBarInsets: Insets? = null + + override var enableSystemBarTheming: Boolean + get() = false + set( + @Suppress("UNUSED_PARAMETER") value, + ) { + throw UnsupportedOperationException("Use edgeToEdgeEnabled and systemBarStyles instead") + } + + private val log = LoggerFactory.getLogger(EdgeToEdgeIDEActivity::class.java) + + @SuppressLint("WrongConstant") + private val onApplyWindowInsetsListener = + OnApplyWindowInsetsListener { view, insets -> + onApplyWindowInsets(insets) + if (!eteUpdateDecorViewPaddingInLandscape || + view.resources.configuration.orientation != Configuration.ORIENTATION_LANDSCAPE + ) { + decorViewPadding?.also { p -> + // when switching from landscape to portrait, restore the original padding + view.setPadding(p.left, p.top, p.right, p.bottom) + } + return@OnApplyWindowInsetsListener insets + } + + if (decorViewPadding == null) { + Rect() + .apply { + left = view.paddingLeft + top = view.paddingTop + right = view.paddingRight + bottom = view.paddingBottom + }.also { paddings -> + decorViewPadding = paddings + } + } + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + val systemBarInsets = insets.getInsets(WindowInsets.Type.systemBars()) + view.setPadding( + systemBarInsets.left, + 0, + systemBarInsets.right, + systemBarInsets.bottom, + ) + } else { + @Suppress("DEPRECATION") + view.setPadding( + insets.stableInsetLeft, + 0, + insets.stableInsetRight, + insets.stableInsetBottom, + ) + } + + insets + } + + override fun onCreate(savedInstanceState: Bundle?) { + applyEdgeToEdge() + super.onCreate(savedInstanceState) + } + + override fun onCreate( + savedInstanceState: Bundle?, + persistentState: PersistableBundle?, + ) { + applyEdgeToEdge() + super.onCreate(savedInstanceState, persistentState) + } + + @SuppressLint("RestrictedApi") + private fun applyEdgeToEdge() { + this.window!!.apply { + addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) + @Suppress("DEPRECATION") + clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION) + if (Build.VERSION.SDK_INT >= VERSION_CODES.P) { + attributes = + attributes.apply { + layoutInDisplayCutoutMode = + WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES + } + } + } + + EdgeToEdgeUtils.applyEdgeToEdge(this, this.statusBarStyle, this.navigationBarStyle) + + ViewCompat.setOnApplyWindowInsetsListener( + this.window.decorView, + this.onApplyWindowInsetsListener, + ) + + this.window.decorView.doOnAttach { onApplySystemBarInsets(getSystemBarInsets(it)) } + } + + /** + * Called when the window insets change. + * + * @param insets The window insets. These insets are not expected to be consumed. + */ + @CallSuper + protected open fun onApplyWindowInsets(insets: WindowInsetsCompat) { + this.systemBarInsets = getSystemBarInsets(insets) + } + + /** + * Called with the system bar insets when the decor view is attached to the window. + */ + protected open fun onApplySystemBarInsets(insets: Insets) {} + + fun closeKeyboard() { + // Get the current focused view; if none, create a new one so that we have a valid window token + val view = currentFocus ?: View(this) + // Retrieve the input method manager service + val inputMethodManager = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager + // Request to hide the keyboard from the window + inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0) + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/app/EditorEvents.kt b/app/src/main/java/org/appdevforall/codeonthego/app/EditorEvents.kt index ef55e1674f..63d8756046 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/app/EditorEvents.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/EditorEvents.kt @@ -15,61 +15,60 @@ import java.util.concurrent.CopyOnWriteArrayList * is a plugin tab (which has no file). */ object EditorEvents { + private const val TAG = "EditorEvents" - private const val TAG = "EditorEvents" + @Volatile + var lastActiveFile: File? = null + private set - @Volatile - var lastActiveFile: File? = null - private set + private val fileChangeListeners = CopyOnWriteArrayList<(File?) -> Unit>() - private val fileChangeListeners = CopyOnWriteArrayList<(File?) -> Unit>() + fun addFileChangeListener(listener: (File?) -> Unit) { + fileChangeListeners.addIfAbsent(listener) + } - fun addFileChangeListener(listener: (File?) -> Unit) { - fileChangeListeners.addIfAbsent(listener) - } + fun removeFileChangeListener(listener: (File?) -> Unit) { + fileChangeListeners.remove(listener) + } - fun removeFileChangeListener(listener: (File?) -> Unit) { - fileChangeListeners.remove(listener) - } + @Volatile + private var lastNotifiedPath: String? = null - @Volatile - private var lastNotifiedPath: String? = null + /** + * Called by the editor activity whenever the displayed tab changes. `file` is non-null + * only when the active tab is a real file (not a plugin tab); `lastActiveFile` is only + * updated for non-null files so consumers can still answer "what was the user editing?" + * while a plugin tab is in the foreground. Listeners fire only when the active path + * actually changes — dedup here means a 2Hz-polling plugin doesn't see redundant + * notifications on every UI tick. + */ + fun notifyFileChanged(file: File?) { + if (file != null) { + lastActiveFile = file + } + val path = file?.absolutePath + if (path == lastNotifiedPath) return + lastNotifiedPath = path + Log.d(TAG, "notifyFileChanged -> ${path ?: ""}") + fileChangeListeners.forEach { listener -> + try { + listener(file) + } catch (_: Exception) { + } + } + } - /** - * Called by the editor activity whenever the displayed tab changes. `file` is non-null - * only when the active tab is a real file (not a plugin tab); `lastActiveFile` is only - * updated for non-null files so consumers can still answer "what was the user editing?" - * while a plugin tab is in the foreground. Listeners fire only when the active path - * actually changes — dedup here means a 2Hz-polling plugin doesn't see redundant - * notifications on every UI tick. - */ - fun notifyFileChanged(file: File?) { - if (file != null) { - lastActiveFile = file - } - val path = file?.absolutePath - if (path == lastNotifiedPath) return - lastNotifiedPath = path - Log.d(TAG, "notifyFileChanged -> ${path ?: ""}") - fileChangeListeners.forEach { listener -> - try { - listener(file) - } catch (_: Exception) { - } - } - } - - /** - * Called when an opened file is no longer in the editor (closed). If it matches our - * stashed `lastActiveFile`, clear it so we don't hand plugins a stale path. - */ - fun notifyFileClosed(file: File) { - if (lastActiveFile?.absolutePath == file.absolutePath) { - Log.d(TAG, "notifyFileClosed: clearing lastActiveFile (${file.absolutePath})") - lastActiveFile = null - // Clear dedupe state too, otherwise reopening the same path later could be - // swallowed by notifyFileChanged's "same path" short-circuit. - lastNotifiedPath = null - } - } + /** + * Called when an opened file is no longer in the editor (closed). If it matches our + * stashed `lastActiveFile`, clear it so we don't hand plugins a stale path. + */ + fun notifyFileClosed(file: File) { + if (lastActiveFile?.absolutePath == file.absolutePath) { + Log.d(TAG, "notifyFileClosed: clearing lastActiveFile (${file.absolutePath})") + lastActiveFile = null + // Clear dedupe state too, otherwise reopening the same path later could be + // swallowed by notifyFileChanged's "same path" short-circuit. + lastNotifiedPath = null + } + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/app/EditorProviderImpl.kt b/app/src/main/java/org/appdevforall/codeonthego/app/EditorProviderImpl.kt index 268aa4acb5..9edf5de3ca 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/app/EditorProviderImpl.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/EditorProviderImpl.kt @@ -3,6 +3,10 @@ package org.appdevforall.codeonthego.app import android.os.Handler import android.os.Looper import androidx.lifecycle.lifecycleScope +import io.github.rosemoe.sora.text.Content +import io.github.rosemoe.sora.widget.CodeEditor +import kotlinx.coroutines.launch +import kotlinx.coroutines.withTimeoutOrNull import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity import org.appdevforall.codeonthego.activities.editor.FileSaveOutcome import org.appdevforall.codeonthego.activities.editor.PeerCursorOverlayManager @@ -14,10 +18,6 @@ import org.appdevforall.codeonthego.models.SaveResult import org.appdevforall.codeonthego.plugins.manager.services.IdeEditorServiceImpl import org.appdevforall.codeonthego.plugins.services.CursorPosition import org.appdevforall.codeonthego.plugins.services.SelectionRange -import io.github.rosemoe.sora.text.Content -import io.github.rosemoe.sora.widget.CodeEditor -import kotlinx.coroutines.launch -import kotlinx.coroutines.withTimeoutOrNull import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode diff --git a/app/src/main/java/org/appdevforall/codeonthego/app/IDEActivity.kt b/app/src/main/java/org/appdevforall/codeonthego/app/IDEActivity.kt index 63bea2c879..23583e03ee 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/app/IDEActivity.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/IDEActivity.kt @@ -18,7 +18,6 @@ package org.appdevforall.codeonthego.app abstract class IDEActivity : BaseIDEActivity() { - - val app: IDEApplication - get() = application as IDEApplication + val app: IDEApplication + get() = application as IDEApplication } diff --git a/app/src/main/java/org/appdevforall/codeonthego/app/IDEActivityDelegate.kt b/app/src/main/java/org/appdevforall/codeonthego/app/IDEActivityDelegate.kt index f0a4465c7c..1409326e78 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/app/IDEActivityDelegate.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/IDEActivityDelegate.kt @@ -24,5 +24,4 @@ import androidx.lifecycle.DefaultLifecycleObserver * * @author Akash Yadav */ -interface IDEActivityDelegate : DefaultLifecycleObserver { -} \ No newline at end of file +interface IDEActivityDelegate : DefaultLifecycleObserver diff --git a/app/src/main/java/org/appdevforall/codeonthego/app/IDEApplication.kt b/app/src/main/java/org/appdevforall/codeonthego/app/IDEApplication.kt index dcb713e2d4..42f6a0cc9f 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/app/IDEApplication.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/IDEApplication.kt @@ -27,17 +27,7 @@ import android.content.Intent import android.content.IntentFilter import androidx.work.Configuration import com.itsaky.androidide.BuildConfig -import org.appdevforall.codeonthego.di.coreModule -import org.appdevforall.codeonthego.di.pluginModule -import org.appdevforall.codeonthego.di.quickBuildModule -import org.appdevforall.codeonthego.di.templateModule -import org.appdevforall.codeonthego.handlers.GlitchTipDiagnosticsContext -import org.appdevforall.codeonthego.plugins.manager.core.PluginManager import com.itsaky.androidide.treesitter.TreeSitter -import org.appdevforall.codeonthego.utils.RecyclableObjectPool -import org.appdevforall.codeonthego.utils.VMUtils -import org.appdevforall.codeonthego.utils.isAtLeastR -import org.appdevforall.codeonthego.utils.isTestMode import com.topjohnwu.superuser.Shell import io.sentry.Sentry import kotlinx.coroutines.CoroutineName @@ -51,6 +41,16 @@ import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import kotlinx.coroutines.plus import kotlinx.coroutines.runBlocking +import org.appdevforall.codeonthego.di.coreModule +import org.appdevforall.codeonthego.di.pluginModule +import org.appdevforall.codeonthego.di.quickBuildModule +import org.appdevforall.codeonthego.di.templateModule +import org.appdevforall.codeonthego.handlers.GlitchTipDiagnosticsContext +import org.appdevforall.codeonthego.plugins.manager.core.PluginManager +import org.appdevforall.codeonthego.utils.RecyclableObjectPool +import org.appdevforall.codeonthego.utils.VMUtils +import org.appdevforall.codeonthego.utils.isAtLeastR +import org.appdevforall.codeonthego.utils.isTestMode import org.koin.android.ext.koin.androidContext import org.koin.core.context.GlobalContext import org.koin.core.context.startKoin diff --git a/app/src/main/java/org/appdevforall/codeonthego/app/PluginRunAppCoordinator.kt b/app/src/main/java/org/appdevforall/codeonthego/app/PluginRunAppCoordinator.kt index 4f78b57c92..aa04995a61 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/app/PluginRunAppCoordinator.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/PluginRunAppCoordinator.kt @@ -3,6 +3,10 @@ package org.appdevforall.codeonthego.app import android.app.Activity import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.lifecycleScope +import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext import org.appdevforall.codeonthego.activities.editor.ProjectHandlerActivity import org.appdevforall.codeonthego.interfaces.IEditorHandler import org.appdevforall.codeonthego.plugins.services.BuildAndLaunchCallback @@ -10,10 +14,6 @@ import org.appdevforall.codeonthego.projects.IProjectManager import org.appdevforall.codeonthego.projects.isPluginProject import org.appdevforall.codeonthego.viewmodel.BuildState import org.appdevforall.codeonthego.viewmodel.BuildViewModel -import kotlinx.coroutines.CancellationException -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext import org.slf4j.LoggerFactory import java.util.concurrent.atomic.AtomicBoolean diff --git a/app/src/main/java/org/appdevforall/codeonthego/app/PluginTerminalLauncher.kt b/app/src/main/java/org/appdevforall/codeonthego/app/PluginTerminalLauncher.kt index f4f757c78c..f574ecb929 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/app/PluginTerminalLauncher.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/PluginTerminalLauncher.kt @@ -7,6 +7,10 @@ import android.os.Looper import androidx.core.os.HandlerCompat import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleOwner +import kotlinx.coroutines.CompletableDeferred +import kotlinx.coroutines.Deferred +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext import org.appdevforall.codeonthego.activities.TerminalActivity import org.appdevforall.codeonthego.plugins.manager.services.LaunchedTerminalCommand import org.appdevforall.codeonthego.plugins.manager.services.TerminalSessionLauncher @@ -18,10 +22,6 @@ import org.appdevforall.codeonthego.terminal.TerminalCommandListener import org.appdevforall.codeonthego.terminal.TerminalCommandRequests import org.appdevforall.codeonthego.terminal.TerminalStartFailure import org.appdevforall.codeonthego.utils.applyMultiWindowFlags -import kotlinx.coroutines.CompletableDeferred -import kotlinx.coroutines.Deferred -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.withContext import org.slf4j.LoggerFactory import java.io.File diff --git a/app/src/main/java/org/appdevforall/codeonthego/app/configuration/JdkDistributionProviderImpl.kt b/app/src/main/java/org/appdevforall/codeonthego/app/configuration/JdkDistributionProviderImpl.kt index 17a0e294b5..5853b3d366 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/app/configuration/JdkDistributionProviderImpl.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/configuration/JdkDistributionProviderImpl.kt @@ -30,44 +30,42 @@ import java.io.File */ @AutoService(IJdkDistributionProvider::class) class JdkDistributionProviderImpl : IJdkDistributionProvider { + companion object { + private val log = LoggerFactory.getLogger(JdkDistributionProviderImpl::class.java) + } - companion object { + private var _installedDistributions: List? = null - private val log = LoggerFactory.getLogger(JdkDistributionProviderImpl::class.java) - } + override val installedDistributions: List + get() = _installedDistributions ?: emptyList() - private var _installedDistributions: List? = null + override fun loadDistributions() { + _installedDistributions = doLoadDistributions() + } - override val installedDistributions: List - get() = _installedDistributions ?: emptyList() + private fun doLoadDistributions(): List { + return JdkUtils.findJavaInstallations().also { distributions -> + if (distributions.isEmpty()) { + return emptyList() + } - override fun loadDistributions() { - _installedDistributions = doLoadDistributions() - } + val selectedJavaHome = + findDefaultDistribution(distributions)?.javaHome?.let { File(it) } + ?: distributions.first().javaHome.let { File(it) } - private fun doLoadDistributions(): List { - return JdkUtils.findJavaInstallations().also { distributions -> - if(distributions.isEmpty()) { - return emptyList() - } + log.debug("Setting Environment.JAVA_HOME to {}", selectedJavaHome.absolutePath) + Environment.JAVA_HOME = selectedJavaHome + Environment.JAVA = selectedJavaHome.resolve("bin/java") + } + } - val selectedJavaHome = findDefaultDistribution(distributions)?.javaHome?.let { File(it) } - ?: distributions.first().javaHome.let { File(it) } + private fun findDefaultDistribution(distributions: List): JdkDistribution? = + distributions.find { + it.javaVersion.startsWith(IJdkDistributionProvider.DEFAULT_JAVA_VERSION) + } - log.debug("Setting Environment.JAVA_HOME to {}", selectedJavaHome.absolutePath) - Environment.JAVA_HOME = selectedJavaHome - Environment.JAVA = selectedJavaHome.resolve("bin/java") - } - } - - private fun findDefaultDistribution(distributions: List): JdkDistribution? { - return distributions.find { - it.javaVersion.startsWith(IJdkDistributionProvider.DEFAULT_JAVA_VERSION) - } - } - - private fun isValidJavaHome(javaHome: File): Boolean { - val javaExec = javaHome.resolve("bin/java") - return javaHome.exists() && javaExec.exists() && javaExec.isFile && javaExec.canExecute() - } -} \ No newline at end of file + private fun isValidJavaHome(javaHome: File): Boolean { + val javaExec = javaHome.resolve("bin/java") + return javaHome.exists() && javaExec.exists() && javaExec.isFile && javaExec.canExecute() + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/ViolationHandler.kt b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/ViolationHandler.kt index e03628639b..5df65e11b4 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/ViolationHandler.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/app/strictmode/ViolationHandler.kt @@ -9,40 +9,40 @@ import org.slf4j.LoggerFactory * @author Akash Yadav */ object ViolationHandler { - private val logger = LoggerFactory.getLogger(ViolationHandler::class.java) + private val logger = LoggerFactory.getLogger(ViolationHandler::class.java) - private const val ALLOW_VIOLATION_MESSAGE = "StrictMode violation '{}' allowed because: {}" - private const val WARN_VIOLATION_MESSAGE = "StrictMode violation detected" + private const val ALLOW_VIOLATION_MESSAGE = "StrictMode violation '{}' allowed because: {}" + private const val WARN_VIOLATION_MESSAGE = "StrictMode violation detected" - /** - * Allow the violation. - * - * @param violation The violation that was detected. - */ - fun allow( - violation: ViolationDispatcher.Violation, - reason: String, - ) { - logger.info(ALLOW_VIOLATION_MESSAGE, violation.violation.javaClass.simpleName, reason) - } + /** + * Allow the violation. + * + * @param violation The violation that was detected. + */ + fun allow( + violation: ViolationDispatcher.Violation, + reason: String, + ) { + logger.info(ALLOW_VIOLATION_MESSAGE, violation.violation.javaClass.simpleName, reason) + } - /** - * Log the violation. - * - * @param violation The violation that was detected. - */ - fun log(violation: ViolationDispatcher.Violation) { - logger.warn(WARN_VIOLATION_MESSAGE, violation.violation) - } + /** + * Log the violation. + * + * @param violation The violation that was detected. + */ + fun log(violation: ViolationDispatcher.Violation) { + logger.warn(WARN_VIOLATION_MESSAGE, violation.violation) + } - /** - * Crash the app (throw an exception on the main thread). - * - * @param violation The violation that was detected. - */ - fun crash(violation: ViolationDispatcher.Violation) { - runOnUiThread { - throw RuntimeException(WARN_VIOLATION_MESSAGE, violation.violation) - } - } -} \ No newline at end of file + /** + * Crash the app (throw an exception on the main thread). + * + * @param violation The violation that was detected. + */ + fun crash(violation: ViolationDispatcher.Violation) { + runOnUiThread { + throw RuntimeException(WARN_VIOLATION_MESSAGE, violation.violation) + } + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/assets/AssetsInstallationHelper.kt b/app/src/main/java/org/appdevforall/codeonthego/assets/AssetsInstallationHelper.kt index bd70b69f36..d2f171c9a7 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/assets/AssetsInstallationHelper.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/assets/AssetsInstallationHelper.kt @@ -4,12 +4,7 @@ import android.content.Context import android.os.StatFs import androidx.annotation.WorkerThread import com.aayushatharva.brotli4j.Brotli4jLoader -import org.appdevforall.codeonthego.app.configuration.IDEBuildConfigProvider import com.itsaky.androidide.resources.R -import org.appdevforall.codeonthego.utils.ContainedPathResolver -import org.appdevforall.codeonthego.utils.ContainedPathResolver.Resolution -import org.appdevforall.codeonthego.utils.Environment.DEFAULT_ROOT -import org.appdevforall.codeonthego.utils.useEntriesEach import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.NonCancellable import kotlinx.coroutines.async @@ -25,6 +20,11 @@ import org.adfa.constants.GRADLE_API_NAME_JAR_ZIP import org.adfa.constants.GRADLE_DISTRIBUTION_ARCHIVE_NAME import org.adfa.constants.LOCAL_MAVEN_REPO_ARCHIVE_ZIP_NAME import org.adfa.constants.TEMPLATE_CORE_ARCHIVE +import org.appdevforall.codeonthego.app.configuration.IDEBuildConfigProvider +import org.appdevforall.codeonthego.utils.ContainedPathResolver +import org.appdevforall.codeonthego.utils.ContainedPathResolver.Resolution +import org.appdevforall.codeonthego.utils.Environment.DEFAULT_ROOT +import org.appdevforall.codeonthego.utils.useEntriesEach import org.slf4j.LoggerFactory import java.io.File import java.io.FileNotFoundException diff --git a/app/src/main/java/org/appdevforall/codeonthego/assets/BaseAssetsInstaller.kt b/app/src/main/java/org/appdevforall/codeonthego/assets/BaseAssetsInstaller.kt index 9d0e3460c8..b9dddd6ce9 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/assets/BaseAssetsInstaller.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/assets/BaseAssetsInstaller.kt @@ -1,9 +1,9 @@ package org.appdevforall.codeonthego.assets import android.content.Context +import com.termux.shared.termux.TermuxConstants import org.appdevforall.codeonthego.utils.Environment import org.appdevforall.codeonthego.utils.FeatureFlags -import com.termux.shared.termux.TermuxConstants import org.slf4j.LoggerFactory import java.io.File import java.nio.file.Path @@ -22,13 +22,13 @@ abstract class BaseAssetsInstaller : AssetsInstaller { "aapt", "aapt2", "aidl", - "apksigner", - "d8", + "apksigner", + "d8", "dexdump", "split-select", "zipalign", )) { Environment.setExecutable(Environment.BUILD_TOOLS_DIR.resolve(bin)) } - } + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/assets/BundledAssetsInstaller.kt b/app/src/main/java/org/appdevforall/codeonthego/assets/BundledAssetsInstaller.kt index 741c4e1fec..4893b7c9ba 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/assets/BundledAssetsInstaller.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/assets/BundledAssetsInstaller.kt @@ -3,15 +3,7 @@ package org.appdevforall.codeonthego.assets import android.content.Context import androidx.annotation.WorkerThread import com.aayushatharva.brotli4j.decoder.BrotliInputStream -import org.appdevforall.codeonthego.app.configuration.CpuArch -import org.appdevforall.codeonthego.managers.ToolsManager import com.itsaky.androidide.resources.R -import org.appdevforall.codeonthego.utils.Environment -import org.appdevforall.codeonthego.utils.TerminalInstaller -import org.appdevforall.codeonthego.utils.retryOnceOnNoSuchFile -import org.appdevforall.codeonthego.utils.throwIfNotSuccess -import org.appdevforall.codeonthego.utils.withTempZipChannel -import org.appdevforall.codeonthego.utils.writeBrotliAssetToPath import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.adfa.constants.ANDROID_SDK_ZIP @@ -24,6 +16,14 @@ import org.adfa.constants.LOCAL_MAVEN_REPO_ARCHIVE_ZIP_NAME import org.adfa.constants.PLUGIN_MAVEN_REPO_ZIP_BR import org.adfa.constants.TEMPLATE_CORE_ARCHIVE import org.adfa.constants.TEMPLATE_CORE_ARCHIVE_BR +import org.appdevforall.codeonthego.app.configuration.CpuArch +import org.appdevforall.codeonthego.managers.ToolsManager +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.TerminalInstaller +import org.appdevforall.codeonthego.utils.retryOnceOnNoSuchFile +import org.appdevforall.codeonthego.utils.throwIfNotSuccess +import org.appdevforall.codeonthego.utils.withTempZipChannel +import org.appdevforall.codeonthego.utils.writeBrotliAssetToPath import org.slf4j.LoggerFactory import java.io.File import java.io.FileNotFoundException diff --git a/app/src/main/java/org/appdevforall/codeonthego/assets/SplitAssetsInstaller.kt b/app/src/main/java/org/appdevforall/codeonthego/assets/SplitAssetsInstaller.kt index badd510b16..7b4e950991 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/assets/SplitAssetsInstaller.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/assets/SplitAssetsInstaller.kt @@ -2,13 +2,7 @@ package org.appdevforall.codeonthego.assets import android.content.Context import androidx.annotation.WorkerThread -import org.appdevforall.codeonthego.app.configuration.CpuArch import com.itsaky.androidide.resources.R -import org.appdevforall.codeonthego.utils.Environment -import org.appdevforall.codeonthego.utils.TerminalInstaller -import org.appdevforall.codeonthego.utils.retryOnceOnNoSuchFile -import org.appdevforall.codeonthego.utils.throwIfNotSuccess -import org.appdevforall.codeonthego.utils.withTempZipChannel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.adfa.constants.ANDROID_SDK_ZIP @@ -18,6 +12,12 @@ import org.adfa.constants.GRADLE_DISTRIBUTION_ARCHIVE_NAME import org.adfa.constants.LOCAL_MAVEN_REPO_ARCHIVE_ZIP_NAME import org.adfa.constants.PLUGIN_MAVEN_REPO_ZIP_NAME import org.adfa.constants.TEMPLATE_CORE_ARCHIVE +import org.appdevforall.codeonthego.app.configuration.CpuArch +import org.appdevforall.codeonthego.utils.Environment +import org.appdevforall.codeonthego.utils.TerminalInstaller +import org.appdevforall.codeonthego.utils.retryOnceOnNoSuchFile +import org.appdevforall.codeonthego.utils.throwIfNotSuccess +import org.appdevforall.codeonthego.utils.withTempZipChannel import org.slf4j.LoggerFactory import java.io.File import java.io.FileNotFoundException diff --git a/app/src/main/java/org/appdevforall/codeonthego/di/AppModule.kt b/app/src/main/java/org/appdevforall/codeonthego/di/AppModule.kt index e94eb40398..7ea15a3d95 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/di/AppModule.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/di/AppModule.kt @@ -1,5 +1,8 @@ package org.appdevforall.codeonthego.di +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.SupervisorJob import org.appdevforall.codeonthego.actions.FileActionManager import org.appdevforall.codeonthego.analytics.AnalyticsManager import org.appdevforall.codeonthego.analytics.IAnalyticsManager @@ -14,9 +17,6 @@ import org.appdevforall.codeonthego.viewmodel.CloneRepositoryViewModel import org.appdevforall.codeonthego.viewmodel.GitBottomSheetViewModel import org.appdevforall.codeonthego.viewmodel.MainViewModel import org.appdevforall.codeonthego.viewmodel.OutlineViewModel -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.SupervisorJob import org.koin.android.ext.koin.androidApplication import org.koin.android.ext.koin.androidContext import org.koin.core.module.dsl.viewModel diff --git a/app/src/main/java/org/appdevforall/codeonthego/di/QuickBuildModule.kt b/app/src/main/java/org/appdevforall/codeonthego/di/QuickBuildModule.kt index eda890d54e..a00a5ba52b 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/di/QuickBuildModule.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/di/QuickBuildModule.kt @@ -4,6 +4,11 @@ import android.os.Build import android.os.SystemClock import androidx.lifecycle.Lifecycle import androidx.lifecycle.ProcessLifecycleOwner +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.SupervisorJob +import kotlinx.coroutines.asCoroutineDispatcher +import kotlinx.coroutines.withContext import org.appdevforall.codeonthego.analytics.quickbuild.AnalyticsQuickBuildMetricsSink import org.appdevforall.codeonthego.projects.IProjectManager import org.appdevforall.codeonthego.projects.ProjectManagerImpl @@ -20,11 +25,6 @@ import org.appdevforall.codeonthego.quickbuild.QuickBuildBenchHooks import org.appdevforall.codeonthego.quickbuild.QuickBuildOutputMetricsSink import org.appdevforall.codeonthego.quickbuild.QuickBuildOutputNarrator import org.appdevforall.codeonthego.utils.ApkInstaller -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.SupervisorJob -import kotlinx.coroutines.asCoroutineDispatcher -import kotlinx.coroutines.withContext import org.appdevforall.cotg.quickbuild.data.DaemonProcessClient import org.appdevforall.cotg.quickbuild.data.QuickBuildDaemon import org.appdevforall.cotg.quickbuild.domain.telemetry.QuickBuildMetricsSink diff --git a/app/src/main/java/org/appdevforall/codeonthego/dnd/DragEventRouter.kt b/app/src/main/java/org/appdevforall/codeonthego/dnd/DragEventRouter.kt index 2ec958dfa9..276a49265c 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/dnd/DragEventRouter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/dnd/DragEventRouter.kt @@ -8,46 +8,51 @@ import android.view.View * into a clean [DropTargetCallback]. */ class DragEventRouter( - private val callback: DropTargetCallback + private val callback: DropTargetCallback, ) : View.OnDragListener { - override fun onDrag(view: View, event: DragEvent): Boolean { - val canHandle = callback.canAcceptDrop(event) - - return when (event.action) { - DragEvent.ACTION_DRAG_STARTED -> { - if (canHandle) callback.onDragStarted(view) - canHandle - } - - DragEvent.ACTION_DRAG_ENTERED -> { - if (canHandle) callback.onDragEntered(view) - true - } - - DragEvent.ACTION_DRAG_LOCATION -> { - canHandle - } - - DragEvent.ACTION_DRAG_EXITED -> { - callback.onDragExited(view) - true - } - - DragEvent.ACTION_DROP -> { - callback.onDragExited(view) - if (canHandle) { - callback.onDrop(event) - } else { - false - } - } - - DragEvent.ACTION_DRAG_ENDED -> { - callback.onDragExited(view) - canHandle - } - - else -> false - } - } + override fun onDrag( + view: View, + event: DragEvent, + ): Boolean { + val canHandle = callback.canAcceptDrop(event) + + return when (event.action) { + DragEvent.ACTION_DRAG_STARTED -> { + if (canHandle) callback.onDragStarted(view) + canHandle + } + + DragEvent.ACTION_DRAG_ENTERED -> { + if (canHandle) callback.onDragEntered(view) + true + } + + DragEvent.ACTION_DRAG_LOCATION -> { + canHandle + } + + DragEvent.ACTION_DRAG_EXITED -> { + callback.onDragExited(view) + true + } + + DragEvent.ACTION_DROP -> { + callback.onDragExited(view) + if (canHandle) { + callback.onDrop(event) + } else { + false + } + } + + DragEvent.ACTION_DRAG_ENDED -> { + callback.onDragExited(view) + canHandle + } + + else -> { + false + } + } + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/dnd/DropTargetCallback.kt b/app/src/main/java/org/appdevforall/codeonthego/dnd/DropTargetCallback.kt index e0eaa5abef..f5a73e9ce6 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/dnd/DropTargetCallback.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/dnd/DropTargetCallback.kt @@ -7,29 +7,29 @@ import android.view.View * Callback interface for handling routed drag-and-drop events on a specific target view. */ interface DropTargetCallback { - /** - * Determines whether the current [event] contains data that this target can handle. - */ - fun canAcceptDrop(event: DragEvent): Boolean + /** + * Determines whether the current [event] contains data that this target can handle. + */ + fun canAcceptDrop(event: DragEvent): Boolean - /** - * Called when a drag operation begins. Useful for applying initial visual cues. - */ - fun onDragStarted(view: View) {} + /** + * Called when a drag operation begins. Useful for applying initial visual cues. + */ + fun onDragStarted(view: View) {} - /** - * Called when a valid dragged item enters the bounds of the target [view]. - */ - fun onDragEntered(view: View) + /** + * Called when a valid dragged item enters the bounds of the target [view]. + */ + fun onDragEntered(view: View) - /** - * Called when a dragged item exits the target [view], or when the drag operation ends/is canceled. - */ - fun onDragExited(view: View) + /** + * Called when a dragged item exits the target [view], or when the drag operation ends/is canceled. + */ + fun onDragExited(view: View) - /** - * Called when the user successfully drops a valid item on the target. - * @return True if the drop was successfully consumed and handled. - */ - fun onDrop(event: DragEvent): Boolean + /** + * Called when the user successfully drops a valid item on the target. + * @return True if the drop was successfully consumed and handled. + */ + fun onDrop(event: DragEvent): Boolean } diff --git a/app/src/main/java/org/appdevforall/codeonthego/dnd/GitUrlDropExtensions.kt b/app/src/main/java/org/appdevforall/codeonthego/dnd/GitUrlDropExtensions.kt index 5010d02ae2..08dacf52ed 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/dnd/GitUrlDropExtensions.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/dnd/GitUrlDropExtensions.kt @@ -5,24 +5,26 @@ import androidx.fragment.app.Fragment import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.LifecycleOwner - fun Fragment.handleGitUrlDrop( - targetView: View = requireView(), - shouldAcceptDrop: () -> Boolean = { isVisible }, - onDropped: (String) -> Unit + targetView: View = requireView(), + shouldAcceptDrop: () -> Boolean = { isVisible }, + onDropped: (String) -> Unit, ) { - val dropTarget = GitUrlDropTarget( - context = requireContext(), - rootView = targetView, - shouldAcceptDrop = shouldAcceptDrop, - onRepositoryDropped = onDropped - ) + val dropTarget = + GitUrlDropTarget( + context = requireContext(), + rootView = targetView, + shouldAcceptDrop = shouldAcceptDrop, + onRepositoryDropped = onDropped, + ) - dropTarget.attach() + dropTarget.attach() - viewLifecycleOwner.lifecycle.addObserver(object : DefaultLifecycleObserver { - override fun onDestroy(owner: LifecycleOwner) { - dropTarget.detach() - } - }) + viewLifecycleOwner.lifecycle.addObserver( + object : DefaultLifecycleObserver { + override fun onDestroy(owner: LifecycleOwner) { + dropTarget.detach() + } + }, + ) } diff --git a/app/src/main/java/org/appdevforall/codeonthego/dnd/GitUrlDropTarget.kt b/app/src/main/java/org/appdevforall/codeonthego/dnd/GitUrlDropTarget.kt index 78a1b978bf..9b0b677c03 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/dnd/GitUrlDropTarget.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/dnd/GitUrlDropTarget.kt @@ -10,98 +10,99 @@ import org.appdevforall.codeonthego.git.core.parseGitRepositoryUrl import org.appdevforall.codeonthego.utils.DropHighlighter internal class GitUrlDropTarget( - private val context: Context, - private val rootView: View, - private val shouldAcceptDrop: () -> Boolean = { true }, - private val onRepositoryDropped: (String) -> Unit, + private val context: Context, + private val rootView: View, + private val shouldAcceptDrop: () -> Boolean = { true }, + private val onRepositoryDropped: (String) -> Unit, ) { - - fun attach() { - ViewCompat.setOnReceiveContentListener( - rootView, - supportedDropMimeTypes, - ) { _, payload -> tryConsumeRepositoryPayload(payload) } - - bindRepositoryDropTarget(rootView) - } - - fun detach() { - ViewCompat.setOnReceiveContentListener(rootView, null, null) - rootView.setOnDragListener(null) - } - - /** - * Attempts to consume a dropped repository URL from the given [payload]. - * Returns `null` on success to indicate consumption, or the original [payload] otherwise. - */ - private fun tryConsumeRepositoryPayload(payload: ContentInfoCompat): ContentInfoCompat? { - if (!shouldAcceptDrop()) { - return payload - } - - val repositoryUrl = extractRepositoryUrl(payload) ?: return payload - - onRepositoryDropped(repositoryUrl) - return null - } - - private fun bindRepositoryDropTarget(view: View) { - val dropCallback = object : DropTargetCallback { - override fun canAcceptDrop(event: DragEvent): Boolean { - return shouldAcceptDrop() && event.clipDescription.isSupportedDropPayload() - } - - override fun onDragStarted(view: View) { - DropHighlighter.highlight(view, context) - } - - override fun onDragEntered(view: View) { - DropHighlighter.highlight(view, context) - } - - override fun onDragExited(view: View) { - DropHighlighter.clear(view) - } - - override fun onDrop(event: DragEvent): Boolean { - val contentInfo = ContentInfoCompat.Builder( - event.clipData, - ContentInfoCompat.SOURCE_DRAG_AND_DROP, - ).build() - - return ViewCompat.performReceiveContent(view, contentInfo) == null - } - } - - view.setOnDragListener(DragEventRouter(dropCallback)) - } - - private fun extractRepositoryUrl(payload: ContentInfoCompat): String? { - val clip = payload.clip - for (index in 0 until clip.itemCount) { - val item = clip.getItemAt(index) - val text = item.uri?.toString() ?: item.coerceToText(context)?.toString() - - if (text.isNullOrBlank()) continue - - parseGitRepositoryUrl(text)?.let { return it } - } - - return null - } - - private fun ClipDescription?.isSupportedDropPayload(): Boolean { - if (this == null) { - return false - } - - return supportedDropMimeTypes.any(::hasMimeType) - } - - private companion object { - val supportedDropMimeTypes = arrayOf( - ClipDescription.MIMETYPE_TEXT_PLAIN, - ClipDescription.MIMETYPE_TEXT_URILIST, - ) - } + fun attach() { + ViewCompat.setOnReceiveContentListener( + rootView, + supportedDropMimeTypes, + ) { _, payload -> tryConsumeRepositoryPayload(payload) } + + bindRepositoryDropTarget(rootView) + } + + fun detach() { + ViewCompat.setOnReceiveContentListener(rootView, null, null) + rootView.setOnDragListener(null) + } + + /** + * Attempts to consume a dropped repository URL from the given [payload]. + * Returns `null` on success to indicate consumption, or the original [payload] otherwise. + */ + private fun tryConsumeRepositoryPayload(payload: ContentInfoCompat): ContentInfoCompat? { + if (!shouldAcceptDrop()) { + return payload + } + + val repositoryUrl = extractRepositoryUrl(payload) ?: return payload + + onRepositoryDropped(repositoryUrl) + return null + } + + private fun bindRepositoryDropTarget(view: View) { + val dropCallback = + object : DropTargetCallback { + override fun canAcceptDrop(event: DragEvent): Boolean = shouldAcceptDrop() && event.clipDescription.isSupportedDropPayload() + + override fun onDragStarted(view: View) { + DropHighlighter.highlight(view, context) + } + + override fun onDragEntered(view: View) { + DropHighlighter.highlight(view, context) + } + + override fun onDragExited(view: View) { + DropHighlighter.clear(view) + } + + override fun onDrop(event: DragEvent): Boolean { + val contentInfo = + ContentInfoCompat + .Builder( + event.clipData, + ContentInfoCompat.SOURCE_DRAG_AND_DROP, + ).build() + + return ViewCompat.performReceiveContent(view, contentInfo) == null + } + } + + view.setOnDragListener(DragEventRouter(dropCallback)) + } + + private fun extractRepositoryUrl(payload: ContentInfoCompat): String? { + val clip = payload.clip + for (index in 0 until clip.itemCount) { + val item = clip.getItemAt(index) + val text = item.uri?.toString() ?: item.coerceToText(context)?.toString() + + if (text.isNullOrBlank()) continue + + parseGitRepositoryUrl(text)?.let { return it } + } + + return null + } + + private fun ClipDescription?.isSupportedDropPayload(): Boolean { + if (this == null) { + return false + } + + return supportedDropMimeTypes.any(::hasMimeType) + } + + private companion object { + val supportedDropMimeTypes = + arrayOf( + ClipDescription.MIMETYPE_TEXT_PLAIN, + ClipDescription.MIMETYPE_TEXT_URILIST, + ) + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/editor/floating/EditorPanelDockableContent.kt b/app/src/main/java/org/appdevforall/codeonthego/editor/floating/EditorPanelDockableContent.kt index d63dbd8c7e..3b1ce6157c 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/editor/floating/EditorPanelDockableContent.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/editor/floating/EditorPanelDockableContent.kt @@ -5,6 +5,10 @@ import android.content.Intent import android.view.View import android.widget.Toast import com.itsaky.androidide.R +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.withContext import org.appdevforall.codeonthego.api.ActionContextProvider import org.appdevforall.codeonthego.api.IDEApiFacade import org.appdevforall.codeonthego.floating.model.ChromeControl @@ -20,10 +24,6 @@ import org.appdevforall.codeonthego.models.Range import org.appdevforall.codeonthego.projects.builder.BuildService import org.appdevforall.codeonthego.ui.CodeEditorView import org.appdevforall.codeonthego.utils.requestBuildCancellation -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.flow.MutableStateFlow -import kotlinx.coroutines.flow.StateFlow -import kotlinx.coroutines.withContext import java.io.File import com.itsaky.androidide.resources.R as ResR diff --git a/app/src/main/java/org/appdevforall/codeonthego/editor/floating/IdeFloatingTabController.kt b/app/src/main/java/org/appdevforall/codeonthego/editor/floating/IdeFloatingTabController.kt index 3bc13b66f3..c5d8cb104f 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/editor/floating/IdeFloatingTabController.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/editor/floating/IdeFloatingTabController.kt @@ -5,16 +5,16 @@ import android.content.Intent import android.widget.Toast import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope +import com.itsaky.androidide.resources.R +import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.launch import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity import org.appdevforall.codeonthego.floating.model.DockingEvent import org.appdevforall.codeonthego.floating.model.DockingManager import org.appdevforall.codeonthego.floating.permission.OverlayPermission import org.appdevforall.codeonthego.floating.service.FloatingTabService import org.appdevforall.codeonthego.floating.window.InitialBounds -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.ui.MetricsCarouselController -import kotlinx.coroutines.CancellationException -import kotlinx.coroutines.launch import org.slf4j.LoggerFactory /** diff --git a/app/src/main/java/org/appdevforall/codeonthego/editor/floating/MetricsCarouselDockableContent.kt b/app/src/main/java/org/appdevforall/codeonthego/editor/floating/MetricsCarouselDockableContent.kt index 23675a8e52..c9e2950bb7 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/editor/floating/MetricsCarouselDockableContent.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/editor/floating/MetricsCarouselDockableContent.kt @@ -24,10 +24,10 @@ import android.view.ViewGroup import android.view.inputmethod.InputMethodManager import androidx.core.view.updateLayoutParams import com.itsaky.androidide.databinding.LayoutMemUsageBinding +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.floating.model.ChromeControl import org.appdevforall.codeonthego.floating.model.DockableContent import org.appdevforall.codeonthego.floating.window.FloatingWindowHost -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.ui.MetricsCarouselController /** diff --git a/app/src/main/java/org/appdevforall/codeonthego/events/FileTree.kt b/app/src/main/java/org/appdevforall/codeonthego/events/FileTree.kt index b740200b39..b003306c27 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/events/FileTree.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/events/FileTree.kt @@ -17,14 +17,25 @@ package org.appdevforall.codeonthego.events +import com.unnamed.b.atv.model.TreeNode import org.appdevforall.codeonthego.eventbus.events.Event import org.appdevforall.codeonthego.models.SheetOption -import com.unnamed.b.atv.model.TreeNode -internal data class FileContextMenuItemClickEvent(val option: SheetOption) : Event() -internal data class FileContextMenuItemLongClickEvent(val option: SheetOption) : Event() +internal data class FileContextMenuItemClickEvent( + val option: SheetOption, +) : Event() + +internal data class FileContextMenuItemLongClickEvent( + val option: SheetOption, +) : Event() + +data class ExpandTreeNodeRequestEvent( + val node: TreeNode, +) : Event() -data class ExpandTreeNodeRequestEvent(val node: TreeNode) : Event() -data class CollapseTreeNodeRequestEvent(val node: TreeNode, val includeSubnodes: Boolean) : Event() +data class CollapseTreeNodeRequestEvent( + val node: TreeNode, + val includeSubnodes: Boolean, +) : Event() class ListProjectFilesRequestEvent : Event() diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/BasePreferenceFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/BasePreferenceFragment.kt index 0aafd426ae..c57e66cacb 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/BasePreferenceFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/BasePreferenceFragment.kt @@ -22,8 +22,10 @@ import androidx.preference.PreferenceFragmentCompat import com.itsaky.androidide.R.xml abstract class BasePreferenceFragment : PreferenceFragmentCompat() { - - override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - setPreferencesFromResource(xml.ide_prefs, rootKey) - } + override fun onCreatePreferences( + savedInstanceState: Bundle?, + rootKey: String?, + ) { + setPreferencesFromResource(xml.ide_prefs, rootKey) + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/CloneRepositoryFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/CloneRepositoryFragment.kt index e6b34fb93e..6a4fc56717 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/CloneRepositoryFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/CloneRepositoryFragment.kt @@ -6,239 +6,257 @@ import android.view.View import android.view.ViewGroup import android.widget.EditText import androidx.core.widget.doAfterTextChanged -import org.koin.androidx.viewmodel.ext.android.activityViewModel import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import com.google.android.material.button.MaterialButton import com.google.android.material.textfield.TextInputLayout -import org.appdevforall.codeonthego.activities.MainActivity -import com.itsaky.androidide.databinding.FragmentCloneRepositoryBinding -import org.appdevforall.codeonthego.viewmodel.CloneRepositoryViewModel -import org.appdevforall.codeonthego.viewmodel.MainViewModel -import org.appdevforall.codeonthego.git.core.models.CloneRepoUiState import com.itsaky.androidide.R +import com.itsaky.androidide.databinding.FragmentCloneRepositoryBinding +import kotlinx.coroutines.launch +import org.appdevforall.codeonthego.activities.MainActivity import org.appdevforall.codeonthego.dnd.handleGitUrlDrop +import org.appdevforall.codeonthego.git.core.models.CloneRepoUiState import org.appdevforall.codeonthego.idetooltips.TooltipManager import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.utils.flashError import org.appdevforall.codeonthego.utils.flashInfo import org.appdevforall.codeonthego.utils.forEachViewRecursively -import kotlinx.coroutines.launch +import org.appdevforall.codeonthego.viewmodel.CloneRepositoryViewModel +import org.appdevforall.codeonthego.viewmodel.MainViewModel +import org.koin.androidx.viewmodel.ext.android.activityViewModel import org.koin.androidx.viewmodel.ext.android.viewModel import java.io.File class CloneRepositoryFragment : BaseFragment() { + private var binding: FragmentCloneRepositoryBinding? = null + private val viewModel: CloneRepositoryViewModel by viewModel() + private val mainViewModel: MainViewModel by activityViewModel() + private var lastStatusResId: Int? = null + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle?, + ): View? { + binding = FragmentCloneRepositoryBinding.inflate(inflater, container, false) + return binding?.root + } + + override fun onViewCreated( + view: View, + savedInstanceState: Bundle?, + ) { + super.onViewCreated(view, savedInstanceState) + + setupUI() + observePendingCloneUrl() + observeViewModel() + handleGitUrlDrop { url -> + binding?.repoUrl?.setText(url) + viewModel.onInputChanged( + url, + binding + ?.localPath + ?.text + ?.toString() + .orEmpty(), + ) + } + } + + private fun setupUI() { + binding?.apply { + repoUrl.doAfterTextChanged { + viewModel.onInputChanged(it.toString(), localPath.text.toString()) + } + + localPath.apply { + doAfterTextChanged { + viewModel.onInputChanged(repoUrl.text.toString(), it.toString()) + } + } + + localPathLayout.setEndIconOnClickListener { + pickDirectory { file -> + val url = repoUrl.text.toString().trim() + var projectName = url.substringAfterLast("/", "") + if (projectName.endsWith(".git")) { + projectName = projectName.dropLast(4) + } + + val destFile = + if (projectName.isNotBlank()) { + File(file, projectName) + } else { + file + } + + localPath.setText(destFile.absolutePath) + } + } + + authCheckbox.setOnCheckedChangeListener { _, isChecked -> + authGroup.visibility = if (isChecked) View.VISIBLE else View.GONE + } + + cloneButton.setOnClickListener { + cloneRepo() + } + + cancelButton.setOnClickListener { + viewModel.cancelClone() + } + + exitButton.setOnClickListener { + mainViewModel.setScreen(MainViewModel.SCREEN_MAIN) + } + + root.forEachViewRecursively { child -> + if (child is EditText || child is TextInputLayout) { + return@forEachViewRecursively + } + child.setOnLongClickListener { v -> + TooltipManager.showIdeCategoryTooltip( + context = requireContext(), + anchorView = v, + tag = TooltipTag.GIT_DOWNLOAD_SCREEN, + ) + true + } + } + } + } + + private fun FragmentCloneRepositoryBinding.cloneRepo() { + val url = repoUrl.text.toString() + val path = localPath.text.toString() + val mUsername = if (authCheckbox.isChecked) username.text.toString() else null + val mPassword = if (authCheckbox.isChecked) password.text.toString() else null + + viewModel.cloneRepository(url, path, mUsername, mPassword) + } + + private fun observeViewModel() { + viewLifecycleOwner.lifecycleScope.launch { + viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { + viewModel.uiState.collect { state -> + binding?.apply { + val isLoading = state is CloneRepoUiState.Cloning + repoUrl.isEnabled = !isLoading + localPath.isEnabled = !isLoading + username.isEnabled = !isLoading + password.isEnabled = !isLoading + + progressBar.apply { + visibility = if (isLoading) View.VISIBLE else View.GONE + if (state is CloneRepoUiState.Cloning) { + progress = state.clonePercentage + } + } + + progressText.apply { + if (state is CloneRepoUiState.Cloning && state.cloneProgress.isNotEmpty()) { + visibility = View.VISIBLE + text = state.cloneProgress + } else { + visibility = View.GONE + } + } + + cancelButton.visibility = + if (state is CloneRepoUiState.Cloning && state.isCancellable) View.VISIBLE else View.GONE + + when (state) { + is CloneRepoUiState.Idle -> { + cloneButton.apply { + isEnabled = state.isCloneButtonEnabled + refreshStatus(isForRetry = false) + } + lastStatusResId = null + } + + is CloneRepoUiState.Cloning -> { + cloneButton.apply { + isEnabled = false + refreshStatus(isForRetry = false) + } + + if (state.statusTextResId != lastStatusResId) { + lastStatusResId = state.statusTextResId + val message = + state.statusTextResId?.let { getString(it) } + ?: getString(R.string.cloning_repo) + flashInfo(message) + } + } + + is CloneRepoUiState.Error -> { + cloneButton.apply { + isEnabled = true + refreshStatus(isForRetry = state.canRetry) + } + val statusMessage = + state.errorResId?.let { getString(it) } ?: state.errorMessage + flashError(statusMessage) + } + + is CloneRepoUiState.Success -> { + cloneButton.isEnabled = true + flashInfo(getString(R.string.clone_successful)) + val destDir = File(state.localPath) + if (destDir.exists()) { + mainViewModel.setScreen(MainViewModel.SCREEN_MAIN) + (requireActivity() as? MainActivity)?.openProject(destDir) + + // Reset state after opening project + repoUrl.text?.clear() + localPath.text?.clear() + username.text?.clear() + password.text?.clear() + authCheckbox.isChecked = false + viewModel.resetState() + } + } + } + } + } + } + } + } + + private fun observePendingCloneUrl() { + viewLifecycleOwner.lifecycleScope.launch { + viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { + mainViewModel.cloneRepositoryEvent.collect { url -> + val trimmedUrl = url.trim() + if (trimmedUrl.isNotBlank()) { + binding?.repoUrl?.setText(trimmedUrl) + viewModel.onInputChanged( + trimmedUrl, + binding + ?.localPath + ?.text + ?.toString() + .orEmpty(), + ) + } + } + } + } + } + + private fun MaterialButton.refreshStatus(isForRetry: Boolean) { + setIconResource(if (isForRetry) R.drawable.ic_refresh else 0) + + text = + context.getString( + if (isForRetry) R.string.retry else R.string.clone_project, + ) + } - private var binding: FragmentCloneRepositoryBinding? = null - private val viewModel: CloneRepositoryViewModel by viewModel() - private val mainViewModel: MainViewModel by activityViewModel() - private var lastStatusResId: Int? = null - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View? { - binding = FragmentCloneRepositoryBinding.inflate(inflater, container, false) - return binding?.root - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - - setupUI() - observePendingCloneUrl() - observeViewModel() - handleGitUrlDrop { url -> - binding?.repoUrl?.setText(url) - viewModel.onInputChanged(url, binding?.localPath?.text?.toString().orEmpty()) - } - } - - private fun setupUI() { - binding?.apply { - - repoUrl.doAfterTextChanged { - viewModel.onInputChanged(it.toString(), localPath.text.toString()) - } - - localPath.apply { - doAfterTextChanged { - viewModel.onInputChanged(repoUrl.text.toString(), it.toString()) - } - } - - localPathLayout.setEndIconOnClickListener { - pickDirectory { file -> - val url = repoUrl.text.toString().trim() - var projectName = url.substringAfterLast("/", "") - if (projectName.endsWith(".git")) { - projectName = projectName.dropLast(4) - } - - val destFile = if (projectName.isNotBlank()) { - File(file, projectName) - } else { - file - } - - localPath.setText(destFile.absolutePath) - } - } - - authCheckbox.setOnCheckedChangeListener { _, isChecked -> - authGroup.visibility = if (isChecked) View.VISIBLE else View.GONE - } - - cloneButton.setOnClickListener { - cloneRepo() - } - - cancelButton.setOnClickListener { - viewModel.cancelClone() - } - - exitButton.setOnClickListener { - mainViewModel.setScreen(MainViewModel.SCREEN_MAIN) - } - - root.forEachViewRecursively { child -> - if (child is EditText || child is TextInputLayout) { - return@forEachViewRecursively - } - child.setOnLongClickListener { v -> - TooltipManager.showIdeCategoryTooltip( - context = requireContext(), - anchorView = v, - tag = TooltipTag.GIT_DOWNLOAD_SCREEN - ) - true - } - } - } - } - - private fun FragmentCloneRepositoryBinding.cloneRepo() { - val url = repoUrl.text.toString() - val path = localPath.text.toString() - val mUsername = if (authCheckbox.isChecked) username.text.toString() else null - val mPassword = if (authCheckbox.isChecked) password.text.toString() else null - - viewModel.cloneRepository(url, path, mUsername, mPassword) - } - - private fun observeViewModel() { - viewLifecycleOwner.lifecycleScope.launch { - viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { - viewModel.uiState.collect { state -> - binding?.apply { - val isLoading = state is CloneRepoUiState.Cloning - repoUrl.isEnabled = !isLoading - localPath.isEnabled = !isLoading - username.isEnabled = !isLoading - password.isEnabled = !isLoading - - progressBar.apply { - visibility = if (isLoading) View.VISIBLE else View.GONE - if (state is CloneRepoUiState.Cloning) { - progress = state.clonePercentage - } - } - - progressText.apply { - if (state is CloneRepoUiState.Cloning && state.cloneProgress.isNotEmpty()) { - visibility = View.VISIBLE - text = state.cloneProgress - } else { - visibility = View.GONE - } - } - - cancelButton.visibility = - if (state is CloneRepoUiState.Cloning && state.isCancellable) View.VISIBLE else View.GONE - - when (state) { - is CloneRepoUiState.Idle -> { - cloneButton.apply { - isEnabled = state.isCloneButtonEnabled - refreshStatus(isForRetry = false) - } - lastStatusResId = null - } - - is CloneRepoUiState.Cloning -> { - cloneButton.apply { - isEnabled = false - refreshStatus(isForRetry = false) - } - - if (state.statusTextResId != lastStatusResId) { - lastStatusResId = state.statusTextResId - val message = state.statusTextResId?.let { getString(it) } - ?: getString(R.string.cloning_repo) - flashInfo(message) - } - } - - is CloneRepoUiState.Error -> { - cloneButton.apply { - isEnabled = true - refreshStatus(isForRetry = state.canRetry) - } - val statusMessage = - state.errorResId?.let { getString(it) } ?: state.errorMessage - flashError(statusMessage) - } - - is CloneRepoUiState.Success -> { - cloneButton.isEnabled = true - flashInfo(getString(R.string.clone_successful)) - val destDir = File(state.localPath) - if (destDir.exists()) { - mainViewModel.setScreen(MainViewModel.SCREEN_MAIN) - (requireActivity() as? MainActivity)?.openProject(destDir) - - // Reset state after opening project - repoUrl.text?.clear() - localPath.text?.clear() - username.text?.clear() - password.text?.clear() - authCheckbox.isChecked = false - viewModel.resetState() - } - } - } - } - } - } - } - } - - private fun observePendingCloneUrl() { - viewLifecycleOwner.lifecycleScope.launch { - viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { - mainViewModel.cloneRepositoryEvent.collect { url -> - val trimmedUrl = url.trim() - if (trimmedUrl.isNotBlank()) { - binding?.repoUrl?.setText(trimmedUrl) - viewModel.onInputChanged(trimmedUrl, binding?.localPath?.text?.toString().orEmpty()) - } - } - } - } - } - - private fun MaterialButton.refreshStatus(isForRetry: Boolean) { - setIconResource(if (isForRetry) R.drawable.ic_refresh else 0) - - text = context.getString( - if (isForRetry) R.string.retry else R.string.clone_project - ) - } - - override fun onDestroyView() { - super.onDestroyView() - binding = null - } + override fun onDestroyView() { + super.onDestroyView() + binding = null + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/CrashReportFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/CrashReportFragment.kt index ce749d37c2..eed45c85db 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/CrashReportFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/CrashReportFragment.kt @@ -40,130 +40,130 @@ import org.appdevforall.codeonthego.utils.resolveAttr class CrashReportFragment : Fragment() { - private var _binding: LayoutCrashReportBinding? = null - private val binding get() = _binding!! - - private var closeAppOnClick = true - - companion object { - const val KEY_CLOSE_APP_ON_CLICK = "close_on_app_click" - - @JvmStatic - fun newInstance(): CrashReportFragment { - return newInstance(true) - } - - @JvmStatic - fun newInstance( - closeAppOnClick: Boolean - ): CrashReportFragment { - val frag = CrashReportFragment() - val args = Bundle().apply { - putBoolean(KEY_CLOSE_APP_ON_CLICK, closeAppOnClick) - } - frag.arguments = args - return frag - } - } - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View { - _binding = LayoutCrashReportBinding.inflate(inflater, container, false) - return binding.root - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - val args = requireArguments() - closeAppOnClick = args.getBoolean(KEY_CLOSE_APP_ON_CLICK) - val title = getString(R.string.msg_ide_crashed) - - binding.apply { - crashTitle.text = title - crashSubtitle.apply { - setCrashInfoText() - } - - closeButton.setOnClickListener { - finishActivity() - } - - btnOkay.setOnClickListener { finishActivity() } - - requireActivity().onBackPressedDispatcher.addCallback( - viewLifecycleOwner, - object : OnBackPressedCallback(true) { - override fun handleOnBackPressed() { - finishActivity() - } - } - ) - - } - } - - fun TextView.setCrashInfoText() { - // Get crash message with placeholder - val supportText = context.getString(R.string.contact_support_team) - val fullText = context.getString(R.string.msg_crash_info, supportText) - val linkColor = requireContext().resolveAttr(com.itsaky.androidide.R.attr.colorOnSurface) - val spannable = SpannableString(fullText) - - // Find clickable phrase in text - val start = fullText.indexOf(supportText) - if (start != -1) { - spannable.setSpan( - object : ClickableSpan() { - override fun onClick(widget: View) { - sendEmail(context = context) - - } - - override fun updateDrawState(ds: TextPaint) { - super.updateDrawState(ds) - ds.color = linkColor - ds.isUnderlineText = true - } - }, - start, - start + supportText.length, - Spanned.SPAN_EXCLUSIVE_EXCLUSIVE - ) - } - - text = spannable - movementMethod = LinkMovementMethod.getInstance() - } - - private fun sendEmail(context: Context) { - val email = "feedback@appdevforall.org" - val subject = Uri.encode(context.getString(R.string.crash_email_subject)) - val body = Uri.encode( - context.getString( - R.string.crash_email_body, - BasicBuildInfo.formatVersion() - ) - ) - - val uri = "mailto:$email?subject=$subject&body=$body".toUri() - - val intent = Intent(Intent.ACTION_SENDTO, uri) - context.startActivity(intent) - } - - private fun finishActivity() { - if (closeAppOnClick) { - requireActivity().finishAffinity() - } else { - requireActivity().finish() - } - } - - override fun onDestroyView() { - super.onDestroyView() - _binding = null - } -} \ No newline at end of file + private var _binding: LayoutCrashReportBinding? = null + private val binding get() = _binding!! + + private var closeAppOnClick = true + + companion object { + const val KEY_CLOSE_APP_ON_CLICK = "close_on_app_click" + + @JvmStatic + fun newInstance(): CrashReportFragment { + return newInstance(true) + } + + @JvmStatic + fun newInstance( + closeAppOnClick: Boolean + ): CrashReportFragment { + val frag = CrashReportFragment() + val args = Bundle().apply { + putBoolean(KEY_CLOSE_APP_ON_CLICK, closeAppOnClick) + } + frag.arguments = args + return frag + } + } + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + _binding = LayoutCrashReportBinding.inflate(inflater, container, false) + return binding.root + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + val args = requireArguments() + closeAppOnClick = args.getBoolean(KEY_CLOSE_APP_ON_CLICK) + val title = getString(R.string.msg_ide_crashed) + + binding.apply { + crashTitle.text = title + crashSubtitle.apply { + setCrashInfoText() + } + + closeButton.setOnClickListener { + finishActivity() + } + + btnOkay.setOnClickListener { finishActivity() } + + requireActivity().onBackPressedDispatcher.addCallback( + viewLifecycleOwner, + object : OnBackPressedCallback(true) { + override fun handleOnBackPressed() { + finishActivity() + } + } + ) + + } + } + + fun TextView.setCrashInfoText() { + // Get crash message with placeholder + val supportText = context.getString(R.string.contact_support_team) + val fullText = context.getString(R.string.msg_crash_info, supportText) + val linkColor = requireContext().resolveAttr(com.itsaky.androidide.R.attr.colorOnSurface) + val spannable = SpannableString(fullText) + + // Find clickable phrase in text + val start = fullText.indexOf(supportText) + if (start != -1) { + spannable.setSpan( + object : ClickableSpan() { + override fun onClick(widget: View) { + sendEmail(context = context) + + } + + override fun updateDrawState(ds: TextPaint) { + super.updateDrawState(ds) + ds.color = linkColor + ds.isUnderlineText = true + } + }, + start, + start + supportText.length, + Spanned.SPAN_EXCLUSIVE_EXCLUSIVE + ) + } + + text = spannable + movementMethod = LinkMovementMethod.getInstance() + } + + private fun sendEmail(context: Context) { + val email = "feedback@appdevforall.org" + val subject = Uri.encode(context.getString(R.string.crash_email_subject)) + val body = Uri.encode( + context.getString( + R.string.crash_email_body, + BasicBuildInfo.formatVersion() + ) + ) + + val uri = "mailto:$email?subject=$subject&body=$body".toUri() + + val intent = Intent(Intent.ACTION_SENDTO, uri) + context.startActivity(intent) + } + + private fun finishActivity() { + if (closeAppOnClick) { + requireActivity().finishAffinity() + } else { + requireActivity().finish() + } + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/DeleteProjectFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/DeleteProjectFragment.kt index ccffd4740b..ee9f2dee21 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/DeleteProjectFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/DeleteProjectFragment.kt @@ -10,8 +10,9 @@ import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.LinearLayoutManager import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.itsaky.androidide.R -import org.appdevforall.codeonthego.adapters.DeleteProjectListAdapter import com.itsaky.androidide.databinding.FragmentDeleteProjectBinding +import kotlinx.coroutines.launch +import org.appdevforall.codeonthego.adapters.DeleteProjectListAdapter import org.appdevforall.codeonthego.idetooltips.TooltipManager import org.appdevforall.codeonthego.idetooltips.TooltipTag.DELETE_PROJECT import org.appdevforall.codeonthego.idetooltips.TooltipTag.DELETE_PROJECT_BUTTON @@ -26,7 +27,6 @@ import org.appdevforall.codeonthego.utils.flashError import org.appdevforall.codeonthego.utils.flashSuccess import org.appdevforall.codeonthego.viewmodel.MainViewModel import org.appdevforall.codeonthego.viewmodel.RecentProjectsViewModel -import kotlinx.coroutines.launch import org.koin.androidx.viewmodel.ext.android.activityViewModel class DeleteProjectFragment : BaseFragment() { diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/EmptyStateFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/EmptyStateFragment.kt index 0f8ec03135..15add4fb4d 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/EmptyStateFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/EmptyStateFragment.kt @@ -12,15 +12,15 @@ import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import androidx.viewbinding.ViewBinding import com.itsaky.androidide.databinding.FragmentEmptyStateBinding -import org.appdevforall.codeonthego.editor.ui.IDEEditor -import org.appdevforall.codeonthego.idetooltips.TooltipManager -import org.appdevforall.codeonthego.utils.viewLifecycleScope -import org.appdevforall.codeonthego.viewmodel.EmptyStateFragmentViewModel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch import kotlinx.coroutines.withContext +import org.appdevforall.codeonthego.editor.ui.IDEEditor +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.utils.viewLifecycleScope +import org.appdevforall.codeonthego.viewmodel.EmptyStateFragmentViewModel abstract class EmptyStateFragment : FragmentWithBinding { constructor(layout: Int, bind: (View) -> T) : super(layout, bind) diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/MainFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/MainFragment.kt index a2c5a5efa9..32f6b0ab7e 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/MainFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/MainFragment.kt @@ -7,20 +7,20 @@ import android.view.View import android.view.ViewGroup import androidx.core.view.isVisible import com.itsaky.androidide.R -import org.appdevforall.codeonthego.utils.BasicBuildInfo -import org.appdevforall.codeonthego.activities.editor.HelpActivity -import org.appdevforall.codeonthego.adapters.MainActionsListAdapter +import com.itsaky.androidide.databinding.FragmentMainBinding +import org.adfa.constants.CONTENT_KEY +import org.adfa.constants.CONTENT_TITLE_KEY import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.ActionItem import org.appdevforall.codeonthego.actions.ActionsRegistry import org.appdevforall.codeonthego.actions.internal.DefaultActionsRegistry -import com.itsaky.androidide.databinding.FragmentMainBinding +import org.appdevforall.codeonthego.activities.editor.HelpActivity +import org.appdevforall.codeonthego.adapters.MainActionsListAdapter import org.appdevforall.codeonthego.dnd.handleGitUrlDrop import org.appdevforall.codeonthego.idetooltips.TooltipManager import org.appdevforall.codeonthego.idetooltips.TooltipTag.MAIN_GET_STARTED +import org.appdevforall.codeonthego.utils.BasicBuildInfo import org.appdevforall.codeonthego.viewmodel.MainViewModel -import org.adfa.constants.CONTENT_KEY -import org.adfa.constants.CONTENT_TITLE_KEY import org.koin.androidx.viewmodel.ext.android.activityViewModel class MainFragment : BaseFragment() { @@ -93,9 +93,9 @@ class MainFragment : BaseFragment() { handleGitUrlDrop( shouldAcceptDrop = { isVisible && - viewModel.currentScreen.value == MainViewModel.SCREEN_MAIN + viewModel.currentScreen.value == MainViewModel.SCREEN_MAIN }, - onDropped = viewModel::requestCloneRepository + onDropped = viewModel::requestCloneRepository, ) } @@ -115,11 +115,13 @@ class MainFragment : BaseFragment() { private fun reloadActions() { val actionData = createActionData() - val actions = registry.getActions(ActionItem.Location.MAIN_SCREEN) - .values - .onEach { it.prepare(actionData) } - .filter { it.visible } - .sortedWith(compareBy({ it.order }, { it.id })) + val actions = + registry + .getActions(ActionItem.Location.MAIN_SCREEN) + .values + .onEach { it.prepare(actionData) } + .filter { it.visible } + .sortedWith(compareBy({ it.order }, { it.id })) // Portrait: single list. Landscape: first 3 (Create, Open, Delete) in middle, last 3 (Terminal, Preferences, Docs) on right. val leftActions = if (binding!!.actionsRight != null) actions.take(3) else actions @@ -127,11 +129,10 @@ class MainFragment : BaseFragment() { binding!!.actionsRight?.adapter = MainActionsListAdapter(actions.drop(3), onClick, onLongClick) } - private fun createActionData(): ActionData { - return ActionData.create(requireActivity()).apply { + private fun createActionData(): ActionData = + ActionData.create(requireActivity()).apply { put(MainViewModel::class.java, viewModel) } - } override fun onDestroyView() { super.onDestroyView() diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/RecentProjectsFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/RecentProjectsFragment.kt index 08991b6960..513cc15c86 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/RecentProjectsFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/RecentProjectsFragment.kt @@ -20,9 +20,15 @@ import com.google.android.material.button.MaterialButton import com.google.android.material.chip.Chip import com.google.android.material.textfield.MaterialAutoCompleteTextView import com.itsaky.androidide.R +import com.itsaky.androidide.databinding.FragmentSavedProjectsBinding +import io.sentry.Sentry +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.debounce +import kotlinx.coroutines.joinAll +import kotlinx.coroutines.launch import org.appdevforall.codeonthego.activities.MainActivity import org.appdevforall.codeonthego.adapters.RecentProjectsAdapter -import com.itsaky.androidide.databinding.FragmentSavedProjectsBinding import org.appdevforall.codeonthego.idetooltips.TooltipManager import org.appdevforall.codeonthego.idetooltips.TooltipTag.EXIT_TO_MAIN import org.appdevforall.codeonthego.idetooltips.TooltipTag.PROJECT_NEW @@ -43,12 +49,6 @@ import org.appdevforall.codeonthego.viewmodel.FilterState import org.appdevforall.codeonthego.viewmodel.MainViewModel import org.appdevforall.codeonthego.viewmodel.RecentProjectsViewModel import org.appdevforall.codeonthego.viewmodel.SortCriteria -import io.sentry.Sentry -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.flow.MutableStateFlow -import kotlinx.coroutines.flow.debounce -import kotlinx.coroutines.joinAll -import kotlinx.coroutines.launch import org.koin.androidx.viewmodel.ext.android.activityViewModel import java.io.File diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/RecyclerViewFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/RecyclerViewFragment.kt index 9a102e3fc1..20b81e27ac 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/RecyclerViewFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/RecyclerViewFragment.kt @@ -127,9 +127,9 @@ abstract class RecyclerViewFragment> : */ fun setAdapter(adapter: A) { _binding?.list?.let { list -> list.adapter = adapter } ?: run { unsavedAdapter = adapter } - if (isAdded && view != null) { - checkIsEmpty() - } + if (isAdded && view != null) { + checkIsEmpty() + } } private fun showFragmentTooltip() { @@ -144,8 +144,8 @@ abstract class RecyclerViewFragment> : } private fun checkIsEmpty() { - if (!isAdded || isDetached) return - isEmpty = _binding?.list?.adapter?.itemCount == 0 + if (!isAdded || isDetached) return + isEmpty = _binding?.list?.adapter?.itemCount == 0 } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/RunTasksDialogFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/RunTasksDialogFragment.kt index 3c2686b6b8..7e0759c3e1 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/RunTasksDialogFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/RunTasksDialogFragment.kt @@ -39,10 +39,11 @@ import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.google.android.material.transition.MaterialSharedAxis import com.itsaky.androidide.R.string -import org.appdevforall.codeonthego.activities.editor.HelpActivity -import org.appdevforall.codeonthego.adapters.RunTasksListAdapter import com.itsaky.androidide.databinding.LayoutRunTaskBinding import com.itsaky.androidide.databinding.LayoutRunTaskDialogBinding +import com.itsaky.androidide.resources.R +import org.appdevforall.codeonthego.activities.editor.HelpActivity +import org.appdevforall.codeonthego.adapters.RunTasksListAdapter import org.appdevforall.codeonthego.idetooltips.TooltipManager import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.lookup.Lookup @@ -50,7 +51,6 @@ import org.appdevforall.codeonthego.models.Checkable import org.appdevforall.codeonthego.project.GradleModels import org.appdevforall.codeonthego.projects.IProjectManager import org.appdevforall.codeonthego.projects.builder.BuildService -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.tasks.executeAsync import org.appdevforall.codeonthego.tasks.mainThreadHandler import org.appdevforall.codeonthego.utils.SingleTextWatcher diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/SearchFieldToolbar.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/SearchFieldToolbar.kt index 5be1c49763..447c4071b3 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/SearchFieldToolbar.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/SearchFieldToolbar.kt @@ -11,6 +11,13 @@ import android.widget.EditText import android.widget.LinearLayout import android.widget.PopupWindow import androidx.core.graphics.drawable.toDrawable +import com.itsaky.androidide.common.R +import com.itsaky.androidide.editor.databinding.LayoutPopupMenuItemBinding +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.SupervisorJob +import kotlinx.coroutines.cancel +import kotlinx.coroutines.launch import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.ActionItem import org.appdevforall.codeonthego.actions.ActionsRegistry @@ -23,15 +30,8 @@ import org.appdevforall.codeonthego.actions.editor.PasteAction import org.appdevforall.codeonthego.actions.editor.SelectAllAction import org.appdevforall.codeonthego.actions.file.ShowTooltipAction import org.appdevforall.codeonthego.actions.internal.DefaultActionsRegistry -import com.itsaky.androidide.common.R -import com.itsaky.androidide.editor.databinding.LayoutPopupMenuItemBinding import org.appdevforall.codeonthego.utils.dpToPx import org.appdevforall.codeonthego.utils.resolveAttr -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.SupervisorJob -import kotlinx.coroutines.cancel -import kotlinx.coroutines.launch class SearchFieldToolbar( private val anchor: EditText, diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/SearchResultFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/SearchResultFragment.kt index 0ab2f2981c..dc42612019 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/SearchResultFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/SearchResultFragment.kt @@ -28,17 +28,17 @@ import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import androidx.recyclerview.widget.RecyclerView +import com.itsaky.androidide.databinding.FragmentSearchResultsReplaceBarBinding +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.flow.combine +import kotlinx.coroutines.launch import org.appdevforall.codeonthego.activities.editor.BaseEditorActivity import org.appdevforall.codeonthego.adapters.SearchListAdapter -import com.itsaky.androidide.databinding.FragmentSearchResultsReplaceBarBinding import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.models.SearchResult import org.appdevforall.codeonthego.search.replace.ReplaceHost import org.appdevforall.codeonthego.search.replace.ReplaceSession import org.appdevforall.codeonthego.viewmodel.EditorViewModel -import kotlinx.coroutines.flow.collectLatest -import kotlinx.coroutines.flow.combine -import kotlinx.coroutines.launch import java.io.File import com.itsaky.androidide.resources.R as ResR diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/TemplateDetailsFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/TemplateDetailsFragment.kt index 372f799231..effbbfe28d 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/TemplateDetailsFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/TemplateDetailsFragment.kt @@ -30,9 +30,13 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.transition.TransitionManager import com.itsaky.androidide.R import com.itsaky.androidide.R.string +import com.itsaky.androidide.databinding.FragmentTemplateDetailsBinding +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.Job +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext import org.appdevforall.codeonthego.activities.MainActivity import org.appdevforall.codeonthego.adapters.TemplateWidgetsListAdapter -import com.itsaky.androidide.databinding.FragmentTemplateDetailsBinding import org.appdevforall.codeonthego.idetooltips.TooltipManager import org.appdevforall.codeonthego.idetooltips.TooltipTag.SETUP_CREATE_PROJECT import org.appdevforall.codeonthego.idetooltips.TooltipTag.SETUP_OVERVIEW @@ -44,10 +48,6 @@ import org.appdevforall.codeonthego.utils.flashError import org.appdevforall.codeonthego.utils.flashSuccess import org.appdevforall.codeonthego.utils.ui.TemplateScrollGateKeeper import org.appdevforall.codeonthego.viewmodel.MainViewModel -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.Job -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext import org.koin.androidx.viewmodel.ext.android.activityViewModel /** diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/TemplateListFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/TemplateListFragment.kt index f194f03d17..df1e0428ba 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/TemplateListFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/TemplateListFragment.kt @@ -17,15 +17,18 @@ package org.appdevforall.codeonthego.fragments +import android.content.res.Configuration import android.os.Bundle import android.view.View -import android.content.res.Configuration import androidx.lifecycle.lifecycleScope -import org.koin.androidx.viewmodel.ext.android.activityViewModel import androidx.recyclerview.widget.GridLayoutManager import com.itsaky.androidide.R -import org.appdevforall.codeonthego.adapters.TemplateListAdapter import com.itsaky.androidide.databinding.FragmentTemplateListBinding +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.Job +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext +import org.appdevforall.codeonthego.adapters.TemplateListAdapter import org.appdevforall.codeonthego.idetooltips.TooltipManager import org.appdevforall.codeonthego.idetooltips.TooltipTag.EXIT_TO_MAIN import org.appdevforall.codeonthego.templates.ITemplateProvider @@ -34,10 +37,7 @@ import org.appdevforall.codeonthego.templates.ProjectTemplate import org.appdevforall.codeonthego.templates.impl.TemplateProviderImpl import org.appdevforall.codeonthego.utils.flashError import org.appdevforall.codeonthego.viewmodel.MainViewModel -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.Job -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext +import org.koin.androidx.viewmodel.ext.android.activityViewModel import org.slf4j.LoggerFactory /** @@ -125,46 +125,48 @@ class TemplateListFragment : log.debug("Reloading templates...") reloadJob?.cancel() - reloadJob = viewLifecycleOwner.lifecycleScope.launch { - val (templates, warnings) = withContext(Dispatchers.IO) { - val provider = ITemplateProvider.getInstance(reload = true) - // Pre-warm the widget view provider so per-bind getInstance() in - // TemplateWidgetsListAdapter doesn't trigger a disk read on the UI thread. - ITemplateWidgetViewProvider.getInstance() - val templates = provider.getTemplates().filterIsInstance() - val warnings = (provider as? TemplateProviderImpl)?.warnings.orEmpty() - templates to warnings - } - - _binding ?: return@launch - - adapter = - TemplateListAdapter( - templates = templates, - onClick = { template, _ -> - viewModel.template.value = template - viewModel.setScreen(MainViewModel.SCREEN_TEMPLATE_DETAILS) - }, - onLongClick = { template, itemView -> - template.tooltipTag?.let { tag -> - TooltipManager.showIdeCategoryTooltip( - context = requireContext(), - anchorView = itemView, - tag = tag - ) - } - }, - ) - binding.list.adapter = adapter - updateSpanCount() - - if (warnings.isNotEmpty()) { - requireActivity().flashError( - warnings.joinToString(System.lineSeparator()) { w -> - requireContext().getString(w.resId, *w.args.toTypedArray()) + reloadJob = + viewLifecycleOwner.lifecycleScope.launch { + val (templates, warnings) = + withContext(Dispatchers.IO) { + val provider = ITemplateProvider.getInstance(reload = true) + // Pre-warm the widget view provider so per-bind getInstance() in + // TemplateWidgetsListAdapter doesn't trigger a disk read on the UI thread. + ITemplateWidgetViewProvider.getInstance() + val templates = provider.getTemplates().filterIsInstance() + val warnings = (provider as? TemplateProviderImpl)?.warnings.orEmpty() + templates to warnings } - ) + + _binding ?: return@launch + + adapter = + TemplateListAdapter( + templates = templates, + onClick = { template, _ -> + viewModel.template.value = template + viewModel.setScreen(MainViewModel.SCREEN_TEMPLATE_DETAILS) + }, + onLongClick = { template, itemView -> + template.tooltipTag?.let { tag -> + TooltipManager.showIdeCategoryTooltip( + context = requireContext(), + anchorView = itemView, + tag = tag, + ) + } + }, + ) + binding.list.adapter = adapter + updateSpanCount() + + if (warnings.isNotEmpty()) { + requireActivity().flashError( + warnings.joinToString(System.lineSeparator()) { w -> + requireContext().getString(w.resId, *w.args.toTypedArray()) + }, + ) + } } - } } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/CallStackFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/CallStackFragment.kt index 3596be8047..79421ea614 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/CallStackFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/CallStackFragment.kt @@ -13,16 +13,16 @@ import androidx.lifecycle.repeatOnLifecycle import androidx.recyclerview.widget.RecyclerView import com.itsaky.androidide.R import com.itsaky.androidide.databinding.DebuggerCallstackItemBinding +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext import org.appdevforall.codeonthego.fragments.RecyclerViewFragment import org.appdevforall.codeonthego.idetooltips.TooltipManager import org.appdevforall.codeonthego.idetooltips.TooltipTag.DEBUG_OUTPUT_CALLSTACK import org.appdevforall.codeonthego.utils.resolveAttr import org.appdevforall.codeonthego.utils.viewLifecycleScope import org.appdevforall.codeonthego.viewmodel.DebuggerViewModel -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext /** * @author Akash Yadav diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/DebuggerFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/DebuggerFragment.kt index de29998f84..5b9d7804ba 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/DebuggerFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/DebuggerFragment.kt @@ -20,6 +20,15 @@ import androidx.viewpager2.adapter.FragmentStateAdapter import com.google.android.material.tabs.TabLayoutMediator import com.itsaky.androidide.R import com.itsaky.androidide.databinding.FragmentDebuggerBinding +import io.sentry.Sentry +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.async +import kotlinx.coroutines.awaitAll +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext +import moe.shizuku.manager.ShizukuState +import moe.shizuku.manager.model.ServiceStatus import org.appdevforall.codeonthego.fragments.EmptyStateFragment import org.appdevforall.codeonthego.idetooltips.TooltipManager import org.appdevforall.codeonthego.idetooltips.TooltipTag.DEBUG_NOT_CONNECTED @@ -33,15 +42,6 @@ import org.appdevforall.codeonthego.utils.viewLifecycleScope import org.appdevforall.codeonthego.viewmodel.DebuggerConnectionState import org.appdevforall.codeonthego.viewmodel.DebuggerViewModel import org.appdevforall.codeonthego.viewmodel.WADBConnectionViewModel -import io.sentry.Sentry -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.async -import kotlinx.coroutines.awaitAll -import kotlinx.coroutines.flow.collectLatest -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext -import moe.shizuku.manager.ShizukuState -import moe.shizuku.manager.model.ServiceStatus import org.slf4j.LoggerFactory import rikka.shizuku.Shizuku @@ -326,6 +326,7 @@ class DebuggerFragment : EmptyStateFragment(FragmentDeb DebuggerConnectionState.SUSPENDED -> { null } + // suspended due to a breakpoint hit or step event DebuggerConnectionState.AWAITING_BREAKPOINT -> { null diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/Resolvable.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/Resolvable.kt index 6d0d1a54a0..777461d077 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/Resolvable.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/Resolvable.kt @@ -1,5 +1,11 @@ package org.appdevforall.codeonthego.fragments.debug +import kotlinx.coroutines.CompletableDeferred +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Deferred +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.ExperimentalCoroutinesApi +import kotlinx.coroutines.withContext import org.appdevforall.codeonthego.lsp.debug.model.StackFrame import org.appdevforall.codeonthego.lsp.debug.model.StackFrameDescriptor import org.appdevforall.codeonthego.lsp.debug.model.ThreadDescriptor @@ -10,81 +16,73 @@ import org.appdevforall.codeonthego.lsp.debug.model.VariableDescriptor import org.appdevforall.codeonthego.lsp.debug.model.VariableKind import org.appdevforall.codeonthego.lsp.java.utils.completedOrNull import org.appdevforall.codeonthego.lsp.java.utils.getValue -import kotlinx.coroutines.CompletableDeferred -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Deferred -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.withContext import org.slf4j.Logger import org.slf4j.LoggerFactory interface Resolvable { - - /** - * Whether the value is resolved. - */ - val isResolved: Boolean - - /** - * Get the resolved value, or throw an exception if the value is not resolved. - */ - val resolved: T - - /** - * Resolve the value. - */ - suspend fun resolve(): T? + /** + * Whether the value is resolved. + */ + val isResolved: Boolean + + /** + * Get the resolved value, or throw an exception if the value is not resolved. + */ + val resolved: T + + /** + * Resolve the value. + */ + suspend fun resolve(): T? } abstract class AbstractResolvable : Resolvable { - - private val _deferred = CompletableDeferred() - - val deferred: Deferred - get() = _deferred - - @OptIn(ExperimentalCoroutinesApi::class) - override val isResolved: Boolean - get() = deferred.completedOrNull != null - - companion object { - @JvmStatic - protected val logger: Logger = LoggerFactory.getLogger(AbstractResolvable::class.java) - private val resolutionDispatcher = Dispatchers.IO - } - - @OptIn(ExperimentalCoroutinesApi::class) - final override suspend fun resolve(): T? { - deferred.completedOrNull?.also { completed -> - // already resolved - return completed - } - - val result = withContext(resolutionDispatcher) { - try { - doResolve()?.also(_deferred::complete) - } catch (err: Throwable) { - logger.error("Resolution failure", err) - _deferred.completeExceptionally(err) - null - } - } - - return result - } - - protected suspend fun withContext(action: suspend CoroutineScope.() -> T): T = - withContext(resolutionDispatcher, action) - - protected abstract suspend fun doResolve(): T + private val _deferred = CompletableDeferred() + + val deferred: Deferred + get() = _deferred + + @OptIn(ExperimentalCoroutinesApi::class) + override val isResolved: Boolean + get() = deferred.completedOrNull != null + + companion object { + @JvmStatic + protected val logger: Logger = LoggerFactory.getLogger(AbstractResolvable::class.java) + private val resolutionDispatcher = Dispatchers.IO + } + + @OptIn(ExperimentalCoroutinesApi::class) + final override suspend fun resolve(): T? { + deferred.completedOrNull?.also { completed -> + // already resolved + return completed + } + + val result = + withContext(resolutionDispatcher) { + try { + doResolve()?.also(_deferred::complete) + } catch (err: Throwable) { + logger.error("Resolution failure", err) + _deferred.completeExceptionally(err) + null + } + } + + return result + } + + protected suspend fun withContext(action: suspend CoroutineScope.() -> T): T = withContext(resolutionDispatcher, action) + + protected abstract suspend fun doResolve(): T } /** * Get the resolved value, or return `null` if the value is not resolved. */ val Resolvable.resolvedOrNull: T? - get() = if (isResolved) resolved else null + get() = if (isResolved) resolved else null /** * Get the resolved value, or return [default value][default] if the value is not resolved. @@ -100,72 +98,76 @@ fun Resolvable.resolvedOr(default: T): T? = if (isResolved) resolved else */ @OptIn(ExperimentalCoroutinesApi::class) class ResolvableVariable private constructor( - private val delegate: Variable, -) : AbstractResolvable(), Variable by delegate, Resolvable { - - internal val deferredValue = CompletableDeferred() - - /** - * Whether the variable is resolved. - */ - override val isResolved: Boolean - get() = super.isResolved && deferredValue.completedOrNull != null - - override val resolved: VariableDescriptor - get() = checkNotNull(deferred.completedOrNull) { - "Variable is not resolved" - } - - fun resolvedName() = deferred.completedOrNull?.name ?: "" - - fun resolvedTypeName() = deferred.completedOrNull?.typeName ?: "" - - fun resolvedValue() = deferredValue.getValue( - defaultValue = null, - ) - - fun resolvedKind(): VariableKind = deferred.completedOrNull?.kind ?: VariableKind.UNKNOWN - - companion object { - - private val logger = LoggerFactory.getLogger(ResolvableVariable::class.java) - - /** - * Create a new eagerly-resolved variable delegating to [delegate]. - * - * @param delegate The delegate variable. - * @return The new eagerly-resolved variable. - */ - fun create(delegate: Variable): ResolvableVariable { - if (delegate is ResolvableVariable) { - return delegate - } - - return ResolvableVariable(delegate) - } - } - - /** - * Resolve the variable state. - */ - override suspend fun doResolve(): VariableDescriptor { - // NOTE: - // Care must be taken to only resolve values which are absolutely needed - // to render the UI. Resolution of values which are not immediately required must be deferred. - - val descriptor = delegate.descriptor() - val value = delegate.value() - deferredValue.complete(value) - return descriptor - } - - override suspend fun objectMembers(): Set> = withContext { - delegate.objectMembers() - .map { variable -> - // members of an eagerly-resolved variable are also eagerly-resolved - create(variable) - }.toSet() - } + private val delegate: Variable, +) : AbstractResolvable(), + Variable by delegate, + Resolvable { + internal val deferredValue = CompletableDeferred() + + /** + * Whether the variable is resolved. + */ + override val isResolved: Boolean + get() = super.isResolved && deferredValue.completedOrNull != null + + override val resolved: VariableDescriptor + get() = + checkNotNull(deferred.completedOrNull) { + "Variable is not resolved" + } + + fun resolvedName() = deferred.completedOrNull?.name ?: "" + + fun resolvedTypeName() = deferred.completedOrNull?.typeName ?: "" + + fun resolvedValue() = + deferredValue.getValue( + defaultValue = null, + ) + + fun resolvedKind(): VariableKind = deferred.completedOrNull?.kind ?: VariableKind.UNKNOWN + + companion object { + private val logger = LoggerFactory.getLogger(ResolvableVariable::class.java) + + /** + * Create a new eagerly-resolved variable delegating to [delegate]. + * + * @param delegate The delegate variable. + * @return The new eagerly-resolved variable. + */ + fun create(delegate: Variable): ResolvableVariable { + if (delegate is ResolvableVariable) { + return delegate + } + + return ResolvableVariable(delegate) + } + } + + /** + * Resolve the variable state. + */ + override suspend fun doResolve(): VariableDescriptor { + // NOTE: + // Care must be taken to only resolve values which are absolutely needed + // to render the UI. Resolution of values which are not immediately required must be deferred. + + val descriptor = delegate.descriptor() + val value = delegate.value() + deferredValue.complete(value) + return descriptor + } + + override suspend fun objectMembers(): Set> = + withContext { + delegate + .objectMembers() + .map { variable -> + // members of an eagerly-resolved variable are also eagerly-resolved + create(variable) + }.toSet() + } } /** @@ -173,64 +175,61 @@ class ResolvableVariable private constructor( */ @OptIn(ExperimentalCoroutinesApi::class) class ResolvableStackFrame private constructor( - private val delegate: StackFrame, -) : AbstractResolvable(), StackFrame by delegate, Resolvable { - - override val resolved: StackFrameDescriptor - get() = checkNotNull(deferred.completedOrNull) { - "Stack frame is not resolved" - } - - companion object { - - /** - * Create a new eagerly-resolved stack frame delegating to [delegate]. - */ - fun create(delegate: StackFrame): ResolvableStackFrame { - if (delegate is ResolvableStackFrame) { - return delegate - } - - return ResolvableStackFrame(delegate) - } - } - - override suspend fun doResolve(): StackFrameDescriptor { - return delegate.descriptor() - } - - override suspend fun getVariables(): List> = - delegate.getVariables().map { variable -> ResolvableVariable.create(variable) } + private val delegate: StackFrame, +) : AbstractResolvable(), + StackFrame by delegate, + Resolvable { + override val resolved: StackFrameDescriptor + get() = + checkNotNull(deferred.completedOrNull) { + "Stack frame is not resolved" + } + + companion object { + /** + * Create a new eagerly-resolved stack frame delegating to [delegate]. + */ + fun create(delegate: StackFrame): ResolvableStackFrame { + if (delegate is ResolvableStackFrame) { + return delegate + } + + return ResolvableStackFrame(delegate) + } + } + + override suspend fun doResolve(): StackFrameDescriptor = delegate.descriptor() + + override suspend fun getVariables(): List> = + delegate.getVariables().map { variable -> ResolvableVariable.create(variable) } } @OptIn(ExperimentalCoroutinesApi::class) class ResolvableThreadInfo private constructor( - private val delegate: ThreadInfo, -) : AbstractResolvable(), ThreadInfo by delegate, Resolvable { - - override val resolved: ThreadDescriptor - get() = checkNotNull(deferred.completedOrNull) { - "Thread is not resolved" - } - - companion object { - - /** - * Create a new eagerly-resolved thread info delegating to [delegate]. - */ - fun create(delegate: ThreadInfo): ResolvableThreadInfo { - if (delegate is ResolvableThreadInfo) { - return delegate - } - - return ResolvableThreadInfo(delegate) - } - } - - override suspend fun doResolve(): ThreadDescriptor { - return delegate.descriptor() - } - - override suspend fun getFrames(): List = - delegate.getFrames().map { frame -> ResolvableStackFrame.create(frame) } + private val delegate: ThreadInfo, +) : AbstractResolvable(), + ThreadInfo by delegate, + Resolvable { + override val resolved: ThreadDescriptor + get() = + checkNotNull(deferred.completedOrNull) { + "Thread is not resolved" + } + + companion object { + /** + * Create a new eagerly-resolved thread info delegating to [delegate]. + */ + fun create(delegate: ThreadInfo): ResolvableThreadInfo { + if (delegate is ResolvableThreadInfo) { + return delegate + } + + return ResolvableThreadInfo(delegate) + } + } + + override suspend fun doResolve(): ThreadDescriptor = delegate.descriptor() + + override suspend fun getFrames(): List = delegate.getFrames().map { frame -> ResolvableStackFrame.create(frame) } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableIcon.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableIcon.kt index 631d997fe2..8676108e30 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableIcon.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableIcon.kt @@ -13,51 +13,51 @@ import androidx.core.graphics.withTranslation * @author Akash Yadav */ class CircleCharDrawable( - private val char: Char, - private val circle: Boolean + private val char: Char, + private val circle: Boolean ) : - Drawable() { - private val mPaint = Paint().apply { - isAntiAlias = true - color = Color.TRANSPARENT - } + Drawable() { + private val mPaint = Paint().apply { + isAntiAlias = true + color = Color.TRANSPARENT + } - private val mTextPaint = Paint().apply { - color = -0x1 - isAntiAlias = true - textSize = Resources.getSystem() - .displayMetrics.density * 14 - textAlign = Paint.Align.CENTER - } + private val mTextPaint = Paint().apply { + color = -0x1 + isAntiAlias = true + textSize = Resources.getSystem() + .displayMetrics.density * 14 + textAlign = Paint.Align.CENTER + } - override fun draw(canvas: Canvas) { - val width = bounds.right.toFloat() - val height = bounds.bottom.toFloat() - if (circle) { - canvas.drawCircle(width / 2, height / 2, width / 2, mPaint) - } else { - canvas.drawRect(0f, 0f, width, height, mPaint) - } - canvas.withTranslation(width / 2f, height / 2f) { - val textCenter = -(mTextPaint.descent() + mTextPaint.ascent()) / 2f - drawText(char.toString(), 0f, textCenter, mTextPaint) - } - } + override fun draw(canvas: Canvas) { + val width = bounds.right.toFloat() + val height = bounds.bottom.toFloat() + if (circle) { + canvas.drawCircle(width / 2, height / 2, width / 2, mPaint) + } else { + canvas.drawRect(0f, 0f, width, height, mPaint) + } + canvas.withTranslation(width / 2f, height / 2f) { + val textCenter = -(mTextPaint.descent() + mTextPaint.ascent()) / 2f + drawText(char.toString(), 0f, textCenter, mTextPaint) + } + } - override fun setAlpha(p1: Int) { - mPaint.alpha = p1 - mTextPaint.alpha = p1 - } + override fun setAlpha(p1: Int) { + mPaint.alpha = p1 + mTextPaint.alpha = p1 + } - override fun setColorFilter(colorFilter: ColorFilter?) { - mTextPaint.colorFilter = colorFilter - } + override fun setColorFilter(colorFilter: ColorFilter?) { + mTextPaint.colorFilter = colorFilter + } - @Deprecated( - "Deprecated in Java", - ReplaceWith("PixelFormat.OPAQUE", "android.graphics.PixelFormat") - ) - override fun getOpacity(): Int { - return PixelFormat.OPAQUE - } -} \ No newline at end of file + @Deprecated( + "Deprecated in Java", + ReplaceWith("PixelFormat.OPAQUE", "android.graphics.PixelFormat") + ) + override fun getOpacity(): Int { + return PixelFormat.OPAQUE + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableListBinder.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableListBinder.kt index a8da8c714f..167a2bbb66 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableListBinder.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableListBinder.kt @@ -11,15 +11,7 @@ import androidx.core.text.PrecomputedTextCompat import androidx.core.widget.TextViewCompat import com.itsaky.androidide.databinding.DebuggerSetVariableValueBinding import com.itsaky.androidide.databinding.DebuggerVariableItemBinding -import org.appdevforall.codeonthego.idetooltips.TooltipManager -import org.appdevforall.codeonthego.idetooltips.TooltipTag.DEBUG_OUTPUT_VARIABLES -import org.appdevforall.codeonthego.lsp.debug.model.VariableDescriptor -import org.appdevforall.codeonthego.lsp.debug.model.VariableKind import com.itsaky.androidide.resources.R -import org.appdevforall.codeonthego.utils.DialogUtils -import org.appdevforall.codeonthego.utils.flashError -import org.appdevforall.codeonthego.utils.isSystemInDarkMode -import org.appdevforall.codeonthego.viewmodel.DebuggerViewModel import io.github.dingyi222666.view.treeview.TreeNode import io.github.dingyi222666.view.treeview.TreeNodeEventListener import io.github.dingyi222666.view.treeview.TreeView @@ -30,6 +22,14 @@ import kotlinx.coroutines.Job import kotlinx.coroutines.ensureActive import kotlinx.coroutines.launch import kotlinx.coroutines.withContext +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag.DEBUG_OUTPUT_VARIABLES +import org.appdevforall.codeonthego.lsp.debug.model.VariableDescriptor +import org.appdevforall.codeonthego.lsp.debug.model.VariableKind +import org.appdevforall.codeonthego.utils.DialogUtils +import org.appdevforall.codeonthego.utils.flashError +import org.appdevforall.codeonthego.utils.isSystemInDarkMode +import org.appdevforall.codeonthego.viewmodel.DebuggerViewModel import org.slf4j.LoggerFactory class VariableListBinder( @@ -357,12 +357,22 @@ class VariableListBinder( private fun VariableDescriptor.icon(context: Context): Int? = when (kind) { - VariableKind.PRIMITIVE -> R.drawable.ic_db_primitive - VariableKind.REFERENCE -> R.drawable.ic_dbg_value - VariableKind.ARRAYLIKE -> + VariableKind.PRIMITIVE -> { + R.drawable.ic_db_primitive + } + + VariableKind.REFERENCE -> { + R.drawable.ic_dbg_value + } + + VariableKind.ARRAYLIKE -> { when (context.isSystemInDarkMode()) { true -> R.drawable.ic_db_array_dark false -> R.drawable.ic_db_array } - else -> null + } + + else -> { + null + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableListFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableListFragment.kt index f83f85edcf..7701fb48cb 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableListFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableListFragment.kt @@ -12,12 +12,12 @@ import androidx.fragment.app.activityViewModels import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle -import org.appdevforall.codeonthego.idetooltips.TooltipManager -import org.appdevforall.codeonthego.idetooltips.TooltipTag.DEBUG_OUTPUT_VARIABLES -import org.appdevforall.codeonthego.viewmodel.DebuggerViewModel import io.github.dingyi222666.view.treeview.TreeView import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch +import org.appdevforall.codeonthego.idetooltips.TooltipManager +import org.appdevforall.codeonthego.idetooltips.TooltipTag.DEBUG_OUTPUT_VARIABLES +import org.appdevforall.codeonthego.viewmodel.DebuggerViewModel /** * @author Akash Yadav diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableTreeNodeGenerator.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableTreeNodeGenerator.kt index c92bf457a8..192fcdd130 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableTreeNodeGenerator.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/VariableTreeNodeGenerator.kt @@ -6,45 +6,43 @@ import io.github.dingyi222666.view.treeview.TreeNode import io.github.dingyi222666.view.treeview.TreeNodeGenerator class VariableTreeNodeGenerator private constructor( - private val rootNodes: Set> = emptySet() + private val rootNodes: Set> = emptySet(), ) : TreeNodeGenerator> { + companion object { + fun newInstance(rootNodes: Set> = emptySet()): TreeNodeGenerator> = + VariableTreeNodeGenerator(rootNodes) + } - companion object { - fun newInstance( - rootNodes: Set> = emptySet() - ): TreeNodeGenerator> = VariableTreeNodeGenerator(rootNodes) - } + override fun createNode( + parentNode: TreeNode>, + currentData: ResolvableVariable<*>, + tree: AbstractTree>, + ): TreeNode> = + TreeNode( + id = Tree.generateId(), + data = currentData, + depth = parentNode.depth + 1, + name = currentData.resolvedOrNull?.name ?: "", + isExpanded = false, + isBranch = true, + ) - override fun createNode( - parentNode: TreeNode>, - currentData: ResolvableVariable<*>, - tree: AbstractTree> - ): TreeNode> = TreeNode( - id = Tree.generateId(), - data = currentData, - depth = parentNode.depth + 1, - name = currentData.resolvedOrNull?.name ?: "", - isExpanded = false, - isBranch = true, - ) + override suspend fun fetchChildData(targetNode: TreeNode>): Set> { + if (targetNode.id == Tree.ROOT_NODE_ID) { + return rootNodes + } - override suspend fun fetchChildData(targetNode: TreeNode>): Set> { - if (targetNode.id == Tree.ROOT_NODE_ID) { - return rootNodes - } + val data = targetNode.data ?: return emptySet() + return data.objectMembers() + } - val data = targetNode.data ?: return emptySet() - return data.objectMembers() - } - - override fun createRootNode(): TreeNode> { - return TreeNode( - id = Tree.ROOT_NODE_ID, - data = null, - depth = -1, - name = Tree.ROOT_NODE_ID.toString(), - isExpanded = true, - isBranch = false, - ) - } -} \ No newline at end of file + override fun createRootNode(): TreeNode> = + TreeNode( + id = Tree.ROOT_NODE_ID, + data = null, + depth = -1, + name = Tree.ROOT_NODE_ID.toString(), + isExpanded = true, + isBranch = false, + ) +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/WADBPermissionFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/WADBPermissionFragment.kt index bc4114d790..3a5b3d5488 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/WADBPermissionFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/debug/WADBPermissionFragment.kt @@ -9,13 +9,13 @@ import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import com.itsaky.androidide.R import com.itsaky.androidide.databinding.FragmentWadbConnectionBinding -import org.appdevforall.codeonthego.fragments.FragmentWithBinding -import org.appdevforall.codeonthego.utils.viewLifecycleScope -import org.appdevforall.codeonthego.viewmodel.WADBConnectionViewModel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch import kotlinx.coroutines.withContext +import org.appdevforall.codeonthego.fragments.FragmentWithBinding +import org.appdevforall.codeonthego.utils.viewLifecycleScope +import org.appdevforall.codeonthego.viewmodel.WADBConnectionViewModel import org.slf4j.LoggerFactory /** @@ -74,7 +74,9 @@ class WADBPermissionFragment : FragmentWithBinding null + else -> { + null + } } status?.also { s -> setConnectionStatus(s) } diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitBottomSheetFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitBottomSheetFragment.kt index 74f3cff7e0..0db5d254e0 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitBottomSheetFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitBottomSheetFragment.kt @@ -20,9 +20,12 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.textfield.TextInputEditText import com.google.android.material.textfield.TextInputLayout import com.itsaky.androidide.R +import com.itsaky.androidide.databinding.FragmentGitBottomSheetBinding +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.flow.combine +import kotlinx.coroutines.launch import org.appdevforall.codeonthego.activities.PreferencesActivity import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity -import com.itsaky.androidide.databinding.FragmentGitBottomSheetBinding import org.appdevforall.codeonthego.events.ListProjectFilesRequestEvent import org.appdevforall.codeonthego.fragments.git.adapter.GitFileChangeAdapter import org.appdevforall.codeonthego.git.core.GitCredentialsManager @@ -42,9 +45,6 @@ import org.appdevforall.codeonthego.viewmodel.BottomSheetViewModel import org.appdevforall.codeonthego.viewmodel.GitBottomSheetViewModel import org.appdevforall.codeonthego.viewmodel.GitBottomSheetViewModel.BranchesUiState import org.appdevforall.codeonthego.viewmodel.GitBottomSheetViewModel.PullUiState -import kotlinx.coroutines.flow.collectLatest -import kotlinx.coroutines.flow.combine -import kotlinx.coroutines.launch import org.greenrobot.eventbus.EventBus import org.koin.androidx.viewmodel.ext.android.activityViewModel import java.io.File diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitCommitHistoryDialog.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitCommitHistoryDialog.kt index b807b30143..b70df1f0cf 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitCommitHistoryDialog.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitCommitHistoryDialog.kt @@ -11,6 +11,8 @@ import androidx.recyclerview.widget.LinearLayoutManager import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.itsaky.androidide.R import com.itsaky.androidide.databinding.DialogGitCommitHistoryBinding +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.launch import org.appdevforall.codeonthego.fragments.git.adapter.GitCommitHistoryAdapter import org.appdevforall.codeonthego.git.core.GitCredentialsManager import org.appdevforall.codeonthego.git.core.models.CommitHistoryUiState @@ -21,8 +23,6 @@ import org.appdevforall.codeonthego.utils.applyLongPressRecursively import org.appdevforall.codeonthego.utils.flashSuccess import org.appdevforall.codeonthego.utils.onLongPress import org.appdevforall.codeonthego.viewmodel.GitBottomSheetViewModel -import kotlinx.coroutines.flow.collectLatest -import kotlinx.coroutines.launch import org.koin.android.ext.android.inject import org.koin.androidx.viewmodel.ext.android.activityViewModel diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitDialogUtils.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitDialogUtils.kt index 37bc6eee93..d78c828cff 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitDialogUtils.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitDialogUtils.kt @@ -9,45 +9,56 @@ import com.itsaky.androidide.databinding.DialogGitCredentialsBinding import org.appdevforall.codeonthego.git.core.GitCredentialsManager fun Fragment.showGitCredentialsDialog( - credentialsManager: GitCredentialsManager, - positiveButtonTextResId: Int, - onPositiveClick: (username: String, token: String) -> Unit + credentialsManager: GitCredentialsManager, + positiveButtonTextResId: Int, + onPositiveClick: (username: String, token: String) -> Unit, ) { - val dialogBinding = DialogGitCredentialsBinding.inflate(layoutInflater) - - dialogBinding.username.setText(credentialsManager.getUsername()) - dialogBinding.token.setText(credentialsManager.getToken()) - - val dialog = MaterialAlertDialogBuilder(requireContext()) - .setTitle(R.string.git_credentials_title) - .setView(dialogBinding.root) - .setPositiveButton(positiveButtonTextResId) { _, _ -> - val username = dialogBinding.username.text?.toString()?.trim() - val token = dialogBinding.token.text?.toString()?.trim() - if (!username.isNullOrBlank() && !token.isNullOrBlank()) { - onPositiveClick(username, token) - } - } - .setNeutralButton(R.string.git_credentials_clear) { _, _ -> - credentialsManager.clearCredentials() - } - .setNegativeButton(android.R.string.cancel, null) - .create() - - dialog.setOnShowListener { - val positiveButton = dialog.getButton(AlertDialog.BUTTON_POSITIVE) - - val validate = { - val user = dialogBinding.username.text?.toString()?.trim() - val token = dialogBinding.token.text?.toString()?.trim() - positiveButton.isEnabled = !user.isNullOrBlank() && !token.isNullOrBlank() - } - - dialogBinding.username.doAfterTextChanged { validate() } - dialogBinding.token.doAfterTextChanged { validate() } - - validate() - } - - dialog.show() + val dialogBinding = DialogGitCredentialsBinding.inflate(layoutInflater) + + dialogBinding.username.setText(credentialsManager.getUsername()) + dialogBinding.token.setText(credentialsManager.getToken()) + + val dialog = + MaterialAlertDialogBuilder(requireContext()) + .setTitle(R.string.git_credentials_title) + .setView(dialogBinding.root) + .setPositiveButton(positiveButtonTextResId) { _, _ -> + val username = + dialogBinding.username.text + ?.toString() + ?.trim() + val token = + dialogBinding.token.text + ?.toString() + ?.trim() + if (!username.isNullOrBlank() && !token.isNullOrBlank()) { + onPositiveClick(username, token) + } + }.setNeutralButton(R.string.git_credentials_clear) { _, _ -> + credentialsManager.clearCredentials() + }.setNegativeButton(android.R.string.cancel, null) + .create() + + dialog.setOnShowListener { + val positiveButton = dialog.getButton(AlertDialog.BUTTON_POSITIVE) + + val validate = { + val user = + dialogBinding.username.text + ?.toString() + ?.trim() + val token = + dialogBinding.token.text + ?.toString() + ?.trim() + positiveButton.isEnabled = !user.isNullOrBlank() && !token.isNullOrBlank() + } + + dialogBinding.username.doAfterTextChanged { validate() } + dialogBinding.token.doAfterTextChanged { validate() } + + validate() + } + + dialog.show() } diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitDiffViewerDialog.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitDiffViewerDialog.kt index 621d4dc1e5..245b82c8c8 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitDiffViewerDialog.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/GitDiffViewerDialog.kt @@ -15,151 +15,180 @@ import androidx.fragment.app.DialogFragment import androidx.lifecycle.lifecycleScope import com.itsaky.androidide.R import com.itsaky.androidide.databinding.DialogGitDiffBinding -import org.appdevforall.codeonthego.viewmodel.GitBottomSheetViewModel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext +import org.appdevforall.codeonthego.viewmodel.GitBottomSheetViewModel import org.koin.androidx.viewmodel.ext.android.activityViewModel import java.io.File class GitDiffViewerDialog : DialogFragment() { + private val viewModel: GitBottomSheetViewModel by activityViewModel() + + private var filePath: String = "" + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setStyle(STYLE_NORMAL, R.style.Theme_AndroidIDE) + filePath = arguments?.getString(ARG_FILE_PATH) ?: getString(R.string.diff_viewer) + } + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle?, + ): View = inflater.inflate(R.layout.dialog_git_diff, container, false) + + override fun onViewCreated( + view: View, + savedInstanceState: Bundle?, + ) { + super.onViewCreated(view, savedInstanceState) + + val binding = DialogGitDiffBinding.bind(view) + + binding.diffTitle.text = filePath + binding.diffText.text = getString(R.string.diff_loading) + + viewLifecycleOwner.lifecycleScope.launch(Dispatchers.IO) { + val repo = viewModel.currentRepository + val diff = + if (repo != null && repo.rootDir.exists()) { + val file = File(repo.rootDir, filePath) + repo.getDiff(file) + } else { + null + } ?: getString(R.string.unable_to_load_diff) + + withContext(Dispatchers.Main) { + binding.diffText.text = applyDiffFormatting(diff) + } + } + + binding.btnClose.setOnClickListener { + dismiss() + } + } + + private fun applyDiffFormatting(diff: String): SpannableStringBuilder { + val builder = SpannableStringBuilder() + val lines = diff.split("\n") + + // Find the index of the first diff chunk (starts with @@) + val firstChunkIndex = lines.indexOfFirst { it.startsWith("@@") } + val startIndex = if (firstChunkIndex != -1) firstChunkIndex else 0 + + val context = requireContext() + val colorAdd = getColor(context, R.color.git_diff_add_text) + val bgAdd = getColor(context, R.color.git_diff_add_bg) + val colorDel = getColor(context, R.color.git_diff_del_text) + val bgDel = getColor(context, R.color.git_diff_del_bg) + val colorHeader = getColor(context, R.color.git_diff_header_text) + + for (i in startIndex until lines.size) { + val line = lines[i] + val startIdx = builder.length + when { + line.startsWith("+") && !line.startsWith("+++") -> { + val formattedLine = line.replaceFirst("+", "+ ") + builder.append(formattedLine).append("\n") + val endIdx = builder.length + + builder.setSpan( + ForegroundColorSpan(colorAdd), + startIdx, + endIdx, + SPAN_EXCLUSIVE_EXCLUSIVE, + ) + builder.setSpan( + FullWidthBackgroundColorSpan(bgAdd), + startIdx, + endIdx, + SPAN_EXCLUSIVE_EXCLUSIVE, + ) + } + + line.startsWith("-") && !line.startsWith("---") -> { + val formattedLine = line.replaceFirst("-", "- ") + builder.append(formattedLine).append("\n") + val endIdx = builder.length + + builder.setSpan( + ForegroundColorSpan(colorDel), + startIdx, + endIdx, + SPAN_EXCLUSIVE_EXCLUSIVE, + ) + builder.setSpan( + FullWidthBackgroundColorSpan(bgDel), + startIdx, + endIdx, + SPAN_EXCLUSIVE_EXCLUSIVE, + ) + } + + line.startsWith("@@") -> { + builder.append(line).append("\n") + val endIdx = builder.length + + builder.setSpan( + ForegroundColorSpan(colorHeader), + startIdx, + endIdx, + SPAN_EXCLUSIVE_EXCLUSIVE, + ) + } + + else -> { + val formattedLine = if (line.startsWith(" ")) " $line" else line + builder.append(formattedLine).append("\n") + } + } + } + + return builder + } + + private class FullWidthBackgroundColorSpan( + private val color: Int, + ) : LineBackgroundSpan { + override fun drawBackground( + canvas: Canvas, + paint: Paint, + left: Int, + right: Int, + top: Int, + baseline: Int, + bottom: Int, + text: CharSequence, + start: Int, + end: Int, + lineNumber: Int, + ) { + val oldColor = paint.color + paint.color = color + canvas.drawRect(left.toFloat(), top.toFloat(), right.toFloat(), bottom.toFloat(), paint) + paint.color = oldColor + } + } + + override fun onStart() { + super.onStart() + dialog?.window?.setLayout( + ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT, + ) + } + + companion object { + private const val ARG_FILE_PATH = "arg_file_path" - private val viewModel: GitBottomSheetViewModel by activityViewModel() - - private var filePath: String = "" - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setStyle(STYLE_NORMAL, R.style.Theme_AndroidIDE) - filePath = arguments?.getString(ARG_FILE_PATH) ?: getString(R.string.diff_viewer) - } - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View { - return inflater.inflate(R.layout.dialog_git_diff, container, false) - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - - val binding = DialogGitDiffBinding.bind(view) - - binding.diffTitle.text = filePath - binding.diffText.text = getString(R.string.diff_loading) - - viewLifecycleOwner.lifecycleScope.launch(Dispatchers.IO) { - val repo = viewModel.currentRepository - val diff = if (repo != null && repo.rootDir.exists()) { - val file = File(repo.rootDir, filePath) - repo.getDiff(file) - } else { - null - } ?: getString(R.string.unable_to_load_diff) - - withContext(Dispatchers.Main) { - binding.diffText.text = applyDiffFormatting(diff) - } - } - - binding.btnClose.setOnClickListener { - dismiss() - } - } - - private fun applyDiffFormatting(diff: String): SpannableStringBuilder { - val builder = SpannableStringBuilder() - val lines = diff.split("\n") - - // Find the index of the first diff chunk (starts with @@) - val firstChunkIndex = lines.indexOfFirst { it.startsWith("@@") } - val startIndex = if (firstChunkIndex != -1) firstChunkIndex else 0 - - val context = requireContext() - val colorAdd = getColor(context, R.color.git_diff_add_text) - val bgAdd = getColor(context, R.color.git_diff_add_bg) - val colorDel = getColor(context, R.color.git_diff_del_text) - val bgDel = getColor(context, R.color.git_diff_del_bg) - val colorHeader = getColor(context, R.color.git_diff_header_text) - - for (i in startIndex until lines.size) { - val line = lines[i] - val startIdx = builder.length - when { - line.startsWith("+") && !line.startsWith("+++") -> { - val formattedLine = line.replaceFirst("+", "+ ") - builder.append(formattedLine).append("\n") - val endIdx = builder.length - - builder.setSpan(ForegroundColorSpan(colorAdd), startIdx, endIdx, - SPAN_EXCLUSIVE_EXCLUSIVE - ) - builder.setSpan(FullWidthBackgroundColorSpan(bgAdd), startIdx, endIdx, - SPAN_EXCLUSIVE_EXCLUSIVE - ) - } - line.startsWith("-") && !line.startsWith("---") -> { - val formattedLine = line.replaceFirst("-", "- ") - builder.append(formattedLine).append("\n") - val endIdx = builder.length - - builder.setSpan(ForegroundColorSpan(colorDel), startIdx, endIdx, - SPAN_EXCLUSIVE_EXCLUSIVE - ) - builder.setSpan(FullWidthBackgroundColorSpan(bgDel), startIdx, endIdx, - SPAN_EXCLUSIVE_EXCLUSIVE - ) - } - line.startsWith("@@") -> { - builder.append(line).append("\n") - val endIdx = builder.length - - builder.setSpan(ForegroundColorSpan(colorHeader), startIdx, endIdx, - SPAN_EXCLUSIVE_EXCLUSIVE - ) - } - else -> { - val formattedLine = if (line.startsWith(" ")) " $line" else line - builder.append(formattedLine).append("\n") - } - } - } - - return builder - } - - private class FullWidthBackgroundColorSpan(private val color: Int) : LineBackgroundSpan { - override fun drawBackground( - canvas: Canvas, paint: Paint, - left: Int, right: Int, top: Int, baseline: Int, bottom: Int, - text: CharSequence, start: Int, end: Int, lineNumber: Int - ) { - val oldColor = paint.color - paint.color = color - canvas.drawRect(left.toFloat(), top.toFloat(), right.toFloat(), bottom.toFloat(), paint) - paint.color = oldColor - } - } - - override fun onStart() { - super.onStart() - dialog?.window?.setLayout( - ViewGroup.LayoutParams.MATCH_PARENT, - ViewGroup.LayoutParams.MATCH_PARENT - ) - } - - companion object { - private const val ARG_FILE_PATH = "arg_file_path" - - fun newInstance(filePath: String): GitDiffViewerDialog { - return GitDiffViewerDialog().apply { - arguments = Bundle().apply { - putString(ARG_FILE_PATH, filePath) - } - } - } - } + fun newInstance(filePath: String): GitDiffViewerDialog = + GitDiffViewerDialog().apply { + arguments = + Bundle().apply { + putString(ARG_FILE_PATH, filePath) + } + } + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/git/adapter/GitCommitHistoryAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/adapter/GitCommitHistoryAdapter.kt index c74e92da1f..153aef65da 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/git/adapter/GitCommitHistoryAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/git/adapter/GitCommitHistoryAdapter.kt @@ -13,49 +13,58 @@ import java.text.SimpleDateFormat import java.util.Date import java.util.Locale -class GitCommitHistoryAdapter : - ListAdapter(DiffCallback()) { +class GitCommitHistoryAdapter : ListAdapter(DiffCallback()) { + override fun onCreateViewHolder( + parent: ViewGroup, + viewType: Int, + ): ViewHolder { + val binding = + ItemGitCommitBinding.inflate( + LayoutInflater.from(parent.context), + parent, + false, + ) + return ViewHolder(binding) + } - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { - val binding = ItemGitCommitBinding.inflate( - LayoutInflater.from(parent.context), parent, false - ) - return ViewHolder(binding) - } + override fun onBindViewHolder( + holder: ViewHolder, + position: Int, + ) { + val commit = getItem(position) + holder.bind(commit) + } - override fun onBindViewHolder(holder: ViewHolder, position: Int) { - val commit = getItem(position) - holder.bind(commit) - } + class ViewHolder( + private val binding: ItemGitCommitBinding, + ) : RecyclerView.ViewHolder(binding.root) { + private val dateFormat = SimpleDateFormat("dd MMM yyyy, HH:mm", Locale.getDefault()) - class ViewHolder(private val binding: ItemGitCommitBinding) : - RecyclerView.ViewHolder(binding.root) { + fun bind(commit: GitCommit) { + binding.apply { + tvCommitMessage.text = commit.message + tvCommitAuthor.text = commit.authorName + tvCommitTime.text = dateFormat.format(Date(commit.timestamp)) + imgCommitStatus.setImageResource(if (commit.hasBeenPushed) R.drawable.ic_cloud_done else R.drawable.ic_upload) + imgCommitStatus.contentDescription = + if (commit.hasBeenPushed) { + binding.root.context.getString(R.string.commit_pushed) + } else { + binding.root.context.getString(R.string.commit_not_pushed) + } + } + } + } - private val dateFormat = SimpleDateFormat("dd MMM yyyy, HH:mm", Locale.getDefault()) - - fun bind(commit: GitCommit) { - binding.apply { - tvCommitMessage.text = commit.message - tvCommitAuthor.text = commit.authorName - tvCommitTime.text = dateFormat.format(Date(commit.timestamp)) - imgCommitStatus.setImageResource(if (commit.hasBeenPushed) R.drawable.ic_cloud_done else R.drawable.ic_upload) - imgCommitStatus.contentDescription = if (commit.hasBeenPushed) { - binding.root.context.getString(R.string.commit_pushed) - } else { - binding.root.context.getString(R.string.commit_not_pushed) - } - } - } - } - - class DiffCallback : DiffUtil.ItemCallback() { - override fun areItemsTheSame(oldItem: GitCommit, newItem: GitCommit): Boolean { - return oldItem.hash == newItem.hash - } - - override fun areContentsTheSame(oldItem: GitCommit, newItem: GitCommit): Boolean { - return oldItem == newItem - } - } + class DiffCallback : DiffUtil.ItemCallback() { + override fun areItemsTheSame( + oldItem: GitCommit, + newItem: GitCommit, + ): Boolean = oldItem.hash == newItem.hash + override fun areContentsTheSame( + oldItem: GitCommit, + newItem: GitCommit, + ): Boolean = oldItem == newItem + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/IdeSetupConfigurationFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/IdeSetupConfigurationFragment.kt index 71f686f7fd..37b98acedb 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/IdeSetupConfigurationFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/IdeSetupConfigurationFragment.kt @@ -57,247 +57,247 @@ import org.appdevforall.codeonthego.utils.getConnectionInfo */ class IdeSetupConfigurationFragment : OnboardingFragment(), SlidePolicy { - private var _content: LayoutOnboardngSetupConfigBinding? = null - private val content: LayoutOnboardngSetupConfigBinding - get() = checkNotNull(_content) { "Fragment has been destroyed" } - - private var backgroundDataRestrictionReceiver: BroadcastReceiver? = null - private var networkStateChangeCallback: NetworkCallback? = null - - companion object { - - @JvmStatic - fun newInstance(context: Context): IdeSetupConfigurationFragment { - return IdeSetupConfigurationFragment().also { - it.arguments = Bundle().apply { - putCharSequence(KEY_ONBOARDING_TITLE, context.getString(R.string.title_install_tools)) - putCharSequence(KEY_ONBOARDING_SUBTITLE, - context.getString(R.string.subtitle_install_tools)) - putCharSequence(KEY_ONBOARDING_EXTRA_INFO, - Html.fromHtml(context.getString(R.string.msg_install_tools), - Html.FROM_HTML_MODE_COMPACT)) - } - } - } - } - - @SuppressLint("PrivateResource") - override fun createContentView(parent: ViewGroup, attachToParent: Boolean) { - _content = LayoutOnboardngSetupConfigBinding.inflate(layoutInflater, parent, attachToParent) - - content.apply { - noConnection.root.setText(R.string.msg_no_internet) - cellularConnection.root.setText(R.string.msg_connected_to_cellular) - meteredConnection.root.setText(R.string.msg_connected_to_metered_connection) - backgroundDataRestricted.root.setText(R.string.msg_disable_background_data_restriction) - - sdkVersionLayout.isEnabled = true - jdkVersionLayout.isEnabled = true - installGit.isEnabled = true - installOpenssh.isEnabled = true - - val sdkVersions = SdkVersion.entries.map { "SDK ${it.version}" }.reversed() - sdkVersion.setText(sdkVersions[0]) - sdkVersion.setAdapter(ArrayAdapter( - requireContext(), - com.google.android.material.R.layout.m3_auto_complete_simple_item, - sdkVersions) - ) - - val jdkVersions = JdkVersion.entries.map { "JDK ${it.version}" } - jdkVersion.setText(jdkVersions[0]) - jdkVersion.setAdapter(ArrayAdapter( - requireContext(), - com.google.android.material.R.layout.m3_auto_complete_simple_item, - jdkVersions) - ) - } - - updateConnectionStatus() - } - - fun buildIdeSetupArguments(): Array { - val args = mutableListOf() - // this is unused due to idesetup.sh changes - // I want to keep this as an example in case we will need termux bash scrip arguments in the future. - - args.setArgument(IdeSetupArgument.INSTALL_DIR, Environment.HOME.absolutePath) - args.setArgument(IdeSetupArgument.SDK_VERSION, - SdkVersion.fromDisplayName(content.sdkVersion.text).version) - args.setArgument(IdeSetupArgument.JDK_VERSION, - JdkVersion.fromDisplayName(content.jdkVersion.text).version) - args.setArgument(IdeSetupArgument.ASSUME_YES) - if (content.installGit.isChecked) { - args.setArgument(IdeSetupArgument.WITH_GIT) - } - if (content.installOpenssh.isChecked) { - args.setArgument(IdeSetupArgument.WITH_OPENSSH) - } - args.setArgument(IdeSetupArgument.OFFLINE_MODE, true) - args.setArgument(IdeSetupArgument.CACHE_DIR, "../../cache/apt/archives") - args.setArgument(IdeSetupArgument.ABI_FOLDER, getAbiFolder(Build.SUPPORTED_ABIS[0])) - return args.toTypedArray() - } - - private fun MutableList.setArgument(argument: IdeSetupArgument, value: Any? = null) { - val strVal = value?.toString() ?: "" - if (argument.requiresValue && strVal.isBlank()) { - throw IllegalArgumentException("${argument.name} requires a value") - } - - add(argument.argumentName) - add(strVal) - } - - private fun getAbiFolder(deviceAbi:String) : String { - val abiList = listOf(V8_KEY, V7_KEY, ARM_KEY) // List of substrings to check for - - val index = abiList.indexOfFirst { deviceAbi.contains(it) } - return abiList[index] - } - - override fun onStart() { - super.onStart() - updateConnectionStatus() - monitorNetworkState() - } - - override fun onStop() { - super.onStop() - removeNetworkMonitors() - } - - private fun updateConnectionStatus(networkCapabilities: NetworkCapabilities? = null) = - updateConnectionStatus(getConnectionInfo(requireContext(), networkCapabilities)) - - private fun updateConnectionStatus(connectionInfo: ConnectionInfo) = runOnUiThread { - content.noConnection.root.isVisible = false - content.cellularConnection.root.isVisible = false - content.meteredConnection.root.isVisible = false - content.backgroundDataRestricted.root.isVisible = false - - if (connectionInfo === ConnectionInfo.UNKNOWN || !connectionInfo.isConnected) { - showNoConnectionWarning() - return@runOnUiThread - } - - if (connectionInfo.isCellularTransport) { - addCellularTransportWarning() - } - - if (connectionInfo.isMeteredConnection && !connectionInfo.isCellularTransport) { - addMeteredConnectionWarning() - } - - if (connectionInfo.isBackgroundDataRestricted) { - addBackgroundDataRestrictedWarning() - } - } - - private fun addBackgroundDataRestrictedWarning() { - content.backgroundDataRestricted.root.apply { - setText(R.string.msg_disable_background_data_restriction) - isVisible = true - } - } - - private fun addMeteredConnectionWarning() { - content.meteredConnection.root.apply { - setText(R.string.msg_connected_to_metered_connection) - isVisible = true - } - } - - private fun addCellularTransportWarning() { - content.cellularConnection.root.apply { - setText(R.string.msg_connected_to_cellular) - isVisible = true - } - } - - private fun showNoConnectionWarning() { - val msg = SpannableStringBuilder(getString(R.string.msg_no_internet)) - msg.append(" ") - msg.append(getString(R.string.action_open_settings), URLSpan(""), - Spannable.SPAN_EXCLUSIVE_EXCLUSIVE - ) - - content.noConnection.root.apply { - isVisible = true - setOnClickListener { - it.context.startActivity(Intent(Settings.ACTION_WIFI_SETTINGS)) - } - } - } - - override fun onDestroyView() { - super.onDestroyView() - backgroundDataRestrictionReceiver = null - networkStateChangeCallback = null - } - - override val isPolicyRespected: Boolean - get() = getConnectionInfo(requireContext()).isConnected - - override fun onUserIllegallyRequestedNextPage() { - flashError(string.msg_no_internet) - } - - private fun monitorNetworkState() { - val connectivityManager = requireContext().getSystemService() ?: return - networkStateChangeCallback?.also { - connectivityManager.registerDefaultNetworkCallback(it) - } - - networkStateChangeCallback = object : NetworkCallback() { - - override fun onCapabilitiesChanged( - network: Network, - networkCapabilities: NetworkCapabilities - ) { - updateConnectionStatus(networkCapabilities) - } - - override fun onLost(network: Network) { - updateConnectionStatus(ConnectionInfo.UNKNOWN) - } - } - - val networkRequest = NetworkRequest.Builder() - .addCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED) - .addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR) - .addTransportType(NetworkCapabilities.TRANSPORT_ETHERNET) - .addTransportType(NetworkCapabilities.TRANSPORT_WIFI) - .build() - connectivityManager.registerNetworkCallback(networkRequest, networkStateChangeCallback!!) - - backgroundDataRestrictionReceiver?.also { - try { - requireContext().unregisterReceiver(it) - } catch (err: Throwable) { /*ignored*/ - } - } - - backgroundDataRestrictionReceiver = object : BroadcastReceiver() { - override fun onReceive(context: Context?, intent: Intent?) { - updateConnectionStatus() - } - } - - requireContext().registerReceiver(backgroundDataRestrictionReceiver!!, - IntentFilter(ConnectivityManager.ACTION_RESTRICT_BACKGROUND_CHANGED)) - } - - private fun removeNetworkMonitors() { - networkStateChangeCallback?.also { - requireContext().getSystemService()?.unregisterNetworkCallback(it) - networkStateChangeCallback = null - } - - backgroundDataRestrictionReceiver?.also { - requireContext().unregisterReceiver(it) - backgroundDataRestrictionReceiver = null - } - } - -} \ No newline at end of file +private var _content: LayoutOnboardngSetupConfigBinding? = null +private val content: LayoutOnboardngSetupConfigBinding + get() = checkNotNull(_content) { "Fragment has been destroyed" } + +private var backgroundDataRestrictionReceiver: BroadcastReceiver? = null +private var networkStateChangeCallback: NetworkCallback? = null + +companion object { + + @JvmStatic + fun newInstance(context: Context): IdeSetupConfigurationFragment { + return IdeSetupConfigurationFragment().also { + it.arguments = Bundle().apply { + putCharSequence(KEY_ONBOARDING_TITLE, context.getString(R.string.title_install_tools)) + putCharSequence(KEY_ONBOARDING_SUBTITLE, + context.getString(R.string.subtitle_install_tools)) + putCharSequence(KEY_ONBOARDING_EXTRA_INFO, + Html.fromHtml(context.getString(R.string.msg_install_tools), + Html.FROM_HTML_MODE_COMPACT)) + } + } + } +} + +@SuppressLint("PrivateResource") +override fun createContentView(parent: ViewGroup, attachToParent: Boolean) { + _content = LayoutOnboardngSetupConfigBinding.inflate(layoutInflater, parent, attachToParent) + + content.apply { + noConnection.root.setText(R.string.msg_no_internet) + cellularConnection.root.setText(R.string.msg_connected_to_cellular) + meteredConnection.root.setText(R.string.msg_connected_to_metered_connection) + backgroundDataRestricted.root.setText(R.string.msg_disable_background_data_restriction) + + sdkVersionLayout.isEnabled = true + jdkVersionLayout.isEnabled = true + installGit.isEnabled = true + installOpenssh.isEnabled = true + + val sdkVersions = SdkVersion.entries.map { "SDK ${it.version}" }.reversed() + sdkVersion.setText(sdkVersions[0]) + sdkVersion.setAdapter(ArrayAdapter( + requireContext(), + com.google.android.material.R.layout.m3_auto_complete_simple_item, + sdkVersions) + ) + + val jdkVersions = JdkVersion.entries.map { "JDK ${it.version}" } + jdkVersion.setText(jdkVersions[0]) + jdkVersion.setAdapter(ArrayAdapter( + requireContext(), + com.google.android.material.R.layout.m3_auto_complete_simple_item, + jdkVersions) + ) + } + + updateConnectionStatus() +} + +fun buildIdeSetupArguments(): Array { + val args = mutableListOf() + // this is unused due to idesetup.sh changes + // I want to keep this as an example in case we will need termux bash scrip arguments in the future. + + args.setArgument(IdeSetupArgument.INSTALL_DIR, Environment.HOME.absolutePath) + args.setArgument(IdeSetupArgument.SDK_VERSION, + SdkVersion.fromDisplayName(content.sdkVersion.text).version) + args.setArgument(IdeSetupArgument.JDK_VERSION, + JdkVersion.fromDisplayName(content.jdkVersion.text).version) + args.setArgument(IdeSetupArgument.ASSUME_YES) + if (content.installGit.isChecked) { + args.setArgument(IdeSetupArgument.WITH_GIT) + } + if (content.installOpenssh.isChecked) { + args.setArgument(IdeSetupArgument.WITH_OPENSSH) + } + args.setArgument(IdeSetupArgument.OFFLINE_MODE, true) + args.setArgument(IdeSetupArgument.CACHE_DIR, "../../cache/apt/archives") + args.setArgument(IdeSetupArgument.ABI_FOLDER, getAbiFolder(Build.SUPPORTED_ABIS[0])) + return args.toTypedArray() +} + +private fun MutableList.setArgument(argument: IdeSetupArgument, value: Any? = null) { + val strVal = value?.toString() ?: "" + if (argument.requiresValue && strVal.isBlank()) { + throw IllegalArgumentException("${argument.name} requires a value") + } + + add(argument.argumentName) + add(strVal) +} + +private fun getAbiFolder(deviceAbi:String) : String { + val abiList = listOf(V8_KEY, V7_KEY, ARM_KEY) // List of substrings to check for + + val index = abiList.indexOfFirst { deviceAbi.contains(it) } + return abiList[index] +} + +override fun onStart() { + super.onStart() + updateConnectionStatus() + monitorNetworkState() +} + +override fun onStop() { + super.onStop() + removeNetworkMonitors() +} + +private fun updateConnectionStatus(networkCapabilities: NetworkCapabilities? = null) = + updateConnectionStatus(getConnectionInfo(requireContext(), networkCapabilities)) + +private fun updateConnectionStatus(connectionInfo: ConnectionInfo) = runOnUiThread { + content.noConnection.root.isVisible = false + content.cellularConnection.root.isVisible = false + content.meteredConnection.root.isVisible = false + content.backgroundDataRestricted.root.isVisible = false + + if (connectionInfo === ConnectionInfo.UNKNOWN || !connectionInfo.isConnected) { + showNoConnectionWarning() + return@runOnUiThread + } + + if (connectionInfo.isCellularTransport) { + addCellularTransportWarning() + } + + if (connectionInfo.isMeteredConnection && !connectionInfo.isCellularTransport) { + addMeteredConnectionWarning() + } + + if (connectionInfo.isBackgroundDataRestricted) { + addBackgroundDataRestrictedWarning() + } +} + +private fun addBackgroundDataRestrictedWarning() { + content.backgroundDataRestricted.root.apply { + setText(R.string.msg_disable_background_data_restriction) + isVisible = true + } +} + +private fun addMeteredConnectionWarning() { + content.meteredConnection.root.apply { + setText(R.string.msg_connected_to_metered_connection) + isVisible = true + } +} + +private fun addCellularTransportWarning() { + content.cellularConnection.root.apply { + setText(R.string.msg_connected_to_cellular) + isVisible = true + } +} + +private fun showNoConnectionWarning() { + val msg = SpannableStringBuilder(getString(R.string.msg_no_internet)) + msg.append(" ") + msg.append(getString(R.string.action_open_settings), URLSpan(""), + Spannable.SPAN_EXCLUSIVE_EXCLUSIVE + ) + + content.noConnection.root.apply { + isVisible = true + setOnClickListener { + it.context.startActivity(Intent(Settings.ACTION_WIFI_SETTINGS)) + } + } +} + +override fun onDestroyView() { + super.onDestroyView() + backgroundDataRestrictionReceiver = null + networkStateChangeCallback = null +} + +override val isPolicyRespected: Boolean + get() = getConnectionInfo(requireContext()).isConnected + +override fun onUserIllegallyRequestedNextPage() { + flashError(string.msg_no_internet) +} + +private fun monitorNetworkState() { + val connectivityManager = requireContext().getSystemService() ?: return + networkStateChangeCallback?.also { + connectivityManager.registerDefaultNetworkCallback(it) + } + + networkStateChangeCallback = object : NetworkCallback() { + + override fun onCapabilitiesChanged( + network: Network, + networkCapabilities: NetworkCapabilities + ) { + updateConnectionStatus(networkCapabilities) + } + + override fun onLost(network: Network) { + updateConnectionStatus(ConnectionInfo.UNKNOWN) + } + } + + val networkRequest = NetworkRequest.Builder() + .addCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED) + .addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR) + .addTransportType(NetworkCapabilities.TRANSPORT_ETHERNET) + .addTransportType(NetworkCapabilities.TRANSPORT_WIFI) + .build() + connectivityManager.registerNetworkCallback(networkRequest, networkStateChangeCallback!!) + + backgroundDataRestrictionReceiver?.also { + try { + requireContext().unregisterReceiver(it) + } catch (err: Throwable) { /*ignored*/ + } + } + + backgroundDataRestrictionReceiver = object : BroadcastReceiver() { + override fun onReceive(context: Context?, intent: Intent?) { + updateConnectionStatus() + } + } + + requireContext().registerReceiver(backgroundDataRestrictionReceiver!!, + IntentFilter(ConnectivityManager.ACTION_RESTRICT_BACKGROUND_CHANGED)) +} + +private fun removeNetworkMonitors() { + networkStateChangeCallback?.also { + requireContext().getSystemService()?.unregisterNetworkCallback(it) + networkStateChangeCallback = null + } + + backgroundDataRestrictionReceiver?.also { + requireContext().unregisterReceiver(it) + backgroundDataRestrictionReceiver = null + } +} + +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingFragment.kt index 8908c92ba9..91f1cc9e58 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingFragment.kt @@ -25,46 +25,52 @@ import androidx.core.view.updateLayoutParams import com.itsaky.androidide.databinding.FragmentOnboardingBinding import org.appdevforall.codeonthego.fragments.FragmentWithBinding -open class OnboardingFragment : - FragmentWithBinding(FragmentOnboardingBinding::inflate) { +open class OnboardingFragment : FragmentWithBinding(FragmentOnboardingBinding::inflate) { + companion object { + const val KEY_ONBOARDING_TITLE = "ide.onboarding.fragment.title" + const val KEY_ONBOARDING_SUBTITLE = "ide.onboarding.fragment.subtitle" + const val KEY_ONBOARDING_EXTRA_INFO = "ide.onboarding.fragment.extraInfo" - companion object { + @JvmStatic + fun newInstance( + title: CharSequence, + subtitle: CharSequence, + extraInfo: CharSequence = "", + ): OnboardingFragment = + OnboardingFragment().apply { + arguments = + Bundle().apply { + putCharSequence(KEY_ONBOARDING_TITLE, title) + putCharSequence(KEY_ONBOARDING_SUBTITLE, subtitle) + putCharSequence(KEY_ONBOARDING_EXTRA_INFO, extraInfo) + } + } + } - const val KEY_ONBOARDING_TITLE = "ide.onboarding.fragment.title" - const val KEY_ONBOARDING_SUBTITLE = "ide.onboarding.fragment.subtitle" - const val KEY_ONBOARDING_EXTRA_INFO = "ide.onboarding.fragment.extraInfo" + override fun onViewCreated( + view: View, + savedInstanceState: Bundle?, + ) { + super.onViewCreated(view, savedInstanceState) + binding.onboardingTitle.text = requireArguments().getCharSequence(KEY_ONBOARDING_TITLE) + binding.onboardingSubtitle.text = requireArguments().getCharSequence(KEY_ONBOARDING_SUBTITLE) - @JvmStatic - fun newInstance(title: CharSequence, subtitle: CharSequence, - extraInfo: CharSequence = ""): OnboardingFragment { - return OnboardingFragment().apply { - arguments = Bundle().apply { - putCharSequence(KEY_ONBOARDING_TITLE, title) - putCharSequence(KEY_ONBOARDING_SUBTITLE, subtitle) - putCharSequence(KEY_ONBOARDING_EXTRA_INFO, extraInfo) - } - } - } - } + val extraInfo = requireArguments().getCharSequence(KEY_ONBOARDING_EXTRA_INFO, "") + if (extraInfo.isBlank()) { + binding.onboardingExtraInfo.updateLayoutParams { + height = 0 + } + } else { + binding.onboardingExtraInfo.movementMethod = LinkMovementMethodCompat.getInstance() + binding.onboardingExtraInfo.text = extraInfo + } - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - binding.onboardingTitle.text = requireArguments().getCharSequence(KEY_ONBOARDING_TITLE) - binding.onboardingSubtitle.text = requireArguments().getCharSequence(KEY_ONBOARDING_SUBTITLE) + binding.contentContainer.removeAllViews() + createContentView(binding.contentContainer, true) + } - val extraInfo = requireArguments().getCharSequence(KEY_ONBOARDING_EXTRA_INFO, "") - if (extraInfo.isBlank()) { - binding.onboardingExtraInfo.updateLayoutParams { - height = 0 - } - } else { - binding.onboardingExtraInfo.movementMethod = LinkMovementMethodCompat.getInstance() - binding.onboardingExtraInfo.text = extraInfo - } - - binding.contentContainer.removeAllViews() - createContentView(binding.contentContainer, true) - } - - protected open fun createContentView(parent: ViewGroup, attachToParent: Boolean) {} -} \ No newline at end of file + protected open fun createContentView( + parent: ViewGroup, + attachToParent: Boolean, + ) {} +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingInfoFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingInfoFragment.kt index e70511b8b1..15acdad9b8 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingInfoFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingInfoFragment.kt @@ -29,43 +29,46 @@ import org.appdevforall.codeonthego.fragments.FragmentWithBinding /** * @author Akash Yadav */ -class OnboardingInfoFragment : - FragmentWithBinding(FragmentOnboardingInfoBinding::inflate) { +class OnboardingInfoFragment : FragmentWithBinding(FragmentOnboardingInfoBinding::inflate) { + companion object { + const val KEY_INFO_TEXT = "ide.onboarding.infoFragment.info" + const val KEY_INFO_ICON = "ide.onboarding.infoFragment.icon" + const val KEY_INFO_ICON_TINT = "ide.onboarding.infoFragment.icon.tint" - companion object { + @JvmStatic + fun newInstance( + title: CharSequence, + info: CharSequence, + @DrawableRes icon: Int, + @ColorInt iconTint: Int, + ): OnboardingInfoFragment = + OnboardingInfoFragment().apply { + arguments = + Bundle().apply { + putCharSequence(OnboardingFragment.KEY_ONBOARDING_TITLE, title) + putCharSequence(KEY_INFO_TEXT, info) + putInt(KEY_INFO_ICON, icon) + putInt(KEY_INFO_ICON_TINT, iconTint) + } + } + } - const val KEY_INFO_TEXT = "ide.onboarding.infoFragment.info" - const val KEY_INFO_ICON = "ide.onboarding.infoFragment.icon" - const val KEY_INFO_ICON_TINT = "ide.onboarding.infoFragment.icon.tint" + override fun onViewCreated( + view: View, + savedInstanceState: Bundle?, + ) { + super.onViewCreated(view, savedInstanceState) - @JvmStatic - fun newInstance( - title: CharSequence, - info: CharSequence, - @DrawableRes icon: Int, - @ColorInt iconTint: Int - ): OnboardingInfoFragment { - return OnboardingInfoFragment().apply { - arguments = Bundle().apply { - putCharSequence(OnboardingFragment.KEY_ONBOARDING_TITLE, title) - putCharSequence(KEY_INFO_TEXT, info) - putInt(KEY_INFO_ICON, icon) - putInt(KEY_INFO_ICON_TINT, iconTint) - } - } - } - } + binding.infoTitle.text = + requireArguments().getCharSequence(OnboardingFragment.KEY_ONBOARDING_TITLE) - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - - binding.infoTitle.text = requireArguments().getCharSequence( - OnboardingFragment.KEY_ONBOARDING_TITLE) - - binding.infoMessage.text = requireArguments().getCharSequence(KEY_INFO_TEXT) - binding.image.setImageResource(requireArguments().getInt(KEY_INFO_ICON)) - ImageViewCompat.setImageTintList(binding.image, - ColorStateList.valueOf(requireArguments().getInt( - KEY_INFO_ICON_TINT))) - } -} \ No newline at end of file + binding.infoMessage.text = requireArguments().getCharSequence(KEY_INFO_TEXT) + binding.image.setImageResource(requireArguments().getInt(KEY_INFO_ICON)) + ImageViewCompat.setImageTintList( + binding.image, + ColorStateList.valueOf( + requireArguments().getInt(KEY_INFO_ICON_TINT), + ), + ) + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingMultiActionFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingMultiActionFragment.kt index ce6e392a27..302164d13e 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingMultiActionFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/OnboardingMultiActionFragment.kt @@ -21,8 +21,8 @@ import android.os.Build import android.os.Bundle import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import org.appdevforall.codeonthego.adapters.onboarding.DefaultOnboardingItemAdapter import com.itsaky.androidide.databinding.LayoutOnboardingMultiactionBinding +import org.appdevforall.codeonthego.adapters.onboarding.DefaultOnboardingItemAdapter import org.appdevforall.codeonthego.models.OnboardingItem import org.appdevforall.codeonthego.utils.uncheckedCast @@ -30,54 +30,53 @@ import org.appdevforall.codeonthego.utils.uncheckedCast * @author Akash Yadav */ open class OnboardingMultiActionFragment : OnboardingFragment() { + protected var recyclerView: RecyclerView? = null + private set - protected var recyclerView: RecyclerView? = null - private set - - companion object { - - const val KEY_ACTION_ITEMS = "ide.onboarding.multiActionFragment.items" + companion object { + const val KEY_ACTION_ITEMS = "ide.onboarding.multiActionFragment.items" - @JvmStatic - fun newInstance( - title: CharSequence, - subtitle: CharSequence, - items: List - ): OnboardingFragment { - return OnboardingMultiActionFragment().apply { - arguments = Bundle().apply { - putCharSequence(KEY_ONBOARDING_TITLE, title) - putCharSequence(KEY_ONBOARDING_SUBTITLE, subtitle) + @JvmStatic + fun newInstance( + title: CharSequence, + subtitle: CharSequence, + items: List, + ): OnboardingFragment = + OnboardingMultiActionFragment().apply { + arguments = + Bundle().apply { + putCharSequence(KEY_ONBOARDING_TITLE, title) + putCharSequence(KEY_ONBOARDING_SUBTITLE, subtitle) - val arr = items.toTypedArray() - putParcelableArray(KEY_ACTION_ITEMS, arr) - } - } - } - } + val arr = items.toTypedArray() + putParcelableArray(KEY_ACTION_ITEMS, arr) + } + } + } - override fun createContentView(parent: ViewGroup, attachToParent: Boolean) { - val binding = LayoutOnboardingMultiactionBinding.inflate(layoutInflater, parent, attachToParent) - binding.onboardingItems.adapter = createAdapter() - recyclerView = binding.onboardingItems - } + override fun createContentView( + parent: ViewGroup, + attachToParent: Boolean, + ) { + val binding = LayoutOnboardingMultiactionBinding.inflate(layoutInflater, parent, attachToParent) + binding.onboardingItems.adapter = createAdapter() + recyclerView = binding.onboardingItems + } - protected inline fun getItemsFromArgs(): Array { - return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - requireArguments().getParcelableArray(KEY_ACTION_ITEMS, T::class.java)!! - } else { - uncheckedCast( - @Suppress("DEPRECATION") requireArguments().getParcelableArray(KEY_ACTION_ITEMS)!!) - } - } + protected inline fun getItemsFromArgs(): Array = + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + requireArguments().getParcelableArray(KEY_ACTION_ITEMS, T::class.java)!! + } else { + uncheckedCast(@Suppress("DEPRECATION") requireArguments().getParcelableArray(KEY_ACTION_ITEMS)!!) + } - override fun onDestroyView() { - super.onDestroyView() - recyclerView = null - } + override fun onDestroyView() { + super.onDestroyView() + recyclerView = null + } - protected open fun createAdapter(): RecyclerView.Adapter<*> { - val items = getItemsFromArgs() - return DefaultOnboardingItemAdapter(items.toList()) - } -} \ No newline at end of file + protected open fun createAdapter(): RecyclerView.Adapter<*> { + val items = getItemsFromArgs() + return DefaultOnboardingItemAdapter(items.toList()) + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/PermissionsFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/PermissionsFragment.kt index 899b143581..c734aaa8d2 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/PermissionsFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/PermissionsFragment.kt @@ -39,13 +39,19 @@ import com.github.appintro.SlidePolicy import com.github.appintro.SlideSelectionListener import com.google.android.material.button.MaterialButton import com.itsaky.androidide.R +import com.itsaky.androidide.buildinfo.BuildInfo +import com.itsaky.androidide.databinding.LayoutDialogPrivacyConsentBinding +import com.itsaky.androidide.databinding.LayoutOnboardingPermissionsBinding +import io.sentry.Sentry +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.Job +import kotlinx.coroutines.flow.first +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext import org.appdevforall.codeonthego.activities.OnboardingActivity import org.appdevforall.codeonthego.adapters.onboarding.OnboardingPermissionsAdapter import org.appdevforall.codeonthego.app.DeviceProtectedApplicationLoader import org.appdevforall.codeonthego.app.IDEApplication -import com.itsaky.androidide.buildinfo.BuildInfo -import com.itsaky.androidide.databinding.LayoutDialogPrivacyConsentBinding -import com.itsaky.androidide.databinding.LayoutOnboardingPermissionsBinding import org.appdevforall.codeonthego.events.InstallationEvent import org.appdevforall.codeonthego.preferences.internal.StatPreferences import org.appdevforall.codeonthego.preferences.internal.TelemetryConsent @@ -61,12 +67,6 @@ import org.appdevforall.codeonthego.utils.viewLifecycleScope import org.appdevforall.codeonthego.utils.viewLifecycleScopeOrNull import org.appdevforall.codeonthego.viewmodel.InstallationState import org.appdevforall.codeonthego.viewmodel.InstallationViewModel -import io.sentry.Sentry -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.Job -import kotlinx.coroutines.flow.first -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext import org.slf4j.LoggerFactory /** diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/ideSetupConfig.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/ideSetupConfig.kt index b914f3dc81..ab8f25f8c5 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/ideSetupConfig.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/onboarding/ideSetupConfig.kt @@ -29,24 +29,24 @@ private val ALL = arrayOf(CpuArch.AARCH64, CpuArch.ARM, CpuArch.X86_64) */ enum class SdkVersion(val version: String, val supportedArchs: Array) { - SDK_33_0_1("33.0.1", ARM_ONLY), - SDK_34_0_0("34.0.0", ARM_ONLY), - SDK_34_0_1("34.0.1", ARM_ONLY), - SDK_34_0_3("34.0.3", ARM_ONLY), - SDK_34_0_4("34.0.4", ALL), - ; +SDK_33_0_1("33.0.1", ARM_ONLY), +SDK_34_0_0("34.0.0", ARM_ONLY), +SDK_34_0_1("34.0.1", ARM_ONLY), +SDK_34_0_3("34.0.3", ARM_ONLY), +SDK_34_0_4("34.0.4", ALL), +; - val displayName = "SDK $version" +val displayName = "SDK $version" - companion object { +companion object { - @JvmStatic - fun fromDisplayName(displayName: CharSequence) = - entries.first { it.displayName.contentEquals(displayName) } + @JvmStatic + fun fromDisplayName(displayName: CharSequence) = + entries.first { it.displayName.contentEquals(displayName) } - @JvmStatic - fun fromVersion(version: CharSequence) = entries.first { it.version.contentEquals(version) } - } + @JvmStatic + fun fromVersion(version: CharSequence) = entries.first { it.version.contentEquals(version) } +} } /** @@ -56,19 +56,19 @@ enum class SdkVersion(val version: String, val supportedArchs: Array) { */ enum class JdkVersion(val version: String) { - JDK_17("17"), - JDK_21("21"), - ; +JDK_17("17"), +JDK_21("21"), +; - val displayName = "JDK $version" +val displayName = "JDK $version" - companion object { +companion object { - @JvmStatic - fun fromDisplayName(displayName: CharSequence) = - entries.first { it.displayName.contentEquals(displayName) } + @JvmStatic + fun fromDisplayName(displayName: CharSequence) = + entries.first { it.displayName.contentEquals(displayName) } - @JvmStatic - fun fromVersion(version: CharSequence) = entries.first { it.version.contentEquals(version) } - } -} \ No newline at end of file + @JvmStatic + fun fromVersion(version: CharSequence) = entries.first { it.version.contentEquals(version) } +} +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/output/BuildOutputFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/BuildOutputFragment.kt index 90bd4e0de3..da5ae31987 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/output/BuildOutputFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/BuildOutputFragment.kt @@ -27,15 +27,6 @@ import androidx.fragment.app.activityViewModels import androidx.lifecycle.lifecycleScope import com.itsaky.androidide.R import com.itsaky.androidide.databinding.LayoutLogFilterBarBinding -import org.appdevforall.codeonthego.editor.ui.EditorSearchLayout -import org.appdevforall.codeonthego.editor.ui.IDEEditor -import org.appdevforall.codeonthego.idetooltips.TooltipTag -import org.appdevforall.codeonthego.models.LogFilter -import org.appdevforall.codeonthego.preferences.internal.EditorPreferences -import org.appdevforall.codeonthego.utils.BasicBuildInfo -import org.appdevforall.codeonthego.utils.dpToPx -import org.appdevforall.codeonthego.utils.flashInfo -import org.appdevforall.codeonthego.viewmodel.BuildOutputViewModel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.ReceiveChannel @@ -48,6 +39,15 @@ import kotlinx.coroutines.sync.withLock import kotlinx.coroutines.withContext import kotlinx.coroutines.withTimeoutOrNull import kotlinx.coroutines.yield +import org.appdevforall.codeonthego.editor.ui.EditorSearchLayout +import org.appdevforall.codeonthego.editor.ui.IDEEditor +import org.appdevforall.codeonthego.idetooltips.TooltipTag +import org.appdevforall.codeonthego.models.LogFilter +import org.appdevforall.codeonthego.preferences.internal.EditorPreferences +import org.appdevforall.codeonthego.utils.BasicBuildInfo +import org.appdevforall.codeonthego.utils.dpToPx +import org.appdevforall.codeonthego.utils.flashInfo +import org.appdevforall.codeonthego.viewmodel.BuildOutputViewModel class BuildOutputFragment : NonEditableEditorFragment(), diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/output/LogFilterBarController.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/LogFilterBarController.kt index c82986fe6a..d79d3974a5 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/output/LogFilterBarController.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/LogFilterBarController.kt @@ -20,12 +20,12 @@ package org.appdevforall.codeonthego.fragments.output import androidx.core.view.isVisible import androidx.core.widget.doAfterTextChanged import com.itsaky.androidide.databinding.LayoutLogFilterBarBinding -import org.appdevforall.codeonthego.utils.ILogger -import org.appdevforall.codeonthego.utils.KeyboardUtils import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job import kotlinx.coroutines.delay import kotlinx.coroutines.launch +import org.appdevforall.codeonthego.utils.ILogger +import org.appdevforall.codeonthego.utils.KeyboardUtils import java.util.EnumSet /** diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/output/LogViewFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/LogViewFragment.kt index 50969099ca..2d4d2d4251 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/output/LogViewFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/LogViewFragment.kt @@ -24,9 +24,20 @@ import androidx.annotation.UiThread import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import com.itsaky.androidide.R -import org.appdevforall.codeonthego.activities.editor.BaseEditorActivity import com.itsaky.androidide.databinding.FragmentLogBinding import com.itsaky.androidide.databinding.LayoutLogFilterBarBinding +import io.github.rosemoe.sora.event.ClickEvent +import io.github.rosemoe.sora.util.IntPair +import io.github.rosemoe.sora.widget.REGION_TEXT +import io.github.rosemoe.sora.widget.resolveTouchRegion +import io.github.rosemoe.sora.widget.style.CursorAnimator +import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.Job +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext +import kotlinx.coroutines.withTimeoutOrNull +import org.appdevforall.codeonthego.activities.editor.BaseEditorActivity import org.appdevforall.codeonthego.editor.language.treesitter.LogLanguage import org.appdevforall.codeonthego.editor.language.treesitter.TreeSitterLanguageProvider import org.appdevforall.codeonthego.editor.schemes.IDEColorScheme @@ -51,17 +62,6 @@ import org.appdevforall.codeonthego.utils.isTestMode import org.appdevforall.codeonthego.utils.jetbrainsMono import org.appdevforall.codeonthego.utils.viewLifecycleScope import org.appdevforall.codeonthego.viewmodel.LogViewModel -import io.github.rosemoe.sora.event.ClickEvent -import io.github.rosemoe.sora.util.IntPair -import io.github.rosemoe.sora.widget.REGION_TEXT -import io.github.rosemoe.sora.widget.resolveTouchRegion -import io.github.rosemoe.sora.widget.style.CursorAnimator -import kotlinx.coroutines.CancellationException -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.Job -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext -import kotlinx.coroutines.withTimeoutOrNull import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/output/NonEditableEditorFragment.java b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/NonEditableEditorFragment.java index ae13fcb02b..ca92ea5c8a 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/output/NonEditableEditorFragment.java +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/output/NonEditableEditorFragment.java @@ -23,6 +23,7 @@ import androidx.annotation.Nullable; import com.itsaky.androidide.R; import com.itsaky.androidide.databinding.FragmentNonEditableEditorBinding; +import io.github.rosemoe.sora.lang.EmptyLanguage; import org.appdevforall.codeonthego.editor.ui.IDEEditor; import org.appdevforall.codeonthego.eventbus.events.preferences.PreferenceChangeEvent; import org.appdevforall.codeonthego.fragments.EmptyStateFragment; @@ -30,7 +31,6 @@ import org.appdevforall.codeonthego.syntax.colorschemes.SchemeAndroidIDE; import org.appdevforall.codeonthego.utils.BasicBuildInfo; import org.appdevforall.codeonthego.utils.TypefaceUtilsKt; -import io.github.rosemoe.sora.lang.EmptyLanguage; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/sheets/BaseBottomSheetFragment.java b/app/src/main/java/org/appdevforall/codeonthego/fragments/sheets/BaseBottomSheetFragment.java index d608abce35..d6509a7a93 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/sheets/BaseBottomSheetFragment.java +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/sheets/BaseBottomSheetFragment.java @@ -24,16 +24,16 @@ public abstract class BaseBottomSheetFragment extends BottomSheetDialogFragment { - protected Dialog mDialog; + protected Dialog mDialog; - @NonNull - @Override - public Dialog onCreateDialog(Bundle savedInstanceState) { - mDialog = super.onCreateDialog(savedInstanceState); - return mDialog; - } + public boolean isShowing() { + return mDialog != null && mDialog.isShowing(); + } - public boolean isShowing() { - return mDialog != null && mDialog.isShowing(); - } + @NonNull + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + mDialog = super.onCreateDialog(savedInstanceState); + return mDialog; + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/sheets/OptionsListFragment.java b/app/src/main/java/org/appdevforall/codeonthego/fragments/sheets/OptionsListFragment.java index ccc8cc75c5..0cd3c99c17 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/sheets/OptionsListFragment.java +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/sheets/OptionsListFragment.java @@ -28,13 +28,13 @@ import androidx.annotation.Nullable; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import java.util.ArrayList; +import java.util.List; import org.appdevforall.codeonthego.adapters.OptionsSheetAdapter; import org.appdevforall.codeonthego.events.FileContextMenuItemClickEvent; import org.appdevforall.codeonthego.events.FileContextMenuItemLongClickEvent; import org.appdevforall.codeonthego.models.SheetOption; import org.appdevforall.codeonthego.utils.ContextUtilsKt; -import java.util.ArrayList; -import java.util.List; import org.greenrobot.eventbus.EventBus; public class OptionsListFragment extends BaseBottomSheetFragment { diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/BuildVariantsFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/BuildVariantsFragment.kt index f87249e016..2c8de2b5a5 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/BuildVariantsFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/BuildVariantsFragment.kt @@ -21,9 +21,9 @@ import android.os.Bundle import android.view.View import androidx.fragment.app.viewModels import androidx.recyclerview.widget.DividerItemDecoration +import com.itsaky.androidide.databinding.FragmentBuildVariantsBinding import org.appdevforall.codeonthego.activities.editor.ProjectHandlerActivity import org.appdevforall.codeonthego.adapters.BuildVariantsAdapter -import com.itsaky.androidide.databinding.FragmentBuildVariantsBinding import org.appdevforall.codeonthego.fragments.EmptyStateFragment import org.appdevforall.codeonthego.tooling.api.models.BuildVariantInfo import org.appdevforall.codeonthego.viewmodel.BuildVariantsViewModel diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/EditorSidebarFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/EditorSidebarFragment.kt index 91bd8685fc..79b1e255d5 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/EditorSidebarFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/EditorSidebarFragment.kt @@ -19,8 +19,8 @@ package org.appdevforall.codeonthego.fragments.sidebar import android.os.Bundle import android.view.View -import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity import com.itsaky.androidide.databinding.FragmentEditorSidebarBinding +import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity import org.appdevforall.codeonthego.fragments.FragmentWithBinding import org.appdevforall.codeonthego.idetooltips.TooltipCategory import org.appdevforall.codeonthego.idetooltips.TooltipManager @@ -31,35 +31,38 @@ import org.appdevforall.codeonthego.utils.EditorSidebarActions * * @author Akash Yadav */ -class EditorSidebarFragment : FragmentWithBinding( - FragmentEditorSidebarBinding::inflate -) { - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - EditorSidebarActions.setup(this) - } +class EditorSidebarFragment : + FragmentWithBinding( + FragmentEditorSidebarBinding::inflate, + ) { + override fun onViewCreated( + view: View, + savedInstanceState: Bundle?, + ) { + super.onViewCreated(view, savedInstanceState) + EditorSidebarActions.setup(this) + } - fun setupTooltip( - view: View, - tooltipTag: String, - category: String = TooltipCategory.CATEGORY_IDE, - ) { - (requireActivity() as? EditorHandlerActivity)?.let { activity -> - view.setOnLongClickListener { view -> - TooltipManager.showTooltip( - context = view.context, - anchorView = view, - category = category, - tag = tooltipTag, - ) - true - } - } - } + fun setupTooltip( + view: View, + tooltipTag: String, + category: String = TooltipCategory.CATEGORY_IDE, + ) { + (requireActivity() as? EditorHandlerActivity)?.let { activity -> + view.setOnLongClickListener { view -> + TooltipManager.showTooltip( + context = view.context, + anchorView = view, + category = category, + tag = tooltipTag, + ) + true + } + } + } - /** - * Get the (nullable) binding object for this fragment. - */ - internal fun getBinding() = _binding + /** + * Get the (nullable) binding object for this fragment. + */ + internal fun getBinding() = _binding } diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeDropController.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeDropController.kt index 8010e242ff..a13611f5f8 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeDropController.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeDropController.kt @@ -6,127 +6,147 @@ import android.view.View import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.lifecycleScope import com.itsaky.androidide.R +import com.unnamed.b.atv.model.TreeNode +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext import org.appdevforall.codeonthego.adapters.viewholders.FileTreeViewHolder import org.appdevforall.codeonthego.dnd.DragEventRouter import org.appdevforall.codeonthego.dnd.DropTargetCallback import org.appdevforall.codeonthego.dnd.hasImportableContent import org.appdevforall.codeonthego.utils.DropHighlighter import org.appdevforall.codeonthego.utils.FileImporter -import com.unnamed.b.atv.model.TreeNode -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext import java.io.File - internal class FileTreeDropController( - private val activity: Activity, - private val onDropCompleted: (TreeNode?, File, Int) -> Unit, - private val onDropFailed: (String) -> Unit, + private val activity: Activity, + private val onDropCompleted: (TreeNode?, File, Int) -> Unit, + private val onDropFailed: (String) -> Unit, ) { - - private data class DropTarget(val node: TreeNode?, val file: File) - - val nodeBinder = FileTreeViewHolder.ExternalDropHandler { node, file, view -> - bindDropTarget(view, DropTarget(node, file)) - } - - fun bindRootTarget(containerView: View, projectRootDirectory: File) { - bindDropTarget(containerView, DropTarget(null, projectRootDirectory)) - } - - private fun bindDropTarget(view: View, target: DropTarget) { - val dropCallback = object : DropTargetCallback { - override fun canAcceptDrop(event: DragEvent): Boolean { - return event.hasImportableContent(activity) - } - - override fun onDragEntered(view: View) { - DropHighlighter.highlight(view, activity) - } - - override fun onDragExited(view: View) { - DropHighlighter.clear(view) - } - - override fun onDrop(event: DragEvent): Boolean { - return importDroppedFiles(target, event) - } - } - - view.setOnDragListener(DragEventRouter(dropCallback)) - } - - private fun importDroppedFiles(target: DropTarget, event: DragEvent): Boolean { - val context = activity.applicationContext - val clipData = event.clipData ?: return false - val dragPermissions = activity.requestDragAndDropPermissions(event) - - val lifecycleOwner = activity as? LifecycleOwner - if (lifecycleOwner == null) { - dragPermissions?.release() - return false - } - - lifecycleOwner.lifecycleScope.launch { - val result = runCatching { - withContext(Dispatchers.IO) { - FileImporter(context).copyDroppedFiles(clipData, target.file) - } - } - - dragPermissions?.release() - - handleImportResult( - target = target, - result = result.getOrNull(), - error = result.exceptionOrNull() - ) - } - - return true - } - - private fun handleImportResult( - target: DropTarget, - result: FileImporter.ImportResult?, - error: Throwable? - ) { - if (activity.isFinishing || activity.isDestroyed) return - - if (error != null) { - onDropFailed(error.toReadableMessage()) - return - } - - when (result) { - is FileImporter.ImportResult.Success -> handleSuccess(target, result) - is FileImporter.ImportResult.PartialSuccess -> handlePartialSuccess(target, result) - is FileImporter.ImportResult.Failure -> onDropFailed(result.error.toReadableMessage()) - else -> {} - } - } - - private fun handleSuccess(target: DropTarget, result: FileImporter.ImportResult.Success) { - if (result.count > 0) { - onDropCompleted(target.node, target.file, result.count) - } else { - val noFilesMsg = activity.getString(R.string.msg_file_tree_drop_no_files) - onDropFailed(noFilesMsg) - } - } - - private fun handlePartialSuccess( - target: DropTarget, - result: FileImporter.ImportResult.PartialSuccess - ) { - onDropCompleted(target.node, target.file, result.count) - onDropFailed(result.error.toReadableMessage()) - } - - private fun Throwable.toReadableMessage(): String { - return cause?.message - ?: message - ?: activity.getString(R.string.msg_file_tree_drop_import_failed) - } + private data class DropTarget( + val node: TreeNode?, + val file: File, + ) + + val nodeBinder = + FileTreeViewHolder.ExternalDropHandler { node, file, view -> + bindDropTarget(view, DropTarget(node, file)) + } + + fun bindRootTarget( + containerView: View, + projectRootDirectory: File, + ) { + bindDropTarget(containerView, DropTarget(null, projectRootDirectory)) + } + + private fun bindDropTarget( + view: View, + target: DropTarget, + ) { + val dropCallback = + object : DropTargetCallback { + override fun canAcceptDrop(event: DragEvent): Boolean = event.hasImportableContent(activity) + + override fun onDragEntered(view: View) { + DropHighlighter.highlight(view, activity) + } + + override fun onDragExited(view: View) { + DropHighlighter.clear(view) + } + + override fun onDrop(event: DragEvent): Boolean = importDroppedFiles(target, event) + } + + view.setOnDragListener(DragEventRouter(dropCallback)) + } + + private fun importDroppedFiles( + target: DropTarget, + event: DragEvent, + ): Boolean { + val context = activity.applicationContext + val clipData = event.clipData ?: return false + val dragPermissions = activity.requestDragAndDropPermissions(event) + + val lifecycleOwner = activity as? LifecycleOwner + if (lifecycleOwner == null) { + dragPermissions?.release() + return false + } + + lifecycleOwner.lifecycleScope.launch { + val result = + runCatching { + withContext(Dispatchers.IO) { + FileImporter(context).copyDroppedFiles(clipData, target.file) + } + } + + dragPermissions?.release() + + handleImportResult( + target = target, + result = result.getOrNull(), + error = result.exceptionOrNull(), + ) + } + + return true + } + + private fun handleImportResult( + target: DropTarget, + result: FileImporter.ImportResult?, + error: Throwable?, + ) { + if (activity.isFinishing || activity.isDestroyed) return + + if (error != null) { + onDropFailed(error.toReadableMessage()) + return + } + + when (result) { + is FileImporter.ImportResult.Success -> { + handleSuccess(target, result) + } + + is FileImporter.ImportResult.PartialSuccess -> { + handlePartialSuccess(target, result) + } + + is FileImporter.ImportResult.Failure -> { + onDropFailed(result.error.toReadableMessage()) + } + + else -> {} + } + } + + private fun handleSuccess( + target: DropTarget, + result: FileImporter.ImportResult.Success, + ) { + if (result.count > 0) { + onDropCompleted(target.node, target.file, result.count) + } else { + val noFilesMsg = activity.getString(R.string.msg_file_tree_drop_no_files) + onDropFailed(noFilesMsg) + } + } + + private fun handlePartialSuccess( + target: DropTarget, + result: FileImporter.ImportResult.PartialSuccess, + ) { + onDropCompleted(target.node, target.file, result.count) + onDropFailed(result.error.toReadableMessage()) + } + + private fun Throwable.toReadableMessage(): String = + cause?.message + ?: message + ?: activity.getString(R.string.msg_file_tree_drop_import_failed) } diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeFragment.kt index 992e56163b..647611fad4 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeFragment.kt @@ -36,9 +36,15 @@ import androidx.transition.ChangeBounds import androidx.transition.TransitionManager import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.itsaky.androidide.R +import com.itsaky.androidide.databinding.LayoutEditorFileTreeBinding +import com.itsaky.androidide.resources.R.drawable +import com.unnamed.b.atv.model.TreeNode +import com.unnamed.b.atv.model.TreeNode.TreeNodeClickListener +import com.unnamed.b.atv.model.TreeNode.TreeNodeLongClickListener +import com.unnamed.b.atv.view.AndroidTreeView +import kotlinx.coroutines.launch import org.appdevforall.codeonthego.adapters.FileSearchAdapter import org.appdevforall.codeonthego.adapters.viewholders.FileTreeViewHolder -import com.itsaky.androidide.databinding.LayoutEditorFileTreeBinding import org.appdevforall.codeonthego.dnd.FileDragError import org.appdevforall.codeonthego.dnd.FileDragResult import org.appdevforall.codeonthego.dnd.FileDragStarter @@ -49,7 +55,6 @@ import org.appdevforall.codeonthego.events.CollapseTreeNodeRequestEvent import org.appdevforall.codeonthego.events.ExpandTreeNodeRequestEvent import org.appdevforall.codeonthego.events.ListProjectFilesRequestEvent import org.appdevforall.codeonthego.projects.IProjectManager -import com.itsaky.androidide.resources.R.drawable import org.appdevforall.codeonthego.tasks.TaskExecutor.executeAsync import org.appdevforall.codeonthego.tasks.callables.FileTreeCallable import org.appdevforall.codeonthego.tasks.callables.FileTreeCallable.SortFileName @@ -63,11 +68,6 @@ import org.appdevforall.codeonthego.utils.flashSuccess import org.appdevforall.codeonthego.viewmodel.FileSearchUiState import org.appdevforall.codeonthego.viewmodel.FileSearchViewModel import org.appdevforall.codeonthego.viewmodel.FileTreeViewModel -import com.unnamed.b.atv.model.TreeNode -import com.unnamed.b.atv.model.TreeNode.TreeNodeClickListener -import com.unnamed.b.atv.model.TreeNode.TreeNodeLongClickListener -import com.unnamed.b.atv.view.AndroidTreeView -import kotlinx.coroutines.launch import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode.MAIN diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeSelectionFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeSelectionFragment.kt index 54c8c28559..29209fed72 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeSelectionFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/FileTreeSelectionFragment.kt @@ -23,98 +23,98 @@ import java.io.File class FileTreeSelectionFragment : Fragment(R.layout.fragment_file_tree_selection) { - private var _binding: FragmentFileTreeSelectionBinding? = null - private val binding get() = _binding!! - - private val selectedFiles = mutableSetOf() - private var treeView: AndroidTreeView? = null - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - _binding = FragmentFileTreeSelectionBinding.bind(view) - loadTreeData() - setupListeners() - } - - private fun loadTreeData() { - binding.loadingIndicator.isVisible = true - val safeContext = requireContext() - viewLifecycleOwner.lifecycleScope.launch { - val projectRootFile = IProjectManager.getInstance().projectDir - if (!projectRootFile.exists()) { - binding.loadingIndicator.isVisible = false - return@launch - } - - val rootNode = withContext(Dispatchers.IO) { - val node = TreeNode.root() - buildTreeNodes(node, projectRootFile, safeContext) - node - } - if (isAdded) { - setupTreeView(rootNode) - } - } - } - - private fun setupTreeView(rootNode: TreeNode) { - binding.loadingIndicator.isVisible = false - treeView = AndroidTreeView(requireContext(), rootNode, R.drawable.bg_ripple) - binding.fileTreeContainer.addView(treeView!!.view) - rootNode.children?.forEach { treeView?.expandNode(it) } - } - - private suspend fun buildTreeNodes(parentNode: TreeNode, dir: File, context: Context) { - dir.listFiles() - ?.sortedWith(compareBy({ !it.isDirectory }, { it.name })) - ?.forEach { file -> - currentCoroutineContext().ensureActive() - val node = TreeNode(file).apply { - viewHolder = MultiSelectFileTreeViewHolder(context, selectedFiles) - } - parentNode.addChild(node) - if (file.isDirectory) { - buildTreeNodes(node, file, context) - } - } - } - - private fun setupListeners() { - binding.fileTreeToolbar.setNavigationOnClickListener { findNavController().popBackStack() } - binding.btnCancelSelection.setOnClickListener { findNavController().popBackStack() } - binding.btnConfirmSelection.setOnClickListener { - - val finalContextList = mutableListOf() - - val baseDir = IProjectManager.getInstance().projectDir - - selectedFiles.forEach { selectedPath -> - val relativePath = selectedPath.relativeTo(baseDir).path - // Create a File object by joining the project root with the relative path - val target = File(baseDir, relativePath) - - if (target.exists() && target.isDirectory) { - // It's a valid directory, so walk through it and add all readable files - target.walkTopDown() - .filter { walkedFile -> walkedFile.isFile && walkedFile.canRead() } - .forEach { walkedFile -> - finalContextList.add(walkedFile.relativeTo(baseDir).path) - } - } else if (target.exists() && target.isFile && target.canRead()) { - // It's a single, readable file - finalContextList.add(relativePath) - } - } - - setFragmentResult("file_selection_request", Bundle().apply { - putStringArrayList("selected_paths", ArrayList(finalContextList.distinct())) - }) - findNavController().popBackStack() - } - } - - override fun onDestroyView() { - super.onDestroyView() - _binding = null - } -} \ No newline at end of file + private var _binding: FragmentFileTreeSelectionBinding? = null + private val binding get() = _binding!! + + private val selectedFiles = mutableSetOf() + private var treeView: AndroidTreeView? = null + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + _binding = FragmentFileTreeSelectionBinding.bind(view) + loadTreeData() + setupListeners() + } + + private fun loadTreeData() { + binding.loadingIndicator.isVisible = true + val safeContext = requireContext() + viewLifecycleOwner.lifecycleScope.launch { + val projectRootFile = IProjectManager.getInstance().projectDir + if (!projectRootFile.exists()) { + binding.loadingIndicator.isVisible = false + return@launch + } + + val rootNode = withContext(Dispatchers.IO) { + val node = TreeNode.root() + buildTreeNodes(node, projectRootFile, safeContext) + node + } + if (isAdded) { + setupTreeView(rootNode) + } + } + } + + private fun setupTreeView(rootNode: TreeNode) { + binding.loadingIndicator.isVisible = false + treeView = AndroidTreeView(requireContext(), rootNode, R.drawable.bg_ripple) + binding.fileTreeContainer.addView(treeView!!.view) + rootNode.children?.forEach { treeView?.expandNode(it) } + } + + private suspend fun buildTreeNodes(parentNode: TreeNode, dir: File, context: Context) { + dir.listFiles() + ?.sortedWith(compareBy({ !it.isDirectory }, { it.name })) + ?.forEach { file -> + currentCoroutineContext().ensureActive() + val node = TreeNode(file).apply { + viewHolder = MultiSelectFileTreeViewHolder(context, selectedFiles) + } + parentNode.addChild(node) + if (file.isDirectory) { + buildTreeNodes(node, file, context) + } + } + } + + private fun setupListeners() { + binding.fileTreeToolbar.setNavigationOnClickListener { findNavController().popBackStack() } + binding.btnCancelSelection.setOnClickListener { findNavController().popBackStack() } + binding.btnConfirmSelection.setOnClickListener { + + val finalContextList = mutableListOf() + + val baseDir = IProjectManager.getInstance().projectDir + + selectedFiles.forEach { selectedPath -> + val relativePath = selectedPath.relativeTo(baseDir).path + // Create a File object by joining the project root with the relative path + val target = File(baseDir, relativePath) + + if (target.exists() && target.isDirectory) { + // It's a valid directory, so walk through it and add all readable files + target.walkTopDown() + .filter { walkedFile -> walkedFile.isFile && walkedFile.canRead() } + .forEach { walkedFile -> + finalContextList.add(walkedFile.relativeTo(baseDir).path) + } + } else if (target.exists() && target.isFile && target.canRead()) { + // It's a single, readable file + finalContextList.add(relativePath) + } + } + + setFragmentResult("file_selection_request", Bundle().apply { + putStringArrayList("selected_paths", ArrayList(finalContextList.distinct())) + }) + findNavController().popBackStack() + } + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/OutlineFragment.kt b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/OutlineFragment.kt index 0e1474294d..5745b61ec9 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/OutlineFragment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/fragments/sidebar/OutlineFragment.kt @@ -13,6 +13,7 @@ import androidx.fragment.app.activityViewModels import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle +import kotlinx.coroutines.launch import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity import org.appdevforall.codeonthego.common.compose.IdeTheme import org.appdevforall.codeonthego.editor.ui.IDEEditor @@ -23,7 +24,6 @@ import org.appdevforall.codeonthego.ui.models.OutlineUiEffect import org.appdevforall.codeonthego.ui.outline.OutlinePanel import org.appdevforall.codeonthego.viewmodel.EditorViewModel import org.appdevforall.codeonthego.viewmodel.OutlineViewModel -import kotlinx.coroutines.launch import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode.MAIN diff --git a/app/src/main/java/org/appdevforall/codeonthego/handlers/BaseEventHandler.kt b/app/src/main/java/org/appdevforall/codeonthego/handlers/BaseEventHandler.kt index 534f36a653..37493856a9 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/handlers/BaseEventHandler.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/handlers/BaseEventHandler.kt @@ -30,18 +30,14 @@ import org.slf4j.LoggerFactory * @author Akash Yadav */ abstract class BaseEventHandler : EventReceiver { + companion object { + @JvmStatic + protected val log: Logger = LoggerFactory.getLogger(BaseEventHandler::class.java) + } - companion object { + protected open fun checkIsEditorActivity(event: Event): Boolean = event.get(Context::class.java) is EditorHandlerActivity - @JvmStatic - protected val log: Logger = LoggerFactory.getLogger(BaseEventHandler::class.java) - } - - protected open fun checkIsEditorActivity(event: Event): Boolean { - return event.get(Context::class.java) is EditorHandlerActivity - } - - protected open fun logCannotHandle(event: Event) { - log.warn("Context is not EditorActivity. Cannot handle {} event.", event.javaClass.simpleName) - } + protected open fun logCannotHandle(event: Event) { + log.warn("Context is not EditorActivity. Cannot handle {} event.", event.javaClass.simpleName) + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/handlers/CrashEventSubscriber.kt b/app/src/main/java/org/appdevforall/codeonthego/handlers/CrashEventSubscriber.kt index d439722edf..35d315c876 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/handlers/CrashEventSubscriber.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/handlers/CrashEventSubscriber.kt @@ -1,10 +1,10 @@ package org.appdevforall.codeonthego.handlers import android.content.Intent +import io.sentry.Sentry import org.appdevforall.codeonthego.activities.CrashHandlerActivity import org.appdevforall.codeonthego.app.IDEApplication import org.appdevforall.codeonthego.eventbus.events.editor.ReportCaughtExceptionEvent -import io.sentry.Sentry import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode import org.slf4j.LoggerFactory diff --git a/app/src/main/java/org/appdevforall/codeonthego/handlers/EditorBuildEventListener.kt b/app/src/main/java/org/appdevforall/codeonthego/handlers/EditorBuildEventListener.kt index c01856071b..e3bcf7a1c1 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/handlers/EditorBuildEventListener.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/handlers/EditorBuildEventListener.kt @@ -20,11 +20,11 @@ package org.appdevforall.codeonthego.handlers import android.os.SystemClock import androidx.annotation.VisibleForTesting import com.itsaky.androidide.R +import com.itsaky.androidide.resources.R.string import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences import org.appdevforall.codeonthego.projects.builder.BuildResult import org.appdevforall.codeonthego.projects.builder.LaunchResult -import com.itsaky.androidide.resources.R.string import org.appdevforall.codeonthego.services.builder.GradleBuildService import org.appdevforall.codeonthego.tooling.api.messages.result.BuildInfo import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult diff --git a/app/src/main/java/org/appdevforall/codeonthego/handlers/FileTreeActionHandler.kt b/app/src/main/java/org/appdevforall/codeonthego/handlers/FileTreeActionHandler.kt index 63711bcd87..dd5aaf85b8 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/handlers/FileTreeActionHandler.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/handlers/FileTreeActionHandler.kt @@ -20,6 +20,10 @@ package org.appdevforall.codeonthego.handlers import android.content.Context import androidx.core.view.GravityCompat import androidx.lifecycle.lifecycleScope +import com.unnamed.b.atv.model.TreeNode +import kotlinx.coroutines.launch +import org.adfa.constants.PLUGIN_ARCHIVE_EXTENSION +import org.adfa.constants.TEMPLATE_ARCHIVE_EXTENSION import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.ActionItem.Location.EDITOR_FILE_TREE import org.appdevforall.codeonthego.actions.ActionMenu @@ -38,10 +42,6 @@ import org.appdevforall.codeonthego.idetooltips.TooltipManager import org.appdevforall.codeonthego.models.SheetOption import org.appdevforall.codeonthego.plugins.extensions.FileTabMenuItem import org.appdevforall.codeonthego.utils.flashError -import com.unnamed.b.atv.model.TreeNode -import kotlinx.coroutines.launch -import org.adfa.constants.PLUGIN_ARCHIVE_EXTENSION -import org.adfa.constants.TEMPLATE_ARCHIVE_EXTENSION import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode.MAIN diff --git a/app/src/main/java/org/appdevforall/codeonthego/handlers/GlitchTipDiagnosticsContext.kt b/app/src/main/java/org/appdevforall/codeonthego/handlers/GlitchTipDiagnosticsContext.kt index d1ef0d775b..ced9272618 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/handlers/GlitchTipDiagnosticsContext.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/handlers/GlitchTipDiagnosticsContext.kt @@ -20,20 +20,20 @@ package org.appdevforall.codeonthego.handlers import android.content.pm.ApplicationInfo import android.os.SystemClock -import org.appdevforall.codeonthego.analytics.AttachedDevicesCollector -import org.appdevforall.codeonthego.app.IDEApplication -import org.appdevforall.codeonthego.app.configuration.IDEBuildConfigProvider import com.itsaky.androidide.buildinfo.BuildInfo -import org.appdevforall.codeonthego.plugins.manager.core.PluginManager -import org.appdevforall.codeonthego.utils.BuildInfoUtils -import org.appdevforall.codeonthego.utils.DeviceUtils -import org.appdevforall.codeonthego.utils.getAppVersionCode import com.termux.shared.android.PackageUtils import com.termux.shared.android.SELinuxUtils import io.sentry.EventProcessor import io.sentry.Hint import io.sentry.SentryEvent import io.sentry.SentryOptions +import org.appdevforall.codeonthego.analytics.AttachedDevicesCollector +import org.appdevforall.codeonthego.app.IDEApplication +import org.appdevforall.codeonthego.app.configuration.IDEBuildConfigProvider +import org.appdevforall.codeonthego.plugins.manager.core.PluginManager +import org.appdevforall.codeonthego.utils.BuildInfoUtils +import org.appdevforall.codeonthego.utils.DeviceUtils +import org.appdevforall.codeonthego.utils.getAppVersionCode import org.slf4j.LoggerFactory /** diff --git a/app/src/main/java/org/appdevforall/codeonthego/handlers/MetricsCrashAttachment.kt b/app/src/main/java/org/appdevforall/codeonthego/handlers/MetricsCrashAttachment.kt index ef460a2c05..f538c9d295 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/handlers/MetricsCrashAttachment.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/handlers/MetricsCrashAttachment.kt @@ -19,15 +19,15 @@ package org.appdevforall.codeonthego.handlers import android.content.Context import android.os.SystemClock -import org.appdevforall.codeonthego.utils.MetricsCsv -import org.appdevforall.codeonthego.utils.MetricsCsvFile -import org.appdevforall.codeonthego.utils.MetricsSnapshotAssembler -import org.appdevforall.codeonthego.utils.MetricsSource import io.sentry.Attachment import io.sentry.EventProcessor import io.sentry.Hint import io.sentry.SentryEvent import io.sentry.SentryOptions +import org.appdevforall.codeonthego.utils.MetricsCsv +import org.appdevforall.codeonthego.utils.MetricsCsvFile +import org.appdevforall.codeonthego.utils.MetricsSnapshotAssembler +import org.appdevforall.codeonthego.utils.MetricsSource import org.slf4j.LoggerFactory import java.io.File diff --git a/app/src/main/java/org/appdevforall/codeonthego/interfaces/DiagnosticClickListener.java b/app/src/main/java/org/appdevforall/codeonthego/interfaces/DiagnosticClickListener.java index 64729205e1..353bc1968e 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/interfaces/DiagnosticClickListener.java +++ b/app/src/main/java/org/appdevforall/codeonthego/interfaces/DiagnosticClickListener.java @@ -17,12 +17,12 @@ **************************************************************************************/ package org.appdevforall.codeonthego.interfaces; +import java.io.File; import org.appdevforall.codeonthego.lsp.models.DiagnosticItem; import org.appdevforall.codeonthego.models.DiagnosticGroup; -import java.io.File; public interface DiagnosticClickListener { - void onGroupClick(DiagnosticGroup group); + void onDiagnosticClick(File file, DiagnosticItem diagnostic); - void onDiagnosticClick(File file, DiagnosticItem diagnostic); + void onGroupClick(DiagnosticGroup group); } diff --git a/app/src/main/java/org/appdevforall/codeonthego/lsp/BreakpointHandler.kt b/app/src/main/java/org/appdevforall/codeonthego/lsp/BreakpointHandler.kt index 26f9d4d339..23e2adcc5c 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/lsp/BreakpointHandler.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/lsp/BreakpointHandler.kt @@ -417,4 +417,4 @@ class BreakpointHandler { fun onHighlightLine(file: String, line: Int) {} fun onUnhighlight() } -} \ No newline at end of file +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/lsp/IDEDebugClientImpl.kt b/app/src/main/java/org/appdevforall/codeonthego/lsp/IDEDebugClientImpl.kt index 70ed763a7c..25c2de7db7 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/lsp/IDEDebugClientImpl.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/lsp/IDEDebugClientImpl.kt @@ -2,6 +2,14 @@ package org.appdevforall.codeonthego.lsp import android.annotation.SuppressLint import android.widget.RemoteViews.RemoteView +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.DelicateCoroutinesApi +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.SupervisorJob +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.launch +import kotlinx.coroutines.newFixedThreadPoolContext +import kotlinx.coroutines.withContext import org.appdevforall.codeonthego.eventbus.events.EventReceiver import org.appdevforall.codeonthego.eventbus.events.editor.DocumentChangeEvent import org.appdevforall.codeonthego.lookup.Lookup @@ -21,14 +29,6 @@ import org.appdevforall.codeonthego.models.Position import org.appdevforall.codeonthego.models.Range import org.appdevforall.codeonthego.viewmodel.DebuggerConnectionState import org.appdevforall.codeonthego.viewmodel.DebuggerViewModel -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.DelicateCoroutinesApi -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.SupervisorJob -import kotlinx.coroutines.flow.StateFlow -import kotlinx.coroutines.launch -import kotlinx.coroutines.newFixedThreadPoolContext -import kotlinx.coroutines.withContext import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode import org.slf4j.LoggerFactory @@ -39,303 +39,326 @@ import java.util.concurrent.CopyOnWriteArraySet * @author Akash Yadav */ class IDEDebugClientImpl( - private val viewModel: DebuggerViewModel, -) : IDebugClient, IDebugEventHandler, EventReceiver { - - private val logger = LoggerFactory.getLogger(IDEDebugClientImpl::class.java) - - @OptIn(DelicateCoroutinesApi::class) - private val clientContext = newFixedThreadPoolContext(4, "IDEDebugClient") - private val clientScope = CoroutineScope(clientContext + SupervisorJob()) - private val clients = CopyOnWriteArraySet() - val breakpoints = BreakpointHandler() - - companion object { - @JvmStatic - fun getInstance() = Lookup.getDefault().lookup(IDEDebugClientImpl::class.java) - - @JvmStatic - fun requireInstance() = checkNotNull(getInstance()) { - "Cannot lookup IDEDebugClientImpl" - } - } - - val connectionStateFlow: StateFlow - get() = viewModel.connectionState - - var connectionState: DebuggerConnectionState - get() = viewModel.connectionState.value - private set(value) { - logger.debug("move to connection state: {}", value) - viewModel.setConnectionState(value) - } - - val debugeePackage: String - get() = viewModel.debugeePackage - - internal val requireClient: RemoteClient - get() = checkNotNull(clientOrNull) - - internal val clientOrNull: RemoteClient? - get() = clients.firstOrNull() - - /** - * Returns true if the client is connected. - * - * @return `true` if the client is connected, `false` otherwise. - */ - fun isVmConnected() = connectionState >= DebuggerConnectionState.ATTACHED - - /** - * Returns true if the client is connected and suspended. - * - * The VM may or may not be able to view/alter its state. Check [connectionState] - * to get the actual state. - * - * @return `true` if the client is connected and suspended, `false` otherwise. - */ - fun isVmSuspended() = connectionState >= DebuggerConnectionState.SUSPENDED - - fun suspendVm() = withClient("suspend vm") { client -> - if (!client.capabilities.suspensionSupport) { - logger.error("Remote client does not support suspending") - return@withClient - } - - if (isVmSuspended()) { - logger.warn("Ignoring attempt to suspend VM when it is already suspended") - return@withClient - } - - logger.debug("suspending client: {}", client.name) - clientScope.launch { - if (client.adapter.suspendClient(client)) { - connectionState = DebuggerConnectionState.SUSPENDED - updateThreadInfo(client) - } - } - } - - fun resumeVm() = withClient("resume vm") { client -> - if (!client.capabilities.suspensionSupport) { - logger.error("Remote client does not support resuming") - return@withClient - } - - if (!isVmSuspended()) { - logger.warn("Ignoring attempt to resume VM when it is not suspended") - return@withClient - } - - logger.debug("resuming client: {}", client.name) - clientScope.launch { - if (client.adapter.resumeClient(client)) { - connectionState = DebuggerConnectionState.ATTACHED - updateThreadInfo(client) - } - } - } - - fun killVm() = withClient("kill vm") { client -> - if (!client.capabilities.killSupport) { - logger.error("Remote client does not support killing debug application") - return@withClient - } - - logger.debug("killing client: {}", client.name) - clientScope.launch { client.adapter.killClient(client) } - } - - fun stepOver() = doStep(type = StepType.Over) - fun stepInto() = doStep(type = StepType.Into) - fun stepOut() = doStep(type = StepType.Out) - - private inline fun withClient(action: String, block: (RemoteClient) -> Unit) { - clientOrNull?.also(block) - ?: logger.error("Cannot perform $action action. Not connected to a remote client.") - } - - private fun doStep( - type: StepType, - countFilter: Int = 1 - ) = withClient("step $type") { client -> - if (!client.capabilities.stepSupport) { - logger.error("Remote client does not support stepping") - return@withClient - } - - clientScope.launch { - val params = StepRequestParams( - remoteClient = client, - type = type, - countFilter = countFilter - ) - - val response = client.adapter.step(params) - if (response.result != StepResult.Success) { - logger.error("Failed to perform step action, result={}", response.result) - } - } - } - - init { - register() - breakpoints.begin { breakpoints -> - - // if we're already connected to a client, update the client as well - clientOrNull?.also { client -> - if (!client.capabilities.breakpointSupport) { - logger.error("Remote client does not support breakpoints") - return@also - } - - clientScope.launch { - clientOrNull?.also { client -> - val response = client.adapter.setBreakpoints( - BreakpointRequest( - remoteClient = client, - breakpoints = breakpoints - ) - ) - - logger.debug("breakpoint result: {}", response.results) - } ?: logger.info("client ${client.name} disconnected while updating breakpoints") - } - } ?: logger.info("deferring breakpoint update, no clients connected") - } - } - - @SuppressLint("ImplicitSamInstance") - @Suppress("UNUSED") - @Subscribe(threadMode = ThreadMode.ASYNC) - fun onContentChange(event: DocumentChangeEvent) { - clientScope.launch { breakpoints.change(event) } - } - - fun toggleBreakpoint(file: File, line: Int) { - clientScope.launch { breakpoints.toggle(file, line) } - } - - override fun onBreakpointHit(event: BreakpointHitEvent) { - logger.debug("onBreakpointHit: {}", event) - - clientScope.launch { - connectionState = DebuggerConnectionState.AWAITING_BREAKPOINT - updateThreadInfo(event.remoteClient, event.threadId) - - openLocation(event) - } - } - - override fun onStep(event: StepEvent) { - logger.debug("onStep: {}", event) - - clientScope.launch { - updateThreadInfo(event.remoteClient, event.threadId) - connectionState = DebuggerConnectionState.AWAITING_BREAKPOINT - - openLocation(event) - } - } - - override fun onAttach(client: RemoteClient) { - logger.debug("onAttach: client={}", client) - - check(client !in clients) { - "Already attached to client" - } - - clients += client - connectionState = DebuggerConnectionState.ATTACHED - breakpoints.unhighlightHighlightedLocation() - - clientScope.launch { - updateThreadInfo(client) - - val breakpoints = breakpoints.allBreakpoints - client.adapter.setBreakpoints( - BreakpointRequest( - remoteClient = client, - breakpoints = breakpoints - ) - ) - } - } - - override fun onDisconnect(client: RemoteClient) { - logger.debug("onDisconnect: client={}", client) - breakpoints.unhighlightHighlightedLocation() - clients -= client - connectionState = DebuggerConnectionState.DETACHED - clientScope.launch { updateThreadInfo(client) } - } - - suspend fun updateThreadInfo( - client: RemoteClient, - selectedThreadId: String? = null, - ) { - val adapter = client.adapter - var selectedThreadIndex = -1 - val threads = when (connectionState) { - DebuggerConnectionState.DETACHED, - DebuggerConnectionState.ATTACHED -> emptyList() - - DebuggerConnectionState.SUSPENDED, - DebuggerConnectionState.AWAITING_BREAKPOINT -> { - val threadResponse = adapter.allThreads( - ThreadListRequestParams( - remoteClient = client - ) - ) - - val threads = threadResponse.threads - if (threads.isEmpty()) { - logger.error("Failed to get info about active threads in VM: {}", client.name) - } else if (selectedThreadId != null) { - selectedThreadIndex = threads.indexOfFirst { - it.descriptor().id == selectedThreadId - } - } - - threads - } - } - - if (threads.isNotEmpty() && selectedThreadIndex < 0) { - selectedThreadIndex = 0 - } - - viewModel.setThreads(threads, selectedThreadIndex) - } - - private suspend fun openLocation(event: LocatableEvent) = openLocation(event.location) - - private suspend fun openLocation(location: Location) { - val file = location.source.path - val position = Position(location.line, 0) - - if (!IDELanguageClientImpl.isInitialized()) { - logger.error("Cannot open {}:{} because language client is not initialized", file, position.line) - return - } - - val activity = IDELanguageClientImpl.getInstance().activity - - if (activity == null) { - logger.error("Cannot open {}:{} because activity is null", file, position.line) - return - } - - breakpoints.highlightLocation(file, position.line) - - withContext(Dispatchers.Main.immediate) { - activity.openFileAndSelect( - file = File(file), - selection = Range( - start = position, - end = position - ) - ) - } - } -} \ No newline at end of file + private val viewModel: DebuggerViewModel, +) : IDebugClient, + IDebugEventHandler, + EventReceiver { + private val logger = LoggerFactory.getLogger(IDEDebugClientImpl::class.java) + + @OptIn(DelicateCoroutinesApi::class) + private val clientContext = newFixedThreadPoolContext(4, "IDEDebugClient") + private val clientScope = CoroutineScope(clientContext + SupervisorJob()) + private val clients = CopyOnWriteArraySet() + val breakpoints = BreakpointHandler() + + companion object { + @JvmStatic + fun getInstance() = Lookup.getDefault().lookup(IDEDebugClientImpl::class.java) + + @JvmStatic + fun requireInstance() = + checkNotNull(getInstance()) { + "Cannot lookup IDEDebugClientImpl" + } + } + + val connectionStateFlow: StateFlow + get() = viewModel.connectionState + + var connectionState: DebuggerConnectionState + get() = viewModel.connectionState.value + private set(value) { + logger.debug("move to connection state: {}", value) + viewModel.setConnectionState(value) + } + + val debugeePackage: String + get() = viewModel.debugeePackage + + internal val requireClient: RemoteClient + get() = checkNotNull(clientOrNull) + + internal val clientOrNull: RemoteClient? + get() = clients.firstOrNull() + + /** + * Returns true if the client is connected. + * + * @return `true` if the client is connected, `false` otherwise. + */ + fun isVmConnected() = connectionState >= DebuggerConnectionState.ATTACHED + + /** + * Returns true if the client is connected and suspended. + * + * The VM may or may not be able to view/alter its state. Check [connectionState] + * to get the actual state. + * + * @return `true` if the client is connected and suspended, `false` otherwise. + */ + fun isVmSuspended() = connectionState >= DebuggerConnectionState.SUSPENDED + + fun suspendVm() = + withClient("suspend vm") { client -> + if (!client.capabilities.suspensionSupport) { + logger.error("Remote client does not support suspending") + return@withClient + } + + if (isVmSuspended()) { + logger.warn("Ignoring attempt to suspend VM when it is already suspended") + return@withClient + } + + logger.debug("suspending client: {}", client.name) + clientScope.launch { + if (client.adapter.suspendClient(client)) { + connectionState = DebuggerConnectionState.SUSPENDED + updateThreadInfo(client) + } + } + } + + fun resumeVm() = + withClient("resume vm") { client -> + if (!client.capabilities.suspensionSupport) { + logger.error("Remote client does not support resuming") + return@withClient + } + + if (!isVmSuspended()) { + logger.warn("Ignoring attempt to resume VM when it is not suspended") + return@withClient + } + + logger.debug("resuming client: {}", client.name) + clientScope.launch { + if (client.adapter.resumeClient(client)) { + connectionState = DebuggerConnectionState.ATTACHED + updateThreadInfo(client) + } + } + } + + fun killVm() = + withClient("kill vm") { client -> + if (!client.capabilities.killSupport) { + logger.error("Remote client does not support killing debug application") + return@withClient + } + + logger.debug("killing client: {}", client.name) + clientScope.launch { client.adapter.killClient(client) } + } + + fun stepOver() = doStep(type = StepType.Over) + + fun stepInto() = doStep(type = StepType.Into) + + fun stepOut() = doStep(type = StepType.Out) + + private inline fun withClient( + action: String, + block: (RemoteClient) -> Unit, + ) { + clientOrNull?.also(block) + ?: logger.error("Cannot perform $action action. Not connected to a remote client.") + } + + private fun doStep( + type: StepType, + countFilter: Int = 1, + ) = withClient("step $type") { client -> + if (!client.capabilities.stepSupport) { + logger.error("Remote client does not support stepping") + return@withClient + } + + clientScope.launch { + val params = + StepRequestParams( + remoteClient = client, + type = type, + countFilter = countFilter, + ) + + val response = client.adapter.step(params) + if (response.result != StepResult.Success) { + logger.error("Failed to perform step action, result={}", response.result) + } + } + } + + init { + register() + breakpoints.begin { breakpoints -> + + // if we're already connected to a client, update the client as well + clientOrNull?.also { client -> + if (!client.capabilities.breakpointSupport) { + logger.error("Remote client does not support breakpoints") + return@also + } + + clientScope.launch { + clientOrNull?.also { client -> + val response = + client.adapter.setBreakpoints( + BreakpointRequest( + remoteClient = client, + breakpoints = breakpoints, + ), + ) + + logger.debug("breakpoint result: {}", response.results) + } ?: logger.info("client ${client.name} disconnected while updating breakpoints") + } + } ?: logger.info("deferring breakpoint update, no clients connected") + } + } + + @SuppressLint("ImplicitSamInstance") + @Suppress("UNUSED") + @Subscribe(threadMode = ThreadMode.ASYNC) + fun onContentChange(event: DocumentChangeEvent) { + clientScope.launch { breakpoints.change(event) } + } + + fun toggleBreakpoint( + file: File, + line: Int, + ) { + clientScope.launch { breakpoints.toggle(file, line) } + } + + override fun onBreakpointHit(event: BreakpointHitEvent) { + logger.debug("onBreakpointHit: {}", event) + + clientScope.launch { + connectionState = DebuggerConnectionState.AWAITING_BREAKPOINT + updateThreadInfo(event.remoteClient, event.threadId) + + openLocation(event) + } + } + + override fun onStep(event: StepEvent) { + logger.debug("onStep: {}", event) + + clientScope.launch { + updateThreadInfo(event.remoteClient, event.threadId) + connectionState = DebuggerConnectionState.AWAITING_BREAKPOINT + + openLocation(event) + } + } + + override fun onAttach(client: RemoteClient) { + logger.debug("onAttach: client={}", client) + + check(client !in clients) { + "Already attached to client" + } + + clients += client + connectionState = DebuggerConnectionState.ATTACHED + breakpoints.unhighlightHighlightedLocation() + + clientScope.launch { + updateThreadInfo(client) + + val breakpoints = breakpoints.allBreakpoints + client.adapter.setBreakpoints( + BreakpointRequest( + remoteClient = client, + breakpoints = breakpoints, + ), + ) + } + } + + override fun onDisconnect(client: RemoteClient) { + logger.debug("onDisconnect: client={}", client) + breakpoints.unhighlightHighlightedLocation() + clients -= client + connectionState = DebuggerConnectionState.DETACHED + clientScope.launch { updateThreadInfo(client) } + } + + suspend fun updateThreadInfo( + client: RemoteClient, + selectedThreadId: String? = null, + ) { + val adapter = client.adapter + var selectedThreadIndex = -1 + val threads = + when (connectionState) { + DebuggerConnectionState.DETACHED, + DebuggerConnectionState.ATTACHED, + -> { + emptyList() + } + + DebuggerConnectionState.SUSPENDED, + DebuggerConnectionState.AWAITING_BREAKPOINT, + -> { + val threadResponse = + adapter.allThreads( + ThreadListRequestParams( + remoteClient = client, + ), + ) + + val threads = threadResponse.threads + if (threads.isEmpty()) { + logger.error("Failed to get info about active threads in VM: {}", client.name) + } else if (selectedThreadId != null) { + selectedThreadIndex = + threads.indexOfFirst { + it.descriptor().id == selectedThreadId + } + } + + threads + } + } + + if (threads.isNotEmpty() && selectedThreadIndex < 0) { + selectedThreadIndex = 0 + } + + viewModel.setThreads(threads, selectedThreadIndex) + } + + private suspend fun openLocation(event: LocatableEvent) = openLocation(event.location) + + private suspend fun openLocation(location: Location) { + val file = location.source.path + val position = Position(location.line, 0) + + if (!IDELanguageClientImpl.isInitialized()) { + logger.error("Cannot open {}:{} because language client is not initialized", file, position.line) + return + } + + val activity = IDELanguageClientImpl.getInstance().activity + + if (activity == null) { + logger.error("Cannot open {}:{} because activity is null", file, position.line) + return + } + + breakpoints.highlightLocation(file, position.line) + + withContext(Dispatchers.Main.immediate) { + activity.openFileAndSelect( + file = File(file), + selection = + Range( + start = position, + end = position, + ), + ) + } + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/lsp/IDELanguageClientImpl.java b/app/src/main/java/org/appdevforall/codeonthego/lsp/IDELanguageClientImpl.java index b71a22b901..0e4ef9856d 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/lsp/IDELanguageClientImpl.java +++ b/app/src/main/java/org/appdevforall/codeonthego/lsp/IDELanguageClientImpl.java @@ -24,6 +24,20 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import io.github.rosemoe.sora.lang.diagnostic.DiagnosticsContainer; +import java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; +import kotlin.Unit; import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity; import org.appdevforall.codeonthego.adapters.DiagnosticsAdapter; import org.appdevforall.codeonthego.adapters.SearchListAdapter; @@ -48,20 +62,6 @@ import org.appdevforall.codeonthego.utils.FlashbarActivityUtilsKt; import org.appdevforall.codeonthego.utils.FlashbarUtilsKt; import org.appdevforall.codeonthego.utils.LSPUtils; -import io.github.rosemoe.sora.lang.diagnostic.DiagnosticsContainer; -import java.io.File; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.stream.Collectors; -import kotlin.Unit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/app/src/main/java/org/appdevforall/codeonthego/lsp/SearchResultGrouping.kt b/app/src/main/java/org/appdevforall/codeonthego/lsp/SearchResultGrouping.kt index 4e2dfec056..c5c11fc958 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/lsp/SearchResultGrouping.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/lsp/SearchResultGrouping.kt @@ -1,9 +1,9 @@ package org.appdevforall.codeonthego.lsp +import io.github.rosemoe.sora.text.Content import org.appdevforall.codeonthego.models.Location import org.appdevforall.codeonthego.models.Range import org.appdevforall.codeonthego.models.SearchResult -import io.github.rosemoe.sora.text.Content import org.slf4j.LoggerFactory import java.io.BufferedReader import java.io.File diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/ArtifactType.kt b/app/src/main/java/org/appdevforall/codeonthego/models/ArtifactType.kt index 9639d1c524..29f2fec50e 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/models/ArtifactType.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/ArtifactType.kt @@ -20,30 +20,30 @@ package org.appdevforall.codeonthego.models import com.google.gson.annotations.SerializedName class ArtifactType { - @SerializedName("type") var type: String? = null - @SerializedName("kind") var kind: String? = null +@SerializedName("type") var type: String? = null +@SerializedName("kind") var kind: String? = null - companion object { - var TYPE_APK = "APK" - } +companion object { + var TYPE_APK = "APK" +} - override fun toString(): String { - return "ArtifactType(type=$type, kind=$kind)" - } +override fun toString(): String { + return "ArtifactType(type=$type, kind=$kind)" +} - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other !is ArtifactType) return false +override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is ArtifactType) return false - if (type != other.type) return false - if (kind != other.kind) return false + if (type != other.type) return false + if (kind != other.kind) return false - return true - } + return true +} - override fun hashCode(): Int { - var result = type?.hashCode() ?: 0 - result = 31 * result + (kind?.hashCode() ?: 0) - return result - } -} \ No newline at end of file +override fun hashCode(): Int { + var result = type?.hashCode() ?: 0 + result = 31 * result + (kind?.hashCode() ?: 0) + return result +} +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/Checkable.kt b/app/src/main/java/org/appdevforall/codeonthego/models/Checkable.kt index 984b704631..45cfb3e5a4 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/models/Checkable.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/Checkable.kt @@ -22,4 +22,7 @@ package org.appdevforall.codeonthego.models * * @author Akash Yadav */ -data class Checkable(var isChecked: Boolean, val data: T) +data class Checkable( + var isChecked: Boolean, + val data: T, +) diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/ContextListItem.kt b/app/src/main/java/org/appdevforall/codeonthego/models/ContextListItem.kt index 1e094248d7..553313fe59 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/models/ContextListItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/ContextListItem.kt @@ -6,12 +6,14 @@ import androidx.annotation.DrawableRes sealed interface ContextListItem // A data class for section titles like "FILES AND FOLDERS" -data class HeaderItem(val title: String) : ContextListItem +data class HeaderItem( + val title: String, +) : ContextListItem // A data class for a single selectable option data class SelectableItem( - val id: String, // A unique ID for the item - val text: String, - @DrawableRes val icon: Int, - var isSelected: Boolean = false -) : ContextListItem \ No newline at end of file + val id: String, // A unique ID for the item + val text: String, + @DrawableRes val icon: Int, + var isSelected: Boolean = false, +) : ContextListItem diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/DeepLinkRequest.kt b/app/src/main/java/org/appdevforall/codeonthego/models/DeepLinkRequest.kt index d76dd3da74..4c0ac08e36 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/models/DeepLinkRequest.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/DeepLinkRequest.kt @@ -19,8 +19,8 @@ package org.appdevforall.codeonthego.models import android.net.Uri import android.os.Parcelable -import org.appdevforall.codeonthego.utils.ContainedPathResolver import kotlinx.parcelize.Parcelize +import org.appdevforall.codeonthego.utils.ContainedPathResolver import java.nio.file.Paths /** diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/DefaultOnboardingItem.kt b/app/src/main/java/org/appdevforall/codeonthego/models/DefaultOnboardingItem.kt index 2cecb56206..b907d23967 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/models/DefaultOnboardingItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/DefaultOnboardingItem.kt @@ -26,11 +26,11 @@ import kotlinx.parcelize.Parcelize */ @Parcelize data class DefaultOnboardingItem( - override val key: String, - override val title: CharSequence, - override val description: CharSequence = "", - override val icon: Int = 0, - override val iconTint: Int = 0, - override val isClickable: Boolean = false, - override val isLongClickable: Boolean = false + override val key: String, + override val title: CharSequence, + override val description: CharSequence = "", + override val icon: Int = 0, + override val iconTint: Int = 0, + override val isClickable: Boolean = false, + override val isLongClickable: Boolean = false, ) : OnboardingItem diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/DiagnosticGroup.java b/app/src/main/java/org/appdevforall/codeonthego/models/DiagnosticGroup.java index fef09f9b05..b8cba906b1 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/models/DiagnosticGroup.java +++ b/app/src/main/java/org/appdevforall/codeonthego/models/DiagnosticGroup.java @@ -17,20 +17,20 @@ **************************************************************************************/ package org.appdevforall.codeonthego.models; -import org.appdevforall.codeonthego.lsp.models.DiagnosticItem; import java.io.File; import java.util.List; +import org.appdevforall.codeonthego.lsp.models.DiagnosticItem; public class DiagnosticGroup { - public int icon; - public String text; - public File file; - public List diagnostics; + public int icon; + public String text; + public File file; + public List diagnostics; - public DiagnosticGroup(int icon, File file, List diagnostics) { - this.icon = icon; - this.file = file; - this.text = file.getName(); - this.diagnostics = diagnostics; - } + public DiagnosticGroup(int icon, File file, List diagnostics) { + this.icon = icon; + this.file = file; + this.text = file.getName(); + this.diagnostics = diagnostics; + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/FileExtension.kt b/app/src/main/java/org/appdevforall/codeonthego/models/FileExtension.kt index e558ef5049..4fbb6e04b5 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/models/FileExtension.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/FileExtension.kt @@ -26,72 +26,82 @@ import java.io.File * * @author Akash Yadav */ -enum class FileExtension(val extension: String, @DrawableRes val icon: Int) { - JAVA("java", R.drawable.ic_language_java), - JAR("jar", R.drawable.ic_language_java), - KT("kt", R.drawable.ic_language_kotlin), - KTS("kts", R.drawable.ic_language_kts), - XML("xml", R.drawable.ic_language_xml), - GRADLE("gradle", R.drawable.ic_gradle), - JSON("json", R.drawable.ic_language_json), - PROPERTIES("properties", R.drawable.ic_language_properties), - APK("apk", R.drawable.ic_file_apk), - TXT("txt", R.drawable.ic_file_txt), - LOG("log", R.drawable.ic_file_txt), - CPP("cpp", R.drawable.ic_language_cpp), - H("h", R.drawable.ic_language_cpp), - BAT("bat", R.drawable.ic_terminal), - DIRECTORY("", R.drawable.ic_folder), - IMAGE("", R.drawable.ic_file_image), - GRADLEW("", R.drawable.ic_terminal), - UNKNOWN("", R.drawable.ic_file_unknown); +enum class FileExtension( + val extension: String, + @DrawableRes val icon: Int, +) { + JAVA("java", R.drawable.ic_language_java), + JAR("jar", R.drawable.ic_language_java), + KT("kt", R.drawable.ic_language_kotlin), + KTS("kts", R.drawable.ic_language_kts), + XML("xml", R.drawable.ic_language_xml), + GRADLE("gradle", R.drawable.ic_gradle), + JSON("json", R.drawable.ic_language_json), + PROPERTIES("properties", R.drawable.ic_language_properties), + APK("apk", R.drawable.ic_file_apk), + TXT("txt", R.drawable.ic_file_txt), + LOG("log", R.drawable.ic_file_txt), + CPP("cpp", R.drawable.ic_language_cpp), + H("h", R.drawable.ic_language_cpp), + BAT("bat", R.drawable.ic_terminal), + DIRECTORY("", R.drawable.ic_folder), + IMAGE("", R.drawable.ic_file_image), + GRADLEW("", R.drawable.ic_terminal), + UNKNOWN("", R.drawable.ic_file_unknown), + ; - /** Factory class for getting [FileExtension] instances. */ - class Factory { - companion object { + /** Factory class for getting [FileExtension] instances. */ + class Factory { + companion object { + /** Get [FileExtension] for the given file. */ + @JvmStatic + fun forFile( + file: File?, + isDirectory: Boolean? = null, + ): FileExtension = + when { + file == null -> { + UNKNOWN + } - /** Get [FileExtension] for the given file. */ - @JvmStatic - fun forFile(file: File?, isDirectory: Boolean? = null): FileExtension { - return when { - file == null -> UNKNOWN - isDirectory == true -> DIRECTORY - else -> { - val name = file.name - val ext = file.extension.lowercase() - when { - isImageExtension(ext) -> IMAGE - name == "gradlew" -> GRADLEW - else -> forExtension(ext) - } - } - } - } + isDirectory == true -> { + DIRECTORY + } - private fun isImageExtension(extension: String?): Boolean { - return when (extension?.lowercase()) { - "jpg", "jpeg", "png", "gif", "webp", "bmp", "ico" -> true - else -> false - } - } + else -> { + val name = file.name + val ext = file.extension.lowercase() + when { + isImageExtension(ext) -> IMAGE + name == "gradlew" -> GRADLEW + else -> forExtension(ext) + } + } + } - /** Get [FileExtension] for the given extension. */ - @JvmStatic - fun forExtension(extension: String?): FileExtension { - // To not assign IMAGE, GRADLEW and DIRECTORY in case of an empty extension, - // we check if an extension is empty here - if (extension.isNullOrEmpty()) { - return UNKNOWN - } - - for (value in entries) { - if (value.extension == extension) { - return value - } - } + private fun isImageExtension(extension: String?): Boolean = + when (extension?.lowercase()) { + "jpg", "jpeg", "png", "gif", "webp", "bmp", "ico" -> true + else -> false + } - return UNKNOWN - } - } - } + /** Get [FileExtension] for the given extension. */ + @JvmStatic + fun forExtension(extension: String?): FileExtension { + // To not assign IMAGE, GRADLEW and DIRECTORY in case of an empty extension, + // we check if an extension is empty here + if (extension.isNullOrEmpty()) { + return UNKNOWN + } + + for (value in entries) { + if (value.extension == extension) { + return value + } + } + + return UNKNOWN + } + } + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/HyperlinkedOnboardingItem.kt b/app/src/main/java/org/appdevforall/codeonthego/models/HyperlinkedOnboardingItem.kt index 0eaef30cff..2a8f1a5b9b 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/models/HyperlinkedOnboardingItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/HyperlinkedOnboardingItem.kt @@ -27,12 +27,12 @@ import kotlinx.parcelize.Parcelize */ @Parcelize data class HyperlinkedOnboardingItem( - override val key: String, - override val title: CharSequence, - val hyperlink: String, - override val description: CharSequence = "", - override val icon: Int = 0, - override val iconTint: Int = 0, - override val isClickable: Boolean = false, - override val isLongClickable: Boolean = false -) : OnboardingItem \ No newline at end of file + override val key: String, + override val title: CharSequence, + val hyperlink: String, + override val description: CharSequence = "", + override val icon: Int = 0, + override val iconTint: Int = 0, + override val isClickable: Boolean = false, + override val isLongClickable: Boolean = false, +) : OnboardingItem diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/IdeSetupArguments.kt b/app/src/main/java/org/appdevforall/codeonthego/models/IdeSetupArguments.kt index 7484a1ee2c..c2d2d1847b 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/models/IdeSetupArguments.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/IdeSetupArguments.kt @@ -25,13 +25,13 @@ package org.appdevforall.codeonthego.models * @author Akash Yadav */ enum class IdeSetupArgument(val argumentName: String, val requiresValue: Boolean = false) { - INSTALL_DIR("--install-dir", true), - WITH_GIT("--with-git"), - ASSUME_YES("--assume-yes"), - WITH_OPENSSH("--with-openssh"), - SDK_VERSION("--sdk", true), - JDK_VERSION("--jdk", true), - OFFLINE_MODE("--offline-mode"), - CACHE_DIR("--cache-dir"), - ABI_FOLDER("--arch", true) +INSTALL_DIR("--install-dir", true), +WITH_GIT("--with-git"), +ASSUME_YES("--assume-yes"), +WITH_OPENSSH("--with-openssh"), +SDK_VERSION("--sdk", true), +JDK_VERSION("--jdk", true), +OFFLINE_MODE("--offline-mode"), +CACHE_DIR("--cache-dir"), +ABI_FOLDER("--arch", true) } diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/MetadataElement.kt b/app/src/main/java/org/appdevforall/codeonthego/models/MetadataElement.kt index a6d86bdc17..de9ac84b65 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/models/MetadataElement.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/MetadataElement.kt @@ -20,38 +20,48 @@ package org.appdevforall.codeonthego.models import com.google.gson.annotations.SerializedName class MetadataElement { - @SerializedName("type") var type: String? = null - @SerializedName("filters") var filters: List? = null - @SerializedName("attributes") var attributes: List? = null - @SerializedName("versionCode") var versionCode = 0 - @SerializedName("versionName") var versionName: String? = null - @SerializedName("outputFile") var outputFile: String? = null - - override fun toString(): String { - return "Element(type=$type, filters=$filters, attributes=$attributes, versionCode=$versionCode, versionName=$versionName, outputFile=$outputFile)" - } - - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other !is MetadataElement) return false - - if (type != other.type) return false - if (filters != other.filters) return false - if (attributes != other.attributes) return false - if (versionCode != other.versionCode) return false - if (versionName != other.versionName) return false - if (outputFile != other.outputFile) return false - - return true - } - - override fun hashCode(): Int { - var result = type?.hashCode() ?: 0 - result = 31 * result + (filters?.hashCode() ?: 0) - result = 31 * result + (attributes?.hashCode() ?: 0) - result = 31 * result + versionCode - result = 31 * result + (versionName?.hashCode() ?: 0) - result = 31 * result + (outputFile?.hashCode() ?: 0) - return result - } -} \ No newline at end of file + @SerializedName("type") + var type: String? = null + + @SerializedName("filters") + var filters: List? = null + + @SerializedName("attributes") + var attributes: List? = null + + @SerializedName("versionCode") + var versionCode = 0 + + @SerializedName("versionName") + var versionName: String? = null + + @SerializedName("outputFile") + var outputFile: String? = null + + override fun toString(): String = + "Element(type=$type, filters=$filters, attributes=$attributes, versionCode=$versionCode, versionName=$versionName, outputFile=$outputFile)" + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is MetadataElement) return false + + if (type != other.type) return false + if (filters != other.filters) return false + if (attributes != other.attributes) return false + if (versionCode != other.versionCode) return false + if (versionName != other.versionName) return false + if (outputFile != other.outputFile) return false + + return true + } + + override fun hashCode(): Int { + var result = type?.hashCode() ?: 0 + result = 31 * result + (filters?.hashCode() ?: 0) + result = 31 * result + (attributes?.hashCode() ?: 0) + result = 31 * result + versionCode + result = 31 * result + (versionName?.hashCode() ?: 0) + result = 31 * result + (outputFile?.hashCode() ?: 0) + return result + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/NewProjectDetails.java b/app/src/main/java/org/appdevforall/codeonthego/models/NewProjectDetails.java index d7013d37d0..c8174a6224 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/models/NewProjectDetails.java +++ b/app/src/main/java/org/appdevforall/codeonthego/models/NewProjectDetails.java @@ -19,75 +19,75 @@ public class NewProjectDetails { - public String name; - public String packageName; - public int minSdk; - public int targetSdk; - public String language; - public String savePath; - public String cppFlags; + public String name; + public String packageName; + public int minSdk; + public int targetSdk; + public String language; + public String savePath; + public String cppFlags; - public NewProjectDetails() {} + public NewProjectDetails() {} - public NewProjectDetails( - String name, - String packageName, - int minSdk, - int targetSdk, - String language, - String cppFlags, - String savePath) { - this.name = name; - this.packageName = packageName; - this.minSdk = minSdk; - this.targetSdk = targetSdk; - this.language = language; - this.cppFlags = cppFlags; - this.savePath = savePath; - } + public NewProjectDetails( + String name, + String packageName, + int minSdk, + int targetSdk, + String language, + String cppFlags, + String savePath) { + this.name = name; + this.packageName = packageName; + this.minSdk = minSdk; + this.targetSdk = targetSdk; + this.language = language; + this.cppFlags = cppFlags; + this.savePath = savePath; + } - public String getName() { - return name; - } + public String getCppFlags() { + return cppFlags; + } - public NewProjectDetails setName(String name) { - this.name = name; - return this; - } + public int getMinSdk() { + return minSdk; + } - public String getPackageName() { - return packageName; - } + public String getName() { + return name; + } - public NewProjectDetails setPackageName(String packageName) { - this.packageName = packageName; - return this; - } + public String getPackageName() { + return packageName; + } - public int getMinSdk() { - return minSdk; - } + public int getTargetSdk() { + return targetSdk; + } - public NewProjectDetails setMinSdk(int minSdk) { - this.minSdk = minSdk; - return this; - } + public NewProjectDetails setCppFlags(String cppFlags) { + this.cppFlags = cppFlags; + return this; + } - public int getTargetSdk() { - return targetSdk; - } + public NewProjectDetails setMinSdk(int minSdk) { + this.minSdk = minSdk; + return this; + } - public NewProjectDetails setTargetSdk(int targetSdk) { - this.targetSdk = targetSdk; - return this; - } + public NewProjectDetails setName(String name) { + this.name = name; + return this; + } - public String getCppFlags() { - return cppFlags; - } + public NewProjectDetails setPackageName(String packageName) { + this.packageName = packageName; + return this; + } - public NewProjectDetails setCppFlags(String cppFlags) { - this.cppFlags = cppFlags; - return this; - } + public NewProjectDetails setTargetSdk(int targetSdk) { + this.targetSdk = targetSdk; + return this; + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/OnboardingItem.kt b/app/src/main/java/org/appdevforall/codeonthego/models/OnboardingItem.kt index 04b04306de..0148635617 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/models/OnboardingItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/OnboardingItem.kt @@ -27,41 +27,40 @@ import androidx.annotation.DrawableRes * @author Akash Yadav */ interface OnboardingItem : Parcelable { + /** + * The key for the item. + */ + val key: String - /** - * The key for the item. - */ - val key: String + /** + * Title for the item. + */ + val title: CharSequence - /** - * Title for the item. - */ - val title: CharSequence + /** + * Short description (or subtitle) for the item. + */ + val description: CharSequence - /** - * Short description (or subtitle) for the item. - */ - val description: CharSequence + /** + * Icon for the item. + */ + @get:DrawableRes + val icon: Int - /** - * Icon for the item. - */ - @get:DrawableRes - val icon: Int + /** + * Icon tint for the item. + */ + @get:ColorInt + val iconTint: Int - /** - * Icon tint for the item. - */ - @get:ColorInt - val iconTint: Int + /** + * Whether is item is clickable. + */ + val isClickable: Boolean - /** - * Whether is item is clickable. - */ - val isClickable: Boolean - - /** - * Whether the item is long clickable. - */ - val isLongClickable: Boolean -} \ No newline at end of file + /** + * Whether the item is long clickable. + */ + val isLongClickable: Boolean +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/OnboardingPermissionItem.kt b/app/src/main/java/org/appdevforall/codeonthego/models/OnboardingPermissionItem.kt index 5488300481..8c769ac877 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/models/OnboardingPermissionItem.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/OnboardingPermissionItem.kt @@ -23,15 +23,12 @@ import androidx.annotation.StringRes * @author Akash Yadav */ data class OnboardingPermissionItem( - val permission: String, - - @StringRes - val title: Int, - - @StringRes - val description: Int, - var isGranted: Boolean, - - var isOptional: Boolean = false, - var isSupportedOnDevice: Boolean = true + val permission: String, + @StringRes + val title: Int, + @StringRes + val description: Int, + var isGranted: Boolean, + var isOptional: Boolean = false, + var isSupportedOnDevice: Boolean = true, ) diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/OpenedFile.kt b/app/src/main/java/org/appdevforall/codeonthego/models/OpenedFile.kt index 5265432b44..7b90bd29ed 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/models/OpenedFile.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/OpenedFile.kt @@ -28,18 +28,16 @@ import org.slf4j.LoggerFactory * @author Akash Yadav */ data class OpenedFile( - @SerializedName(KEY_FILE) val filePath: String, - @SerializedName(KEY_SELECTION) var selection: Range + @SerializedName(KEY_FILE) val filePath: String, + @SerializedName(KEY_SELECTION) var selection: Range, ) { + companion object { + private const val KEY_FILE = "file" + private const val KEY_SELECTION = "selection" + private val log = LoggerFactory.getLogger(OpenedFile::class.java) - companion object { - - private const val KEY_FILE = "file" - private const val KEY_SELECTION = "selection" - private val log = LoggerFactory.getLogger(OpenedFile::class.java) - - fun readFrom(reader: JsonReader): OpenedFile? { - return try { + fun readFrom(reader: JsonReader): OpenedFile? = + try { // reader.beginObject() // var path = "" // var selection = Range.NONE @@ -54,11 +52,10 @@ data class OpenedFile( // reader.endObject() // // OpenedFile(path, selection) - Gson().fromJson(reader, OpenedFile::class.java) - } catch (err: Exception) { - log.error("Failed to read opened file", err) - null - } - } - } + Gson().fromJson(reader, OpenedFile::class.java) + } catch (err: Exception) { + log.error("Failed to read opened file", err) + null + } + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/OpenedFilesCache.kt b/app/src/main/java/org/appdevforall/codeonthego/models/OpenedFilesCache.kt index a03f8b4aea..3baae2e539 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/models/OpenedFilesCache.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/OpenedFilesCache.kt @@ -28,46 +28,44 @@ import java.io.Reader * @author Akash Yadav */ data class OpenedFilesCache( - @SerializedName(KEY_PROJECT_PATH) val projectPath: String = "", - @SerializedName(KEY_SELECTED_FILE) val selectedFile: String, - @SerializedName(KEY_ALL_FILES) val allFiles: List, + @SerializedName(KEY_PROJECT_PATH) val projectPath: String = "", + @SerializedName(KEY_SELECTED_FILE) val selectedFile: String, + @SerializedName(KEY_ALL_FILES) val allFiles: List, ) { + companion object { + private const val KEY_PROJECT_PATH = "projectPath" + private const val KEY_SELECTED_FILE = "selectedFile" + private const val KEY_ALL_FILES = "allFiles" + private val log = LoggerFactory.getLogger(OpenedFilesCache::class.java) - companion object { + @JvmStatic + fun parse(contentReader: Reader): OpenedFilesCache? { + return try { + JsonReader(contentReader).use { reader -> + if (!reader.hasNext()) { + return@use null + } - private const val KEY_PROJECT_PATH = "projectPath" - private const val KEY_SELECTED_FILE = "selectedFile" - private const val KEY_ALL_FILES = "allFiles" - private val log = LoggerFactory.getLogger(OpenedFilesCache::class.java) + reader.beginObject() + var projectPath = "" + var selectedFile = "" + var allFiles = emptyList() + while (reader.hasNext()) { + when (reader.nextName()) { + KEY_PROJECT_PATH -> projectPath = reader.nextString() + KEY_SELECTED_FILE -> selectedFile = reader.nextString() + KEY_ALL_FILES -> allFiles = Gson().fromJson(reader, object : TypeToken>() {}) + else -> reader.skipValue() + } + } + reader.endObject() - @JvmStatic - fun parse(contentReader: Reader): OpenedFilesCache? { - return try { - JsonReader(contentReader).use { reader -> - if (!reader.hasNext()) { - return@use null - } - - reader.beginObject() - var projectPath = "" - var selectedFile = "" - var allFiles = emptyList() - while (reader.hasNext()) { - when (reader.nextName()) { - KEY_PROJECT_PATH -> projectPath = reader.nextString() - KEY_SELECTED_FILE -> selectedFile = reader.nextString() - KEY_ALL_FILES -> allFiles = Gson().fromJson(reader, object : TypeToken>() {}) - else -> reader.skipValue() - } - } - reader.endObject() - - return@use OpenedFilesCache(projectPath, selectedFile, allFiles) - } - } catch (err: Exception) { - log.error("Failed to parse opened files cache", err) - null - } - } - } -} \ No newline at end of file + return@use OpenedFilesCache(projectPath, selectedFile, allFiles) + } + } catch (err: Exception) { + log.error("Failed to parse opened files cache", err) + null + } + } + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/ProjectTemplate.java b/app/src/main/java/org/appdevforall/codeonthego/models/ProjectTemplate.java index edd5c48734..5793cdab17 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/models/ProjectTemplate.java +++ b/app/src/main/java/org/appdevforall/codeonthego/models/ProjectTemplate.java @@ -23,92 +23,93 @@ public class ProjectTemplate { - private int id; - private String name; - private String description; - private boolean isSupportJava; - private boolean isSupportKotlin; - private boolean isCpp; - - @DrawableRes private int imageId; - - public ProjectTemplate() {} - - public ProjectTemplate(int id, String name, String description, int imageId) { - this.id = id; - this.name = name; - this.description = description; - this.imageId = imageId; - } - - public int getId() { - return id; - } - - public ProjectTemplate setId(int id) { - this.id = id; - return this; - } - - public ProjectTemplate setName(Context ctx, @StringRes int name) { - return setName(ctx.getString(name)); - } - - public String getName() { - return name; - } - - public ProjectTemplate setName(String name) { - this.name = name; - return this; - } - - public ProjectTemplate setDescription(Context ctx, @StringRes int desc) { - return setDescription(ctx.getString(desc)); - } - - public String getDescription() { - return description; - } - - public ProjectTemplate setDescription(String description) { - this.description = description; - return this; - } - - public int getImageId() { - return imageId; - } - - public ProjectTemplate setImageId(@DrawableRes int imageId) { - this.imageId = imageId; - return this; - } - - public boolean isSupportJava() { - return this.isSupportJava; - } - - public ProjectTemplate setSupportJava(boolean isSupportJava) { - this.isSupportJava = isSupportJava; - return this; - } - - public boolean isSupportKotlin() { - return this.isSupportKotlin; - } - - public ProjectTemplate setSupportKotlin(boolean isSupportKotlin) { - this.isSupportKotlin = isSupportKotlin; - return this; - } - - public boolean isCpp() { - return this.isCpp; - } - - public ProjectTemplate setIsCpp(boolean isCpp) { - this.isCpp = isCpp; - return this; - } + private int id; + private String name; + private String description; + private boolean isSupportJava; + private boolean isSupportKotlin; + private boolean isCpp; + + @DrawableRes + private int imageId; + + public ProjectTemplate() {} + + public ProjectTemplate(int id, String name, String description, int imageId) { + this.id = id; + this.name = name; + this.description = description; + this.imageId = imageId; + } + + public String getDescription() { + return description; + } + + public int getId() { + return id; + } + + public int getImageId() { + return imageId; + } + + public String getName() { + return name; + } + + public boolean isCpp() { + return this.isCpp; + } + + public boolean isSupportJava() { + return this.isSupportJava; + } + + public boolean isSupportKotlin() { + return this.isSupportKotlin; + } + + public ProjectTemplate setDescription(Context ctx, @StringRes int desc) { + return setDescription(ctx.getString(desc)); + } + + public ProjectTemplate setDescription(String description) { + this.description = description; + return this; + } + + public ProjectTemplate setId(int id) { + this.id = id; + return this; + } + + public ProjectTemplate setImageId(@DrawableRes int imageId) { + this.imageId = imageId; + return this; + } + + public ProjectTemplate setIsCpp(boolean isCpp) { + this.isCpp = isCpp; + return this; + } + + public ProjectTemplate setName(Context ctx, @StringRes int name) { + return setName(ctx.getString(name)); + } + + public ProjectTemplate setName(String name) { + this.name = name; + return this; + } + + public ProjectTemplate setSupportJava(boolean isSupportJava) { + this.isSupportJava = isSupportJava; + return this; + } + + public ProjectTemplate setSupportKotlin(boolean isSupportKotlin) { + this.isSupportKotlin = isSupportKotlin; + return this; + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/RunTasksCategory.kt b/app/src/main/java/org/appdevforall/codeonthego/models/RunTasksCategory.kt index f50dfec78c..4ede78232d 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/models/RunTasksCategory.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/RunTasksCategory.kt @@ -21,4 +21,7 @@ import androidx.annotation.StringRes import org.appdevforall.codeonthego.tooling.api.models.GradleTask /** @author Akash Yadav */ -data class RunTasksCategory(@StringRes val title: Int, val tasks: List>) +data class RunTasksCategory( + @StringRes val title: Int, + val tasks: List>, +) diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/StepResult.kt b/app/src/main/java/org/appdevforall/codeonthego/models/StepResult.kt index fc201c9f23..68b330356a 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/models/StepResult.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/StepResult.kt @@ -1,8 +1,8 @@ package org.appdevforall.codeonthego.models data class StepResult( - val stepId: Int, - val wasSuccessful: Boolean, - val output: String, - val error: String? = null -) \ No newline at end of file + val stepId: Int, + val wasSuccessful: Boolean, + val output: String, + val error: String? = null, +) diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/StorageInfo.kt b/app/src/main/java/org/appdevforall/codeonthego/models/StorageInfo.kt index d4016f04e4..c95fc8f5b9 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/models/StorageInfo.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/StorageInfo.kt @@ -1,7 +1,7 @@ package org.appdevforall.codeonthego.models data class StorageInfo( - val isLowStorage: Boolean, - val availableBytes: Long, - val additionalBytesNeeded: Long + val isLowStorage: Boolean, + val availableBytes: Long, + val additionalBytesNeeded: Long, ) diff --git a/app/src/main/java/org/appdevforall/codeonthego/models/Symbol.kt b/app/src/main/java/org/appdevforall/codeonthego/models/Symbol.kt index 0bc03a7d56..2057f85911 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/models/Symbol.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/models/Symbol.kt @@ -21,36 +21,36 @@ package org.appdevforall.codeonthego.models * * @author Akash Yadav */ -open class Symbol @JvmOverloads constructor( - open val label: String, - open val commit: String, - open val offset: Int = 1, - open val description: String = label -) { - @JvmOverloads - constructor(both: String, offset: Int = 1) : this(both, both, offset) +open class Symbol + @JvmOverloads + constructor( + open val label: String, + open val commit: String, + open val offset: Int = 1, + open val description: String = label, + ) { + @JvmOverloads + constructor(both: String, offset: Int = 1) : this(both, both, offset) - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other !is Symbol) return false + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is Symbol) return false - if (label != other.label) return false - if (commit != other.commit) return false - if (offset != other.offset) return false - if (description != other.description) return false + if (label != other.label) return false + if (commit != other.commit) return false + if (offset != other.offset) return false + if (description != other.description) return false - return true - } + return true + } - override fun hashCode(): Int { - var result = label.hashCode() - result = 31 * result + commit.hashCode() - result = 31 * result + offset - result = 31 * result + description.hashCode() - return result - } + override fun hashCode(): Int { + var result = label.hashCode() + result = 31 * result + commit.hashCode() + result = 31 * result + offset + result = 31 * result + description.hashCode() + return result + } - override fun toString(): String { - return "Symbol(label='$label', commit='$commit', offset=$offset, description='$description')" - } -} \ No newline at end of file + override fun toString(): String = "Symbol(label='$label', commit='$commit', offset=$offset, description='$description')" + } diff --git a/app/src/main/java/org/appdevforall/codeonthego/projects/builder/BuildResult.kt b/app/src/main/java/org/appdevforall/codeonthego/projects/builder/BuildResult.kt index 933652a060..272b0fd0cd 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/projects/builder/BuildResult.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/projects/builder/BuildResult.kt @@ -1,7 +1,7 @@ package org.appdevforall.codeonthego.projects.builder data class BuildResult( - val isSuccess: Boolean, - val message: String, - val launchResult: LaunchResult? = null -) \ No newline at end of file + val isSuccess: Boolean, + val message: String, + val launchResult: LaunchResult? = null, +) diff --git a/app/src/main/java/org/appdevforall/codeonthego/projects/builder/LaunchResult.kt b/app/src/main/java/org/appdevforall/codeonthego/projects/builder/LaunchResult.kt index 7205e58f5e..0a2486b32b 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/projects/builder/LaunchResult.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/projects/builder/LaunchResult.kt @@ -1,3 +1,6 @@ package org.appdevforall.codeonthego.projects.builder -data class LaunchResult(val isSuccess: Boolean, val message: String) \ No newline at end of file +data class LaunchResult( + val isSuccess: Boolean, + val message: String, +) diff --git a/app/src/main/java/org/appdevforall/codeonthego/provider/IDEDocumentsProvider.java b/app/src/main/java/org/appdevforall/codeonthego/provider/IDEDocumentsProvider.java index 12f396abc1..fa03cd4671 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/provider/IDEDocumentsProvider.java +++ b/app/src/main/java/org/appdevforall/codeonthego/provider/IDEDocumentsProvider.java @@ -29,302 +29,295 @@ import android.webkit.MimeTypeMap; import androidx.annotation.NonNull; import com.itsaky.androidide.resources.R; -import org.appdevforall.codeonthego.utils.Environment; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Collections; import java.util.LinkedList; import java.util.Locale; +import org.appdevforall.codeonthego.utils.Environment; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * A document provider for the Storage Access Framework which exposes the files in the $HOME/ - * directory to other apps. + * A document provider for the Storage Access Framework which exposes the files in the $HOME/ directory to other apps. * - *

Note that this replaces providing an activity matching the ACTION_GET_CONTENT intent: + *

+ * Note that this replaces providing an activity matching the ACTION_GET_CONTENT intent: * - *

"A document provider and ACTION_GET_CONTENT should be considered mutually exclusive. If you - * support both of them simultaneously, your app will appear twice in the system picker UI, offering - * two different ways of accessing your stored data. This would be confusing for users." - - * http://developer.android.com/guide/topics/providers/document-provider.html#43 + *

+ * "A document provider and ACTION_GET_CONTENT should be considered mutually exclusive. If you support both of them simultaneously, your app will appear twice in the system picker UI, offering two different ways of accessing your stored data. This would be confusing for users." - http://developer.android.com/guide/topics/providers/document-provider.html#43 * - * @see TermuxDocumentsProvider + * @see TermuxDocumentsProvider */ public class IDEDocumentsProvider extends DocumentsProvider { - private static final String ALL_MIME_TYPES = "*/*"; - private static final Logger LOG = LoggerFactory.getLogger(IDEDocumentsProvider.class); - private static final File BASE_DIR = getBaseDir(); - // The default columns to return information about a root if no specific - // columns are requested in a query. - private static final String[] DEFAULT_ROOT_PROJECTION = - new String[]{ - Root.COLUMN_ROOT_ID, - Root.COLUMN_MIME_TYPES, - Root.COLUMN_FLAGS, - Root.COLUMN_ICON, - Root.COLUMN_TITLE, - Root.COLUMN_SUMMARY, - Root.COLUMN_DOCUMENT_ID, - Root.COLUMN_AVAILABLE_BYTES - }; - // The default columns to return information about a document if no specific - // columns are requested in a query. - private static final String[] DEFAULT_DOCUMENT_PROJECTION = - new String[]{ - Document.COLUMN_DOCUMENT_ID, - Document.COLUMN_MIME_TYPE, - Document.COLUMN_DISPLAY_NAME, - Document.COLUMN_LAST_MODIFIED, - Document.COLUMN_FLAGS, - Document.COLUMN_SIZE - }; + private static final String ALL_MIME_TYPES = "*/*"; + private static final Logger LOG = LoggerFactory.getLogger(IDEDocumentsProvider.class); + private static final File BASE_DIR = getBaseDir(); + // The default columns to return information about a root if no specific + // columns are requested in a query. + private static final String[] DEFAULT_ROOT_PROJECTION = new String[]{ + Root.COLUMN_ROOT_ID, + Root.COLUMN_MIME_TYPES, + Root.COLUMN_FLAGS, + Root.COLUMN_ICON, + Root.COLUMN_TITLE, + Root.COLUMN_SUMMARY, + Root.COLUMN_DOCUMENT_ID, + Root.COLUMN_AVAILABLE_BYTES + }; + // The default columns to return information about a document if no specific + // columns are requested in a query. + private static final String[] DEFAULT_DOCUMENT_PROJECTION = new String[]{ + Document.COLUMN_DOCUMENT_ID, + Document.COLUMN_MIME_TYPE, + Document.COLUMN_DISPLAY_NAME, + Document.COLUMN_LAST_MODIFIED, + Document.COLUMN_FLAGS, + Document.COLUMN_SIZE + }; - @NonNull - private static File getBaseDir() { - if (Environment.HOME != null) { - return Environment.HOME; - } + @NonNull + private static File getBaseDir() { + if (Environment.HOME != null) { + return Environment.HOME; + } - return new File(Environment.DEFAULT_HOME); - } + return new File(Environment.DEFAULT_HOME); + } - @Override - public boolean onCreate() { - return true; - } + /** + * Get the document id given a file. This document id must be consistent across time as other applications may save the ID and use it to reference documents later. + * + *

+ * The reverse of @{link #getFileForDocId}. + */ + private static String getDocIdForFile(File file) { + return file.getAbsolutePath(); + } - @Override - public boolean isChildDocument(String parentDocumentId, String documentId) { - return documentId.startsWith(parentDocumentId); - } + /** + * Get the file given a document id (the reverse of {@link #getDocIdForFile(File)}). + */ + private static File getFileForDocId(String docId) throws FileNotFoundException { + final File f = new File(docId); + if (!f.exists()) { + throw new FileNotFoundException(f.getAbsolutePath() + " not found"); + } + return f; + } - @Override - public String createDocument(String parentDocumentId, String mimeType, String displayName) - throws FileNotFoundException { - File newFile = new File(parentDocumentId, displayName); - int noConflictId = 2; - while (newFile.exists()) { - newFile = new File(parentDocumentId, displayName + " (" + noConflictId++ + ")"); - } - try { - boolean succeeded; - if (Document.MIME_TYPE_DIR.equals(mimeType)) { - succeeded = newFile.mkdir(); - } else { - succeeded = newFile.createNewFile(); - } - if (!succeeded) { - throw new FileNotFoundException("Failed to create document with id " + newFile.getPath()); - } - } catch (IOException e) { - throw new FileNotFoundException("Failed to create document with id " + newFile.getPath()); - } - return newFile.getPath(); - } + private static String getMimeType(File file) { + if (file.isDirectory()) { + return Document.MIME_TYPE_DIR; + } else { + final String name = file.getName(); + final int lastDot = name.lastIndexOf('.'); + if (lastDot >= 0) { + final String extension = name.substring(lastDot + 1).toLowerCase(Locale.ROOT); + final String mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); + if (mime != null) { + return mime; + } + } + return "application/octet-stream"; + } + } - @Override - public void deleteDocument(String documentId) throws FileNotFoundException { - File file = getFileForDocId(documentId); - if (!file.delete()) { - throw new FileNotFoundException("Failed to delete document with id " + documentId); - } - } + @Override + public String createDocument(String parentDocumentId, String mimeType, String displayName) + throws FileNotFoundException { + File newFile = new File(parentDocumentId, displayName); + int noConflictId = 2; + while (newFile.exists()) { + newFile = new File(parentDocumentId, displayName + " (" + noConflictId++ + ")"); + } + try { + boolean succeeded; + if (Document.MIME_TYPE_DIR.equals(mimeType)) { + succeeded = newFile.mkdir(); + } else { + succeeded = newFile.createNewFile(); + } + if (!succeeded) { + throw new FileNotFoundException("Failed to create document with id " + newFile.getPath()); + } + } catch (IOException e) { + throw new FileNotFoundException("Failed to create document with id " + newFile.getPath()); + } + return newFile.getPath(); + } - @Override - public Cursor queryRoots(String[] projection) { - final MatrixCursor result = - new MatrixCursor(projection != null ? projection : DEFAULT_ROOT_PROJECTION); - final String applicationName = getContext().getString(R.string.app_name); + @Override + public void deleteDocument(String documentId) throws FileNotFoundException { + File file = getFileForDocId(documentId); + if (!file.delete()) { + throw new FileNotFoundException("Failed to delete document with id " + documentId); + } + } - final MatrixCursor.RowBuilder row = result.newRow(); - LOG.debug("queryRoots() before all add"); - row.add(Root.COLUMN_ROOT_ID, getDocIdForFile(BASE_DIR)); - LOG.debug("queryRoots() before all add, 1"); - row.add(Root.COLUMN_DOCUMENT_ID, getDocIdForFile(BASE_DIR)); - LOG.debug("queryRoots() before all add, 2"); - row.add(Root.COLUMN_SUMMARY, null); - LOG.debug("queryRoots() before all add, 3"); - row.add( - Root.COLUMN_FLAGS, - Root.FLAG_SUPPORTS_CREATE | Root.FLAG_SUPPORTS_SEARCH | Root.FLAG_SUPPORTS_IS_CHILD); - LOG.debug("queryRoots() before all add, 4"); - row.add(Root.COLUMN_TITLE, applicationName); - LOG.debug("queryRoots() before all add, 5"); - row.add(Root.COLUMN_MIME_TYPES, ALL_MIME_TYPES); - LOG.debug("queryRoots() before all add, 6"); - row.add(Root.COLUMN_AVAILABLE_BYTES, BASE_DIR.getFreeSpace()); - LOG.debug("queryRoots() before all add, 7"); - row.add(Root.COLUMN_ICON, R.drawable.ic_launcher_foreground); - LOG.debug("queryRoots() before all add"); - return result; - } + @Override + public String getDocumentType(String documentId) throws FileNotFoundException { + File file = getFileForDocId(documentId); + return getMimeType(file); + } - /** - * Get the document id given a file. This document id must be consistent across time as other - * applications may save the ID and use it to reference documents later. - * - *

The reverse of @{link #getFileForDocId}. - */ - private static String getDocIdForFile(File file) { - return file.getAbsolutePath(); - } + @Override + public boolean isChildDocument(String parentDocumentId, String documentId) { + return documentId.startsWith(parentDocumentId); + } - @Override - public Cursor queryDocument(String documentId, String[] projection) throws FileNotFoundException { - final MatrixCursor result = - new MatrixCursor(projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION); - includeFile(result, documentId, null); - return result; - } + @Override + public boolean onCreate() { + return true; + } - @Override - public Cursor queryChildDocuments(String parentDocumentId, String[] projection, String sortOrder) - throws FileNotFoundException { - final MatrixCursor result = - new MatrixCursor(projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION); - final File parent = getFileForDocId(parentDocumentId); - for (File file : parent.listFiles()) { - includeFile(result, null, file); - } - return result; - } + @Override + public ParcelFileDescriptor openDocument( + final String documentId, String mode, CancellationSignal signal) + throws FileNotFoundException { + final File file = getFileForDocId(documentId); + final int accessMode = ParcelFileDescriptor.parseMode(mode); + return ParcelFileDescriptor.open(file, accessMode); + } - @Override - public Cursor querySearchDocuments(String rootId, String query, String[] projection) - throws FileNotFoundException { - final MatrixCursor result = - new MatrixCursor(projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION); - final File parent = getFileForDocId(rootId); + @Override + public AssetFileDescriptor openDocumentThumbnail( + String documentId, Point sizeHint, CancellationSignal signal) throws FileNotFoundException { + final File file = getFileForDocId(documentId); + final ParcelFileDescriptor pfd = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY); + return new AssetFileDescriptor(pfd, 0, file.length()); + } - // This example implementation searches file names for the query and doesn't rank search - // results, so we can stop as soon as we find a sufficient number of matches. Other - // implementations might rank results and use other data about files, rather than the file - // name, to produce a match. - final LinkedList pending = new LinkedList<>(); - pending.add(parent); + @Override + public Cursor queryChildDocuments(String parentDocumentId, String[] projection, String sortOrder) + throws FileNotFoundException { + final MatrixCursor result = new MatrixCursor(projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION); + final File parent = getFileForDocId(parentDocumentId); + for (File file : parent.listFiles()) { + includeFile(result, null, file); + } + return result; + } - final int MAX_SEARCH_RESULTS = 50; - while (!pending.isEmpty() && result.getCount() < MAX_SEARCH_RESULTS) { - final File file = pending.removeFirst(); - // Avoid directories outside the $HOME directory linked with symlinks (to avoid e.g. - // search - // through the whole SD card). - boolean isInsideHome; - try { - isInsideHome = file.getCanonicalPath().startsWith(Environment.HOME.getAbsolutePath()); - } catch (IOException e) { - isInsideHome = true; - } - if (isInsideHome) { - if (file.isDirectory()) { - Collections.addAll(pending, file.listFiles()); - } else { - if (file.getName().toLowerCase(Locale.ROOT).contains(query)) { - includeFile(result, null, file); - } - } - } - } + @Override + public Cursor queryDocument(String documentId, String[] projection) throws FileNotFoundException { + final MatrixCursor result = new MatrixCursor(projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION); + includeFile(result, documentId, null); + return result; + } - return result; - } + @Override + public Cursor queryRoots(String[] projection) { + final MatrixCursor result = new MatrixCursor(projection != null ? projection : DEFAULT_ROOT_PROJECTION); + final String applicationName = getContext().getString(R.string.app_name); - @Override - public String getDocumentType(String documentId) throws FileNotFoundException { - File file = getFileForDocId(documentId); - return getMimeType(file); - } + final MatrixCursor.RowBuilder row = result.newRow(); + LOG.debug("queryRoots() before all add"); + row.add(Root.COLUMN_ROOT_ID, getDocIdForFile(BASE_DIR)); + LOG.debug("queryRoots() before all add, 1"); + row.add(Root.COLUMN_DOCUMENT_ID, getDocIdForFile(BASE_DIR)); + LOG.debug("queryRoots() before all add, 2"); + row.add(Root.COLUMN_SUMMARY, null); + LOG.debug("queryRoots() before all add, 3"); + row.add( + Root.COLUMN_FLAGS, + Root.FLAG_SUPPORTS_CREATE | Root.FLAG_SUPPORTS_SEARCH | Root.FLAG_SUPPORTS_IS_CHILD); + LOG.debug("queryRoots() before all add, 4"); + row.add(Root.COLUMN_TITLE, applicationName); + LOG.debug("queryRoots() before all add, 5"); + row.add(Root.COLUMN_MIME_TYPES, ALL_MIME_TYPES); + LOG.debug("queryRoots() before all add, 6"); + row.add(Root.COLUMN_AVAILABLE_BYTES, BASE_DIR.getFreeSpace()); + LOG.debug("queryRoots() before all add, 7"); + row.add(Root.COLUMN_ICON, R.drawable.ic_launcher_foreground); + LOG.debug("queryRoots() before all add"); + return result; + } - @Override - public ParcelFileDescriptor openDocument( - final String documentId, String mode, CancellationSignal signal) - throws FileNotFoundException { - final File file = getFileForDocId(documentId); - final int accessMode = ParcelFileDescriptor.parseMode(mode); - return ParcelFileDescriptor.open(file, accessMode); - } + @Override + public Cursor querySearchDocuments(String rootId, String query, String[] projection) + throws FileNotFoundException { + final MatrixCursor result = new MatrixCursor(projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION); + final File parent = getFileForDocId(rootId); - @Override - public AssetFileDescriptor openDocumentThumbnail( - String documentId, Point sizeHint, CancellationSignal signal) throws FileNotFoundException { - final File file = getFileForDocId(documentId); - final ParcelFileDescriptor pfd = - ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY); - return new AssetFileDescriptor(pfd, 0, file.length()); - } + // This example implementation searches file names for the query and doesn't rank search + // results, so we can stop as soon as we find a sufficient number of matches. Other + // implementations might rank results and use other data about files, rather than the file + // name, to produce a match. + final LinkedList pending = new LinkedList<>(); + pending.add(parent); - /** - * Add a representation of a file to a cursor. - * - * @param result the cursor to modify - * @param docId the document ID representing the desired file (may be null if given file) - * @param file the File object representing the desired file (may be null if given docID) - */ - private void includeFile(MatrixCursor result, String docId, File file) - throws FileNotFoundException { - if (docId == null) { - docId = getDocIdForFile(file); - } else { - file = getFileForDocId(docId); - } + final int MAX_SEARCH_RESULTS = 50; + while (!pending.isEmpty() && result.getCount() < MAX_SEARCH_RESULTS) { + final File file = pending.removeFirst(); + // Avoid directories outside the $HOME directory linked with symlinks (to avoid e.g. + // search + // through the whole SD card). + boolean isInsideHome; + try { + isInsideHome = file.getCanonicalPath().startsWith(Environment.HOME.getAbsolutePath()); + } catch (IOException e) { + isInsideHome = true; + } + if (isInsideHome) { + if (file.isDirectory()) { + Collections.addAll(pending, file.listFiles()); + } else { + if (file.getName().toLowerCase(Locale.ROOT).contains(query)) { + includeFile(result, null, file); + } + } + } + } - int flags = 0; - if (file.isDirectory()) { - if (file.canWrite()) { - flags |= Document.FLAG_DIR_SUPPORTS_CREATE; - } - } else if (file.canWrite()) { - flags |= Document.FLAG_SUPPORTS_WRITE; - } - if (file.getParentFile().canWrite()) { - flags |= Document.FLAG_SUPPORTS_DELETE; - } + return result; + } - final String displayName = file.getName(); - final String mimeType = getMimeType(file); - if (mimeType.startsWith("image/")) { - flags |= Document.FLAG_SUPPORTS_THUMBNAIL; - } + /** + * Add a representation of a file to a cursor. + * + * @param result + * the cursor to modify + * @param docId + * the document ID representing the desired file (may be null if given file) + * @param file + * the File object representing the desired file (may be null if given docID) + */ + private void includeFile(MatrixCursor result, String docId, File file) + throws FileNotFoundException { + if (docId == null) { + docId = getDocIdForFile(file); + } else { + file = getFileForDocId(docId); + } - final MatrixCursor.RowBuilder row = result.newRow(); - row.add(Document.COLUMN_DOCUMENT_ID, docId); - row.add(Document.COLUMN_DISPLAY_NAME, displayName); - row.add(Document.COLUMN_SIZE, file.length()); - row.add(Document.COLUMN_MIME_TYPE, mimeType); - row.add(Document.COLUMN_LAST_MODIFIED, file.lastModified()); - row.add(Document.COLUMN_FLAGS, flags); - row.add(Document.COLUMN_ICON, R.mipmap.ic_launcher); - } + int flags = 0; + if (file.isDirectory()) { + if (file.canWrite()) { + flags |= Document.FLAG_DIR_SUPPORTS_CREATE; + } + } else if (file.canWrite()) { + flags |= Document.FLAG_SUPPORTS_WRITE; + } + if (file.getParentFile().canWrite()) { + flags |= Document.FLAG_SUPPORTS_DELETE; + } - /** - * Get the file given a document id (the reverse of {@link #getDocIdForFile(File)}). - */ - private static File getFileForDocId(String docId) throws FileNotFoundException { - final File f = new File(docId); - if (!f.exists()) { - throw new FileNotFoundException(f.getAbsolutePath() + " not found"); - } - return f; - } + final String displayName = file.getName(); + final String mimeType = getMimeType(file); + if (mimeType.startsWith("image/")) { + flags |= Document.FLAG_SUPPORTS_THUMBNAIL; + } - private static String getMimeType(File file) { - if (file.isDirectory()) { - return Document.MIME_TYPE_DIR; - } else { - final String name = file.getName(); - final int lastDot = name.lastIndexOf('.'); - if (lastDot >= 0) { - final String extension = name.substring(lastDot + 1).toLowerCase(Locale.ROOT); - final String mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); - if (mime != null) { - return mime; - } - } - return "application/octet-stream"; - } - } + final MatrixCursor.RowBuilder row = result.newRow(); + row.add(Document.COLUMN_DOCUMENT_ID, docId); + row.add(Document.COLUMN_DISPLAY_NAME, displayName); + row.add(Document.COLUMN_SIZE, file.length()); + row.add(Document.COLUMN_MIME_TYPE, mimeType); + row.add(Document.COLUMN_LAST_MODIFIED, file.lastModified()); + row.add(Document.COLUMN_FLAGS, flags); + row.add(Document.COLUMN_ICON, R.mipmap.ic_launcher); + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/quickbuild/GenerateSourcesDeferral.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/GenerateSourcesDeferral.kt index a68e235b84..68d4ccafa0 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/quickbuild/GenerateSourcesDeferral.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/GenerateSourcesDeferral.kt @@ -1,12 +1,12 @@ package org.appdevforall.codeonthego.quickbuild -import org.appdevforall.codeonthego.projects.ProjectManagerImpl import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job import kotlinx.coroutines.delay import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.launch +import org.appdevforall.codeonthego.projects.ProjectManagerImpl import org.appdevforall.cotg.quickbuild.domain.session.QuickBuildSessionState import org.koin.core.context.GlobalContext import org.slf4j.LoggerFactory diff --git a/app/src/main/java/org/appdevforall/codeonthego/quickbuild/GradleQuickBuildProvisioner.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/GradleQuickBuildProvisioner.kt index 7c63ae1f04..3dce155fd4 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/quickbuild/GradleQuickBuildProvisioner.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/GradleQuickBuildProvisioner.kt @@ -2,23 +2,23 @@ package org.appdevforall.codeonthego.quickbuild import android.content.Context import androidx.annotation.StringRes +import com.itsaky.androidide.resources.R +import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.delay +import kotlinx.coroutines.future.await +import kotlinx.coroutines.withContext import org.appdevforall.codeonthego.lookup.Lookup import org.appdevforall.codeonthego.projects.IProjectManager import org.appdevforall.codeonthego.projects.api.AndroidModule import org.appdevforall.codeonthego.projects.builder.BuildService import org.appdevforall.codeonthego.projects.isPluginProject -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.services.builder.GradleBuildService import org.appdevforall.codeonthego.tooling.api.GradlePluginConfig import org.appdevforall.codeonthego.tooling.api.messages.BuildRunType import org.appdevforall.codeonthego.tooling.api.messages.GradleBuildParams import org.appdevforall.codeonthego.tooling.api.messages.TaskExecutionMessage import org.appdevforall.codeonthego.tooling.api.messages.result.TaskExecutionResult -import kotlinx.coroutines.CancellationException -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.delay -import kotlinx.coroutines.future.await -import kotlinx.coroutines.withContext import org.appdevforall.cotg.quickbuild.data.FileGenerationStore import org.appdevforall.cotg.quickbuild.data.ProxyAppInfo import org.appdevforall.cotg.quickbuild.data.QuickBuildProjectLayout diff --git a/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildGraphWarmUp.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildGraphWarmUp.kt index 25aa1fa53c..5af5ae341d 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildGraphWarmUp.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildGraphWarmUp.kt @@ -1,9 +1,9 @@ package org.appdevforall.codeonthego.quickbuild -import org.appdevforall.codeonthego.utils.FeatureFlags import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.first +import org.appdevforall.codeonthego.utils.FeatureFlags import org.appdevforall.cotg.quickbuild.service.session.QuickBuildSessionManager import org.koin.core.context.GlobalContext import org.slf4j.LoggerFactory diff --git a/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildInstallAdapters.kt b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildInstallAdapters.kt index 4166af39b9..42bc9f2315 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildInstallAdapters.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/quickbuild/QuickBuildInstallAdapters.kt @@ -4,10 +4,10 @@ import android.content.Context import android.content.pm.PackageInfo import android.content.pm.PackageInstaller import android.content.pm.PackageManager -import org.appdevforall.codeonthego.events.InstallationEvent -import org.appdevforall.codeonthego.utils.isAtLeastP import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.SharedFlow +import org.appdevforall.codeonthego.events.InstallationEvent +import org.appdevforall.codeonthego.utils.isAtLeastP import org.appdevforall.cotg.quickbuild.service.provision.InstallBroadcast import org.appdevforall.cotg.quickbuild.service.provision.InstalledPackages import org.greenrobot.eventbus.EventBus diff --git a/app/src/main/java/org/appdevforall/codeonthego/repositories/BreakpointRepository.kt b/app/src/main/java/org/appdevforall/codeonthego/repositories/BreakpointRepository.kt index faba5feba9..150ac3ed9e 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/repositories/BreakpointRepository.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/repositories/BreakpointRepository.kt @@ -109,4 +109,4 @@ object BreakpointRepository { } } } -} \ No newline at end of file +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/repositories/PluginRepository.kt b/app/src/main/java/org/appdevforall/codeonthego/repositories/PluginRepository.kt index 3f1dbd9189..05d0295f79 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/repositories/PluginRepository.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/repositories/PluginRepository.kt @@ -10,49 +10,51 @@ import java.io.File * Defines the contract for plugin data operations */ interface PluginRepository { - - /** - * Get all available plugins - */ - suspend fun getAllPlugins(): Result> - - /** - * Enable a plugin by ID - */ - suspend fun enablePlugin(pluginId: String): Result - - /** - * Disable a plugin by ID - */ - suspend fun disablePlugin(pluginId: String): Result - - /** - * Uninstall a plugin by ID - */ - suspend fun uninstallPlugin(pluginId: String): Result - - /** - * Read plugin metadata from a file without installing it - */ - suspend fun getPluginMetadataFromFile(pluginFile: File): Result - - /** - * Returns true if the incoming file's signing certificate matches the installed plugin's certificate - */ - suspend fun haveMatchingSignatures(incomingFile: File, existingPluginId: String): Result - - /** - * Install a plugin from file - */ - suspend fun installPluginFromFile(pluginFile: File): Result - - /** - * Reload all plugins - */ - suspend fun reloadPlugins(): Result - - /** - * Check if plugin manager is available - */ - fun isPluginManagerAvailable(): Boolean -} \ No newline at end of file + /** + * Get all available plugins + */ + suspend fun getAllPlugins(): Result> + + /** + * Enable a plugin by ID + */ + suspend fun enablePlugin(pluginId: String): Result + + /** + * Disable a plugin by ID + */ + suspend fun disablePlugin(pluginId: String): Result + + /** + * Uninstall a plugin by ID + */ + suspend fun uninstallPlugin(pluginId: String): Result + + /** + * Read plugin metadata from a file without installing it + */ + suspend fun getPluginMetadataFromFile(pluginFile: File): Result + + /** + * Returns true if the incoming file's signing certificate matches the installed plugin's certificate + */ + suspend fun haveMatchingSignatures( + incomingFile: File, + existingPluginId: String, + ): Result + + /** + * Install a plugin from file + */ + suspend fun installPluginFromFile(pluginFile: File): Result + + /** + * Reload all plugins + */ + suspend fun reloadPlugins(): Result + + /** + * Check if plugin manager is available + */ + fun isPluginManagerAvailable(): Boolean +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/repositories/PluginRepositoryImpl.kt b/app/src/main/java/org/appdevforall/codeonthego/repositories/PluginRepositoryImpl.kt index 7b8b9d098f..3aae9155d7 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/repositories/PluginRepositoryImpl.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/repositories/PluginRepositoryImpl.kt @@ -1,13 +1,13 @@ package org.appdevforall.codeonthego.repositories import android.util.Log +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext +import org.adfa.constants.PLUGIN_ARCHIVE_EXTENSION import org.appdevforall.codeonthego.plugins.PluginInfo import org.appdevforall.codeonthego.plugins.PluginMetadata import org.appdevforall.codeonthego.plugins.manager.core.PluginManager import org.appdevforall.codeonthego.plugins.manager.loaders.toPluginMetadata -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.withContext -import org.adfa.constants.PLUGIN_ARCHIVE_EXTENSION import java.io.File /** diff --git a/app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateCollectionRepositoryImpl.kt b/app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateCollectionRepositoryImpl.kt index 97f0618472..1bbe8349a6 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateCollectionRepositoryImpl.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateCollectionRepositoryImpl.kt @@ -1,10 +1,5 @@ package org.appdevforall.codeonthego.repositories -import org.appdevforall.codeonthego.templates.ITemplateProvider -import org.appdevforall.codeonthego.templates.TemplateRecipe -import org.appdevforall.codeonthego.templates.impl.TemplateWarning -import org.appdevforall.codeonthego.templates.impl.zip.ZipTemplateReader -import org.appdevforall.codeonthego.utils.Environment import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.sync.Mutex @@ -12,6 +7,11 @@ import kotlinx.coroutines.sync.withLock import kotlinx.coroutines.withContext import org.adfa.constants.TEMPLATE_ARCHIVE_EXTENSION import org.adfa.constants.TEMPLATE_CORE_ARCHIVE +import org.appdevforall.codeonthego.templates.ITemplateProvider +import org.appdevforall.codeonthego.templates.TemplateRecipe +import org.appdevforall.codeonthego.templates.impl.TemplateWarning +import org.appdevforall.codeonthego.templates.impl.zip.ZipTemplateReader +import org.appdevforall.codeonthego.utils.Environment import org.slf4j.LoggerFactory import java.io.File import java.util.UUID diff --git a/app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateRepositoryImpl.kt b/app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateRepositoryImpl.kt index 3bce8c89d7..ec3a590332 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateRepositoryImpl.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/repositories/TemplateRepositoryImpl.kt @@ -1,13 +1,13 @@ package org.appdevforall.codeonthego.repositories -import org.appdevforall.codeonthego.templates.ITemplateProvider -import org.appdevforall.codeonthego.templates.manager.models.CgtFileItem -import org.appdevforall.codeonthego.templates.manager.models.TemplateProvenance -import org.appdevforall.codeonthego.templates.manager.parsing.CgtTemplateReader import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.adfa.constants.TEMPLATE_CORE_ARCHIVE +import org.appdevforall.codeonthego.templates.ITemplateProvider +import org.appdevforall.codeonthego.templates.manager.models.CgtFileItem +import org.appdevforall.codeonthego.templates.manager.models.TemplateProvenance +import org.appdevforall.codeonthego.templates.manager.parsing.CgtTemplateReader import org.json.JSONException import org.slf4j.LoggerFactory import java.io.File diff --git a/app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProject.kt b/app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProject.kt index 8d311c9032..24838aed86 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProject.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/roomData/recentproject/RecentProject.kt @@ -6,17 +6,16 @@ import androidx.room.Index import androidx.room.PrimaryKey @Entity( - tableName = "recent_project_table", - indices = [Index(value = ["location"], unique = true)] + tableName = "recent_project_table", + indices = [Index(value = ["location"], unique = true)], ) data class RecentProject( - @PrimaryKey(autoGenerate = true) - @ColumnInfo(name = "id") val id: Int = 0, - @ColumnInfo(name = "name") val name: String, - @ColumnInfo(name = "create_at") val createdAt: String, - @ColumnInfo(name = "location") val location: String, - @ColumnInfo(name = "last_modified") val lastModified: String = "0", - @ColumnInfo(name = "template_name") val templateName: String = "unknown", - @ColumnInfo(name = "language") val language: String = "unknown" + @PrimaryKey(autoGenerate = true) + @ColumnInfo(name = "id") val id: Int = 0, + @ColumnInfo(name = "name") val name: String, + @ColumnInfo(name = "create_at") val createdAt: String, + @ColumnInfo(name = "location") val location: String, + @ColumnInfo(name = "last_modified") val lastModified: String = "0", + @ColumnInfo(name = "template_name") val templateName: String = "unknown", + @ColumnInfo(name = "language") val language: String = "unknown", ) - diff --git a/app/src/main/java/org/appdevforall/codeonthego/search/replace/ProjectReplacer.kt b/app/src/main/java/org/appdevforall/codeonthego/search/replace/ProjectReplacer.kt index 0881b59b02..f9f22ef0fd 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/search/replace/ProjectReplacer.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/search/replace/ProjectReplacer.kt @@ -1,9 +1,9 @@ package org.appdevforall.codeonthego.search.replace -import org.appdevforall.codeonthego.models.SearchResult import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext +import org.appdevforall.codeonthego.models.SearchResult import java.io.File import java.io.IOException import java.nio.file.Files diff --git a/app/src/main/java/org/appdevforall/codeonthego/search/replace/ReplaceCoordinator.kt b/app/src/main/java/org/appdevforall/codeonthego/search/replace/ReplaceCoordinator.kt index 98e2dabbc5..54806d213c 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/search/replace/ReplaceCoordinator.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/search/replace/ReplaceCoordinator.kt @@ -1,9 +1,9 @@ package org.appdevforall.codeonthego.search.replace +import io.github.rosemoe.sora.text.Content import org.appdevforall.codeonthego.editor.ui.IDEEditor import org.appdevforall.codeonthego.eventbus.events.file.FileContentChangedEvent import org.appdevforall.codeonthego.models.SearchResult -import io.github.rosemoe.sora.text.Content import org.greenrobot.eventbus.EventBus import java.io.File diff --git a/app/src/main/java/org/appdevforall/codeonthego/search/replace/TextReplacement.kt b/app/src/main/java/org/appdevforall/codeonthego/search/replace/TextReplacement.kt index fbf4a995c0..aaa9f500a0 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/search/replace/TextReplacement.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/search/replace/TextReplacement.kt @@ -1,7 +1,7 @@ package org.appdevforall.codeonthego.search.replace -import org.appdevforall.codeonthego.models.SearchResult import io.github.rosemoe.sora.text.Content +import org.appdevforall.codeonthego.models.SearchResult object TextReplacement { sealed interface Result { diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/ToolingServerAlreadyStartedException.java b/app/src/main/java/org/appdevforall/codeonthego/services/ToolingServerAlreadyStartedException.java index bf585b0993..e160f7c60c 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/ToolingServerAlreadyStartedException.java +++ b/app/src/main/java/org/appdevforall/codeonthego/services/ToolingServerAlreadyStartedException.java @@ -24,11 +24,11 @@ */ public class ToolingServerAlreadyStartedException extends IllegalStateException { - public ToolingServerAlreadyStartedException() { - this("Tooling API server is already started"); - } + public ToolingServerAlreadyStartedException() { + this("Tooling API server is already started"); + } - public ToolingServerAlreadyStartedException(final String s) { - super(s); - } + public ToolingServerAlreadyStartedException(final String s) { + super(s); + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/ToolingServerNotStartedException.java b/app/src/main/java/org/appdevforall/codeonthego/services/ToolingServerNotStartedException.java index 15ba061221..da6e9d6469 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/ToolingServerNotStartedException.java +++ b/app/src/main/java/org/appdevforall/codeonthego/services/ToolingServerNotStartedException.java @@ -24,11 +24,11 @@ */ public class ToolingServerNotStartedException extends IllegalStateException { - public ToolingServerNotStartedException() { - this("Tooling API server has not been started"); - } + public ToolingServerNotStartedException() { + this("Tooling API server has not been started"); + } - public ToolingServerNotStartedException(final String s) { - super(s); - } + public ToolingServerNotStartedException(final String s) { + super(s); + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/builder/CpuInfo.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/CpuInfo.kt index 4c3c185586..c718da79ee 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/builder/CpuInfo.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/CpuInfo.kt @@ -126,25 +126,31 @@ object CpuInfo { total: Int, ): CpuTopology = when (clusters.size) { - 0 -> CpuTopology(null, total, 0, total) + 0 -> { + CpuTopology(null, total, 0, total) + } - 1 -> CpuTopology(null, clusters[0].second, 0, total) + 1 -> { + CpuTopology(null, clusters[0].second, 0, total) + } - 2 -> + 2 -> { CpuTopology( primeCores = null, bigCores = clusters[1].second, smallCores = clusters[0].second, totalCores = total, ) + } - 3 -> + 3 -> { CpuTopology( primeCores = clusters[2].second, bigCores = clusters[1].second, smallCores = clusters[0].second, totalCores = total, ) + } else -> { // 4+ clusters: small = lowest, prime = highest, big = everything in between diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleBuildService.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleBuildService.kt index c7acc0ed50..aa2913b078 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleBuildService.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleBuildService.kt @@ -29,6 +29,17 @@ import androidx.core.app.NotificationManagerCompat import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import com.itsaky.androidide.BuildConfig +import com.itsaky.androidide.resources.R +import com.termux.shared.termux.shell.command.environment.TermuxShellEnvironment +import io.sentry.Sentry +import kotlinx.coroutines.CoroutineName +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.Job +import kotlinx.coroutines.cancel +import kotlinx.coroutines.future.await +import kotlinx.coroutines.isActive +import kotlinx.coroutines.launch import org.appdevforall.codeonthego.analytics.IAnalyticsManager import org.appdevforall.codeonthego.analytics.gradle.BuildCompletedMetric import org.appdevforall.codeonthego.analytics.gradle.BuildStartedMetric @@ -44,7 +55,6 @@ import org.appdevforall.codeonthego.preferences.internal.BuildPreferences import org.appdevforall.codeonthego.preferences.internal.DevOpsPreferences import org.appdevforall.codeonthego.projects.ProjectManagerImpl import org.appdevforall.codeonthego.projects.builder.BuildService -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.services.ToolingServerNotStartedException import org.appdevforall.codeonthego.services.builder.ToolingServerRunner.OnServerStartListener import org.appdevforall.codeonthego.tasks.ifCancelledOrInterrupted @@ -75,16 +85,6 @@ import org.appdevforall.codeonthego.utils.Environment import org.appdevforall.codeonthego.utils.FeatureFlags import org.appdevforall.codeonthego.utils.ResourceUtils import org.appdevforall.codeonthego.utils.ZipUtils -import com.termux.shared.termux.shell.command.environment.TermuxShellEnvironment -import io.sentry.Sentry -import kotlinx.coroutines.CoroutineName -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.Job -import kotlinx.coroutines.cancel -import kotlinx.coroutines.future.await -import kotlinx.coroutines.isActive -import kotlinx.coroutines.launch import org.greenrobot.eventbus.EventBus import org.koin.android.ext.android.inject import org.slf4j.LoggerFactory diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleBuildServiceConnnection.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleBuildServiceConnnection.kt index 71343a68da..d39038da95 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleBuildServiceConnnection.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleBuildServiceConnnection.kt @@ -28,21 +28,22 @@ import org.slf4j.LoggerFactory * @author Akash Yadav */ class GradleBuildServiceConnnection : ServiceConnection { - - internal var onConnected: ((GradleBuildService) -> Unit)? = null - - companion object { - - private val log = LoggerFactory.getLogger(GradleBuildServiceConnnection::class.java) - } - - override fun onServiceConnected(name: ComponentName?, service: IBinder?) { - val serviceBinder = service as GradleServiceBinder - onConnected?.invoke(serviceBinder.service!!) - } - - override fun onServiceDisconnected(name: ComponentName?) { - onConnected = null - log.info("Disconnected from Gradle build service") - } -} \ No newline at end of file + internal var onConnected: ((GradleBuildService) -> Unit)? = null + + companion object { + private val log = LoggerFactory.getLogger(GradleBuildServiceConnnection::class.java) + } + + override fun onServiceConnected( + name: ComponentName?, + service: IBinder?, + ) { + val serviceBinder = service as GradleServiceBinder + onConnected?.invoke(serviceBinder.service!!) + } + + override fun onServiceDisconnected(name: ComponentName?) { + onConnected = null + log.info("Disconnected from Gradle build service") + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleServiceBinder.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleServiceBinder.kt index cad5deb113..d23e0b86a2 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleServiceBinder.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/GradleServiceBinder.kt @@ -24,12 +24,13 @@ import android.os.Binder * * @author Akash Yadav */ -internal class GradleServiceBinder(service: GradleBuildService?) : Binder() { +internal class GradleServiceBinder( + service: GradleBuildService?, +) : Binder() { + var service: GradleBuildService? = service + private set - var service: GradleBuildService? = service - private set - - fun release() { - service = null - } + fun release() { + service = null + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/builder/ThermalSafeStrategy.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/ThermalSafeStrategy.kt index 0fe4cb24ea..9d17b0adac 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/builder/ThermalSafeStrategy.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/ThermalSafeStrategy.kt @@ -44,8 +44,11 @@ class ThermalSafeStrategy( }, kotlin = when (val k = kotlin) { - is KotlinCompilerExecution.InProcess -> k - is KotlinCompilerExecution.Daemon -> + is KotlinCompilerExecution.InProcess -> { + k + } + + is KotlinCompilerExecution.Daemon -> { k.run { copy( jvm = @@ -58,6 +61,7 @@ class ThermalSafeStrategy( }, ) } + } }, aapt2 = aapt2.copy(threadPoolSize = newMaxWorkers), ) diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/builder/ToolingServerRunner.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/ToolingServerRunner.kt index d646850d94..6a31cc22f3 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/builder/ToolingServerRunner.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/ToolingServerRunner.kt @@ -18,6 +18,14 @@ package org.appdevforall.codeonthego.services.builder import android.content.Context +import com.termux.shared.reflection.ReflectionUtils +import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.CoroutineName +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.Job +import kotlinx.coroutines.joinAll +import kotlinx.coroutines.launch import org.appdevforall.codeonthego.logging.provider.IdeLogRouter import org.appdevforall.codeonthego.managers.ToolsManager import org.appdevforall.codeonthego.tasks.cancelIfActive @@ -28,14 +36,6 @@ import org.appdevforall.codeonthego.tooling.api.util.ToolingApiLauncher import org.appdevforall.codeonthego.tooling.api.util.ToolingProps import org.appdevforall.codeonthego.utils.Environment import org.appdevforall.codeonthego.utils.FeatureFlags -import com.termux.shared.reflection.ReflectionUtils -import kotlinx.coroutines.CancellationException -import kotlinx.coroutines.CoroutineName -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.Job -import kotlinx.coroutines.joinAll -import kotlinx.coroutines.launch import org.slf4j.LoggerFactory import java.io.InputStream import java.util.concurrent.atomic.AtomicBoolean diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/builder/util.kt b/app/src/main/java/org/appdevforall/codeonthego/services/builder/util.kt index d412b5d757..ee2080dd67 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/builder/util.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/builder/util.kt @@ -24,10 +24,10 @@ import org.appdevforall.codeonthego.tooling.api.messages.GradleDistributionParam * The distribution params. This considers [gradleInstallationDir] preference as well. */ val gradleDistributionParams: GradleDistributionParams - get() { - if (BuildPreferences.gradleInstallationDir.isBlank()) { - return GradleDistributionParams.WRAPPER - } +get() { + if (BuildPreferences.gradleInstallationDir.isBlank()) { + return GradleDistributionParams.WRAPPER + } - return GradleDistributionParams.forInstallationDir(BuildPreferences.gradleInstallationDir) - } \ No newline at end of file + return GradleDistributionParams.forInstallationDir(BuildPreferences.gradleInstallationDir) +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/debug/DebugOverlayManager.kt b/app/src/main/java/org/appdevforall/codeonthego/services/debug/DebugOverlayManager.kt index aa252f6d0b..73e3b00bf8 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/debug/DebugOverlayManager.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/debug/DebugOverlayManager.kt @@ -3,6 +3,7 @@ package org.appdevforall.codeonthego.services.debug import android.content.Context import android.graphics.PixelFormat import android.hardware.display.DisplayManager +import android.provider.Settings import android.view.ContextThemeWrapper import android.view.Gravity import android.view.LayoutInflater @@ -10,13 +11,12 @@ import android.view.MotionEvent import android.view.ViewConfiguration import android.view.WindowManager import android.widget.Toast -import android.provider.Settings import androidx.core.content.ContextCompat import androidx.core.hardware.display.DisplayManagerCompat import com.itsaky.androidide.R +import com.itsaky.androidide.databinding.DebuggerActionsWindowBinding import org.appdevforall.codeonthego.actions.ActionItem import org.appdevforall.codeonthego.actions.ActionsRegistry -import com.itsaky.androidide.databinding.DebuggerActionsWindowBinding import org.appdevforall.codeonthego.idetooltips.TooltipManager import org.appdevforall.codeonthego.idetooltips.TooltipTag import org.appdevforall.codeonthego.utils.PermissionsHelper @@ -68,7 +68,9 @@ class DebugOverlayManager private constructor( overlayLayoutParams.y = initialWindowY + deltaY windowManager.updateViewLayout(binding.root, overlayLayoutParams) true - } else false + } else { + false + } } MotionEvent.ACTION_UP -> { @@ -86,7 +88,9 @@ class DebugOverlayManager private constructor( false } - else -> false + else -> { + false + } } } @@ -94,7 +98,7 @@ class DebugOverlayManager private constructor( TooltipManager.showIdeCategoryTooltip( context = view.context, anchorView = view.rootView, - tag = TooltipTag.DEBUGGER_ACTION_MOVE + tag = TooltipTag.DEBUGGER_ACTION_MOVE, ) true } @@ -102,15 +106,21 @@ class DebugOverlayManager private constructor( private var isShown = false private val overlayLayoutParams by lazy { - WindowManager.LayoutParams( - /* w = */ WindowManager.LayoutParams.WRAP_CONTENT, - /* h = */ WindowManager.LayoutParams.WRAP_CONTENT, - /* _type = */ WM_OVERLAY_TYPE, - /* _flags = */ WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, - /* _format = */ PixelFormat.TRANSLUCENT - ).apply { - gravity = Gravity.TOP or Gravity.CENTER_HORIZONTAL - } + WindowManager + .LayoutParams( + // w = + WindowManager.LayoutParams.WRAP_CONTENT, + // h = + WindowManager.LayoutParams.WRAP_CONTENT, + // _type = + WM_OVERLAY_TYPE, + // _flags = + WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, + // _format = + PixelFormat.TRANSLUCENT, + ).apply { + gravity = Gravity.TOP or Gravity.CENTER_HORIZONTAL + } } fun show() { @@ -124,11 +134,12 @@ class DebugOverlayManager private constructor( logger.warn("Overlay permission denied. Skipping debugger overlay window.") val state = PermissionsHelper.getOverlayPermissionState(ctx) - val message = if (state == PermissionsHelper.OverlayPermissionState.UNSUPPORTED) { - ctx.getString(R.string.permission_overlay_unsupported_hint) - } else { - ctx.getString(R.string.permission_overlay_restricted_settings_hint) - } + val message = + if (state == PermissionsHelper.OverlayPermissionState.UNSUPPORTED) { + ctx.getString(R.string.permission_overlay_unsupported_hint) + } else { + ctx.getString(R.string.permission_overlay_restricted_settings_hint) + } Toast.makeText(ctx, message, Toast.LENGTH_LONG).show() return } @@ -161,7 +172,6 @@ class DebugOverlayManager private constructor( } companion object { - private val logger = LoggerFactory.getLogger(DebugOverlayManager::class.java) private const val WM_OVERLAY_TYPE = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY @@ -170,23 +180,29 @@ class DebugOverlayManager private constructor( * @param ctx The [Context] to use for creating the [DebugOverlayManager]. * @return A new [DebugOverlayManager]. */ - fun create(ctx: Context, displayId: Int = -1): DebugOverlayManager { - val windowContext = run { - if (displayId == -1) { - logger.debug("no display id provided. overlay will be shown on default display") - return@run ctx - } + fun create( + ctx: Context, + displayId: Int = -1, + ): DebugOverlayManager { + val windowContext = + run { + if (displayId == -1) { + logger.debug("no display id provided. overlay will be shown on default display") + return@run ctx + } - logger.debug("trying to get window context for displayId={}", displayId) - val displayManager = DisplayManagerCompat.getInstance(ctx) - val targetDisplay = displayManager.getDisplay(displayId) - val displayContext = - if (targetDisplay != null) ctx.createDisplayContext(targetDisplay) else ctx + logger.debug("trying to get window context for displayId={}", displayId) + val displayManager = DisplayManagerCompat.getInstance(ctx) + val targetDisplay = displayManager.getDisplay(displayId) + val displayContext = + if (targetDisplay != null) ctx.createDisplayContext(targetDisplay) else ctx - if (isAtLeastR()) { - displayContext.createWindowContext(WM_OVERLAY_TYPE, null) - } else displayContext - } + if (isAtLeastR()) { + displayContext.createWindowContext(WM_OVERLAY_TYPE, null) + } else { + displayContext + } + } // IMPORTANT! // Wrap the context with a theme, so we could use MaterialButtons! @@ -212,4 +228,4 @@ class DebugOverlayManager private constructor( ) } } -} \ No newline at end of file +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/debug/DebuggerActionsOverlayAdapter.kt b/app/src/main/java/org/appdevforall/codeonthego/services/debug/DebuggerActionsOverlayAdapter.kt index 8bd9f9257e..cb23197f8d 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/debug/DebuggerActionsOverlayAdapter.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/debug/DebuggerActionsOverlayAdapter.kt @@ -4,60 +4,65 @@ import android.view.LayoutInflater import android.view.ViewGroup import androidx.appcompat.widget.TooltipCompat import androidx.recyclerview.widget.RecyclerView +import com.itsaky.androidide.editor.databinding.LayoutPopupMenuItemBinding import org.appdevforall.codeonthego.actions.ActionData import org.appdevforall.codeonthego.actions.ActionItem import org.appdevforall.codeonthego.actions.ActionsRegistry import org.appdevforall.codeonthego.actions.internal.DefaultActionsRegistry -import com.itsaky.androidide.editor.databinding.LayoutPopupMenuItemBinding import org.appdevforall.codeonthego.idetooltips.TooltipManager /** * @author Akash Yadav */ class DebuggerActionsOverlayAdapter( - actions: List, -): RecyclerView.Adapter() { - - private val actions = actions.sortedBy { action -> action.order } - private val actionsRegister = ActionsRegistry.getInstance() as DefaultActionsRegistry - - class VH( - val binding: LayoutPopupMenuItemBinding - ): RecyclerView.ViewHolder(binding.root) - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VH { - val inflater = LayoutInflater.from(parent.context) - val binding = LayoutPopupMenuItemBinding.inflate(inflater, parent, false) - return VH(binding) - } - - override fun getItemCount() = actions.size - - override fun onBindViewHolder(holder: VH, position: Int) { - val binding = holder.binding - val action = actions[position] - val data = ActionData.create(binding.root.context) - - action.prepare(data) - - binding.root.icon = action.icon - binding.root.alpha = if (action.enabled) 1f else 0.5f - TooltipCompat.setTooltipText(binding.root, action.label) - - binding.root.apply { - setOnClickListener { - if (action.enabled) { - actionsRegister.executeAction(action, data) - } - } - setOnLongClickListener { - TooltipManager.showIdeCategoryTooltip( - context = this.context, - anchorView = this.rootView, - tag = action.tooltipTag - ) - true - } - } - } -} \ No newline at end of file + actions: List, +) : RecyclerView.Adapter() { + private val actions = actions.sortedBy { action -> action.order } + private val actionsRegister = ActionsRegistry.getInstance() as DefaultActionsRegistry + + class VH( + val binding: LayoutPopupMenuItemBinding, + ) : RecyclerView.ViewHolder(binding.root) + + override fun onCreateViewHolder( + parent: ViewGroup, + viewType: Int, + ): VH { + val inflater = LayoutInflater.from(parent.context) + val binding = LayoutPopupMenuItemBinding.inflate(inflater, parent, false) + return VH(binding) + } + + override fun getItemCount() = actions.size + + override fun onBindViewHolder( + holder: VH, + position: Int, + ) { + val binding = holder.binding + val action = actions[position] + val data = ActionData.create(binding.root.context) + + action.prepare(data) + + binding.root.icon = action.icon + binding.root.alpha = if (action.enabled) 1f else 0.5f + TooltipCompat.setTooltipText(binding.root, action.label) + + binding.root.apply { + setOnClickListener { + if (action.enabled) { + actionsRegister.executeAction(action, data) + } + } + setOnLongClickListener { + TooltipManager.showIdeCategoryTooltip( + context = this.context, + anchorView = this.rootView, + tag = action.tooltipTag, + ) + true + } + } + } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/debug/DebuggerService.kt b/app/src/main/java/org/appdevforall/codeonthego/services/debug/DebuggerService.kt index f780f6780b..af202a68f1 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/debug/DebuggerService.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/debug/DebuggerService.kt @@ -4,6 +4,13 @@ import android.app.Activity import android.app.Service import android.content.Intent import android.os.IBinder +import com.itsaky.androidide.buildinfo.BuildInfo +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.flow.combine +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext import org.appdevforall.codeonthego.actions.ActionItem import org.appdevforall.codeonthego.actions.ActionsRegistry import org.appdevforall.codeonthego.actions.debug.KillVmAction @@ -14,15 +21,8 @@ import org.appdevforall.codeonthego.actions.debug.StepOverAction import org.appdevforall.codeonthego.actions.debug.SuspendResumeVmAction import org.appdevforall.codeonthego.activities.editor.BaseEditorActivity import org.appdevforall.codeonthego.app.IDEApplication -import com.itsaky.androidide.buildinfo.BuildInfo import org.appdevforall.codeonthego.tasks.cancelIfActive import org.appdevforall.codeonthego.viewmodel.DebuggerConnectionState -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.flow.collectLatest -import kotlinx.coroutines.flow.combine -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext import org.slf4j.LoggerFactory /** diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/debug/ForegroundAppReceiver.kt b/app/src/main/java/org/appdevforall/codeonthego/services/debug/ForegroundAppReceiver.kt index b52f41c617..c077f43271 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/debug/ForegroundAppReceiver.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/debug/ForegroundAppReceiver.kt @@ -54,7 +54,10 @@ class ForegroundAppReceiver : BroadcastReceiver() { val foregroundAppState = _foregroundAppState.asStateFlow() } - override fun onReceive(context: Context?, intent: Intent?) { + override fun onReceive( + context: Context?, + intent: Intent?, + ) { if (intent?.action != ACTION_FOREGROUND_APP_CHANGED) { logger.error("onReceive: intent.action={} is not supported", intent?.action ?: "null") return @@ -65,7 +68,10 @@ class ForegroundAppReceiver : BroadcastReceiver() { val packageNames = intent.getStringArrayExtra(EXTRA_FOREGROUND_PACKAGES) ?: emptyArray() logger.debug( - "onReceive: uid={}, pid={}, packageName={}", uid, pid, packageNames.contentToString() + "onReceive: uid={}, pid={}, packageName={}", + uid, + pid, + packageNames.contentToString(), ) if (packageNames.isEmpty()) { @@ -75,4 +81,4 @@ class ForegroundAppReceiver : BroadcastReceiver() { val newState = ForegroundAppState(uid, pid, packageNames) _foregroundAppState.update { newState } } -} \ No newline at end of file +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/log/CachingLogSender.kt b/app/src/main/java/org/appdevforall/codeonthego/services/log/CachingLogSender.kt index bad952c7eb..e76dbe96f7 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/log/CachingLogSender.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/log/CachingLogSender.kt @@ -25,27 +25,22 @@ import org.appdevforall.codeonthego.logsender.ILogSender * @author Akash Yadav */ class CachingLogSender( - private val sender: ILogSender, - internal val port: Int, - internal var isStarted: Boolean + private val sender: ILogSender, + internal val port: Int, + internal var isStarted: Boolean, ) : ILogSender by sender { + private var cachedPid: Int = -1 + private var cachedId: String? = null + private var cachedPckName: String? = null - private var cachedPid: Int = -1 - private var cachedId: String? = null - private var cachedPckName: String? = null + override fun getPid(): Int { + if (this.cachedPid != -1) { + return this.cachedPid + } + return sender.pid.also { this.cachedPid = it } + } - override fun getPid(): Int { - if (this.cachedPid != -1) { - return this.cachedPid - } - return sender.pid.also { this.cachedPid = it } - } + override fun getPackageName(): String = this.cachedPckName ?: sender.packageName.also { this.cachedPckName = it } - override fun getPackageName(): String { - return this.cachedPckName ?: sender.packageName.also { this.cachedPckName = it } - } - - override fun getId(): String { - return this.cachedId ?: sender.id.also { this.cachedId = it } - } -} \ No newline at end of file + override fun getId(): String = this.cachedId ?: sender.id.also { this.cachedId = it } +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/log/ConnectionObserverParams.kt b/app/src/main/java/org/appdevforall/codeonthego/services/log/ConnectionObserverParams.kt index 1c8338c63d..e12e919bbe 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/log/ConnectionObserverParams.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/log/ConnectionObserverParams.kt @@ -27,29 +27,29 @@ import android.os.Bundle * @property totalConnections The total number of connections after this client was connected/disconnected. * @author Akash Yadav */ -data class ConnectionObserverParams(val clientId: String, val totalConnections: Int) { - - companion object { - - const val KEY_CLIENT_ID = "org.appdevforall.codeonthego.logreceiver.connectedClientId" - const val KEY_CONNECTION_COUNT = "org.appdevforall.codeonthego.logreceiver.connectionCount" - - @JvmStatic - internal fun from(intent: Intent?): ConnectionObserverParams? { - val clientId = intent?.getStringExtra(KEY_CLIENT_ID) ?: return null - val connectionCount = intent.getIntExtra(KEY_CONNECTION_COUNT, -1) - if (connectionCount == -1) { - return null - } - - return ConnectionObserverParams(clientId, connectionCount) - } - } - - internal fun bundle(): Bundle { - return Bundle().apply { - putString(KEY_CLIENT_ID, clientId) - putInt(KEY_CONNECTION_COUNT, totalConnections) - } - } +data class ConnectionObserverParams( + val clientId: String, + val totalConnections: Int, +) { + companion object { + const val KEY_CLIENT_ID = "org.appdevforall.codeonthego.logreceiver.connectedClientId" + const val KEY_CONNECTION_COUNT = "org.appdevforall.codeonthego.logreceiver.connectionCount" + + @JvmStatic + internal fun from(intent: Intent?): ConnectionObserverParams? { + val clientId = intent?.getStringExtra(KEY_CLIENT_ID) ?: return null + val connectionCount = intent.getIntExtra(KEY_CONNECTION_COUNT, -1) + if (connectionCount == -1) { + return null + } + + return ConnectionObserverParams(clientId, connectionCount) + } + } + + internal fun bundle(): Bundle = + Bundle().apply { + putString(KEY_CLIENT_ID, clientId) + putInt(KEY_CONNECTION_COUNT, totalConnections) + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/log/LogReceiverService.kt b/app/src/main/java/org/appdevforall/codeonthego/services/log/LogReceiverService.kt index 3764b50b25..400de6c3a7 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/log/LogReceiverService.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/log/LogReceiverService.kt @@ -36,124 +36,119 @@ import java.util.concurrent.atomic.AtomicBoolean * @author Akash Yadav */ class LogReceiverService : Service() { - - private val binder = LogReceiverImpl() - private val started = AtomicBoolean(false) - private val isBoundToConsumer = AtomicBoolean(false) - - private val scheduledExecutor = Executors.newSingleThreadScheduledExecutor() - - companion object { - - private val log = LoggerFactory.getLogger(LogReceiverService::class.java) - - internal const val ACTION_CONNECT_LOG_CONSUMER = "org.appdevforall.codeonthego.logrecevier.CONNECT_LOG_CONSUMER" - internal const val ACTION_CONNECTION_UPDATE = "org.appdevforall.codeonthego.logreceiver.CONNECTION_UPDATE" - - private const val LOG_CONSUMER_WAIT_DURATION = 10 // seconds - - @JvmStatic - internal val LOOKUP_KEY = Lookup.Key() - } - - override fun onCreate() { - super.onCreate() - Lookup.getDefault().update(LOOKUP_KEY, this) - log.info("LogReceiverService has been created") - } - - override fun onBind(intent: Intent?): IBinder? { - log.debug("Received bind request: {}", intent) - - if (!DevOpsPreferences.logsenderEnabled) { - log.debug("Rejecting bind request. LogReceiver is disabled.") - return null - } - - if (intent?.action == ACTION_CONNECT_LOG_CONSUMER) { - if (isBoundToConsumer.get()) { - log.warn("LogReceiverService is limited to one consumer only.") - return null - } - - log.info("Log consumer has been bound") - return startBinderAndGet().also { binder -> - binder.startReaders() - isBoundToConsumer.set(true) - } - } - - if (intent?.action != LogSender.SERVICE_ACTION) { - log.debug("Rejecting bind request: action={}", intent?.action) - return null - } - - log.debug("Accepting bind request...") - return startBinderAndGet().also { - if (!isBoundToConsumer.get()) { - // listen for consumers to bind to the service for next LOG_CONSUMER_WAIT_DURATION - // if the consumer still does not connect, disconnect from all senders and stop the service - listenForConsumer() - } - } - } - - override fun onUnbind(intent: Intent?): Boolean { - return super.onUnbind(intent) - } - - private fun startBinderAndGet(): LogReceiverImpl { - return binder.also { - if (!started.getAndSet(true)) { - binder.acceptSenders() - binder.connectionObserver = this::onConnectionUpdated - } - } - } - - override fun onDestroy() { - super.onDestroy() - log.debug("LogReceiverService is being destroyed...") - binder.close() - started.set(false) - try { - scheduledExecutor.shutdownNow() - } catch (e: Exception) { - // ignored - } - Lookup.getDefault().unregister(LOOKUP_KEY) - } - - fun setConsumer(consumer: ((LogLine) -> Unit)?) { - binder.consumer = consumer - } - - private fun onConnectionUpdated(params: ConnectionObserverParams) { - val intent = Intent(ACTION_CONNECTION_UPDATE) - intent.putExtras(params.bundle()) - LocalBroadcastManager.getInstance(this).sendBroadcastSync(intent) - } - - private fun listenForConsumer() { - log.debug("Waiting for log consumer...") - scheduledExecutor.schedule({ - if (!isBoundToConsumer.get()) { - // ask senders to disconnect - log.debug("No log consumer has been bound to the log receiver service") - binder.disconnectAll() - } - }, LOG_CONSUMER_WAIT_DURATION.toLong(), TimeUnit.SECONDS) - } - - /** - * Disconnects all connected log senders. Disconnecting all senders will eventually lead - * to this service being destroyed. - */ - internal fun disconnectAll() { - if (started.get()) { - binder.disconnectAll() - } - } + private val binder = LogReceiverImpl() + private val started = AtomicBoolean(false) + private val isBoundToConsumer = AtomicBoolean(false) + + private val scheduledExecutor = Executors.newSingleThreadScheduledExecutor() + + companion object { + private val log = LoggerFactory.getLogger(LogReceiverService::class.java) + + internal const val ACTION_CONNECT_LOG_CONSUMER = "org.appdevforall.codeonthego.logrecevier.CONNECT_LOG_CONSUMER" + internal const val ACTION_CONNECTION_UPDATE = "org.appdevforall.codeonthego.logreceiver.CONNECTION_UPDATE" + + private const val LOG_CONSUMER_WAIT_DURATION = 10 // seconds + + @JvmStatic + internal val LOOKUP_KEY = Lookup.Key() + } + + override fun onCreate() { + super.onCreate() + Lookup.getDefault().update(LOOKUP_KEY, this) + log.info("LogReceiverService has been created") + } + + override fun onBind(intent: Intent?): IBinder? { + log.debug("Received bind request: {}", intent) + + if (!DevOpsPreferences.logsenderEnabled) { + log.debug("Rejecting bind request. LogReceiver is disabled.") + return null + } + + if (intent?.action == ACTION_CONNECT_LOG_CONSUMER) { + if (isBoundToConsumer.get()) { + log.warn("LogReceiverService is limited to one consumer only.") + return null + } + + log.info("Log consumer has been bound") + return startBinderAndGet().also { binder -> + binder.startReaders() + isBoundToConsumer.set(true) + } + } + + if (intent?.action != LogSender.SERVICE_ACTION) { + log.debug("Rejecting bind request: action={}", intent?.action) + return null + } + + log.debug("Accepting bind request...") + return startBinderAndGet().also { + if (!isBoundToConsumer.get()) { + // listen for consumers to bind to the service for next LOG_CONSUMER_WAIT_DURATION + // if the consumer still does not connect, disconnect from all senders and stop the service + listenForConsumer() + } + } + } + + override fun onUnbind(intent: Intent?): Boolean = super.onUnbind(intent) + + private fun startBinderAndGet(): LogReceiverImpl = + binder.also { + if (!started.getAndSet(true)) { + binder.acceptSenders() + binder.connectionObserver = this::onConnectionUpdated + } + } + + override fun onDestroy() { + super.onDestroy() + log.debug("LogReceiverService is being destroyed...") + binder.close() + started.set(false) + try { + scheduledExecutor.shutdownNow() + } catch (e: Exception) { + // ignored + } + Lookup.getDefault().unregister(LOOKUP_KEY) + } + + fun setConsumer(consumer: ((LogLine) -> Unit)?) { + binder.consumer = consumer + } + + private fun onConnectionUpdated(params: ConnectionObserverParams) { + val intent = Intent(ACTION_CONNECTION_UPDATE) + intent.putExtras(params.bundle()) + LocalBroadcastManager.getInstance(this).sendBroadcastSync(intent) + } + + private fun listenForConsumer() { + log.debug("Waiting for log consumer...") + scheduledExecutor.schedule({ + if (!isBoundToConsumer.get()) { + // ask senders to disconnect + log.debug("No log consumer has been bound to the log receiver service") + binder.disconnectAll() + } + }, LOG_CONSUMER_WAIT_DURATION.toLong(), TimeUnit.SECONDS) + } + + /** + * Disconnects all connected log senders. Disconnecting all senders will eventually lead + * to this service being destroyed. + */ + internal fun disconnectAll() { + if (started.get()) { + binder.disconnectAll() + } + } } /** @@ -161,6 +156,4 @@ class LogReceiverService : Service() { * * @return The [LogReceiverService] instance or `null` it the service is not registered. */ -fun lookupLogService(): LogReceiverService? { - return Lookup.getDefault().lookup(LogReceiverService.LOOKUP_KEY) -} +fun lookupLogService(): LogReceiverService? = Lookup.getDefault().lookup(LogReceiverService.LOOKUP_KEY) diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/log/LogSenderHandler.kt b/app/src/main/java/org/appdevforall/codeonthego/services/log/LogSenderHandler.kt index 0ec0848e40..43321c60ab 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/log/LogSenderHandler.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/log/LogSenderHandler.kt @@ -17,11 +17,11 @@ package org.appdevforall.codeonthego.services.log -import org.appdevforall.codeonthego.logsender.socket.SenderInfoCommand -import org.appdevforall.codeonthego.models.LogLine import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext +import org.appdevforall.codeonthego.logsender.socket.SenderInfoCommand +import org.appdevforall.codeonthego.models.LogLine import org.slf4j.LoggerFactory import java.net.Socket import java.net.SocketException @@ -31,51 +31,53 @@ import java.net.SocketException * * @author Akash Yadav */ -class LogSenderHandler(private val sender: SenderInfoCommand, private val socket: Socket, - internal var consumer: ((LogLine) -> Unit)? = null, - private var onClose: ((String) -> Unit)? = null) : AutoCloseable { - - private var manuallyClosed = false - - companion object { +class LogSenderHandler( + private val sender: SenderInfoCommand, + private val socket: Socket, + internal var consumer: ((LogLine) -> Unit)? = null, + private var onClose: ((String) -> Unit)? = null, +) : AutoCloseable { + private var manuallyClosed = false - private val log = LoggerFactory.getLogger(LogSenderHandler::class.java) - } + companion object { + private val log = LoggerFactory.getLogger(LogSenderHandler::class.java) + } - suspend fun startAsync() = withContext(Dispatchers.IO) { - try { - socket.getInputStream().bufferedReader().use { reader -> - while (!socket.isClosed) { - try { - LogLine.forLogString(reader.readLine())?.let { line -> consumer?.invoke(line) } - } catch (cancellation: CancellationException) { - break - } - } - } - } catch (err: SocketException) { - if (!manuallyClosed) { - log.error("An error occurred while reading from socket", err) - } - } finally { - close() - } - } + suspend fun startAsync() = + withContext(Dispatchers.IO) { + try { + socket.getInputStream().bufferedReader().use { reader -> + while (!socket.isClosed) { + try { + LogLine.forLogString(reader.readLine())?.let { line -> consumer?.invoke(line) } + } catch (cancellation: CancellationException) { + break + } + } + } + } catch (err: SocketException) { + if (!manuallyClosed) { + log.error("An error occurred while reading from socket", err) + } + } finally { + close() + } + } - override fun close() { - try { - manuallyClosed = true + override fun close() { + try { + manuallyClosed = true - if (!socket.isClosed) { - log.debug("Closing log sender handler...") - socket.close() - } - } catch (err: Throwable) { - log.error("Failed to close socket", err) - } finally { - onClose?.invoke(this.sender.senderId) - this.consumer = null - this.onClose = null - } - } + if (!socket.isClosed) { + log.debug("Closing log sender handler...") + socket.close() + } + } catch (err: Throwable) { + log.error("Failed to close socket", err) + } finally { + onClose?.invoke(this.sender.senderId) + this.consumer = null + this.onClose = null + } + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/log/MultiLogSenderHandler.kt b/app/src/main/java/org/appdevforall/codeonthego/services/log/MultiLogSenderHandler.kt index 8977e90e81..82be172abd 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/log/MultiLogSenderHandler.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/log/MultiLogSenderHandler.kt @@ -17,16 +17,16 @@ package org.appdevforall.codeonthego.services.log -import org.appdevforall.codeonthego.logsender.socket.SenderInfoCommand -import org.appdevforall.codeonthego.logsender.socket.SocketCommandParser -import org.appdevforall.codeonthego.models.LogLine -import org.appdevforall.codeonthego.tasks.cancelIfActive import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job import kotlinx.coroutines.launch import kotlinx.coroutines.withContext +import org.appdevforall.codeonthego.logsender.socket.SenderInfoCommand +import org.appdevforall.codeonthego.logsender.socket.SocketCommandParser +import org.appdevforall.codeonthego.models.LogLine +import org.appdevforall.codeonthego.tasks.cancelIfActive import org.slf4j.LoggerFactory import java.lang.Thread.currentThread import java.net.ServerSocket @@ -39,106 +39,106 @@ import java.util.concurrent.atomic.AtomicInteger * * @author Akash Yadav */ -class MultiLogSenderHandler(consumer: ((LogLine) -> Unit)? = null) : AutoCloseable { - - private val clients = ConcurrentHashMap() - private val port = AtomicInteger(-1) - private var isAlive = AtomicBoolean(false) - - private var logHandlerScope = CoroutineScope( - Dispatchers.IO + CoroutineName("MultiLogSenderHandler")) - - internal var consumer: ((LogLine) -> Unit)? = consumer - set(value) { - field = value - clients.forEach { (_, client) -> client.consumer = value } - } - - companion object { - private val log = LoggerFactory.getLogger(MultiLogSenderHandler::class.java) - } - - fun getPort(): Int { - return port.get() - } - - private suspend fun startAsync() = withContext(Dispatchers.IO) { - val job = coroutineContext[Job] - val server = try { - ServerSocket(0) - } catch (err: Exception) { - log.error("Failed to start log receiver socket", err) - return@withContext - } - - try { - port.set(server.localPort) - log.info("Starting log receiver server socket at port {}", getPort()) - - while (job?.isCancelled != true && isAlive.get()) { - val clientSocket = server.accept() - - val senderInfoLine = clientSocket.getInputStream().bufferedReader().readLine() - val command = SocketCommandParser.parse(senderInfoLine) - if (command == null || command !is SenderInfoCommand) { - log.error( - "Cannot accept log sender client. A sender must send the /sender command first.") - clientSocket.use {} - continue - } - - val handler = LogSenderHandler(command, clientSocket, consumer, ::removeClient) - - log.info("A log sender has been connected") - - clients[command.senderId] = handler - - handler.startAsync() - } - } catch (interrupt: InterruptedException) { - log.warn("MultiLogSenderHandler thread has been interrupted") - currentThread().interrupt() - } catch (err: Throwable) { - log.error("An error occurred while accept log client connections", err) - } finally { - this@MultiLogSenderHandler.close() - server.close() - } - } - - internal fun removeClient(senderId: String) { - clients.remove(senderId)?.closeAndLogError() - } - - private fun removeAllClients() { - this.clients.forEach { (_, handler) -> - handler.closeAndLogError() - } - - this.clients.clear() - } - - fun start() { - isAlive.set(true) - logHandlerScope.launch { - startAsync() - } - } - - fun isAlive() = isAlive.get() - - override fun close() { - this.isAlive.set(false) - this.removeAllClients() - this.consumer = null - this.logHandlerScope.cancelIfActive() - } - - private fun LogSenderHandler.closeAndLogError() { - try { - close() - } catch (e: Exception) { - log.warn("Failed to close", e) - } - } +class MultiLogSenderHandler( + consumer: ((LogLine) -> Unit)? = null, +) : AutoCloseable { + private val clients = ConcurrentHashMap() + private val port = AtomicInteger(-1) + private var isAlive = AtomicBoolean(false) + + private var logHandlerScope = + CoroutineScope(Dispatchers.IO + CoroutineName("MultiLogSenderHandler")) + + internal var consumer: ((LogLine) -> Unit)? = consumer + set(value) { + field = value + clients.forEach { (_, client) -> client.consumer = value } + } + + companion object { + private val log = LoggerFactory.getLogger(MultiLogSenderHandler::class.java) + } + + fun getPort(): Int = port.get() + + private suspend fun startAsync() = + withContext(Dispatchers.IO) { + val job = coroutineContext[Job] + val server = + try { + ServerSocket(0) + } catch (err: Exception) { + log.error("Failed to start log receiver socket", err) + return@withContext + } + + try { + port.set(server.localPort) + log.info("Starting log receiver server socket at port {}", getPort()) + + while (job?.isCancelled != true && isAlive.get()) { + val clientSocket = server.accept() + + val senderInfoLine = clientSocket.getInputStream().bufferedReader().readLine() + val command = SocketCommandParser.parse(senderInfoLine) + if (command == null || command !is SenderInfoCommand) { + log.error("Cannot accept log sender client. A sender must send the /sender command first.") + clientSocket.use {} + continue + } + + val handler = LogSenderHandler(command, clientSocket, consumer, ::removeClient) + + log.info("A log sender has been connected") + + clients[command.senderId] = handler + + handler.startAsync() + } + } catch (interrupt: InterruptedException) { + log.warn("MultiLogSenderHandler thread has been interrupted") + currentThread().interrupt() + } catch (err: Throwable) { + log.error("An error occurred while accept log client connections", err) + } finally { + this@MultiLogSenderHandler.close() + server.close() + } + } + + internal fun removeClient(senderId: String) { + clients.remove(senderId)?.closeAndLogError() + } + + private fun removeAllClients() { + this.clients.forEach { (_, handler) -> + handler.closeAndLogError() + } + + this.clients.clear() + } + + fun start() { + isAlive.set(true) + logHandlerScope.launch { + startAsync() + } + } + + fun isAlive() = isAlive.get() + + override fun close() { + this.isAlive.set(false) + this.removeAllClients() + this.consumer = null + this.logHandlerScope.cancelIfActive() + } + + private fun LogSenderHandler.closeAndLogError() { + try { + close() + } catch (e: Exception) { + log.warn("Failed to close", e) + } + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/services/log/utils.kt b/app/src/main/java/org/appdevforall/codeonthego/services/log/utils.kt index c7eab54466..9cd4dafeb9 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/services/log/utils.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/services/log/utils.kt @@ -21,10 +21,10 @@ import android.os.RemoteException import org.appdevforall.codeonthego.logsender.ILogSender fun ILogSender.isAlive() : Boolean { - return try { - ping() - true - } catch (err: RemoteException) { - false - } -} \ No newline at end of file +return try { + ping() + true +} catch (err: RemoteException) { + false +} +} diff --git a/app/src/main/java/org/appdevforall/codeonthego/shortcuts/IdeShortcutActions.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/IdeShortcutActions.kt index dd2e828178..12c0717114 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/shortcuts/IdeShortcutActions.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/IdeShortcutActions.kt @@ -55,10 +55,9 @@ class IdeShortcutActions( private fun findActionById( actionsRegistry: ActionsRegistry, actionId: String, - ): ActionItem? { - return ActionItem.Location.entries + ): ActionItem? = + ActionItem.Location.entries .asSequence() .mapNotNull { location -> actionsRegistry.findAction(location, actionId) } .firstOrNull() - } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutCatalog.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutCatalog.kt index 691e2e0aac..49e9f37574 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutCatalog.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutCatalog.kt @@ -5,7 +5,6 @@ import android.content.Context class ShortcutCatalog( private val groupProvider: ShortcutGroupProvider = ShortcutGroupProvider(), ) { - fun all(context: Context): List { val groups = groupProvider.all() return groups.flatMap { group -> group.shortcuts(context) } diff --git a/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutGroupProvider.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutGroupProvider.kt index 42e1589e52..51fda598ba 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutGroupProvider.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutGroupProvider.kt @@ -10,10 +10,11 @@ import org.appdevforall.codeonthego.shortcuts.groups.WindowsAndDisplayGroup * Provides the set of available shortcut groups for the IDE. */ class ShortcutGroupProvider { - fun all(): List = listOf( - ProjectsAndSolutionsGroup(), - WindowsAndDisplayGroup(), - FileManagementGroup(), - SearchAndReplaceGroup(), - ) + fun all(): List = + listOf( + ProjectsAndSolutionsGroup(), + WindowsAndDisplayGroup(), + FileManagementGroup(), + SearchAndReplaceGroup(), + ) } diff --git a/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutManager.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutManager.kt index 6d70b7c00a..2ff6c33dc3 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutManager.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/ShortcutManager.kt @@ -8,15 +8,15 @@ import android.widget.EditText class ShortcutManager( context: Context, ) { - private val catalog: List = ShortcutCatalog().all(context) - private val contextPriority = listOf( - ShortcutContext.MODAL, - ShortcutContext.EDITOR, - ShortcutContext.MAIN, - ShortcutContext.APP_GLOBAL, - ) + private val contextPriority = + listOf( + ShortcutContext.MODAL, + ShortcutContext.EDITOR, + ShortcutContext.MAIN, + ShortcutContext.APP_GLOBAL, + ) fun dispatch( event: KeyEvent, @@ -27,11 +27,12 @@ class ShortcutManager( ): Boolean { if (!shouldHandleShortcuts(event, focusView)) return false - val activeContexts = if (hasModal) { - setOf(ShortcutContext.APP_GLOBAL, ShortcutContext.MODAL) - } else { - setOf(ShortcutContext.APP_GLOBAL, context) - } + val activeContexts = + if (hasModal) { + setOf(ShortcutContext.APP_GLOBAL, ShortcutContext.MODAL) + } else { + setOf(ShortcutContext.APP_GLOBAL, context) + } val definition = findMatchingShortcut(event, activeContexts) ?: return false return executionContext.ideShortcutActions.execute(definition.actionId) @@ -49,10 +50,11 @@ class ShortcutManager( event: KeyEvent, activeContexts: Set, ): ShortcutDefinition? { - val matchingDefinitions = catalog.filter { definition -> - definition.contexts.any(activeContexts::contains) && - definition.bindings.any { it.matches(event) } - } + val matchingDefinitions = + catalog.filter { definition -> + definition.contexts.any(activeContexts::contains) && + definition.bindings.any { it.matches(event) } + } return matchingDefinitions.maxByOrNull { definition -> definition.contexts diff --git a/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/FileManagementGroup.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/FileManagementGroup.kt index 05eaa6af82..50f0800bb3 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/FileManagementGroup.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/FileManagementGroup.kt @@ -2,42 +2,45 @@ package org.appdevforall.codeonthego.shortcuts.groups import android.content.Context import android.view.KeyEvent +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.file.CloseFileAction import org.appdevforall.codeonthego.actions.file.SaveFileAction -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.shortcuts.KeyShortcut import org.appdevforall.codeonthego.shortcuts.ShortcutCategory import org.appdevforall.codeonthego.shortcuts.ShortcutContext import org.appdevforall.codeonthego.shortcuts.ShortcutDefinition internal class FileManagementGroup : ShortcutGroup { - override fun shortcuts(context: Context): List { - return listOf( + override fun shortcuts(context: Context): List = + listOf( ShortcutDefinition( id = ShortcutDefinitionIds.SAVE_ALL_FILES, title = context.getString(R.string.save), - bindings = listOf( - KeyShortcut.ctrl(KeyEvent.KEYCODE_S), - ), + bindings = + listOf( + KeyShortcut.ctrl(KeyEvent.KEYCODE_S), + ), category = ShortcutCategory.FILE_MANAGEMENT, - contexts = setOf( - ShortcutContext.EDITOR, - ), + contexts = + setOf( + ShortcutContext.EDITOR, + ), actionId = SaveFileAction.ID, ), ShortcutDefinition( id = ShortcutDefinitionIds.CLOSE_CURRENT_FILE, title = context.getString(R.string.shortcut_close_current_file), - bindings = listOf( - KeyShortcut.ctrl(KeyEvent.KEYCODE_W), - KeyShortcut.ctrl(KeyEvent.KEYCODE_F4), - ), + bindings = + listOf( + KeyShortcut.ctrl(KeyEvent.KEYCODE_W), + KeyShortcut.ctrl(KeyEvent.KEYCODE_F4), + ), category = ShortcutCategory.FILE_MANAGEMENT, - contexts = setOf( - ShortcutContext.EDITOR, - ), + contexts = + setOf( + ShortcutContext.EDITOR, + ), actionId = CloseFileAction.ID, ), ) - } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/ProjectsAndSolutionsGroup.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/ProjectsAndSolutionsGroup.kt index 6c8328fd23..a266e349c1 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/ProjectsAndSolutionsGroup.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/ProjectsAndSolutionsGroup.kt @@ -2,54 +2,59 @@ package org.appdevforall.codeonthego.shortcuts.groups import android.content.Context import android.view.KeyEvent +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.main.CloneRepositoryAction import org.appdevforall.codeonthego.actions.main.CreateProjectAction import org.appdevforall.codeonthego.actions.main.OpenProjectAction -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.shortcuts.KeyShortcut import org.appdevforall.codeonthego.shortcuts.ShortcutCategory import org.appdevforall.codeonthego.shortcuts.ShortcutContext import org.appdevforall.codeonthego.shortcuts.ShortcutDefinition internal class ProjectsAndSolutionsGroup : ShortcutGroup { - override fun shortcuts(context: Context): List { - return listOf( + override fun shortcuts(context: Context): List = + listOf( ShortcutDefinition( id = ShortcutDefinitionIds.CREATE_PROJECT, title = context.getString(R.string.shortcut_create_project), - bindings = listOf( - KeyShortcut.ctrl(KeyEvent.KEYCODE_N), - ), + bindings = + listOf( + KeyShortcut.ctrl(KeyEvent.KEYCODE_N), + ), category = ShortcutCategory.PROJECTS_AND_SOLUTIONS, - contexts = setOf( - ShortcutContext.MAIN, - ), + contexts = + setOf( + ShortcutContext.MAIN, + ), actionId = CreateProjectAction.ID, ), ShortcutDefinition( id = ShortcutDefinitionIds.OPEN_PROJECT, title = context.getString(R.string.shortcut_open_project), - bindings = listOf( - KeyShortcut.ctrl(KeyEvent.KEYCODE_O), - ), + bindings = + listOf( + KeyShortcut.ctrl(KeyEvent.KEYCODE_O), + ), category = ShortcutCategory.PROJECTS_AND_SOLUTIONS, - contexts = setOf( - ShortcutContext.MAIN, - ), + contexts = + setOf( + ShortcutContext.MAIN, + ), actionId = OpenProjectAction.ID, ), ShortcutDefinition( id = ShortcutDefinitionIds.CLONE_REPOSITORY, title = context.getString(R.string.shortcut_clone_repository), - bindings = listOf( - KeyShortcut.ctrlShift(KeyEvent.KEYCODE_O), - ), + bindings = + listOf( + KeyShortcut.ctrlShift(KeyEvent.KEYCODE_O), + ), category = ShortcutCategory.PROJECTS_AND_SOLUTIONS, - contexts = setOf( - ShortcutContext.MAIN, - ), + contexts = + setOf( + ShortcutContext.MAIN, + ), actionId = CloneRepositoryAction.ID, ), ) - } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/SearchAndReplaceGroup.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/SearchAndReplaceGroup.kt index 72a6ee4bdc..bc4b7488c2 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/SearchAndReplaceGroup.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/SearchAndReplaceGroup.kt @@ -2,10 +2,10 @@ package org.appdevforall.codeonthego.shortcuts.groups import android.content.Context import android.view.KeyEvent +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.etc.FindInFileAction import org.appdevforall.codeonthego.actions.etc.FindInProjectAction import org.appdevforall.codeonthego.actions.etc.ReplaceInProjectAction -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.shortcuts.KeyShortcut import org.appdevforall.codeonthego.shortcuts.ShortcutCategory import org.appdevforall.codeonthego.shortcuts.ShortcutContext diff --git a/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/WindowsAndDisplayGroup.kt b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/WindowsAndDisplayGroup.kt index 218681d234..c28eaf2b5c 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/WindowsAndDisplayGroup.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/shortcuts/groups/WindowsAndDisplayGroup.kt @@ -2,67 +2,74 @@ package org.appdevforall.codeonthego.shortcuts.groups import android.content.Context import android.view.KeyEvent +import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.actions.main.OpenTerminalAction import org.appdevforall.codeonthego.actions.main.PreferencesAction import org.appdevforall.codeonthego.actions.sidebar.PreferencesSidebarAction import org.appdevforall.codeonthego.actions.sidebar.TerminalSidebarAction -import com.itsaky.androidide.resources.R import org.appdevforall.codeonthego.shortcuts.KeyShortcut import org.appdevforall.codeonthego.shortcuts.ShortcutCategory import org.appdevforall.codeonthego.shortcuts.ShortcutContext import org.appdevforall.codeonthego.shortcuts.ShortcutDefinition internal class WindowsAndDisplayGroup : ShortcutGroup { - override fun shortcuts(context: Context): List { - return listOf( + override fun shortcuts(context: Context): List = + listOf( ShortcutDefinition( id = ShortcutDefinitionIds.OPEN_TERMINAL, title = context.getString(R.string.shortcut_open_terminal), - bindings = listOf( - KeyShortcut.ctrlAlt(KeyEvent.KEYCODE_T), - ), + bindings = + listOf( + KeyShortcut.ctrlAlt(KeyEvent.KEYCODE_T), + ), category = ShortcutCategory.WINDOWS_AND_DISPLAY, - contexts = setOf( - ShortcutContext.EDITOR, - ), + contexts = + setOf( + ShortcutContext.EDITOR, + ), actionId = TerminalSidebarAction.ID, ), ShortcutDefinition( id = ShortcutDefinitionIds.OPEN_TERMINAL_MAIN, title = context.getString(R.string.shortcut_open_terminal), - bindings = listOf( - KeyShortcut.ctrlAlt(KeyEvent.KEYCODE_T), - ), + bindings = + listOf( + KeyShortcut.ctrlAlt(KeyEvent.KEYCODE_T), + ), category = ShortcutCategory.WINDOWS_AND_DISPLAY, - contexts = setOf( - ShortcutContext.MAIN, - ), + contexts = + setOf( + ShortcutContext.MAIN, + ), actionId = OpenTerminalAction.ID, ), ShortcutDefinition( id = ShortcutDefinitionIds.OPEN_PREFERENCES, title = context.getString(R.string.shortcut_open_preferences), - bindings = listOf( - KeyShortcut.ctrl(KeyEvent.KEYCODE_COMMA), - ), + bindings = + listOf( + KeyShortcut.ctrl(KeyEvent.KEYCODE_COMMA), + ), category = ShortcutCategory.WINDOWS_AND_DISPLAY, - contexts = setOf( - ShortcutContext.EDITOR, - ), + contexts = + setOf( + ShortcutContext.EDITOR, + ), actionId = PreferencesSidebarAction.ID, ), ShortcutDefinition( id = ShortcutDefinitionIds.OPEN_PREFERENCES_MAIN, title = context.getString(R.string.shortcut_open_preferences), - bindings = listOf( - KeyShortcut.ctrl(KeyEvent.KEYCODE_COMMA), - ), + bindings = + listOf( + KeyShortcut.ctrl(KeyEvent.KEYCODE_COMMA), + ), category = ShortcutCategory.WINDOWS_AND_DISPLAY, - contexts = setOf( - ShortcutContext.MAIN, - ), + contexts = + setOf( + ShortcutContext.MAIN, + ), actionId = PreferencesAction.ID, ), ) - } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/tasks/callables/FileTreeCallable.java b/app/src/main/java/org/appdevforall/codeonthego/tasks/callables/FileTreeCallable.java index af2ade771e..7fff2a5e6d 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/tasks/callables/FileTreeCallable.java +++ b/app/src/main/java/org/appdevforall/codeonthego/tasks/callables/FileTreeCallable.java @@ -21,77 +21,79 @@ package org.appdevforall.codeonthego.tasks.callables; import android.content.Context; - -import org.appdevforall.codeonthego.adapters.viewholders.FileTreeViewHolder; import com.unnamed.b.atv.model.TreeNode; - import java.io.File; import java.io.FileFilter; import java.util.Arrays; import java.util.Comparator; import java.util.concurrent.Callable; +import org.appdevforall.codeonthego.adapters.viewholders.FileTreeViewHolder; public class FileTreeCallable implements Callable { - private final Context ctx; - private final TreeNode parent; - private final File file; - private final FileTreeViewHolder.ExternalDropHandler externalDropHandler; + private final Context ctx; + private final TreeNode parent; + private final File file; + private final FileTreeViewHolder.ExternalDropHandler externalDropHandler; - public FileTreeCallable(Context ctx, TreeNode parent, File file) { - this(ctx, parent, file, null); - } + public FileTreeCallable(Context ctx, TreeNode parent, File file) { + this(ctx, parent, file, null); + } - public FileTreeCallable( - Context ctx, TreeNode parent, File file, FileTreeViewHolder.ExternalDropHandler externalDropHandler) { - this.ctx = ctx; - this.parent = parent; - this.file = file; - this.externalDropHandler = externalDropHandler; - } + public FileTreeCallable( + Context ctx, TreeNode parent, File file, FileTreeViewHolder.ExternalDropHandler externalDropHandler) { + this.ctx = ctx; + this.parent = parent; + this.file = file; + this.externalDropHandler = externalDropHandler; + } - @Override - public Boolean call() throws Exception { - populateChildren(file.listFiles(/*new HiddenFilesFilter()*/), parent); - return true; - } + @Override + public Boolean call() throws Exception { + populateChildren(file.listFiles(/* new HiddenFilesFilter() */), parent); + return true; + } - private void populateChildren(File[] files, TreeNode parent) { - if (files == null) return; + private TreeNode createNode(File file) { + TreeNode node = new TreeNode(file); + node.setViewHolder(new FileTreeViewHolder(ctx, externalDropHandler)); + return node; + } - Arrays.sort(files, new SortFileName()); - Arrays.sort(files, new SortFolder()); - for (File file : files) { - parent.addChild(createNode(file), false); - } - } + private void populateChildren(File[] files, TreeNode parent) { + if (files == null) + return; - private TreeNode createNode(File file) { - TreeNode node = new TreeNode(file); - node.setViewHolder(new FileTreeViewHolder(ctx, externalDropHandler)); - return node; - } + Arrays.sort(files, new SortFileName()); + Arrays.sort(files, new SortFolder()); + for (File file : files) { + parent.addChild(createNode(file), false); + } + } - public static class HiddenFilesFilter implements FileFilter { + public static class HiddenFilesFilter implements FileFilter { - @Override - public boolean accept(File p1) { - return !p1.getName().startsWith("."); - } - } + @Override + public boolean accept(File p1) { + return !p1.getName().startsWith("."); + } + } - public static class SortFileName implements Comparator { - @Override - public int compare(File f1, File f2) { - return f1.getName().compareTo(f2.getName()); - } - } + public static class SortFileName implements Comparator { + @Override + public int compare(File f1, File f2) { + return f1.getName().compareTo(f2.getName()); + } + } - public static class SortFolder implements Comparator { - @Override - public int compare(File f1, File f2) { - if (f1.isDirectory() == f2.isDirectory()) return 0; - else if (f1.isDirectory() && !f2.isDirectory()) return -1; - else return 1; - } - } + public static class SortFolder implements Comparator { + @Override + public int compare(File f1, File f2) { + if (f1.isDirectory() == f2.isDirectory()) + return 0; + else if (f1.isDirectory() && !f2.isDirectory()) + return -1; + else + return 1; + } + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/tasks/callables/ListDirectoryCallable.java b/app/src/main/java/org/appdevforall/codeonthego/tasks/callables/ListDirectoryCallable.java index 74ac14bf5e..616e960a2b 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/tasks/callables/ListDirectoryCallable.java +++ b/app/src/main/java/org/appdevforall/codeonthego/tasks/callables/ListDirectoryCallable.java @@ -21,9 +21,9 @@ package org.appdevforall.codeonthego.tasks.callables; import android.text.TextUtils; -import org.appdevforall.codeonthego.utils.FileUtils; import java.io.File; import java.io.FileFilter; +import org.appdevforall.codeonthego.utils.FileUtils; public class ListDirectoryCallable implements java.util.concurrent.Callable { diff --git a/app/src/main/java/org/appdevforall/codeonthego/tasks/callables/UnzipCallable.java b/app/src/main/java/org/appdevforall/codeonthego/tasks/callables/UnzipCallable.java index 4525d60a5a..38a0cb0c21 100755 --- a/app/src/main/java/org/appdevforall/codeonthego/tasks/callables/UnzipCallable.java +++ b/app/src/main/java/org/appdevforall/codeonthego/tasks/callables/UnzipCallable.java @@ -20,10 +20,10 @@ package org.appdevforall.codeonthego.tasks.callables; -import org.appdevforall.codeonthego.utils.ZipUtils; import java.io.File; import java.util.List; import java.util.concurrent.Callable; +import org.appdevforall.codeonthego.utils.ZipUtils; public final class UnzipCallable implements Callable> { diff --git a/app/src/main/java/org/appdevforall/codeonthego/ui/CodeEditorView.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/CodeEditorView.kt index e7a348e4a8..2ef7559962 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/ui/CodeEditorView.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/CodeEditorView.kt @@ -30,9 +30,31 @@ import android.view.LayoutInflater import android.view.MotionEvent import androidx.appcompat.widget.LinearLayoutCompat import androidx.core.view.isVisible +import com.itsaky.androidide.editor.databinding.LayoutCodeEditorBinding +import io.github.rosemoe.sora.event.ClickEvent +import io.github.rosemoe.sora.event.InterceptTarget +import io.github.rosemoe.sora.event.TextSizeChangeEvent +import io.github.rosemoe.sora.lang.EmptyLanguage +import io.github.rosemoe.sora.text.Content +import io.github.rosemoe.sora.text.LineSeparator +import io.github.rosemoe.sora.util.IntPair +import io.github.rosemoe.sora.widget.CodeEditor +import io.github.rosemoe.sora.widget.DirectAccessProps +import io.github.rosemoe.sora.widget.REGION_LINE_NUMBER +import io.github.rosemoe.sora.widget.component.Magnifier +import io.github.rosemoe.sora.widget.resolveTouchRegion +import kotlinx.coroutines.CoroutineName +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.DelicateCoroutinesApi +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.ExperimentalCoroutinesApi +import kotlinx.coroutines.launch +import kotlinx.coroutines.newSingleThreadContext +import kotlinx.coroutines.withContext +import org.adfa.constants.PLUGIN_ARCHIVE_EXTENSION +import org.adfa.constants.TEMPLATE_ARCHIVE_EXTENSION import org.appdevforall.codeonthego.activities.editor.BaseEditorActivity import org.appdevforall.codeonthego.editor.api.IEditor -import com.itsaky.androidide.editor.databinding.LayoutCodeEditorBinding import org.appdevforall.codeonthego.editor.events.FileUpdateEvent import org.appdevforall.codeonthego.editor.events.LanguageUpdateEvent import org.appdevforall.codeonthego.editor.language.IDELanguage @@ -58,28 +80,6 @@ import org.appdevforall.codeonthego.tasks.cancelIfActive import org.appdevforall.codeonthego.tasks.runOnUiThread import org.appdevforall.codeonthego.utils.customOrJBMono import org.appdevforall.codeonthego.utils.dpToPx -import io.github.rosemoe.sora.event.ClickEvent -import io.github.rosemoe.sora.event.InterceptTarget -import io.github.rosemoe.sora.event.TextSizeChangeEvent -import io.github.rosemoe.sora.lang.EmptyLanguage -import io.github.rosemoe.sora.text.Content -import io.github.rosemoe.sora.text.LineSeparator -import io.github.rosemoe.sora.util.IntPair -import io.github.rosemoe.sora.widget.CodeEditor -import io.github.rosemoe.sora.widget.DirectAccessProps -import io.github.rosemoe.sora.widget.REGION_LINE_NUMBER -import io.github.rosemoe.sora.widget.component.Magnifier -import io.github.rosemoe.sora.widget.resolveTouchRegion -import kotlinx.coroutines.CoroutineName -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.DelicateCoroutinesApi -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.launch -import kotlinx.coroutines.newSingleThreadContext -import kotlinx.coroutines.withContext -import org.adfa.constants.PLUGIN_ARCHIVE_EXTENSION -import org.adfa.constants.TEMPLATE_ARCHIVE_EXTENSION import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode diff --git a/app/src/main/java/org/appdevforall/codeonthego/ui/CustomDividerItemDecoration.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/CustomDividerItemDecoration.kt index f953fdf887..31b82ca62d 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/ui/CustomDividerItemDecoration.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/CustomDividerItemDecoration.kt @@ -8,38 +8,46 @@ import android.view.View import androidx.core.content.ContextCompat import androidx.recyclerview.widget.RecyclerView -class CustomDividerItemDecoration(context: Context, private val drawableResId: Int) : - RecyclerView.ItemDecoration() { - private val divider: Drawable? = ContextCompat.getDrawable(context, drawableResId) +class CustomDividerItemDecoration( + context: Context, + private val drawableResId: Int, +) : RecyclerView.ItemDecoration() { + private val divider: Drawable? = ContextCompat.getDrawable(context, drawableResId) - override fun onDraw(c: Canvas, parent: RecyclerView, state: RecyclerView.State) { - divider ?: return + override fun onDraw( + c: Canvas, + parent: RecyclerView, + state: RecyclerView.State, + ) { + divider ?: return - val left = parent.paddingLeft - val right = parent.width - parent.paddingRight + val left = parent.paddingLeft + val right = parent.width - parent.paddingRight - // Loop until the second to last child - val childCount = parent.childCount - for (i in 0 until childCount - 1) { - val child = parent.getChildAt(i) - val params = child.layoutParams as RecyclerView.LayoutParams - val top = child.bottom + params.bottomMargin - val bottom = top + divider.intrinsicHeight - divider.setBounds(left, top, right, bottom) - divider.draw(c) - } - } + // Loop until the second to last child + val childCount = parent.childCount + for (i in 0 until childCount - 1) { + val child = parent.getChildAt(i) + val params = child.layoutParams as RecyclerView.LayoutParams + val top = child.bottom + params.bottomMargin + val bottom = top + divider.intrinsicHeight + divider.setBounds(left, top, right, bottom) + divider.draw(c) + } + } - override fun getItemOffsets( - outRect: Rect, view: View, - parent: RecyclerView, state: RecyclerView.State - ) { - val position = parent.getChildAdapterPosition(view) - // Only add bottom offset if this is not the last item - if (position < state.itemCount - 1) { - outRect.bottom = divider?.intrinsicHeight ?: 0 - } else { - outRect.bottom = 0 - } - } + override fun getItemOffsets( + outRect: Rect, + view: View, + parent: RecyclerView, + state: RecyclerView.State, + ) { + val position = parent.getChildAdapterPosition(view) + // Only add bottom offset if this is not the last item + if (position < state.itemCount - 1) { + outRect.bottom = divider?.intrinsicHeight ?: 0 + } else { + outRect.bottom = 0 + } + } } diff --git a/app/src/main/java/org/appdevforall/codeonthego/ui/CustomSnackbar.kt b/app/src/main/java/org/appdevforall/codeonthego/ui/CustomSnackbar.kt index 7d0947076d..7b5a5c9cc3 100644 --- a/app/src/main/java/org/appdevforall/codeonthego/ui/CustomSnackbar.kt +++ b/app/src/main/java/org/appdevforall/codeonthego/ui/CustomSnackbar.kt @@ -9,68 +9,68 @@ import android.widget.TextView import com.google.android.material.snackbar.Snackbar import com.itsaky.androidide.R -class CustomSnackbar(private val context: Context, private val rootView: View) { - - private var snackbar: Snackbar? = null - - @SuppressLint("RestrictedApi") - fun show( - message: String, - textFirstAction: String?, - textSecondaryAction: String?, - actionFirst: (() -> Unit)? = null, - actionSecondary: (() -> Unit)? = null - ) { - snackbar = Snackbar.make(rootView, "", Snackbar.LENGTH_INDEFINITE) - - val snackbarView = snackbar?.view - val inflater = LayoutInflater.from(context) - - val customView = inflater.inflate(R.layout.snackbar_custom, null) - - val textView = customView.findViewById(R.id.snackbar_message) - textView.text = message - - val btnFirstAction = customView.findViewById