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

index 1eee7a17917550526b1803b81d40b4eae083f692..6d5f7f10dd0834bb71cc48ca4a0d5040d54600e0 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) {