Skip to content

Commit

Permalink
i18n: fix localization inspection triggering
Browse files Browse the repository at this point in the history
GitOrigin-RevId: f7282fb8b5ce7445ee7ff0a9cf17b3eae4944eab
  • Loading branch information
smirok authored and intellij-monorepo-bot committed Jan 19, 2024
1 parent f28b6f9 commit 4c29b35
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,8 @@ class PestRunConfiguration(project: Project, factory: ConfigurationFactory) : Ph
PhpTestRunnerSettings.Scope.Directory -> PathUtil.getFileName(StringUtil.notNullize(runner.directoryPath))
PhpTestRunnerSettings.Scope.File -> PathUtil.getFileName(StringUtil.notNullize(runner.filePath))
PhpTestRunnerSettings.Scope.Method -> {
val builder = StringBuilder()
val file = PathUtil.getFileName(StringUtil.notNullize(runner.filePath))
builder.append(file)
builder.append("::")
builder.append(runner.methodName)
builder.toString()
"$file::${runner.methodName}"
}
PhpTestRunnerSettings.Scope.ConfigurationFile -> PathUtil.getFileName(
StringUtil.notNullize(runner.configurationFilePath)
Expand All @@ -140,7 +136,7 @@ class PestRunConfiguration(project: Project, factory: ConfigurationFactory) : Ph
fun applyTestArguments(command: PhpCommandSettings, coverageArguments: List<String>) {
val config = PhpTestFrameworkSettingsManager.getInstance(project)
.getOrCreateByInterpreter(PestFrameworkType.instance, interpreter, true)
?: throw ExecutionException("Could not find php interpreter.")
?: throw ExecutionException(PestBundle.message("DIALOG_MESSAGE_COULD_NOT_FIND_PHP_INTERPRETER"))

val version = null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.intellij.find.usages.api.SearchTarget
import com.intellij.find.usages.api.UsageHandler
import com.intellij.model.Pointer
import com.intellij.model.Symbol
import com.intellij.openapi.util.NlsSafe
import com.intellij.openapi.util.TextRange
import com.intellij.platform.backend.navigation.NavigationRequest
import com.intellij.platform.backend.navigation.NavigationTarget
Expand All @@ -17,7 +18,7 @@ import com.intellij.refactoring.rename.api.RenameTarget
import com.pestphp.pest.features.customExpectations.generators.Method

class PestCustomExpectationSymbol(
val expectationName: String,
@NlsSafe val expectationName: String,
val file: PsiFile,
val rangeInFile: TextRange,
val methodDescriptor: Method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.jetbrains.php.lang.lexer.PhpTokenTypes
import com.jetbrains.php.lang.psi.PhpPsiUtil
import com.jetbrains.php.lang.psi.elements.PhpUse
import com.jetbrains.php.lang.psi.elements.impl.FunctionReferenceImpl
import com.pestphp.pest.PestBundle

class SnapshotLineMarkerProvider : RelatedItemLineMarkerProvider() {
override fun collectNavigationMarkers(
Expand All @@ -33,7 +34,7 @@ class SnapshotLineMarkerProvider : RelatedItemLineMarkerProvider() {

val builder = NavigationGutterIconBuilder.create(AllIcons.Nodes.DataSchema)
.setTargets(snapshotFiles)
.setTooltipText("Navigate to snapshot files")
.setTooltipText(PestBundle.message("TOOLTIP_NAVIGATE_TO_SNAPSHOT_FILES"))
result.add(builder.createLineMarkerInfo(element))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@ import com.intellij.notification.Notification
import com.intellij.notification.NotificationGroupManager
import com.intellij.notification.NotificationType
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.Nls

class OutdatedNotification {
private val group = NotificationGroupManager.getInstance()
.getNotificationGroup("Outdated Pest")

fun notify(content: String): Notification {
return notify(null, content)
}

fun notify(project: Project?, content: String): Notification {
fun notify(project: Project?, @Nls content: String): Notification {
val notification: Notification = group.createNotification(content, NotificationType.ERROR)
notification.notify(project)
return notification
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/pestBundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ RUNTIME_CONFIGURATION_EXCEPTION_MESSAGE=''{0}'' for ''{1}'' run configuration
CANNOT_RUN_PEST_WITH_TYPE_MESSAGE=Cannot run Pest with type
COVERAGE_ENGINE_LABEL_TEXT=Preferred Coverage engine:
NOTIFICATION_GROUP_OUTDATED_PEST=Outdated Pest
DIALOG_MESSAGE_COULD_NOT_FIND_PHP_INTERPRETER=Could not find php interpreter.
TOOLTIP_NAVIGATE_TO_SNAPSHOT_FILES=Navigate to snapshot files

action.Pest.New.File.text=Pest Test
action.Pest.New.Dataset.text=Pest Dataset
Expand Down

0 comments on commit 4c29b35

Please sign in to comment.