Skip to content

Commit

Permalink
Merge pull request #95 from JetBrains-Research/arksap2002/improvement…
Browse files Browse the repository at this point in the history
…s/handling-an-inconclusive-request

TestSpark does not provide any feedback if a client sends an inappropriate request via a per-test textbox after tests generation via LLM
  • Loading branch information
arksap2002 authored Jan 8, 2024
2 parents 00f6d40 + 9d88411 commit 77d9684
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.jetbrains.research.testspark.display

import com.intellij.lang.Language
import com.intellij.notification.NotificationGroupManager
import com.intellij.notification.NotificationType
import com.intellij.openapi.command.WriteCommandAction
import com.intellij.openapi.components.service
import com.intellij.openapi.diff.DiffColors
Expand Down Expand Up @@ -405,9 +407,19 @@ class TestCasePanelFactory(
)
addTest(modifiedTest)
} else {
NotificationGroupManager.getInstance()
.getNotificationGroup("LLM Execution Error")
.createNotification(
TestSparkBundle.message("llmWarningTitle"),
TestSparkBundle.message("noRequestFromLLM"),
NotificationType.WARNING,
)
.notify(project)

loadingLabel.isVisible = false
sendButton.isEnabled = true
}

if (processStopped(project, indicator)) return

indicator.stop()
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/messages/TestSpark.properties
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ tooLongPrompt=The generated prompt is too long! Please, generate tests for singl
requestError=An error occurred during interaction with the LLM Platform. Code:
savingTestFileIssue=Plugin cannot save the test file
promptReduction=The generated prompt is too long, plugin reduced Large Language Model parameters.
!No request from LLM
noRequestFromLLM=LLM does not provide any response. Could you, please, change the message.
!Build error messages
commonBuildErrorMessage=Please make sure that IntelliJ can build your project without any issues or provide the correct build command in the settings
sendingFeedback=Sending your request to LLM
testRunning=Test running
!Run caution message
runCautionMessage=By clicking "OK" you agree to run this code on your machine

0 comments on commit 77d9684

Please sign in to comment.