Move method: showErrorHint

GitOrigin-RevId: 0b14982dbefdd8d21880aaea46e250b546dec20b
This commit is contained in:
Natalia.Ukhorskaya
2013-02-21 14:29:37 +03:00
committed by intellij-monorepo-bot
parent 1901424bdb
commit 9078a60225
2 changed files with 15 additions and 4 deletions
@@ -1,11 +1,15 @@
package org.jetbrains.jet.plugin.codeInsight;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiComment;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiWhiteSpace;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.PsiUtilCore;
import com.intellij.refactoring.util.CommonRefactoringUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.JetBlockExpression;
@@ -152,6 +156,15 @@ public class CodeInsightUtils {
return null;
}
public static void showErrorHint(
@NotNull Project project, @NotNull Editor editor,
@NotNull String message, @NotNull String title,
@Nullable String helpId
) {
if (ApplicationManager.getApplication().isUnitTestMode()) throw new RuntimeException(message);
CommonRefactoringUtil.showErrorHint(project, editor, message, title, helpId);
}
private CodeInsightUtils() {
}
}
@@ -49,6 +49,7 @@ import org.jetbrains.jet.lang.types.TypeUtils;
import org.jetbrains.jet.lang.types.checker.JetTypeChecker;
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
import org.jetbrains.jet.lexer.JetTokens;
import org.jetbrains.jet.plugin.codeInsight.CodeInsightUtils;
import org.jetbrains.jet.plugin.codeInsight.ReferenceToClassesShortening;
import org.jetbrains.jet.plugin.project.AnalyzeSingleFileUtil;
import org.jetbrains.jet.plugin.refactoring.*;
@@ -568,10 +569,7 @@ public class JetIntroduceVariableHandler extends JetIntroduceHandlerBase {
}
private static void showErrorHint(Project project, Editor editor, String message) {
if (ApplicationManager.getApplication().isUnitTestMode()) throw new RuntimeException(message);
CommonRefactoringUtil.showErrorHint(project, editor, message,
INTRODUCE_VARIABLE,
HelpID.INTRODUCE_VARIABLE);
CodeInsightUtils.showErrorHint(project, editor, message, INTRODUCE_VARIABLE, HelpID.INTRODUCE_VARIABLE);
}
@Override