always try to use injected document when handling typing, so that autocompletion popup is invoked in right editor

This commit is contained in:
Kirill.Safonov
2010-12-30 20:47:28 +03:00
parent 268dc24c93
commit abe7d93631
2 changed files with 4 additions and 13 deletions
@@ -55,6 +55,10 @@ abstract class CompletionAutoPopupTestCase extends LightCodeInsightFixtureTestCa
})
}
protected void doHighlighting() {
UIUtil.invokeAndWaitIfNeeded({ myFixture.doHighlighting() } as Runnable)
}
void type(String s) {
for (i in 0..<s.size()) {
final c = s.charAt(i)
@@ -246,19 +246,6 @@ public class TypedHandler implements TypedActionHandler {
}
static Editor injectedEditorIfCharTypedIsSignificant(final char charTyped, Editor editor, PsiFile oldFile) {
boolean significant = charTyped == '"' ||
charTyped == '\'' ||
charTyped == '[' ||
charTyped == '(' ||
charTyped == ']' ||
charTyped == ')' ||
charTyped == '{' ||
charTyped == '}' ||
charTyped == '.';
if (!significant) {
return editor;
}
int offset = editor.getCaretModel().getOffset();
// even for uncommitted document try to retrieve injected fragment that has been there recently
// we are assuming here that when user is (even furiously) typing, injected language would not change