IDEA-84511 (Completion of tag 'source' inside maven-compiler-plugin configuration inserts closed tag.)

This commit is contained in:
Sergey Evdokimov
2012-04-13 19:51:45 +04:00
parent d125357e9c
commit be4f27b657
@@ -141,7 +141,7 @@ public class XmlTagInsertHandler implements InsertHandler<LookupElement> {
template.setToReformat(!htmlCode);
StringBuilder indirectRequiredAttrs = addRequiredAttributes(descriptor, tag, template, containingFile);
final boolean chooseAttributeName = addTail(completionChar, descriptor, tag, template, indirectRequiredAttrs);
final boolean chooseAttributeName = addTail(completionChar, descriptor, htmlCode, tag, template, indirectRequiredAttrs);
templateManager.startTemplate(editor, template, new TemplateEditingAdapter() {
private RangeMarker myAttrValueMarker;
@@ -246,6 +246,7 @@ public class XmlTagInsertHandler implements InsertHandler<LookupElement> {
protected static boolean addTail(char completionChar,
XmlElementDescriptor descriptor,
boolean isHtmlCode,
XmlTag tag,
Template template,
StringBuilder indirectRequiredAttrs) {
@@ -290,7 +291,7 @@ public class XmlTagInsertHandler implements InsertHandler<LookupElement> {
}
}
else if (completionChar == Lookup.AUTO_INSERT_SELECT_CHAR || completionChar == Lookup.NORMAL_SELECT_CHAR || completionChar == Lookup.REPLACE_SELECT_CHAR) {
if (WebEditorOptions.getInstance().isAutomaticallyInsertClosingTag() && HtmlUtil.isSingleHtmlTag(tag.getName())) {
if (WebEditorOptions.getInstance().isAutomaticallyInsertClosingTag() && isHtmlCode && HtmlUtil.isSingleHtmlTag(tag.getName())) {
template.addTextSegment(tag instanceof HtmlTag ? ">" : "/>");
}
else {