From b100cb37b7e5b4d3945d92a75f4ad9488df614ee Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Fri, 30 Aug 2013 15:25:06 +0400 Subject: [PATCH] IDEA-112914 Insert closing tag after typing "); + return Result.STOP; + } } + if (!"/".equals(prevLeafText.trim())) return Result.CONTINUE; + while((prevLeaf = TreeUtil.prevLeaf(prevLeaf)) != null && prevLeaf.getElementType() == XmlTokenType.XML_WHITE_SPACE); if(prevLeaf instanceof OuterLanguageElement) { element = file.getViewProvider().findElementAt(offset - 1, file.getLanguage()); diff --git a/xml/tests/src/com/intellij/codeInsight/completion/XmlTypedHandlersTest.java b/xml/tests/src/com/intellij/codeInsight/completion/XmlTypedHandlersTest.java new file mode 100644 index 000000000000..6a5edda198d8 --- /dev/null +++ b/xml/tests/src/com/intellij/codeInsight/completion/XmlTypedHandlersTest.java @@ -0,0 +1,32 @@ +/* + * Copyright 2000-2013 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.codeInsight.completion; + +import com.intellij.ide.highlighter.XmlFileType; +import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase; + +/** + * @author Dmitry Avdeev + * Date: 30.08.13 + */ +public class XmlTypedHandlersTest extends LightPlatformCodeInsightFixtureTestCase { + + public void testClosingTag() throws Exception { + myFixture.configureByText(XmlFileType.INSTANCE, "<"); + myFixture.type('/'); + myFixture.checkResult(""); + } +}