mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
a way to get SeverityRegistrar from within platform
This commit is contained in:
+10
@@ -20,10 +20,13 @@ import com.intellij.codeHighlighting.HighlightDisplayLevel;
|
||||
import com.intellij.lang.annotation.HighlightSeverity;
|
||||
import com.intellij.openapi.editor.markup.TextAttributes;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.JDOMExternalizable;
|
||||
import com.intellij.openapi.util.JDOMExternalizableStringList;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import gnu.trove.THashMap;
|
||||
import gnu.trove.TObjectIntHashMap;
|
||||
@@ -68,6 +71,13 @@ public class SeverityRegistrar implements JDOMExternalizable, Comparator<Highlig
|
||||
STANDARD_SEVERITIES.put(highlightSeverity.toString(), highlightInfoType);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static SeverityRegistrar getSeverityRegistrar(@Nullable Project project) {
|
||||
return project == null
|
||||
? InspectionProfileManager.getInstance().getSeverityRegistrar()
|
||||
: InspectionProjectProfileManager.getInstance(project).getSeverityRegistrar();
|
||||
}
|
||||
|
||||
public void registerSeverity(@NotNull SeverityBasedTextAttributes info, Color renderColor){
|
||||
final HighlightSeverity severity = info.getType().getSeverity(null);
|
||||
myMap.put(severity.toString(), info);
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ import java.util.List;
|
||||
* User: anna
|
||||
* Date: 29-Nov-2005
|
||||
*/
|
||||
public abstract class InspectionProfileManager extends ApplicationProfileManager implements NamedComponent {
|
||||
public abstract class InspectionProfileManager extends ApplicationProfileManager implements SeverityProvider, NamedComponent {
|
||||
@NonNls protected static final String INSPECTION_DIR = "inspection";
|
||||
@NonNls protected static final String FILE_SPEC = "$ROOT_CONFIG$/" + INSPECTION_DIR;
|
||||
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
* User: anna
|
||||
* Date: 30-Nov-2005
|
||||
*/
|
||||
public abstract class InspectionProjectProfileManager extends DefaultProjectProfileManager implements ProjectComponent, PersistentStateComponent<Element> {
|
||||
public abstract class InspectionProjectProfileManager extends DefaultProjectProfileManager implements ProjectComponent, SeverityProvider, PersistentStateComponent<Element> {
|
||||
public InspectionProjectProfileManager(@NotNull Project project,
|
||||
@NotNull InspectionProfileManager inspectionProfileManager,
|
||||
@NotNull DependencyValidationManager holder) {
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
stateSplitter = InspectionProjectProfileManagerImpl.ProfileStateSplitter.class)
|
||||
}
|
||||
)
|
||||
public class InspectionProjectProfileManagerImpl extends InspectionProjectProfileManager implements SeverityProvider, ProjectComponent, PersistentStateComponent<Element> {
|
||||
public class InspectionProjectProfileManagerImpl extends InspectionProjectProfileManager implements ProjectComponent, PersistentStateComponent<Element> {
|
||||
private final Map<String, InspectionProfileWrapper> myName2Profile = new ConcurrentHashMap<String, InspectionProfileWrapper>();
|
||||
private final SeverityRegistrar mySeverityRegistrar;
|
||||
private final NamedScopeManager myLocalScopesHolder;
|
||||
|
||||
+2
-2
@@ -528,7 +528,7 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzer implements JDOMEx
|
||||
@NotNull final Processor<HighlightInfo> processor) {
|
||||
LOG.assertTrue(ApplicationManager.getApplication().isReadAccessAllowed());
|
||||
|
||||
final SeverityRegistrar severityRegistrar = SeverityUtil.getSeverityRegistrar(project);
|
||||
final SeverityRegistrar severityRegistrar = SeverityRegistrar.getSeverityRegistrar(project);
|
||||
MarkupModelEx model = (MarkupModelEx)DocumentMarkupModel.forDocument(document, project, true);
|
||||
return model.processRangeHighlightersOverlappingWith(startOffset, endOffset, new Processor<RangeHighlighterEx>() {
|
||||
@Override
|
||||
@@ -551,7 +551,7 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzer implements JDOMEx
|
||||
@NotNull final Processor<HighlightInfo> processor) {
|
||||
LOG.assertTrue(ApplicationManager.getApplication().isReadAccessAllowed());
|
||||
|
||||
final SeverityRegistrar severityRegistrar = SeverityUtil.getSeverityRegistrar(project);
|
||||
final SeverityRegistrar severityRegistrar = SeverityRegistrar.getSeverityRegistrar(project);
|
||||
MarkupModelEx model = (MarkupModelEx)DocumentMarkupModel.forDocument(document, project, true);
|
||||
return model.processRangeHighlightersOutside(startOffset, endOffset, new Processor<RangeHighlighterEx>() {
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ public class DaemonTooltipRendererProvider implements ErrorStripTooltipRendererP
|
||||
ContainerUtil.quickSort(infos, new Comparator<HighlightInfo>() {
|
||||
@Override
|
||||
public int compare(final HighlightInfo o1, final HighlightInfo o2) {
|
||||
int i = SeverityUtil.getSeverityRegistrar(myProject).compare(o2.getSeverity(), o1.getSeverity());
|
||||
int i = SeverityRegistrar.getSeverityRegistrar(myProject).compare(o2.getSeverity(), o1.getSeverity());
|
||||
if (i != 0) return i;
|
||||
return o1.getToolTip().compareTo(o2.getToolTip());
|
||||
}
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ public class GotoNextErrorHandler implements CodeInsightActionHandler {
|
||||
}
|
||||
|
||||
private void gotoNextError(Project project, Editor editor, PsiFile file, int caretOffset) {
|
||||
final SeverityRegistrar severityRegistrar = SeverityUtil.getSeverityRegistrar(project);
|
||||
final SeverityRegistrar severityRegistrar = SeverityRegistrar.getSeverityRegistrar(project);
|
||||
DaemonCodeAnalyzerSettings settings = DaemonCodeAnalyzerSettings.getInstance();
|
||||
int maxSeverity = settings.NEXT_ERROR_ACTION_GOES_TO_ERRORS_FIRST ? severityRegistrar.getSeveritiesCount() - 1 : 0;
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ public class HighlightInfo implements Segment {
|
||||
public static TextAttributes getAttributesByType(@Nullable final PsiElement element,
|
||||
@NotNull HighlightInfoType type,
|
||||
@NotNull TextAttributesScheme colorsScheme) {
|
||||
final SeverityRegistrar severityRegistrar = SeverityUtil
|
||||
final SeverityRegistrar severityRegistrar = SeverityRegistrar
|
||||
.getSeverityRegistrar(element != null ? element.getProject() : null);
|
||||
final TextAttributes textAttributes = severityRegistrar.getTextAttributesBySeverity(type.getSeverity(element));
|
||||
if (textAttributes != null) {
|
||||
|
||||
@@ -18,12 +18,7 @@ package com.intellij.codeInsight.daemon.impl;
|
||||
import com.intellij.openapi.editor.colors.EditorColorsManager;
|
||||
import com.intellij.openapi.editor.colors.EditorColorsScheme;
|
||||
import com.intellij.openapi.editor.markup.TextAttributes;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManagerImpl;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManagerImpl;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -45,11 +40,4 @@ public class SeverityUtil {
|
||||
}
|
||||
return new SeverityRegistrar.SeverityBasedTextAttributes(registrar.getTextAttributesBySeverity(type.getSeverity(null)), (HighlightInfoType.HighlightInfoTypeImpl)type);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static SeverityRegistrar getSeverityRegistrar(@Nullable Project project) {
|
||||
return project == null
|
||||
? ((InspectionProfileManagerImpl)InspectionProfileManager.getInstance()).getSeverityRegistrar()
|
||||
: InspectionProjectProfileManagerImpl.getInstanceImpl(project).getSeverityRegistrar();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ public class TrafficLightRenderer implements ErrorStripeRenderer, Disposable {
|
||||
myDaemonCodeAnalyzer = project == null ? null : (DaemonCodeAnalyzerImpl)DaemonCodeAnalyzer.getInstance(project);
|
||||
myDocument = document;
|
||||
myFile = file;
|
||||
mySeverityRegistrar = SeverityUtil.getSeverityRegistrar(myProject);
|
||||
mySeverityRegistrar = SeverityRegistrar.getSeverityRegistrar(myProject);
|
||||
refresh();
|
||||
|
||||
if (project != null) {
|
||||
|
||||
+1
-1
@@ -224,7 +224,7 @@ public class TrafficProgressPanel extends JPanel {
|
||||
String text = "<html><body>";
|
||||
for (int i = status.errorCount.length - 1; i >= 0; i--) {
|
||||
if (status.errorCount[i] > 0) {
|
||||
final HighlightSeverity severity = SeverityUtil.getSeverityRegistrar(myTrafficLightRenderer.getProject()).getSeverityByIndex(i);
|
||||
final HighlightSeverity severity = SeverityRegistrar.getSeverityRegistrar(myTrafficLightRenderer.getProject()).getSeverityByIndex(i);
|
||||
String name =
|
||||
status.errorCount[i] > 1 ? StringUtil.pluralize(severity.toString().toLowerCase()) : severity.toString().toLowerCase();
|
||||
text += status.errorAnalyzingFinished
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ public class TrafficTooltipRendererImpl extends ComparableObject.Impl implements
|
||||
@Override
|
||||
public void repaintTooltipWindow() {
|
||||
if (myPanel != null) {
|
||||
SeverityRegistrar severityRegistrar = SeverityUtil.getSeverityRegistrar(myTrafficLightRenderer.getProject());
|
||||
SeverityRegistrar severityRegistrar = SeverityRegistrar.getSeverityRegistrar(myTrafficLightRenderer.getProject());
|
||||
TrafficLightRenderer.DaemonCodeAnalyzerStatus status = myTrafficLightRenderer.getDaemonCodeAnalyzerStatus(true, severityRegistrar);
|
||||
myPanel.updatePanel(status, false);
|
||||
}
|
||||
|
||||
+3
-3
@@ -164,7 +164,7 @@ public class UpdateHighlightersUtil {
|
||||
if (info.getStartOffset() < startOffset || info.getEndOffset() > endOffset) return;
|
||||
|
||||
MarkupModel markup = DocumentMarkupModel.forDocument(document, project, true);
|
||||
final SeverityRegistrar severityRegistrar = SeverityUtil.getSeverityRegistrar(project);
|
||||
final SeverityRegistrar severityRegistrar = SeverityRegistrar.getSeverityRegistrar(project);
|
||||
final boolean myInfoIsError = isSevere(info, severityRegistrar);
|
||||
Processor<HighlightInfo> otherHighlightInTheWayProcessor = new Processor<HighlightInfo>() {
|
||||
@Override
|
||||
@@ -236,7 +236,7 @@ public class UpdateHighlightersUtil {
|
||||
final MarkupModel markup = DocumentMarkupModel.forDocument(document, project, true);
|
||||
assertMarkupConsistent(markup, project);
|
||||
|
||||
final SeverityRegistrar severityRegistrar = SeverityUtil.getSeverityRegistrar(project);
|
||||
final SeverityRegistrar severityRegistrar = SeverityRegistrar.getSeverityRegistrar(project);
|
||||
final HighlightersRecycler infosToRemove = new HighlightersRecycler();
|
||||
ContainerUtil.quickSort(infos, BY_START_OFFSET_NODUPS);
|
||||
|
||||
@@ -309,7 +309,7 @@ public class UpdateHighlightersUtil {
|
||||
final int group) {
|
||||
ApplicationManager.getApplication().assertIsDispatchThread();
|
||||
|
||||
final SeverityRegistrar severityRegistrar = SeverityUtil.getSeverityRegistrar(project);
|
||||
final SeverityRegistrar severityRegistrar = SeverityRegistrar.getSeverityRegistrar(project);
|
||||
final HighlightersRecycler infosToRemove = new HighlightersRecycler();
|
||||
DaemonCodeAnalyzerImpl.processHighlights(document, project, null, range.getStartOffset(), range.getEndOffset(), new Processor<HighlightInfo>() {
|
||||
@Override
|
||||
|
||||
+4
-4
@@ -17,7 +17,7 @@
|
||||
package com.intellij.codeInsight.intention.impl;
|
||||
|
||||
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityUtil;
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityRegistrar;
|
||||
import com.intellij.codeInsight.daemon.impl.ShowIntentionsPass;
|
||||
import com.intellij.codeInsight.intention.EmptyIntentionAction;
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
@@ -72,7 +72,7 @@ public class FileLevelIntentionComponent extends EditorNotificationPanel {
|
||||
}
|
||||
|
||||
myLabel.setText(description);
|
||||
myLabel.setIcon(SeverityUtil.getSeverityRegistrar(project).compare(severity, HighlightSeverity.ERROR) >= 0 ? AllIcons.Actions.QuickfixBulb : AllIcons.Actions.IntentionBulb);
|
||||
myLabel.setIcon(SeverityRegistrar.getSeverityRegistrar(project).compare(severity, HighlightSeverity.ERROR) >= 0 ? AllIcons.Actions.QuickfixBulb : AllIcons.Actions.IntentionBulb);
|
||||
|
||||
new ClickListener() {
|
||||
@Override
|
||||
@@ -97,11 +97,11 @@ public class FileLevelIntentionComponent extends EditorNotificationPanel {
|
||||
}
|
||||
|
||||
private Color getColor(HighlightSeverity severity) {
|
||||
if (SeverityUtil.getSeverityRegistrar(myProject).compare(severity, HighlightSeverity.ERROR) >= 0) {
|
||||
if (SeverityRegistrar.getSeverityRegistrar(myProject).compare(severity, HighlightSeverity.ERROR) >= 0) {
|
||||
return LightColors.RED;
|
||||
}
|
||||
|
||||
if (SeverityUtil.getSeverityRegistrar(myProject).compare(severity, HighlightSeverity.WARNING) >= 0) {
|
||||
if (SeverityRegistrar.getSeverityRegistrar(myProject).compare(severity, HighlightSeverity.WARNING) >= 0) {
|
||||
return LightColors.YELLOW;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
package com.intellij.codeInspection.ui;
|
||||
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityUtil;
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityRegistrar;
|
||||
import com.intellij.codeInspection.CommonProblemDescriptor;
|
||||
import com.intellij.codeInspection.ProblemDescriptor;
|
||||
import com.intellij.codeInspection.offline.OfflineProblemDescriptor;
|
||||
@@ -56,7 +56,7 @@ public class InspectionResultsViewComparator implements Comparator {
|
||||
if (node1 instanceof InspectionSeverityGroupNode && node2 instanceof InspectionSeverityGroupNode) {
|
||||
final InspectionSeverityGroupNode groupNode1 = (InspectionSeverityGroupNode)node1;
|
||||
final InspectionSeverityGroupNode groupNode2 = (InspectionSeverityGroupNode)node2;
|
||||
return -SeverityUtil.getSeverityRegistrar(groupNode1.getProject()).compare(groupNode1.getSeverityLevel().getSeverity(), groupNode2.getSeverityLevel().getSeverity());
|
||||
return -SeverityRegistrar.getSeverityRegistrar(groupNode1.getProject()).compare(groupNode1.getSeverityLevel().getSeverity(), groupNode2.getSeverityLevel().getSeverity());
|
||||
}
|
||||
if (node1 instanceof InspectionSeverityGroupNode) return -1;
|
||||
if (node2 instanceof InspectionSeverityGroupNode) return 1;
|
||||
|
||||
@@ -18,10 +18,7 @@ package com.intellij.openapi.vcs.impl;
|
||||
import com.intellij.codeInsight.CodeSmellInfo;
|
||||
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
|
||||
import com.intellij.codeInsight.daemon.HighlightDisplayKey;
|
||||
import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl;
|
||||
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
|
||||
import com.intellij.codeInsight.daemon.impl.HighlightInfoType;
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityUtil;
|
||||
import com.intellij.codeInsight.daemon.impl.*;
|
||||
import com.intellij.ide.errorTreeView.NewErrorTreeViewPanel;
|
||||
import com.intellij.lang.annotation.HighlightSeverity;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -176,7 +173,7 @@ public class CodeSmellDetectorImpl extends CodeSmellDetector {
|
||||
if (highlights == null) return;
|
||||
for (HighlightInfo highlightInfo : highlights) {
|
||||
final HighlightSeverity severity = highlightInfo.getSeverity();
|
||||
if (SeverityUtil.getSeverityRegistrar(myProject).compare(severity, HighlightSeverity.WARNING) >= 0) {
|
||||
if (SeverityRegistrar.getSeverityRegistrar(myProject).compare(severity, HighlightSeverity.WARNING) >= 0) {
|
||||
result.add(new CodeSmellInfo(document, getDescription(highlightInfo),
|
||||
new TextRange(highlightInfo.startOffset, highlightInfo.endOffset), severity));
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ package com.intellij.designer.componentTree;
|
||||
|
||||
import com.intellij.codeHighlighting.HighlightDisplayLevel;
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityRegistrar;
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityUtil;
|
||||
import com.intellij.designer.actions.DesignerActionPanel;
|
||||
import com.intellij.designer.actions.StartInplaceEditing;
|
||||
import com.intellij.designer.designSurface.DesignerEditorPanel;
|
||||
@@ -159,7 +158,7 @@ public final class ComponentTree extends Tree implements DataProvider {
|
||||
@Nullable
|
||||
private static HighlightDisplayLevel getHighlightDisplayLevel(Project project, RadComponent component) {
|
||||
HighlightDisplayLevel displayLevel = null;
|
||||
SeverityRegistrar severityRegistrar = SeverityUtil.getSeverityRegistrar(project);
|
||||
SeverityRegistrar severityRegistrar = SeverityRegistrar.getSeverityRegistrar(project);
|
||||
for (ErrorInfo errorInfo : RadComponent.getError(component)) {
|
||||
if (displayLevel == null || severityRegistrar.compare(errorInfo.getLevel().getSeverity(), displayLevel.getSeverity()) > 0) {
|
||||
displayLevel = errorInfo.getLevel();
|
||||
@@ -174,7 +173,7 @@ public final class ComponentTree extends Tree implements DataProvider {
|
||||
|
||||
if (level != null) {
|
||||
TextAttributesKey attributesKey =
|
||||
SeverityUtil.getSeverityRegistrar(myDesigner.getProject()).getHighlightInfoTypeBySeverity(level.getSeverity()).getAttributesKey();
|
||||
SeverityRegistrar.getSeverityRegistrar(myDesigner.getProject()).getHighlightInfoTypeBySeverity(level.getSeverity()).getAttributesKey();
|
||||
final TextAttributes textAttributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(attributesKey);
|
||||
|
||||
wrapper = new AttributeWrapper() {
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package com.intellij.designer.propertyTable;
|
||||
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityUtil;
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityRegistrar;
|
||||
import com.intellij.designer.DesignerBundle;
|
||||
import com.intellij.designer.designSurface.ComponentSelectionListener;
|
||||
import com.intellij.designer.designSurface.DesignerEditorPanel;
|
||||
@@ -104,7 +104,7 @@ public class RadPropertyTable extends PropertyTable implements DataProvider, Com
|
||||
|
||||
@NotNull
|
||||
protected TextAttributesKey getErrorAttributes(@NotNull HighlightSeverity severity) {
|
||||
return SeverityUtil.getSeverityRegistrar(myProject).getHighlightInfoTypeBySeverity(severity).getAttributesKey();
|
||||
return SeverityRegistrar.getSeverityRegistrar(myProject).getHighlightInfoTypeBySeverity(severity).getAttributesKey();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
package com.intellij.uiDesigner;
|
||||
|
||||
import com.intellij.codeHighlighting.HighlightDisplayLevel;
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityUtil;
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityRegistrar;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.module.Module;
|
||||
@@ -392,7 +392,7 @@ public final class ErrorAnalyzer {
|
||||
public static HighlightDisplayLevel getHighlightDisplayLevel(final Project project, @NotNull final RadComponent component) {
|
||||
HighlightDisplayLevel displayLevel = null;
|
||||
for(ErrorInfo errInfo: getAllErrorsForComponent(component)) {
|
||||
if (displayLevel == null || SeverityUtil.getSeverityRegistrar(project).compare(errInfo.getHighlightDisplayLevel().getSeverity(), displayLevel.getSeverity()) > 0) {
|
||||
if (displayLevel == null || SeverityRegistrar.getSeverityRegistrar(project).compare(errInfo.getHighlightDisplayLevel().getSeverity(), displayLevel.getSeverity()) > 0) {
|
||||
displayLevel = errInfo.getHighlightDisplayLevel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
package com.intellij.uiDesigner.componentTree;
|
||||
|
||||
import com.intellij.codeHighlighting.HighlightDisplayLevel;
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityUtil;
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityRegistrar;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.DeleteProvider;
|
||||
import com.intellij.ide.highlighter.JavaHighlightingColors;
|
||||
@@ -328,7 +328,7 @@ public final class ComponentTree extends Tree implements DataProvider {
|
||||
|
||||
SimpleTextAttributes result = highlightMap.get(attrs);
|
||||
if (result == null) {
|
||||
final TextAttributesKey attrKey = SeverityUtil.getSeverityRegistrar(myProject).getHighlightInfoTypeBySeverity(level.getSeverity()).getAttributesKey();
|
||||
final TextAttributesKey attrKey = SeverityRegistrar.getSeverityRegistrar(myProject).getHighlightInfoTypeBySeverity(level.getSeverity()).getAttributesKey();
|
||||
TextAttributes textAttrs = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(attrKey);
|
||||
textAttrs = TextAttributes.merge(attrs.toTextAttributes(), textAttrs);
|
||||
result = SimpleTextAttributes.fromTextAttributes(textAttrs);
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package com.intellij.uiDesigner.propertyInspector;
|
||||
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityUtil;
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityRegistrar;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.ui.LafManager;
|
||||
import com.intellij.ide.ui.LafManagerListener;
|
||||
@@ -1131,7 +1131,7 @@ public final class PropertyInspectorTable extends Table implements DataProvider{
|
||||
Map<HighlightSeverity, SimpleTextAttributes> cache = modified ? myModifiedHighlightAttributes : myHighlightAttributes;
|
||||
result = cache.get(severity);
|
||||
if (result == null) {
|
||||
final TextAttributesKey attrKey = SeverityUtil.getSeverityRegistrar(myProject).getHighlightInfoTypeBySeverity(severity).getAttributesKey();
|
||||
final TextAttributesKey attrKey = SeverityRegistrar.getSeverityRegistrar(myProject).getHighlightInfoTypeBySeverity(severity).getAttributesKey();
|
||||
TextAttributes textAttrs = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(attrKey);
|
||||
if (modified) {
|
||||
textAttrs = textAttrs.clone();
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.intellij.util.xml.highlighting;
|
||||
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityRegistrar;
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityUtil;
|
||||
import com.intellij.codeInsight.daemon.impl.TrafficLightRenderer;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.lang.annotation.HighlightSeverity;
|
||||
@@ -171,7 +170,7 @@ public class DomElementsErrorPanel extends JPanel implements CommittablePanel, H
|
||||
int sum = 0;
|
||||
for (DomElement element : myDomElements) {
|
||||
final DomElementsProblemsHolder holder = myAnnotationsManager.getCachedProblemHolder(element);
|
||||
sum += (SeverityUtil.getSeverityRegistrar(getProject()).compare(minSeverity, HighlightSeverity.WARNING) >= 0 ? holder
|
||||
sum += (SeverityRegistrar.getSeverityRegistrar(getProject()).compare(minSeverity, HighlightSeverity.WARNING) >= 0 ? holder
|
||||
.getProblems(element, true, true) : holder.getProblems(element, true, minSeverity)).size();
|
||||
}
|
||||
status.errorCount[i] = sum;
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
|
||||
package com.intellij.util.xml.highlighting;
|
||||
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityUtil;
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityRegistrar;
|
||||
import com.intellij.lang.annotation.Annotation;
|
||||
import com.intellij.lang.annotation.HighlightSeverity;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
@@ -129,7 +129,7 @@ public class DomElementsProblemsHolderImpl implements DomElementsProblemsHolder
|
||||
public List<DomElementProblemDescriptor> getProblems(final DomElement domElement, final boolean withChildren, final HighlightSeverity minSeverity) {
|
||||
return ContainerUtil.findAll(getProblems(domElement, true, withChildren), new Condition<DomElementProblemDescriptor>() {
|
||||
public boolean value(final DomElementProblemDescriptor object) {
|
||||
return SeverityUtil.getSeverityRegistrar(domElement.getManager().getProject()).compare(object.getHighlightSeverity(), minSeverity) >= 0;
|
||||
return SeverityRegistrar.getSeverityRegistrar(domElement.getManager().getProject()).compare(object.getHighlightSeverity(), minSeverity) >= 0;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -17,10 +17,7 @@ package com.intellij.codeInsight.daemon.impl.analysis;
|
||||
|
||||
import com.intellij.BundleBase;
|
||||
import com.intellij.codeInsight.daemon.*;
|
||||
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
|
||||
import com.intellij.codeInsight.daemon.impl.HighlightInfoType;
|
||||
import com.intellij.codeInsight.daemon.impl.HighlightVisitor;
|
||||
import com.intellij.codeInsight.daemon.impl.SeverityUtil;
|
||||
import com.intellij.codeInsight.daemon.impl.*;
|
||||
import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixAction;
|
||||
import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixActionRegistrarImpl;
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
@@ -361,7 +358,7 @@ public class XmlHighlightVisitor extends XmlElementVisitor implements HighlightV
|
||||
localizedMessage,
|
||||
isInjectedHtmlTagForWhichNoProblemsReporting((HtmlTag)tag) ?
|
||||
HighlightInfoType.INFORMATION :
|
||||
SeverityUtil.getSeverityRegistrar(tag.getProject()).getHighlightInfoTypeBySeverity(profile.getErrorLevel(key, tag).getSeverity()),
|
||||
SeverityRegistrar.getSeverityRegistrar(tag.getProject()).getHighlightInfoTypeBySeverity(profile.getErrorLevel(key, tag).getSeverity()),
|
||||
addAttributeFix,
|
||||
basicIntention);
|
||||
} else if (!htmlTag) {
|
||||
|
||||
Reference in New Issue
Block a user