SSR: fix too much escaping on complete-match tool tip

This commit is contained in:
Bas Leijdekkers
2017-10-09 12:54:16 +02:00
parent 59a76688ba
commit b34aa8f9d4
2 changed files with 6 additions and 36 deletions
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 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-2017 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.structuralsearch.plugin.ui;
import com.intellij.codeInsight.hint.TooltipController;
@@ -188,7 +174,7 @@ public class SubstitutionShortInfoHandler implements DocumentListener, EditorMou
if (buf.length() == 0) {
return SSRBundle.message("no.constraints.specified.tooltip.message");
}
return StringUtil.escapeXml(buf.toString());
return buf.toString();
}
private static void append(final StringBuilder buf, final String str) {
@@ -216,7 +202,7 @@ public class SubstitutionShortInfoHandler implements DocumentListener, EditorMou
editor.getComponent().getRootPane().getLayeredPane());
final HintHint hint = new HintHint(editor, bestPoint).setAwtTooltip(true).setHighlighterType(true).setShowImmediately(true)
.setCalloutShift(editor.getLineHeight() / 2 - 1);
TooltipController.getInstance().showTooltip(editor, p, text, visibleArea.width, false, SS_INFO_TOOLTIP_GROUP, hint);
TooltipController.getInstance().showTooltip(editor, p, StringUtil.escapeXml(text), visibleArea.width, false, SS_INFO_TOOLTIP_GROUP, hint);
}
static SubstitutionShortInfoHandler retrieve(Editor editor) {
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 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-2017 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.structuralsearch.plugin.ui;
import com.intellij.codeInsight.template.TemplateContextType;
@@ -190,15 +176,13 @@ public class UIUtil {
return;
}
final MatchOptions matchOptions = configuration.getMatchOptions();
final MatchVariableConstraint constraint =
getOrAddVariableConstraint(Configuration.CONTEXT_VAR_NAME, configuration);
final MatchVariableConstraint constraint = getOrAddVariableConstraint(Configuration.CONTEXT_VAR_NAME, configuration);
if (isTarget(Configuration.CONTEXT_VAR_NAME, matchOptions)) {
constraint.setPartOfSearchResults(true);
}
label.setText(SSRBundle.message("complete.match.variable.tooltip.message",
SubstitutionShortInfoHandler.getShortParamString(constraint)));
final IdeTooltipManager tooltipManager = IdeTooltipManager.getInstance();
tooltipManager.show(tooltip, true);
IdeTooltipManager.getInstance().show(tooltip, true);
}
@Override