From c70be787640a94508126aaf6eadd263adf25e58d Mon Sep 17 00:00:00 2001 From: "Gregory.Shrago" Date: Wed, 12 Dec 2012 20:10:59 +0400 Subject: [PATCH] fix java by-comment injection --- .../intelliLang/inject/java/ConcatenationInjector.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/ConcatenationInjector.java b/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/ConcatenationInjector.java index 3cb3524a3075..15c79cbaa3c5 100644 --- a/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/ConcatenationInjector.java +++ b/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/ConcatenationInjector.java @@ -297,7 +297,10 @@ public class ConcatenationInjector implements ConcatenationAwareInjector { private boolean processCommentInjections(PsiVariable owner) { Ref causeRef = Ref.create(); - BaseInjection injection = InjectorUtils.findCommentInjection(owner, LanguageInjectionSupport.JAVA_SUPPORT_ID, causeRef); + PsiElement anchor = owner.getFirstChild() instanceof PsiComment? + (owner.getModifierList() != null? owner.getModifierList() : owner.getTypeElement()) : owner; + if (anchor == null) return true; + BaseInjection injection = InjectorUtils.findCommentInjection(anchor, LanguageInjectionSupport.JAVA_SUPPORT_ID, causeRef); return injection == null || processCommentInjectionInner(owner, causeRef.get(), injection); }