Skip to content

Commit

Permalink
refactor(quick-assistant): include language in generated code snippet…
Browse files Browse the repository at this point in the history
… prompt
  • Loading branch information
phodal committed Nov 25, 2024
1 parent 2685135 commit a8b11fa
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ open class QuickAssistantAction : AnAction() {

val actionMap = component.actionMap

val language = element?.language?.displayName ?: ""

actionMap.put(QUICK_ASSISTANT_SUBMIT_ACTION, object : AbstractAction() {
override fun actionPerformed(e: ActionEvent?) {
val text =
"""Generate a concise code snippet with no extra text, description, or comments.
|The code should achieve the following task: ${component.getText()}"""
"""Generate a concise $language code snippet with no extra text, description, or comments.
| The code should achieve the following task: ${component.getText()}"""
.trimMargin()

val offset = editor.caretModel.offset
Expand Down

0 comments on commit a8b11fa

Please sign in to comment.