diff --git a/README.md b/README.md
index 7c2859f..3a3b54e 100644
--- a/README.md
+++ b/README.md
@@ -78,6 +78,7 @@ make it work with JUnit 5. Feel free to use the code (in package ```de.platon42.
- Bugfix: Missing REPT and ENDR assembler directives added.
- Cosmetics: Changed or added some icons at various places.
- Performance: Reference search for global labels and symbols now uses stub index.
+- Compatibility: Restored compatibility with IDEs versions < 2021.1.
### V0.2 (27-Jul-21)
diff --git a/build.gradle b/build.gradle
index a56db23..d3f1a02 100644
--- a/build.gradle
+++ b/build.gradle
@@ -44,6 +44,16 @@ intellij {
// setPlugins(["com.intellij.java"])
}
+runPluginVerifier {
+ ideVersions = ["IC-193.5662.53", "IC-211.7628.21", // 2019.3.1 - 2021.1.3
+ "CL-193.5233.103", "CL-193.7288.25", // 2019.3
+ "CL-201.6668.126", "CL-201.8743.17", // 2020.1
+ "CL-202.6397.106", "CL-202.8194.17", // 2020.2
+ "CL-203.5981.166", "CL-203.8084.11", // 2020.3
+ "CL-211.6693.114", "CL-211.7628.27"] // 2021.1
+ downloadDir = System.getProperty("user.home") + "/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea"
+}
+
patchPluginXml {
setChangeNotes("""
V0.3 (unreleased)
@@ -55,6 +65,7 @@ patchPluginXml {
Bugfix: Missing REPT and ENDR assembler directives added.
Cosmetics: Changed or added some icons at various places.
Performance: Reference search for global labels and symbols now uses stub index.
+ Compatibility: Restored compatibility with IDEs versions < 2021.1.
V0.2 (27-Jul-21)
diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/M68kIcons.kt b/src/main/java/de/platon42/intellij/plugins/m68k/M68kIcons.kt
index 90def27..62097a5 100644
--- a/src/main/java/de/platon42/intellij/plugins/m68k/M68kIcons.kt
+++ b/src/main/java/de/platon42/intellij/plugins/m68k/M68kIcons.kt
@@ -9,4 +9,6 @@ object M68kIcons {
val GLOBAL_LABEL = AllIcons.Nodes.Method
val SYMBOL_DEF = AllIcons.Nodes.ClassInitializer
val MACRO_DEF = AllIcons.Nodes.MultipleTypeDefinitions
+ val REGISTER = AllIcons.Nodes.DataTables // AllIcons.Nodes.Record only available starting from 2020.1
+ val MNEMONIC = AllIcons.Nodes.C_protected
}
\ No newline at end of file
diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/asm/M68kMnemonicCompletionContributor.kt b/src/main/java/de/platon42/intellij/plugins/m68k/asm/M68kMnemonicCompletionContributor.kt
index e5a7f30..7704e71 100644
--- a/src/main/java/de/platon42/intellij/plugins/m68k/asm/M68kMnemonicCompletionContributor.kt
+++ b/src/main/java/de/platon42/intellij/plugins/m68k/asm/M68kMnemonicCompletionContributor.kt
@@ -2,16 +2,16 @@ package de.platon42.intellij.plugins.m68k.asm
import com.intellij.codeInsight.completion.*
import com.intellij.codeInsight.lookup.LookupElementBuilder
-import com.intellij.icons.AllIcons
import com.intellij.patterns.PlatformPatterns
import com.intellij.util.ProcessingContext
+import de.platon42.intellij.plugins.m68k.M68kIcons
import de.platon42.intellij.plugins.m68k.psi.M68kTypes
class M68kMnemonicCompletionContributor : CompletionContributor() {
companion object {
val MNEMONICS = M68kIsa.mnemonics
- .map { PrioritizedLookupElement.withPriority(LookupElementBuilder.create(it).withIcon(AllIcons.Nodes.Protected), 10.0) }
+ .map { PrioritizedLookupElement.withPriority(LookupElementBuilder.create(it).withIcon(M68kIcons.MNEMONIC), 10.0) }
}
init {
diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/refs/M68kChooseByNameContributor.kt b/src/main/java/de/platon42/intellij/plugins/m68k/refs/M68kChooseByNameContributor.kt
index 7b33a0c..2a0a5b2 100644
--- a/src/main/java/de/platon42/intellij/plugins/m68k/refs/M68kChooseByNameContributor.kt
+++ b/src/main/java/de/platon42/intellij/plugins/m68k/refs/M68kChooseByNameContributor.kt
@@ -1,8 +1,7 @@
package de.platon42.intellij.plugins.m68k.refs
-import com.intellij.navigation.ChooseByNameContributorEx2
+import com.intellij.navigation.ChooseByNameContributorEx
import com.intellij.navigation.NavigationItem
-import com.intellij.openapi.project.Project
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.psi.stubs.StubIndex
import com.intellij.util.Processor
@@ -13,17 +12,17 @@ import de.platon42.intellij.plugins.m68k.psi.M68kSymbolDefinition
import de.platon42.intellij.plugins.m68k.stubs.M68kGlobalLabelStubIndex
import de.platon42.intellij.plugins.m68k.stubs.M68kSymbolDefinitionStubIndex
-class M68kChooseByNameContributor : ChooseByNameContributorEx2 {
+class M68kChooseByNameContributor : ChooseByNameContributorEx {
- override fun processNames(processor: Processor, parameters: FindSymbolParameters) {
- processNames(processor, parameters.searchScope, parameters.idFilter)
- }
+// override fun processNames(processor: Processor, parameters: FindSymbolParameters) {
+// processNames(processor, parameters.searchScope, parameters.idFilter)
+// }
- override fun getItemsByName(name: String, pattern: String, project: Project, includeNonProjectItems: Boolean): Array {
- val result: MutableList = ArrayList()
- processElementsWithName(name, result::add, FindSymbolParameters.wrap(pattern, project, includeNonProjectItems))
- return result.toTypedArray()
- }
+// override fun getItemsByName(name: String, pattern: String, project: Project, includeNonProjectItems: Boolean): Array {
+// val result: MutableList = ArrayList()
+// processElementsWithName(name, result::add, FindSymbolParameters.wrap(pattern, project, includeNonProjectItems))
+// return result.toTypedArray()
+// }
override fun processNames(processor: Processor, scope: GlobalSearchScope, filter: IdFilter?) {
StubIndex.getInstance().processAllKeys(M68kGlobalLabelStubIndex.KEY, processor, scope, filter)
diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/refs/M68kGlobalLabelSymbolCompletionContributor.kt b/src/main/java/de/platon42/intellij/plugins/m68k/refs/M68kGlobalLabelSymbolCompletionContributor.kt
index 7af34bb..174aec5 100644
--- a/src/main/java/de/platon42/intellij/plugins/m68k/refs/M68kGlobalLabelSymbolCompletionContributor.kt
+++ b/src/main/java/de/platon42/intellij/plugins/m68k/refs/M68kGlobalLabelSymbolCompletionContributor.kt
@@ -3,9 +3,9 @@ package de.platon42.intellij.plugins.m68k.refs
import com.intellij.codeInsight.completion.*
import com.intellij.codeInsight.lookup.LookupElement
import com.intellij.codeInsight.lookup.LookupElementBuilder
-import com.intellij.icons.AllIcons
import com.intellij.patterns.PlatformPatterns
import com.intellij.util.ProcessingContext
+import de.platon42.intellij.plugins.m68k.M68kIcons
import de.platon42.intellij.plugins.m68k.psi.M68kLookupUtil
import de.platon42.intellij.plugins.m68k.psi.M68kTypes
@@ -18,7 +18,7 @@ class M68kGlobalLabelSymbolCompletionContributor : CompletionContributor() {
"a0", "a1", "a2", "a3", "a4", "a5", "a6", "sp",
"pc"
)
- .map { PrioritizedLookupElement.withPriority(LookupElementBuilder.create(it).withIcon(AllIcons.Nodes.Record).withBoldness(true), 2.0) }
+ .map { PrioritizedLookupElement.withPriority(LookupElementBuilder.create(it).withIcon(M68kIcons.REGISTER).withBoldness(true), 2.0) }
}
init {
diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/structureview/M68kStructureViewElement.kt b/src/main/java/de/platon42/intellij/plugins/m68k/structureview/M68kStructureViewElement.kt
index c85507f..461f911 100644
--- a/src/main/java/de/platon42/intellij/plugins/m68k/structureview/M68kStructureViewElement.kt
+++ b/src/main/java/de/platon42/intellij/plugins/m68k/structureview/M68kStructureViewElement.kt
@@ -4,7 +4,6 @@ import com.intellij.ide.structureView.StructureViewTreeElement
import com.intellij.ide.util.treeView.smartTree.TreeElement
import com.intellij.navigation.ItemPresentation
import com.intellij.psi.NavigatablePsiElement
-import com.intellij.refactoring.suggested.startOffset
import de.platon42.intellij.plugins.m68k.psi.M68kFile
import de.platon42.intellij.plugins.m68k.psi.M68kGlobalLabel
import de.platon42.intellij.plugins.m68k.psi.M68kLookupUtil
@@ -19,9 +18,9 @@ class M68kStructureViewElement(private val myElement: NavigatablePsiElement) : S
return when (myElement) {
is M68kFile -> {
listOf(
- M68kLookupUtil.findAllSymbolDefinitions(myElement).sortedBy { it.startOffset },
- M68kLookupUtil.findAllMacroDefinitions(myElement).sortedBy { it.startOffset },
- M68kLookupUtil.findAllGlobalLabels(myElement).sortedBy { it.startOffset },
+ M68kLookupUtil.findAllSymbolDefinitions(myElement).sortedBy { it.textRange.startOffset },
+ M68kLookupUtil.findAllMacroDefinitions(myElement).sortedBy { it.textRange.startOffset },
+ M68kLookupUtil.findAllGlobalLabels(myElement).sortedBy { it.textRange.startOffset },
// M68kLookupUtil.findAllSymbolDefinitions(myElement).sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER) { it.name!! }),
// M68kLookupUtil.findAllGlobalLabels(myElement).sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER) { it.name!! })
)