diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/LiveTemplateDocumentationProvider.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/LiveTemplateDocumentationProvider.java index df42a8eb630e..60b82baafff0 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/LiveTemplateDocumentationProvider.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/LiveTemplateDocumentationProvider.java @@ -1,21 +1,8 @@ -/* - * Copyright 2000-2014 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. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.codeInsight.template.impl; import com.intellij.lang.documentation.AbstractDocumentationProvider; +import com.intellij.lang.documentation.DocumentationMarkup; import com.intellij.navigation.ItemPresentation; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.PsiElement; @@ -48,12 +35,9 @@ public class LiveTemplateDocumentationProvider extends AbstractDocumentationProv } TemplateImpl template = ((LiveTemplateElement)element).getTemplate(); - StringBuilder doc = new StringBuilder("

").append(template.getKey()).append("

"); - String description = template.getDescription(); - if (StringUtil.isNotEmpty(description)) { - doc.append("
").append(StringUtil.escapeXml(description)).append("

template text

"); - } - return doc.append("
").append(StringUtil.escapeXml(template.getString())).append("
").toString(); + return DocumentationMarkup.DEFINITION_START + StringUtil.escapeXml(template.getString()) + DocumentationMarkup.DEFINITION_END + + DocumentationMarkup.CONTENT_START + StringUtil.escapeXml(StringUtil.notNullize(template.getDescription())) + + DocumentationMarkup.CONTENT_END; } private static class LiveTemplateElement extends FakePsiElement {