mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[command-completion] IDEA-381060 Command completion preview descriptions should end with a period
GitOrigin-RevId: bba450771087349c1b60ea39901aa4ef60c55e2e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
77ce0f8ed2
commit
c042af8733
+4
-1
@@ -215,7 +215,10 @@ class JavaCommandsCompletionTest : LightFixtureCompletionTestCase() {
|
||||
}
|
||||
""".trimIndent())
|
||||
val elements = myFixture.completeBasic()
|
||||
selectItem(elements.first { element -> element.lookupString.contains("copy ref", ignoreCase = true) })
|
||||
val item = elements.first { element -> element.lookupString.contains("copy ref", ignoreCase = true) }
|
||||
val preview = (item.`as`(CommandCompletionLookupElement::class.java))?.preview
|
||||
assertEquals("Copy reference for 'foo'.", (preview as IntentionPreviewInfo.Html).content().toString())
|
||||
selectItem(item)
|
||||
myFixture.performEditorAction(IdeActions.ACTION_EDITOR_PASTE)
|
||||
NonBlockingReadActionImpl.waitForAsyncTaskCompletion()
|
||||
myFixture.checkResult("""
|
||||
|
||||
+6
-2
@@ -238,8 +238,12 @@ open class ActionCompletionCommand(
|
||||
}
|
||||
|
||||
override fun getPreview(): IntentionPreviewInfo {
|
||||
if (previewText == null) return IntentionPreviewInfo.EMPTY
|
||||
return IntentionPreviewInfo.Html(previewText)
|
||||
var contentHtml = previewText
|
||||
if (contentHtml == null) return IntentionPreviewInfo.EMPTY
|
||||
if (!contentHtml.endsWith(".")) {
|
||||
contentHtml = "$contentHtml."
|
||||
}
|
||||
return IntentionPreviewInfo.Html(contentHtml)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user