diff --git a/xml/impl/src/com/intellij/codeInsight/completion/XmlTagInsertHandler.java b/xml/impl/src/com/intellij/codeInsight/completion/XmlTagInsertHandler.java index d8844ec7b5f1..15968704f92f 100644 --- a/xml/impl/src/com/intellij/codeInsight/completion/XmlTagInsertHandler.java +++ b/xml/impl/src/com/intellij/codeInsight/completion/XmlTagInsertHandler.java @@ -6,6 +6,7 @@ import com.intellij.application.options.editor.WebEditorOptions; import com.intellij.codeInsight.TailType; import com.intellij.codeInsight.daemon.impl.quickfix.EmptyExpression; import com.intellij.codeInsight.editorActions.XmlEditUtil; +import com.intellij.codeInsight.editorActions.XmlTagNameSynchronizer; import com.intellij.codeInsight.lookup.Lookup; import com.intellij.codeInsight.lookup.LookupElement; import com.intellij.codeInsight.lookup.LookupItem; @@ -24,7 +25,6 @@ import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.RangeMarker; import com.intellij.openapi.editor.ScrollType; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.Key; import com.intellij.openapi.util.text.StringUtil; import com.intellij.profile.codeInspection.InspectionProjectProfileManager; import com.intellij.psi.PsiDocumentManager; @@ -50,7 +50,6 @@ import org.jetbrains.annotations.Nullable; import java.util.*; public class XmlTagInsertHandler implements InsertHandler { - public static final Key ENFORCING_TAG = Key.create("xml.insert.handler.enforcing.tag"); public static final XmlTagInsertHandler INSTANCE = new XmlTagInsertHandler(); @Override @@ -58,13 +57,13 @@ public class XmlTagInsertHandler implements InsertHandler { Project project = context.getProject(); Editor editor = context.getEditor(); // Need to insert " " to prevent creating tags like SKIP_COMMAND = Key.create("tag.name.synchronizer.skip.command"); private static final Logger LOG = Logger.getInstance(XmlTagNameSynchronizer.class); private static final Set SUPPORTED_LANGUAGES = ContainerUtil.set(HTMLLanguage.INSTANCE, XMLLanguage.INSTANCE, @@ -168,8 +168,9 @@ public class XmlTagNameSynchronizer implements NamedComponent, CommandListener { final CharSequence fragment = event.getNewFragment(); final int newLength = event.getNewLength(); - if (document.getUserData(XmlTagInsertHandler.ENFORCING_TAG) == Boolean.TRUE) { + if (document.getUserData(SKIP_COMMAND) == Boolean.TRUE) { // xml completion inserts extra space after tag name to ensure correct parsing + // js auto-import may change beginning of the document when component is imported // we need to ignore it return; }