Added ChooseByNameContributor.
This commit is contained in:
parent
9a37b9c569
commit
331b88c05f
@ -0,0 +1,24 @@
|
|||||||
|
package de.platon42.intellij.plugins.m68k.refs
|
||||||
|
|
||||||
|
import com.intellij.navigation.ChooseByNameContributor
|
||||||
|
import com.intellij.navigation.NavigationItem
|
||||||
|
import com.intellij.openapi.project.Project
|
||||||
|
import de.platon42.intellij.plugins.m68k.psi.M68kLookupUtil.findAllGlobalLabels
|
||||||
|
import de.platon42.intellij.plugins.m68k.psi.M68kLookupUtil.findAllSymbolDefinitions
|
||||||
|
|
||||||
|
class M68kChooseByNameContributor : ChooseByNameContributor {
|
||||||
|
override fun getNames(project: Project, includeNonProjectItems: Boolean): Array<String> {
|
||||||
|
return listOf(findAllGlobalLabels(project), findAllSymbolDefinitions(project))
|
||||||
|
.asSequence()
|
||||||
|
.flatten()
|
||||||
|
.mapNotNull { it.name }
|
||||||
|
.toList()
|
||||||
|
.toTypedArray()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemsByName(name: String, pattern: String, project: Project, includeNonProjectItems: Boolean): Array<NavigationItem> {
|
||||||
|
return listOf(findAllGlobalLabels(project), findAllSymbolDefinitions(project))
|
||||||
|
.flatten()
|
||||||
|
.toTypedArray()
|
||||||
|
}
|
||||||
|
}
|
@ -29,6 +29,7 @@
|
|||||||
implementationClass="de.platon42.intellij.plugins.m68k.refs.M68kSymbolReferenceElementManipulator"/>
|
implementationClass="de.platon42.intellij.plugins.m68k.refs.M68kSymbolReferenceElementManipulator"/>
|
||||||
|
|
||||||
<psi.referenceContributor implementation="de.platon42.intellij.plugins.m68k.refs.M68kReferenceContributor"/>
|
<psi.referenceContributor implementation="de.platon42.intellij.plugins.m68k.refs.M68kReferenceContributor"/>
|
||||||
|
<gotoSymbolContributor implementation="de.platon42.intellij.plugins.m68k.refs.M68kChooseByNameContributor"/>
|
||||||
<renameInputValidator implementation="de.platon42.intellij.plugins.m68k.psi.M68kRenameInputValidator"/>
|
<renameInputValidator implementation="de.platon42.intellij.plugins.m68k.psi.M68kRenameInputValidator"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user