mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
showing hint on temporary injection
This commit is contained in:
@@ -684,6 +684,9 @@ public class HintManagerImpl extends HintManager implements Disposable {
|
||||
}
|
||||
|
||||
public void showInformationHint(@NotNull Editor editor, @NotNull JComponent component, boolean showByBalloon) {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
return;
|
||||
}
|
||||
LightweightHint hint = new LightweightHint(component);
|
||||
Point p = getHintPosition(hint, editor, ABOVE);
|
||||
showEditorHint(hint, editor, p, HIDE_BY_ANY_KEY | HIDE_BY_TEXT_CHANGE | HIDE_BY_SCROLLING, 0, false);
|
||||
|
||||
+5
-1
@@ -16,6 +16,7 @@
|
||||
package org.intellij.plugins.intelliLang.inject;
|
||||
|
||||
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
|
||||
import com.intellij.codeInsight.hint.HintManager;
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.injected.editor.EditorWindow;
|
||||
import com.intellij.lang.Language;
|
||||
@@ -27,6 +28,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.popup.PopupChooserBuilder;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
@@ -111,7 +113,9 @@ public class InjectLanguageAction implements IntentionAction {
|
||||
return;
|
||||
}
|
||||
}
|
||||
TemporaryPlacesRegistry.getInstance(project).getLanguageInjectionSupport().addInjectionInPlace(language, host);
|
||||
if (TemporaryPlacesRegistry.getInstance(project).getLanguageInjectionSupport().addInjectionInPlace(language, host)) {
|
||||
HintManager.getInstance().showInformationHint(editor, StringUtil.escapeXml(language.getDisplayName()) + " was temporarily injected");
|
||||
}
|
||||
}
|
||||
finally {
|
||||
if (injectable.getLanguage() != null) { // no need for reference injection
|
||||
|
||||
Reference in New Issue
Block a user