From 44be16f73ce9a462d23b1390de2aee9f882ef084 Mon Sep 17 00:00:00 2001 From: Alexander Zolotov Date: Fri, 30 Dec 2016 17:01:12 +0300 Subject: [PATCH] Emmet: fix surrounding html comment (WEB-19796) --- .../intellij/codeInsight/template/HtmlTextContextType.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xml/impl/src/com/intellij/codeInsight/template/HtmlTextContextType.java b/xml/impl/src/com/intellij/codeInsight/template/HtmlTextContextType.java index 35bb8de01d99..c16509e45d2f 100644 --- a/xml/impl/src/com/intellij/codeInsight/template/HtmlTextContextType.java +++ b/xml/impl/src/com/intellij/codeInsight/template/HtmlTextContextType.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,8 @@ public class HtmlTextContextType extends TemplateContextType { } public static boolean isInContext(@NotNull PsiElement element) { - if (PsiTreeUtil.getParentOfType(element, XmlComment.class) != null) { + if (PsiTreeUtil.getParentOfType(element, XmlComment.class) != null + && element.getNode().getElementType() != XmlTokenType.XML_COMMENT_START) { return false; } if (PsiTreeUtil.getParentOfType(element, XmlText.class) != null) {