mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[ByteCodeViewer] IDEA-375621 Enable Kotlin "explicit API mode"
GitOrigin-RevId: 4699d8a32823b9a5e94031f4be8a8dd8f0bdc092
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0eca9e6594
commit
f4fde2a91a
@@ -1,5 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="kotlin-language" name="Kotlin">
|
||||
<configuration version="5" platform="JVM 17" allPlatforms="JVM [17]" useProjectSettings="false">
|
||||
<compilerSettings>
|
||||
<option name="additionalArguments" value="-Xjvm-default=all -opt-in=com.intellij.openapi.util.IntellijInternalApi -Xexplicit-api=strict" />
|
||||
</compilerSettings>
|
||||
<compilerArguments>
|
||||
<stringArguments>
|
||||
<stringArg name="jvmTarget" arg="17" />
|
||||
<stringArg name="apiVersion" arg="2.2" />
|
||||
<stringArg name="languageVersion" arg="2.2" />
|
||||
</stringArguments>
|
||||
</compilerArguments>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.intellij.psi.util.PsiUtil
|
||||
import com.intellij.psi.util.parentsOfType
|
||||
import java.util.*
|
||||
|
||||
object ByteCodeViewerManager {
|
||||
public object ByteCodeViewerManager {
|
||||
private val CLASS_SEARCHER_EP = ExtensionPointName<ClassSearcher>("ByteCodeViewer.classSearcher")
|
||||
|
||||
private fun PsiClass.containingClassFileClass(): PsiClass {
|
||||
@@ -28,7 +28,7 @@ object ByteCodeViewerManager {
|
||||
.first()
|
||||
}
|
||||
|
||||
internal fun findClassFile(aClass: PsiClass): VirtualFile? {
|
||||
public fun findClassFile(aClass: PsiClass): VirtualFile? {
|
||||
val fileClass = aClass.containingClassFileClass()
|
||||
val file = fileClass.originalElement.containingFile.virtualFile ?: return null
|
||||
val fileIndex = ProjectFileIndex.getInstance(aClass.project)
|
||||
@@ -49,12 +49,12 @@ object ByteCodeViewerManager {
|
||||
|
||||
@Deprecated(message = "Use findClassFile instead")
|
||||
@JvmStatic
|
||||
fun loadClassFileBytes(aClass: PsiClass): ByteArray? {
|
||||
public fun loadClassFileBytes(aClass: PsiClass): ByteArray? {
|
||||
return findClassFile(aClass)?.contentsToByteArray(false)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getContainingClass(psiElement: PsiElement): PsiClass? {
|
||||
public fun getContainingClass(psiElement: PsiElement): PsiClass? {
|
||||
for (searcher in CLASS_SEARCHER_EP.extensionList) {
|
||||
val aClass = searcher.findClass(psiElement)
|
||||
if (aClass != null) return aClass
|
||||
|
||||
@@ -4,6 +4,6 @@ package com.intellij.byteCodeViewer
|
||||
import com.intellij.psi.PsiClass
|
||||
import com.intellij.psi.PsiElement
|
||||
|
||||
interface ClassSearcher {
|
||||
fun findClass(place: PsiElement): PsiClass?
|
||||
public interface ClassSearcher {
|
||||
public fun findClass(place: PsiElement): PsiClass?
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.intellij.openapi.application.PathManager
|
||||
import com.intellij.testFramework.PlatformTestUtil
|
||||
import com.intellij.testFramework.fixtures.BasePlatformTestCase
|
||||
|
||||
class BytecodeLineMappingTest : BasePlatformTestCase() {
|
||||
internal class BytecodeLineMappingTest : BasePlatformTestCase() {
|
||||
private fun getSelectionFromSource(text: String): Pair<Int, Int> {
|
||||
myFixture.configureByText(getTestName(false) + ".java", text)
|
||||
val sourceDocument = myFixture.editor.document
|
||||
|
||||
Reference in New Issue
Block a user