-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WI-75699 Add Go To "method to test" and "test to method" navigations
GitOrigin-RevId: 2e0dc1e8cedf3cb2dfe8505cac1201211fe76d7a
- Loading branch information
1 parent
5ab16a9
commit ec8c515
Showing
7 changed files
with
192 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/kotlin/com/pestphp/pest/goto/PestGotoTargetPresentationProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.pestphp.pest.goto | ||
|
||
import com.intellij.codeInsight.navigation.GotoTargetPresentationProvider | ||
import com.intellij.openapi.util.NlsSafe | ||
import com.intellij.platform.backend.presentation.TargetPresentation | ||
import com.intellij.psi.PsiElement | ||
import com.pestphp.pest.PestIcons | ||
import com.pestphp.pest.getPestTestName | ||
import com.pestphp.pest.isPestTestReference | ||
|
||
class PestGotoTargetPresentationProvider: GotoTargetPresentationProvider { | ||
override fun getTargetPresentation(element: PsiElement, differentNames: Boolean): TargetPresentation? { | ||
if (element.isPestTestReference()) { | ||
@NlsSafe val pestTestName = element.getPestTestName() | ||
return TargetPresentation.builder(pestTestName ?: element.containingFile.name) | ||
.containerText(element.containingFile?.presentation?.locationString) | ||
.icon(PestIcons.Logo) | ||
.presentation() | ||
} | ||
return null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters