Struts2 path completion
authorDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Fri, 12 Feb 2010 11:27:18 +0000 (12 14:27 +0300)
committerDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Fri, 12 Feb 2010 11:27:18 +0000 (12 14:27 +0300)
platform/lang-impl/src/com/intellij/codeInsight/completion/LegacyCompletionContributor.java

index 1eee7a1..6d5f7f1 100644 (file)
@@ -112,8 +112,11 @@ public class LegacyCompletionContributor extends CompletionContributor {
       }
     }
     else if (ref instanceof PsiDynaReference) {
+      int offset = startOffset - ref.getElement().getTextRange().getStartOffset();
       for (final PsiReference reference : ((PsiDynaReference<?>)ref).getReferences()) {
-        processReference(result, startOffset, consumer, reference);
+        if (reference.getRangeInElement().contains(offset)) {
+          processReference(result, startOffset, consumer, reference);
+        }
       }
     }
     else if (ref != null) {