mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
[command-completion] IDEA-375804 Impossible to find CommandCompletionType
(cherry picked from commit 168553d5b5bce830d4a231115f4c5b734eacf788) IJ-CR-168918 GitOrigin-RevId: aa56e2e8ebd4e84438e64f8a24528c3385b8c17a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9f571ef662
commit
a8d0a77229
@@ -962,6 +962,16 @@ class JavaCommandsCompletionTest : LightFixtureCompletionTestCase() {
|
||||
assertTrue(elements.any { element -> element.lookupString.contains("Create method from", ignoreCase = true) })
|
||||
}
|
||||
|
||||
fun testForceCallException() {
|
||||
Registry.get("ide.completion.command.force.enabled").setValue(true, getTestRootDisposable())
|
||||
myFixture.configureByText(JavaFileType.INSTANCE, """
|
||||
class A {
|
||||
void foo() {
|
||||
}
|
||||
}
|
||||
a<caret>""".trimIndent())
|
||||
myFixture.completeBasic()
|
||||
}
|
||||
|
||||
private class TestHintManager : HintManagerImpl() {
|
||||
var called: Boolean = false
|
||||
|
||||
@@ -429,7 +429,7 @@ internal fun findCommandCompletionType(
|
||||
return InvocationCommandType.FullSuffix(text.substring(offset - indexOf + 2, offset),
|
||||
text.substring(offset - indexOf, offset - indexOf + 2))
|
||||
}
|
||||
if (indexOf > 0 && text.substring(offset - indexOf, offset - indexOf + 2).startsWith(factory.suffix())) {
|
||||
if (indexOf > 0 && text.substring(offset - indexOf).startsWith(factory.suffix())) {
|
||||
//force call with one point
|
||||
return InvocationCommandType.PartialSuffix(text.substring(offset - indexOf + 1, offset),
|
||||
text.substring(offset - indexOf, offset - indexOf + 1))
|
||||
|
||||
Reference in New Issue
Block a user