mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
hide lookup on typing special characters in a live template expression (IDEA-92139)
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
import java.io.File;
|
||||
import java.lang.Object;
|
||||
import java.util.Map;
|
||||
|
||||
class Foo {
|
||||
void foo(Map<File, Object> files, File file, Object filx) {
|
||||
for (File file1 : file.<caret>) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import java.io.File;
|
||||
import java.lang.Object;
|
||||
import java.util.Map;
|
||||
|
||||
class Foo {
|
||||
void foo(Map<File, Object> files, File file, Object filx) {
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
@@ -190,6 +190,14 @@ public class LiveTemplateTest extends LightCodeInsightFixtureTestCase {
|
||||
assert !state.finished
|
||||
}
|
||||
|
||||
public void testAllowTypingRandomExpressionsWithLookupOpen() {
|
||||
configure();
|
||||
startTemplate("iter", "iterations")
|
||||
myFixture.type('file.')
|
||||
checkResult()
|
||||
assert !state.finished
|
||||
}
|
||||
|
||||
private TemplateState getState() {
|
||||
TemplateManagerImpl.getTemplateState(getEditor())
|
||||
}
|
||||
|
||||
+4
@@ -34,6 +34,10 @@ public class LiveTemplateCharFilter extends CharFilter {
|
||||
}
|
||||
return Result.HIDE_LOOKUP;
|
||||
}
|
||||
if (item instanceof TemplateExpressionLookupElement) {
|
||||
if (Character.isJavaIdentifierPart(c)) return Result.ADD_TO_PREFIX;
|
||||
return Result.HIDE_LOOKUP;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user