diff options
author | vaage <vaage@google.com> | 2021-09-28 11:42:33 -0700 |
---|---|---|
committer | Aaron Vaage <vaage@google.com> | 2021-10-13 19:48:54 +0000 |
commit | 005eccf4bbffa91232502495d078499dec508885 (patch) | |
tree | a97e7969d34a3b6ae00adeab56cc01267119ac48 | |
parent | d0a0f058e8669b5894087ed788850aff663c661b (diff) | |
download | idea-005eccf4bbffa91232502495d078499dec508885.tar.gz |
Rename IntellijNavSource as ApkNavSource
Now that all the other nav sources have been extracted, the only logic
left in IntellijNavSource was the code to search an APK. The class has
been renamed to better reflect the scope of the nav source.
Unlike the other nav sources, this one was left in the original language
(Java) with minimal alterations since we cannot easily test the logic
here.
Bug: 197112399
Test: Untested, no method to easily test APK code navigation.
Change-Id: Ifaa7fd661bd3b7953b63f5a194453289cf3260c9
-rw-r--r-- | codenavigation/src/com/android/tools/idea/codenavigation/ApkNavSource.java (renamed from codenavigation/src/com/android/tools/idea/codenavigation/IntellijNavSource.java) | 12 | ||||
-rw-r--r-- | codenavigation/src/com/android/tools/idea/codenavigation/IntellijNavSourceProxy.kt | 5 | ||||
-rw-r--r-- | profilers-android/src/com/android/tools/idea/profilers/AndroidProfilerToolWindow.java | 1 | ||||
-rw-r--r-- | profilers-android/src/com/android/tools/idea/profilers/IntellijProfilerServices.java | 2 |
4 files changed, 6 insertions, 14 deletions
diff --git a/codenavigation/src/com/android/tools/idea/codenavigation/IntellijNavSource.java b/codenavigation/src/com/android/tools/idea/codenavigation/ApkNavSource.java index 63a7d8b0207..54928ab7646 100644 --- a/codenavigation/src/com/android/tools/idea/codenavigation/IntellijNavSource.java +++ b/codenavigation/src/com/android/tools/idea/codenavigation/ApkNavSource.java @@ -32,15 +32,16 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** - * A {@link NavSource} that searches for a navigatble within an IntelliJ project. + * A {@link NavSource} that searches an APK to convert a {@link CodeLocation} to a + * {@link Navigatable}. */ -public class IntellijNavSource implements NavSource { +public class ApkNavSource implements NavSource { @NotNull private final Project myProject; @NotNull private final List<LibraryMapping> myLibraryMappings; - public IntellijNavSource(@NotNull Project project) { + public ApkNavSource(@NotNull Project project) { myProject = project; myLibraryMappings = getLibraryMappings(project); } @@ -48,11 +49,6 @@ public class IntellijNavSource implements NavSource { @Nullable @Override public Navigatable lookUp(@NotNull CodeLocation location, @Nullable String arch) { - return getNavigatable(location); - } - - @Nullable - private Navigatable getNavigatable(@NotNull CodeLocation location) { if (!Strings.isNullOrEmpty(location.getFileName()) && location.getLineNumber() != CodeLocation.INVALID_LINE_NUMBER) { Navigatable navigatable = getExplicitLocationNavigable(location); diff --git a/codenavigation/src/com/android/tools/idea/codenavigation/IntellijNavSourceProxy.kt b/codenavigation/src/com/android/tools/idea/codenavigation/IntellijNavSourceProxy.kt index 950ce71df93..5aeac025c66 100644 --- a/codenavigation/src/com/android/tools/idea/codenavigation/IntellijNavSourceProxy.kt +++ b/codenavigation/src/com/android/tools/idea/codenavigation/IntellijNavSourceProxy.kt @@ -19,10 +19,9 @@ import com.android.tools.nativeSymbolizer.NativeSymbolizer import com.intellij.openapi.project.Project import com.intellij.pom.Navigatable -// TODO(vaage): Once [IntellijNavSource] has been fully broken-up, rename this [NavSource] to be -// [IntellijNavSource]. +// TODO(vaage): Rename this [NavSource] to [IntellijNavSource]. class IntellijNavSourceProxy(project:Project, symbolizer: NativeSymbolizer): NavSource { - private val sources = listOf(IntellijNavSource(project), + private val sources = listOf(ApkNavSource(project), NativeNavSource(project, symbolizer), PsiNavSource(project)) diff --git a/profilers-android/src/com/android/tools/idea/profilers/AndroidProfilerToolWindow.java b/profilers-android/src/com/android/tools/idea/profilers/AndroidProfilerToolWindow.java index 086143bdab1..d1033f30ddd 100644 --- a/profilers-android/src/com/android/tools/idea/profilers/AndroidProfilerToolWindow.java +++ b/profilers-android/src/com/android/tools/idea/profilers/AndroidProfilerToolWindow.java @@ -24,7 +24,6 @@ import com.android.tools.idea.codenavigation.CodeNavigator; import com.android.tools.idea.model.AndroidModuleInfo; import com.android.tools.idea.transport.TransportService; import com.android.tools.idea.transport.TransportServiceProxy; -import com.android.tools.idea.codenavigation.IntellijNavSource; import com.android.tools.nativeSymbolizer.ProjectSymbolSource; import com.android.tools.nativeSymbolizer.SymbolFilesLocator; import com.android.tools.nativeSymbolizer.SymbolSource; diff --git a/profilers-android/src/com/android/tools/idea/profilers/IntellijProfilerServices.java b/profilers-android/src/com/android/tools/idea/profilers/IntellijProfilerServices.java index 05fa792da62..b3cf60ad995 100644 --- a/profilers-android/src/com/android/tools/idea/profilers/IntellijProfilerServices.java +++ b/profilers-android/src/com/android/tools/idea/profilers/IntellijProfilerServices.java @@ -16,7 +16,6 @@ package com.android.tools.idea.profilers; import com.android.tools.idea.codenavigation.CodeNavigator; -import com.android.tools.idea.codenavigation.PsiNavSource; import com.android.tools.idea.codenavigation.IntellijNavSourceProxy; import com.android.tools.idea.flags.StudioFlags; import com.android.tools.idea.gradle.project.sync.hyperlink.OpenUrlHyperlink; @@ -30,7 +29,6 @@ import com.android.tools.idea.project.AndroidNotification; import com.android.tools.idea.run.AndroidRunConfigurationBase; import com.android.tools.idea.run.editor.ProfilerState; import com.android.tools.idea.run.profiler.CpuProfilerConfigsState; -import com.android.tools.idea.codenavigation.IntellijNavSource; import com.android.tools.nativeSymbolizer.NativeSymbolizer; import com.android.tools.nativeSymbolizer.NativeSymbolizerKt; import com.android.tools.nativeSymbolizer.SymbolFilesLocator; |