Introduced IdeErrorMessages, which is now used along with DefaultErrorMessages in IDEA plugin.
This commit is contained in:
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2012 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 org.jetbrains.jet.plugin.highlighter;
|
||||||
|
|
||||||
|
import org.jetbrains.jet.lang.diagnostics.Diagnostic;
|
||||||
|
import org.jetbrains.jet.lang.diagnostics.rendering.DefaultErrorMessages;
|
||||||
|
import org.jetbrains.jet.lang.diagnostics.rendering.DiagnosticFactoryToRendererMap;
|
||||||
|
import org.jetbrains.jet.lang.diagnostics.rendering.DiagnosticRenderer;
|
||||||
|
import org.jetbrains.jet.lang.diagnostics.rendering.DispatchingDiagnosticRenderer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Evgeny Gerashchenko
|
||||||
|
* @since 4/13/12
|
||||||
|
*/
|
||||||
|
public class IdeErrorMessages {
|
||||||
|
public static final DiagnosticFactoryToRendererMap MAP = new DiagnosticFactoryToRendererMap();
|
||||||
|
public static final DiagnosticRenderer<Diagnostic> RENDERER = new DispatchingDiagnosticRenderer(MAP, DefaultErrorMessages.MAP);
|
||||||
|
|
||||||
|
static {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
private IdeErrorMessages() {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -238,7 +238,7 @@ public class JetPsiChecker implements Annotator {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private static String getMessage(@NotNull Diagnostic diagnostic) {
|
private static String getMessage(@NotNull Diagnostic diagnostic) {
|
||||||
String message = DefaultErrorMessages.RENDERER.render(diagnostic);
|
String message = IdeErrorMessages.RENDERER.render(diagnostic);
|
||||||
if (ApplicationManager.getApplication().isInternal() || ApplicationManager.getApplication().isUnitTestMode()) {
|
if (ApplicationManager.getApplication().isInternal() || ApplicationManager.getApplication().isUnitTestMode()) {
|
||||||
return "[" + diagnostic.getFactory().getName() + "] " + message;
|
return "[" + diagnostic.getFactory().getName() + "] " + message;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user