mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[ByteCodeViewer] reformat and optimize imports
GitOrigin-RevId: aff3cbd742fae99cb127a607125efb96d00d4769
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4d829a7a2d
commit
a42b2c1df1
@@ -9,7 +9,10 @@ import com.intellij.openapi.roots.ProjectFileIndex
|
||||
import com.intellij.openapi.util.text.StringUtil
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import com.intellij.openapi.vfs.resolveFromRootOrRelative
|
||||
import com.intellij.psi.*
|
||||
import com.intellij.psi.PsiClass
|
||||
import com.intellij.psi.PsiClassOwner
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.PsiTypeParameter
|
||||
import com.intellij.psi.util.ClassUtil
|
||||
import com.intellij.psi.util.PsiTreeUtil
|
||||
import com.intellij.psi.util.PsiUtil
|
||||
@@ -37,15 +40,14 @@ object ByteCodeViewerManager {
|
||||
else {
|
||||
// source code; looking for a .class file in compiler output
|
||||
val moduleExtension = CompilerModuleExtension.getInstance(fileIndex.getModuleForFile(file)) ?: return null
|
||||
val classRoot = if (fileIndex.isInTestSourceContent(file)) {
|
||||
moduleExtension.compilerOutputPathForTests
|
||||
} else {
|
||||
moduleExtension.compilerOutputPath
|
||||
} ?: return null
|
||||
val classRoot = if (fileIndex.isInTestSourceContent(file)) moduleExtension.compilerOutputPathForTests
|
||||
else moduleExtension.compilerOutputPath
|
||||
if (classRoot == null) return null
|
||||
return classRoot.resolveFromRootOrRelative(jvmClassName.replace('.', '/') + ".class")
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated(message = "Use findClassFile instead")
|
||||
@JvmStatic
|
||||
fun loadClassFileBytes(aClass: PsiClass): ByteArray? {
|
||||
return findClassFile(aClass)?.contentsToByteArray(false)
|
||||
|
||||
@@ -109,7 +109,7 @@ internal class ShowBytecodeAction : AnAction() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
val syncWithEditorAction = object : ToggleAction(BytecodeViewerBundle.messagePointer("action.sync.with.editor.name")) {
|
||||
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.EDT
|
||||
|
||||
@@ -121,7 +121,7 @@ internal class ShowBytecodeAction : AnAction() {
|
||||
BytecodeViewerSettings.getInstance().state.syncWithEditor = state
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return DefaultActionGroup(showDebugAction, syncWithEditorAction)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user