mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
notnull, cleanup
GitOrigin-RevId: 04cf8a716196d0c05031edc810a44bb5e1a19e38
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d431c29891
commit
bea50636b2
@@ -15,7 +15,7 @@ abstract class JvmGoToRelatedTestBase : LightJvmCodeInsightFixtureTestCase() {
|
||||
assertion: (GotoRelatedItem) -> Unit
|
||||
) {
|
||||
configureByText("$fileName${lang.ext}", before)
|
||||
val items = GotoRelatedSymbolAction.getItems(myFixture.getFile(), myFixture.getEditor(), null)
|
||||
val items = GotoRelatedSymbolAction.getItems(myFixture.getFile(), myFixture.getEditor())
|
||||
assertSize(1, items)
|
||||
assertion(items.first())
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.intellij.codeInsight.navigation.getRelatedItemsPopup
|
||||
import com.intellij.lang.LangBundle
|
||||
import com.intellij.navigation.GotoRelatedItem
|
||||
import com.intellij.openapi.actionSystem.*
|
||||
import com.intellij.openapi.actionSystem.impl.SimpleDataContext
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.impl.EditorComponentImpl
|
||||
import com.intellij.openapi.ui.MessageType
|
||||
@@ -61,7 +62,7 @@ class GotoRelatedSymbolAction : AnAction() {
|
||||
companion object {
|
||||
@TestOnly
|
||||
@JvmStatic
|
||||
fun getItems(psiFile: PsiFile, editor: Editor?, dataContext: DataContext?): List<GotoRelatedItem> {
|
||||
fun getItems(psiFile: PsiFile, editor: Editor?, dataContext: DataContext = SimpleDataContext.EMPTY_CONTEXT): List<GotoRelatedItem> {
|
||||
return collectRelatedItems(getContextElement(psiFile, editor), dataContext)
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.intellij.codeInsight.navigation.NavigationUtil;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.navigation.GotoRelatedItem;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.impl.SimpleDataContext;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import com.intellij.testFramework.builders.JavaModuleFixtureBuilder;
|
||||
@@ -50,7 +51,7 @@ public class ActionDeclarationRelatedItemLineMarkerProviderTest extends JavaCode
|
||||
buildTooltipText("firstDeclaration", "secondDeclaration"),
|
||||
DevKitIcons.Gutter.Plugin, "action");
|
||||
|
||||
List<GotoRelatedItem> relatedItems = NavigationUtil.collectRelatedItems(myFixture.findClass("MyAction"), null);
|
||||
List<GotoRelatedItem> relatedItems = NavigationUtil.collectRelatedItems(myFixture.findClass("MyAction"), SimpleDataContext.EMPTY_CONTEXT);
|
||||
assertSize(2, relatedItems);
|
||||
DomGotoRelatedItem first = assertInstanceOf(relatedItems.get(0), DomGotoRelatedItem.class);
|
||||
assertEquals("DevKit", first.getGroup());
|
||||
|
||||
@@ -4,6 +4,7 @@ package org.jetbrains.kotlin.idea.navigation
|
||||
|
||||
import com.intellij.codeInsight.navigation.GotoTargetHandler
|
||||
import com.intellij.codeInsight.navigation.collectRelatedItems
|
||||
import com.intellij.openapi.actionSystem.impl.SimpleDataContext
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.EditorFactory
|
||||
import com.intellij.psi.PsiDocumentManager
|
||||
@@ -57,7 +58,7 @@ abstract class AbstractKotlinGotoRelatedSymbolMultiModuleTest : AbstractKotlinNa
|
||||
|
||||
override fun doNavigate(editor: Editor, file: PsiFile): GotoTargetHandler.GotoData {
|
||||
val source = file.findElementAt(editor.caretModel.offset)!!
|
||||
val relatedItems = collectRelatedItems(contextElement = source, dataContext = null)
|
||||
val relatedItems = collectRelatedItems(contextElement = source, dataContext = SimpleDataContext.EMPTY_CONTEXT)
|
||||
return GotoTargetHandler.GotoData(source, relatedItems.map { it.element }.toTypedArray(), emptyList())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user